!function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";function i(t,e,i){e=e||st;var n,r=e.createElement("script");if(r.text=t,i)for(n in bt)i[n]&&(r[n]=i[n]);e.head.appendChild(r).parentNode.removeChild(r)}function n(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?dt[pt.call(t)]||"object":typeof t}function r(t){var e=!!t&&"length"in t&&t.length,i=n(t);return!yt(t)&&!_t(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function o(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function s(t,e,i){return yt(e)?wt.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?wt.grep(t,function(t){return t===e!==i}):"string"!=typeof e?wt.grep(t,function(t){return ut.call(e,t)>-1!==i}):wt.filter(e,t,i)}function a(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function l(t){var e={};return wt.each(t.match(kt)||[],function(t,i){e[i]=!0}),e}function h(t){return t}function c(t){throw t}function u(t,e,i,n){var r;try{t&&yt(r=t.promise)?r.call(t).done(e).fail(i):t&&yt(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}function d(){st.removeEventListener("DOMContentLoaded",d),t.removeEventListener("load",d),wt.ready()}function p(t,e){return e.toUpperCase()}function f(t){return t.replace(Bt,"ms-").replace(Gt,p)}function m(){this.expando=wt.expando+m.uid++}function g(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Vt.test(t)?JSON.parse(t):t)}function v(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(jt,"-$&").toLowerCase(),i=t.getAttribute(n),"string"==typeof i){try{i=g(i)}catch(r){}Ut.set(t,e,i)}else i=void 0;return i}function y(t,e,i,n){var r,o,s=20,a=n?function(){return n.cur()}:function(){return wt.css(t,e,"")},l=a(),h=i&&i[3]||(wt.cssNumber[e]?"":"px"),c=(wt.cssNumber[e]||"px"!==h&&+l)&&Xt.exec(wt.css(t,e));if(c&&c[3]!==h){for(l/=2,h=h||c[3],c=+l||1;s--;)wt.style(t,e,c+h),(1-o)*(1-(o=a()/l||.5))<=0&&(s=0),c/=o;c=2*c,wt.style(t,e,c+h),i=i||[]}return i&&(c=+c||+l||0,r=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=h,n.start=c,n.end=r)),r}function _(t){var e,i=t.ownerDocument,n=t.nodeName,r=Zt[n];return r?r:(e=i.body.appendChild(i.createElement(n)),r=wt.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),Zt[n]=r,r)}function b(t,e){for(var i,n,r=[],o=0,s=t.length;o<s;o++)n=t[o],n.style&&(i=n.style.display,e?("none"===i&&(r[o]=zt.get(n,"display")||null,r[o]||(n.style.display="")),""===n.style.display&&Yt(n)&&(r[o]=_(n))):"none"!==i&&(r[o]="none",zt.set(n,"display",i)));for(o=0;o<s;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}function x(t,e){var i;return i="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&o(t,e)?wt.merge([t],i):i}function w(t,e){for(var i=0,n=t.length;i<n;i++)zt.set(t[i],"globalEval",!e||zt.get(e[i],"globalEval"))}function T(t,e,i,r,o){for(var s,a,l,h,c,u,d=e.createDocumentFragment(),p=[],f=0,m=t.length;f<m;f++)if(s=t[f],s||0===s)if("object"===n(s))wt.merge(p,s.nodeType?[s]:s);else if(ee.test(s)){for(a=a||d.appendChild(e.createElement("div")),l=(Qt.exec(s)||["",""])[1].toLowerCase(),h=te[l]||te._default,a.innerHTML=h[1]+wt.htmlPrefilter(s)+h[2],u=h[0];u--;)a=a.lastChild;wt.merge(p,a.childNodes),a=d.firstChild,a.textContent=""}else p.push(e.createTextNode(s));for(d.textContent="",f=0;s=p[f++];)if(r&&wt.inArray(s,r)>-1)o&&o.push(s);else if(c=wt.contains(s.ownerDocument,s),a=x(d.appendChild(s),"script"),c&&w(a),i)for(u=0;s=a[u++];)$t.test(s.type||"")&&i.push(s);return d}function S(){return!0}function M(){return!1}function E(){try{return st.activeElement}catch(t){}}function A(t,e,i,n,r,o){var s,a;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=void 0);for(a in e)A(t,a,i,n,e[a],o);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),r===!1)r=M;else if(!r)return t;return 1===o&&(s=r,r=function(t){return wt().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=wt.guid++)),t.each(function(){wt.event.add(this,e,r,n,i)})}function C(t,e){return o(t,"table")&&o(11!==e.nodeType?e:e.firstChild,"tr")?wt(t).children("tbody")[0]||t:t}function P(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function D(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function L(t,e){var i,n,r,o,s,a,l,h;if(1===e.nodeType){if(zt.hasData(t)&&(o=zt.access(t),s=zt.set(e,o),h=o.events)){delete s.handle,s.events={};for(r in h)for(i=0,n=h[r].length;i<n;i++)wt.event.add(e,r,h[r][i])}Ut.hasData(t)&&(a=Ut.access(t),l=wt.extend({},a),Ut.set(e,l))}}function R(t,e){var i=e.nodeName.toLowerCase();"input"===i&&Jt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function I(t,e,n,r){e=ht.apply([],e);var o,s,a,l,h,c,u=0,d=t.length,p=d-1,f=e[0],m=yt(f);if(m||d>1&&"string"==typeof f&&!vt.checkClone&&le.test(f))return t.each(function(i){var o=t.eq(i);m&&(e[0]=f.call(this,i,o.html())),I(o,e,n,r)});if(d&&(o=T(e,t[0].ownerDocument,!1,t,r),s=o.firstChild,1===o.childNodes.length&&(o=s),s||r)){for(a=wt.map(x(o,"script"),P),l=a.length;u<d;u++)h=o,u!==p&&(h=wt.clone(h,!0,!0),l&&wt.merge(a,x(h,"script"))),n.call(t[u],h,u);if(l)for(c=a[a.length-1].ownerDocument,wt.map(a,D),u=0;u<l;u++)h=a[u],$t.test(h.type||"")&&!zt.access(h,"globalEval")&&wt.contains(c,h)&&(h.src&&"module"!==(h.type||"").toLowerCase()?wt._evalUrl&&wt._evalUrl(h.src):i(h.textContent.replace(he,""),c,h))}return t}function k(t,e,i){for(var n,r=e?wt.filter(e,t):t,o=0;null!=(n=r[o]);o++)i||1!==n.nodeType||wt.cleanData(x(n)),n.parentNode&&(i&&wt.contains(n.ownerDocument,n)&&w(x(n,"script")),n.parentNode.removeChild(n));return t}function O(t,e,i){var n,r,o,s,a=t.style;return i=i||ue(t),i&&(s=i.getPropertyValue(e)||i[e],""!==s||wt.contains(t.ownerDocument,t)||(s=wt.style(t,e)),!vt.pixelBoxStyles()&&ce.test(s)&&de.test(e)&&(n=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=i.width,a.width=n,a.minWidth=r,a.maxWidth=o)),void 0!==s?s+"":s}function H(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function N(t){if(t in ye)return t;for(var e=t[0].toUpperCase()+t.slice(1),i=ve.length;i--;)if(t=ve[i]+e,t in ye)return t}function B(t){var e=wt.cssProps[t];return e||(e=wt.cssProps[t]=N(t)||t),e}function G(t,e,i){var n=Xt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function F(t,e,i,n,r,o){var s="width"===e?1:0,a=0,l=0;if(i===(n?"border":"content"))return 0;for(;s<4;s+=2)"margin"===i&&(l+=wt.css(t,i+qt[s],!0,r)),n?("content"===i&&(l-=wt.css(t,"padding"+qt[s],!0,r)),"margin"!==i&&(l-=wt.css(t,"border"+qt[s]+"Width",!0,r))):(l+=wt.css(t,"padding"+qt[s],!0,r),"padding"!==i?l+=wt.css(t,"border"+qt[s]+"Width",!0,r):a+=wt.css(t,"border"+qt[s]+"Width",!0,r));return!n&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))),l}function z(t,e,i){var n=ue(t),r=O(t,e,n),o="border-box"===wt.css(t,"boxSizing",!1,n),s=o;if(ce.test(r)){if(!i)return r;r="auto"}return s=s&&(vt.boxSizingReliable()||r===t.style[e]),("auto"===r||!parseFloat(r)&&"inline"===wt.css(t,"display",!1,n))&&(r=t["offset"+e[0].toUpperCase()+e.slice(1)],s=!0),r=parseFloat(r)||0,r+F(t,e,i||(o?"border":"content"),s,n,r)+"px"}function U(t,e,i,n,r){return new U.prototype.init(t,e,i,n,r)}function V(){be&&(st.hidden===!1&&t.requestAnimationFrame?t.requestAnimationFrame(V):t.setTimeout(V,wt.fx.interval),wt.fx.tick())}function j(){return t.setTimeout(function(){_e=void 0}),_e=Date.now()}function W(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)i=qt[n],r["margin"+i]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function X(t,e,i){for(var n,r=(K.tweeners[e]||[]).concat(K.tweeners["*"]),o=0,s=r.length;o<s;o++)if(n=r[o].call(i,e,t))return n}function q(t,e,i){var n,r,o,s,a,l,h,c,u="width"in e||"height"in e,d=this,p={},f=t.style,m=t.nodeType&&Yt(t),g=zt.get(t,"fxshow");i.queue||(s=wt._queueHooks(t,"fx"),null==s.unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,d.always(function(){d.always(function(){s.unqueued--,wt.queue(t,"fx").length||s.empty.fire()})}));for(n in e)if(r=e[n],xe.test(r)){if(delete e[n],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[n])continue;m=!0}p[n]=g&&g[n]||wt.style(t,n)}if(l=!wt.isEmptyObject(e),l||!wt.isEmptyObject(p)){u&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],h=g&&g.display,null==h&&(h=zt.get(t,"display")),c=wt.css(t,"display"),"none"===c&&(h?c=h:(b([t],!0),h=t.style.display||h,c=wt.css(t,"display"),b([t]))),("inline"===c||"inline-block"===c&&null!=h)&&"none"===wt.css(t,"float")&&(l||(d.done(function(){f.display=h}),null==h&&(c=f.display,h="none"===c?"":c)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),l=!1;for(n in p)l||(g?"hidden"in g&&(m=g.hidden):g=zt.access(t,"fxshow",{display:h}),o&&(g.hidden=!m),m&&b([t],!0),d.done(function(){m||b([t]),zt.remove(t,"fxshow");for(n in p)wt.style(t,n,p[n])})),l=X(m?g[n]:0,n,d),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}}function Y(t,e){var i,n,r,o,s;for(i in t)if(n=f(i),r=e[n],o=t[i],Array.isArray(o)&&(r=o[1],o=t[i]=o[0]),i!==n&&(t[n]=o,delete t[i]),s=wt.cssHooks[n],s&&"expand"in s){o=s.expand(o),delete t[n];for(i in o)i in t||(t[i]=o[i],e[i]=r)}else e[n]=r}function K(t,e,i){var n,r,o=0,s=K.prefilters.length,a=wt.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var e=_e||j(),i=Math.max(0,h.startTime+h.duration-e),n=i/h.duration||0,o=1-n,s=0,l=h.tweens.length;s<l;s++)h.tweens[s].run(o);return a.notifyWith(t,[h,o,i]),o<1&&l?i:(l||a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h]),!1)},h=a.promise({elem:t,props:wt.extend({},e),opts:wt.extend(!0,{specialEasing:{},easing:wt.easing._default},i),originalProperties:e,originalOptions:i,startTime:_e||j(),duration:i.duration,tweens:[],createTween:function(e,i){var n=wt.Tween(t,h.opts,e,i,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(n),n},stop:function(e){var i=0,n=e?h.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)h.tweens[i].run(1);return e?(a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h,e])):a.rejectWith(t,[h,e]),this}}),c=h.props;for(Y(c,h.opts.specialEasing);o<s;o++)if(n=K.prefilters[o].call(h,t,c,h.opts))return yt(n.stop)&&(wt._queueHooks(h.elem,h.opts.queue).stop=n.stop.bind(n)),n;return wt.map(c,X,h),yt(h.opts.start)&&h.opts.start.call(t,h),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always),wt.fx.timer(wt.extend(l,{elem:t,anim:h,queue:h.opts.queue})),h}function Z(t){var e=t.match(kt)||[];return e.join(" ")}function J(t){return t.getAttribute&&t.getAttribute("class")||""}function Q(t){return Array.isArray(t)?t:"string"==typeof t?t.match(kt)||[]:[]}function $(t,e,i,r){var o;if(Array.isArray(e))wt.each(e,function(e,n){i||Ie.test(t)?r(t,n):$(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,r)});else if(i||"object"!==n(e))r(t,e);else for(o in e)$(t+"["+o+"]",e[o],i,r)}function tt(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,o=e.toLowerCase().match(kt)||[];if(yt(i))for(;n=o[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function et(t,e,i,n){function r(a){var l;return o[a]=!0,wt.each(t[a]||[],function(t,a){var h=a(e,i,n);return"string"!=typeof h||s||o[h]?s?!(l=h):void 0:(e.dataTypes.unshift(h),r(h),!1)}),l}var o={},s=t===We;return r(e.dataTypes[0])||!o["*"]&&r("*")}function it(t,e){var i,n,r=wt.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&wt.extend(!0,t,n),t}function nt(t,e,i){for(var n,r,o,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)o=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==l[0]&&l.unshift(o),i[o]}function rt(t,e,i,n){var r,o,s,a,l,h={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)h[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(s=h[l+" "+o]||h["* "+o],!s)for(r in h)if(a=r.split(" "),a[1]===o&&(s=h[l+" "+a[0]]||h["* "+a[0]])){s===!0?s=h[r]:h[r]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&t["throws"])e=s(e);else try{e=s(e)}catch(u){return{state:"parsererror",error:s?u:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}var ot=[],st=t.document,at=Object.getPrototypeOf,lt=ot.slice,ht=ot.concat,ct=ot.push,ut=ot.indexOf,dt={},pt=dt.toString,ft=dt.hasOwnProperty,mt=ft.toString,gt=mt.call(Object),vt={},yt=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},_t=function(t){return null!=t&&t===t.window},bt={type:!0,src:!0,noModule:!0},xt="3.3.1",wt=function(t,e){return new wt.fn.init(t,e)},Tt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;wt.fn=wt.prototype={jquery:xt,constructor:wt,length:0,toArray:function(){return lt.call(this)},get:function(t){return null==t?lt.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=wt.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return wt.each(this,t)},map:function(t){return this.pushStack(wt.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(lt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:ct,sort:ot.sort,splice:ot.splice},wt.extend=wt.fn.extend=function(){var t,e,i,n,r,o,s=arguments[0]||{},a=1,l=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[a]||{},a++),"object"==typeof s||yt(s)||(s={}),a===l&&(s=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=s[e],n=t[e],s!==n&&(h&&n&&(wt.isPlainObject(n)||(r=Array.isArray(n)))?(r?(r=!1,o=i&&Array.isArray(i)?i:[]):o=i&&wt.isPlainObject(i)?i:{},s[e]=wt.extend(h,o,n)):void 0!==n&&(s[e]=n));return s},wt.extend({expando:"jQuery"+(xt+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==pt.call(t))&&(!(e=at(t))||(i=ft.call(e,"constructor")&&e.constructor,"function"==typeof i&&mt.call(i)===gt))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t){i(t)},each:function(t,e){var i,n=0;if(r(t))for(i=t.length;n<i&&e.call(t[n],n,t[n])!==!1;n++);else for(n in t)if(e.call(t[n],n,t[n])===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(Tt,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(r(Object(t))?wt.merge(i,"string"==typeof t?[t]:t):ct.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:ut.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;n<i;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n,r=[],o=0,s=t.length,a=!i;o<s;o++)n=!e(t[o],o),n!==a&&r.push(t[o]);return r},map:function(t,e,i){var n,o,s=0,a=[];if(r(t))for(n=t.length;s<n;s++)o=e(t[s],s,i),null!=o&&a.push(o);else for(s in t)o=e(t[s],s,i),null!=o&&a.push(o);return ht.apply([],a)},guid:1,support:vt}),"function"==typeof Symbol&&(wt.fn[Symbol.iterator]=ot[Symbol.iterator]),wt.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){dt["[object "+e+"]"]=e.toLowerCase()});var St=function(t){function e(t,e,i,n){var r,o,s,a,l,h,c,d=e&&e.ownerDocument,f=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return i;if(!n&&((e?e.ownerDocument||e:z)!==I&&R(e),e=e||I,O)){if(11!==f&&(l=vt.exec(t)))if(r=l[1]){if(9===f){if(!(s=e.getElementById(r)))return i;if(s.id===r)return i.push(s),i}else if(d&&(s=d.getElementById(r))&&G(e,s)&&s.id===r)return i.push(s),i}else{if(l[2])return Q.apply(i,e.getElementsByTagName(t)),i;if((r=l[3])&&w.getElementsByClassName&&e.getElementsByClassName)return Q.apply(i,e.getElementsByClassName(r)),i}if(w.qsa&&!X[t+" "]&&(!H||!H.test(t))){if(1!==f)d=e,c=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(xt,wt):e.setAttribute("id",a=F),h=E(t),o=h.length;o--;)h[o]="#"+a+" "+p(h[o]);c=h.join(","),d=yt.test(t)&&u(e.parentNode)||e}if(c)try{return Q.apply(i,d.querySelectorAll(c)),i}catch(m){}finally{a===F&&e.removeAttribute("id")}}}return C(t.replace(at,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>T.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[F]=!0,t}function r(t){var e=I.createElement("fieldset");try{return!!t(e)}catch(i){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var i=t.split("|"),n=i.length;n--;)T.attrHandle[i[n]]=e}function s(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function a(t){return function(e){var i=e.nodeName.toLowerCase();return"input"===i&&e.type===t}}function l(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function h(t){return function(e){return"form"in e?e.parentNode&&e.disabled===!1?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&St(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function c(t){return n(function(e){return e=+e,n(function(i,n){for(var r,o=t([],i.length,e),s=o.length;s--;)i[r=o[s]]&&(i[r]=!(n[r]=i[r]))})})}function u(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function d(){}function p(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function f(t,e,i){var n=e.dir,r=e.next,o=r||n,s=i&&"parentNode"===o,a=V++;return e.first?function(e,i,r){for(;e=e[n];)if(1===e.nodeType||s)return t(e,i,r);return!1}:function(e,i,l){var h,c,u,d=[U,a];if(l){for(;e=e[n];)if((1===e.nodeType||s)&&t(e,i,l))return!0}else for(;e=e[n];)if(1===e.nodeType||s)if(u=e[F]||(e[F]={}),c=u[e.uniqueID]||(u[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[n]||e;else{if((h=c[o])&&h[0]===U&&h[1]===a)return d[2]=h[2];if(c[o]=d,d[2]=t(e,i,l))return!0}return!1}}function m(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function g(t,i,n){for(var r=0,o=i.length;r<o;r++)e(t,i[r],n);return n}function v(t,e,i,n,r){for(var o,s=[],a=0,l=t.length,h=null!=e;a<l;a++)(o=t[a])&&(i&&!i(o,n,r)||(s.push(o),h&&e.push(a)));return s}function y(t,e,i,r,o,s){return r&&!r[F]&&(r=y(r)),o&&!o[F]&&(o=y(o,s)),n(function(n,s,a,l){var h,c,u,d=[],p=[],f=s.length,m=n||g(e||"*",a.nodeType?[a]:a,[]),y=!t||!n&&e?m:v(m,d,t,a,l),_=i?o||(n?t:f||r)?[]:s:y;if(i&&i(y,_,a,l),r)for(h=v(_,p),r(h,[],a,l),c=h.length;c--;)(u=h[c])&&(_[p[c]]=!(y[p[c]]=u));if(n){if(o||t){if(o){for(h=[],c=_.length;c--;)(u=_[c])&&h.push(y[c]=u);o(null,_=[],h,l)}for(c=_.length;c--;)(u=_[c])&&(h=o?tt(n,u):d[c])>-1&&(n[h]=!(s[h]=u))}}else _=v(_===s?_.splice(f,_.length):_),o?o(null,s,_,l):Q.apply(s,_)})}function _(t){for(var e,i,n,r=t.length,o=T.relative[t[0].type],s=o||T.relative[" "],a=o?1:0,l=f(function(t){return t===e},s,!0),h=f(function(t){return tt(e,t)>-1},s,!0),c=[function(t,i,n){var r=!o&&(n||i!==P)||((e=i).nodeType?l(t,i,n):h(t,i,n));return e=null,r}];a<r;a++)if(i=T.relative[t[a].type])c=[f(m(c),i)];else{if(i=T.filter[t[a].type].apply(null,t[a].matches),i[F]){for(n=++a;n<r&&!T.relative[t[n].type];n++);return y(a>1&&m(c),a>1&&p(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(at,"$1"),i,a<n&&_(t.slice(a,n)),n<r&&_(t=t.slice(n)),n<r&&p(t))}c.push(i)}return m(c)}function b(t,i){var r=i.length>0,o=t.length>0,s=function(n,s,a,l,h){var c,u,d,p=0,f="0",m=n&&[],g=[],y=P,_=n||o&&T.find.TAG("*",h),b=U+=null==y?1:Math.random()||.1,x=_.length;for(h&&(P=s===I||s||h);f!==x&&null!=(c=_[f]);f++){if(o&&c){for(u=0,s||c.ownerDocument===I||(R(c),a=!O);d=t[u++];)if(d(c,s||I,a)){l.push(c);break}h&&(U=b)}r&&((c=!d&&c)&&p--,n&&m.push(c))}if(p+=f,r&&f!==p){for(u=0;d=i[u++];)d(m,g,s,a);if(n){if(p>0)for(;f--;)m[f]||g[f]||(g[f]=Z.call(l));g=v(g)}Q.apply(l,g),h&&!n&&g.length>0&&p+i.length>1&&e.uniqueSort(l)}return h&&(U=b,P=y),m};return r?n(s):s}var x,w,T,S,M,E,A,C,P,D,L,R,I,k,O,H,N,B,G,F="sizzle"+1*new Date,z=t.document,U=0,V=0,j=i(),W=i(),X=i(),q=function(t,e){return t===e&&(L=!0),0},Y={}.hasOwnProperty,K=[],Z=K.pop,J=K.push,Q=K.push,$=K.slice,tt=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",it="[\\x20\\t\\r\\n\\f]",nt="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",rt="\\["+it+"*("+nt+")(?:"+it+"*([*^$|!~]?=)"+it+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+nt+"))|)"+it+"*\\]",ot=":("+nt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+rt+")*)|.*)\\)|)",st=new RegExp(it+"+","g"),at=new RegExp("^"+it+"+|((?:^|[^\\\\])(?:\\\\.)*)"+it+"+$","g"),lt=new RegExp("^"+it+"*,"+it+"*"),ht=new RegExp("^"+it+"*([>+~]|"+it+")"+it+"*"),ct=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),ut=new RegExp(ot),dt=new RegExp("^"+nt+"$"),pt={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt+"|[*])"),ATTR:new RegExp("^"+rt),PSEUDO:new RegExp("^"+ot),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},ft=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,gt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,_t=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),bt=function(t,e,i){var n="0x"+e-65536;return n!==n||i?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},xt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,wt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},Tt=function(){R()},St=f(function(t){return t.disabled===!0&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{Q.apply(K=$.call(z.childNodes),z.childNodes),K[z.childNodes.length].nodeType}catch(Mt){Q={apply:K.length?function(t,e){J.apply(t,$.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}w=e.support={},M=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},R=e.setDocument=function(t){var e,i,n=t?t.ownerDocument||t:z;return n!==I&&9===n.nodeType&&n.documentElement?(I=n,k=I.documentElement,O=!M(I),z!==I&&(i=I.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",Tt,!1):i.attachEvent&&i.attachEvent("onunload",Tt)),w.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=r(function(t){return t.appendChild(I.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=gt.test(I.getElementsByClassName),w.getById=r(function(t){return k.appendChild(t).id=F,!I.getElementsByName||!I.getElementsByName(F).length}),w.getById?(T.filter.ID=function(t){var e=t.replace(_t,bt);return function(t){return t.getAttribute("id")===e}},T.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&O){var i=e.getElementById(t);return i?[i]:[]}}):(T.filter.ID=function(t){var e=t.replace(_t,bt);return function(t){var i="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},T.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&O){var i,n,r,o=e.getElementById(t);if(o){if(i=o.getAttributeNode("id"),i&&i.value===t)return[o];for(r=e.getElementsByName(t),n=0;o=r[n++];)if(i=o.getAttributeNode("id"),i&&i.value===t)return[o]}return[]}}),T.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;i=o[r++];)1===i.nodeType&&n.push(i);return n}return o},T.find.CLASS=w.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&O)return e.getElementsByClassName(t)},N=[],H=[],(w.qsa=gt.test(I.querySelectorAll))&&(r(function(t){k.appendChild(t).innerHTML="<a id='"+F+"'></a><select id='"+F+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&H.push("[*^$]="+it+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||H.push("\\["+it+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+F+"-]").length||H.push("~="),t.querySelectorAll(":checked").length||H.push(":checked"),t.querySelectorAll("a#"+F+"+*").length||H.push(".#.+[+~]")}),r(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=I.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&H.push("name"+it+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&H.push(":enabled",":disabled"),k.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&H.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),H.push(",.*:")})),(w.matchesSelector=gt.test(B=k.matches||k.webkitMatchesSelector||k.mozMatchesSelector||k.oMatchesSelector||k.msMatchesSelector))&&r(function(t){w.disconnectedMatch=B.call(t,"*"),B.call(t,"[s!='']:x"),N.push("!=",ot)}),H=H.length&&new RegExp(H.join("|")),N=N.length&&new RegExp(N.join("|")),e=gt.test(k.compareDocumentPosition),G=e||gt.test(k.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},q=e?function(t,e){if(t===e)return L=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i?i:(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!w.sortDetached&&e.compareDocumentPosition(t)===i?t===I||t.ownerDocument===z&&G(z,t)?-1:e===I||e.ownerDocument===z&&G(z,e)?1:D?tt(D,t)-tt(D,e):0:4&i?-1:1)}:function(t,e){if(t===e)return L=!0,0;var i,n=0,r=t.parentNode,o=e.parentNode,a=[t],l=[e];if(!r||!o)return t===I?-1:e===I?1:r?-1:o?1:D?tt(D,t)-tt(D,e):0;if(r===o)return s(t,e);for(i=t;i=i.parentNode;)a.unshift(i);for(i=e;i=i.parentNode;)l.unshift(i);for(;a[n]===l[n];)n++;return n?s(a[n],l[n]):a[n]===z?-1:l[n]===z?1:0},I):I},e.matches=function(t,i){return e(t,null,null,i)},e.matchesSelector=function(t,i){if((t.ownerDocument||t)!==I&&R(t),i=i.replace(ct,"='$1']"),w.matchesSelector&&O&&!X[i+" "]&&(!N||!N.test(i))&&(!H||!H.test(i)))try{var n=B.call(t,i);if(n||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(r){}return e(i,I,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==I&&R(t),G(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==I&&R(t);var i=T.attrHandle[e.toLowerCase()],n=i&&Y.call(T.attrHandle,e.toLowerCase())?i(t,e,!O):void 0;return void 0!==n?n:w.attributes||!O?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},e.escape=function(t){return(t+"").replace(xt,wt)},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,i=[],n=0,r=0;if(L=!w.detectDuplicates,D=!w.sortStable&&t.slice(0),t.sort(q),L){for(;e=t[r++];)e===t[r]&&(n=i.push(r));for(;n--;)t.splice(i[n],1)}return D=null,t},S=e.getText=function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=S(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[n++];)i+=S(e);return i},T=e.selectors={cacheLength:50,createPseudo:n,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(_t,bt),t[3]=(t[3]||t[4]||t[5]||"").replace(_t,bt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&ut.test(i)&&(e=E(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(_t,bt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=j[t+" "];return e||(e=new RegExp("(^|"+it+")"+t+"("+it+"|$)"))&&j(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,i,n){return function(r){var o=e.attr(r,t);return null==o?"!="===i:!i||(o+="","="===i?o===n:"!="===i?o!==n:"^="===i?n&&0===o.indexOf(n):"*="===i?n&&o.indexOf(n)>-1:"$="===i?n&&o.slice(-n.length)===n:"~="===i?(" "+o.replace(st," ")+" ").indexOf(n)>-1:"|="===i&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,i,n,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var h,c,u,d,p,f,m=o!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,_=!1;if(g){if(o){for(;m;){for(d=e;d=d[m];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?g.firstChild:g.lastChild],s&&y){for(d=g,u=d[F]||(d[F]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),h=c[t]||[],p=h[0]===U&&h[1],_=p&&h[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(_=p=0)||f.pop();)if(1===d.nodeType&&++_&&d===e){c[t]=[U,p,_];break}}else if(y&&(d=e,u=d[F]||(d[F]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),h=c[t]||[],p=h[0]===U&&h[1],_=p),_===!1)for(;(d=++p&&d&&d[m]||(_=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++_||(y&&(u=d[F]||(d[F]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),c[t]=[U,_]),d!==e)););return _-=r,_===n||_%n===0&&_/n>=0}}},PSEUDO:function(t,i){var r,o=T.pseudos[t]||T.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[F]?o(i):o.length>1?(r=[t,t,"",i],T.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,r=o(t,i),s=r.length;s--;)n=tt(t,r[s]),t[n]=!(e[n]=r[s])}):function(t){return o(t,0,r)}):o}},pseudos:{not:n(function(t){var e=[],i=[],r=A(t.replace(at,"$1"));return r[F]?n(function(t,e,i,n){for(var o,s=r(t,null,n,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,n,o){return e[0]=t,r(e,null,o,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(_t,bt),function(e){return(e.textContent||e.innerText||S(e)).indexOf(t)>-1}}),lang:n(function(t){return dt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(_t,bt).toLowerCase(),function(e){var i;do if(i=O?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return i=i.toLowerCase(),i===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===k},focus:function(t){
return t===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:h(!1),disabled:h(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!T.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return ft.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:c(function(){return[0]}),last:c(function(t,e){return[e-1]}),eq:c(function(t,e,i){return[i<0?i+e:i]}),even:c(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:c(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:c(function(t,e,i){for(var n=i<0?i+e:i;--n>=0;)t.push(n);return t}),gt:c(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}},T.pseudos.nth=T.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})T.pseudos[x]=a(x);for(x in{submit:!0,reset:!0})T.pseudos[x]=l(x);return d.prototype=T.filters=T.pseudos,T.setFilters=new d,E=e.tokenize=function(t,i){var n,r,o,s,a,l,h,c=W[t+" "];if(c)return i?0:c.slice(0);for(a=t,l=[],h=T.preFilter;a;){n&&!(r=lt.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),n=!1,(r=ht.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(at," ")}),a=a.slice(n.length));for(s in T.filter)!(r=pt[s].exec(a))||h[s]&&!(r=h[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?e.error(t):W(t,l).slice(0)},A=e.compile=function(t,e){var i,n=[],r=[],o=X[t+" "];if(!o){for(e||(e=E(t)),i=e.length;i--;)o=_(e[i]),o[F]?n.push(o):r.push(o);o=X(t,b(r,n)),o.selector=t}return o},C=e.select=function(t,e,i,n){var r,o,s,a,l,h="function"==typeof t&&t,c=!n&&E(t=h.selector||t);if(i=i||[],1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&9===e.nodeType&&O&&T.relative[o[1].type]){if(e=(T.find.ID(s.matches[0].replace(_t,bt),e)||[])[0],!e)return i;h&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=pt.needsContext.test(t)?0:o.length;r--&&(s=o[r],!T.relative[a=s.type]);)if((l=T.find[a])&&(n=l(s.matches[0].replace(_t,bt),yt.test(o[0].type)&&u(e.parentNode)||e))){if(o.splice(r,1),t=n.length&&p(o),!t)return Q.apply(i,n),i;break}}return(h||A(t,c))(n,e,!O,i,!e||yt.test(t)&&u(e.parentNode)||e),i},w.sortStable=F.split("").sort(q).join("")===F,w.detectDuplicates=!!L,R(),w.sortDetached=r(function(t){return 1&t.compareDocumentPosition(I.createElement("fieldset"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,i){var n;if(!i)return t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(t);wt.find=St,wt.expr=St.selectors,wt.expr[":"]=wt.expr.pseudos,wt.uniqueSort=wt.unique=St.uniqueSort,wt.text=St.getText,wt.isXMLDoc=St.isXML,wt.contains=St.contains,wt.escapeSelector=St.escape;var Mt=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&wt(t).is(i))break;n.push(t)}return n},Et=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},At=wt.expr.match.needsContext,Ct=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;wt.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?wt.find.matchesSelector(n,t)?[n]:[]:wt.find.matches(t,wt.grep(e,function(t){return 1===t.nodeType}))},wt.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(wt(t).filter(function(){for(e=0;e<n;e++)if(wt.contains(r[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)wt.find(t,r[e],i);return n>1?wt.uniqueSort(i):i},filter:function(t){return this.pushStack(s(this,t||[],!1))},not:function(t){return this.pushStack(s(this,t||[],!0))},is:function(t){return!!s(this,"string"==typeof t&&At.test(t)?wt(t):t||[],!1).length}});var Pt,Dt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Lt=wt.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||Pt,"string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:Dt.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof wt?e[0]:e,wt.merge(this,wt.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:st,!0)),Ct.test(n[1])&&wt.isPlainObject(e))for(n in e)yt(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=st.getElementById(n[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):yt(t)?void 0!==i.ready?i.ready(t):t(wt):wt.makeArray(t,this)};Lt.prototype=wt.fn,Pt=wt(st);var Rt=/^(?:parents|prev(?:Until|All))/,It={children:!0,contents:!0,next:!0,prev:!0};wt.fn.extend({has:function(t){var e=wt(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(wt.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,r=this.length,o=[],s="string"!=typeof t&&wt(t);if(!At.test(t))for(;n<r;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(s?s.index(i)>-1:1===i.nodeType&&wt.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?wt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?ut.call(wt(t),this[0]):ut.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(wt.uniqueSort(wt.merge(this.get(),wt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),wt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Mt(t,"parentNode")},parentsUntil:function(t,e,i){return Mt(t,"parentNode",i)},next:function(t){return a(t,"nextSibling")},prev:function(t){return a(t,"previousSibling")},nextAll:function(t){return Mt(t,"nextSibling")},prevAll:function(t){return Mt(t,"previousSibling")},nextUntil:function(t,e,i){return Mt(t,"nextSibling",i)},prevUntil:function(t,e,i){return Mt(t,"previousSibling",i)},siblings:function(t){return Et((t.parentNode||{}).firstChild,t)},children:function(t){return Et(t.firstChild)},contents:function(t){return o(t,"iframe")?t.contentDocument:(o(t,"template")&&(t=t.content||t),wt.merge([],t.childNodes))}},function(t,e){wt.fn[t]=function(i,n){var r=wt.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=wt.filter(n,r)),this.length>1&&(It[t]||wt.uniqueSort(r),Rt.test(t)&&r.reverse()),this.pushStack(r)}});var kt=/[^\x20\t\r\n\f]+/g;wt.Callbacks=function(t){t="string"==typeof t?l(t):wt.extend({},t);var e,i,r,o,s=[],a=[],h=-1,c=function(){for(o=o||t.once,r=e=!0;a.length;h=-1)for(i=a.shift();++h<s.length;)s[h].apply(i[0],i[1])===!1&&t.stopOnFalse&&(h=s.length,i=!1);t.memory||(i=!1),e=!1,o&&(s=i?[]:"")},u={add:function(){return s&&(i&&!e&&(h=s.length-1,a.push(i)),function r(e){wt.each(e,function(e,i){yt(i)?t.unique&&u.has(i)||s.push(i):i&&i.length&&"string"!==n(i)&&r(i)})}(arguments),i&&!e&&c()),this},remove:function(){return wt.each(arguments,function(t,e){for(var i;(i=wt.inArray(e,s,i))>-1;)s.splice(i,1),i<=h&&h--}),this},has:function(t){return t?wt.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=a=[],s=i="",this},disabled:function(){return!s},lock:function(){return o=a=[],i||e||(s=i=""),this},locked:function(){return!!o},fireWith:function(t,i){return o||(i=i||[],i=[t,i.slice?i.slice():i],a.push(i),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},wt.extend({Deferred:function(e){var i=[["notify","progress",wt.Callbacks("memory"),wt.Callbacks("memory"),2],["resolve","done",wt.Callbacks("once memory"),wt.Callbacks("once memory"),0,"resolved"],["reject","fail",wt.Callbacks("once memory"),wt.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(t){return r.then(null,t)},pipe:function(){var t=arguments;return wt.Deferred(function(e){wt.each(i,function(i,n){var r=yt(t[n[4]])&&t[n[4]];o[n[1]](function(){var t=r&&r.apply(this,arguments);t&&yt(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[n[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,n,r){function o(e,i,n,r){return function(){var a=this,l=arguments,u=function(){var t,u;if(!(e<s)){if(t=n.apply(a,l),t===i.promise())throw new TypeError("Thenable self-resolution");u=t&&("object"==typeof t||"function"==typeof t)&&t.then,yt(u)?r?u.call(t,o(s,i,h,r),o(s,i,c,r)):(s++,u.call(t,o(s,i,h,r),o(s,i,c,r),o(s,i,h,i.notifyWith))):(n!==h&&(a=void 0,l=[t]),(r||i.resolveWith)(a,l))}},d=r?u:function(){try{u()}catch(t){wt.Deferred.exceptionHook&&wt.Deferred.exceptionHook(t,d.stackTrace),e+1>=s&&(n!==c&&(a=void 0,l=[t]),i.rejectWith(a,l))}};e?d():(wt.Deferred.getStackHook&&(d.stackTrace=wt.Deferred.getStackHook()),t.setTimeout(d))}}var s=0;return wt.Deferred(function(t){i[0][3].add(o(0,t,yt(r)?r:h,t.notifyWith)),i[1][3].add(o(0,t,yt(e)?e:h)),i[2][3].add(o(0,t,yt(n)?n:c))}).promise()},promise:function(t){return null!=t?wt.extend(t,r):r}},o={};return wt.each(i,function(t,e){var s=e[2],a=e[5];r[e[1]]=s.add,a&&s.add(function(){n=a},i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),s.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=s.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,i=e,n=Array(i),r=lt.call(arguments),o=wt.Deferred(),s=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?lt.call(arguments):i,--e||o.resolveWith(n,r)}};if(e<=1&&(u(t,o.done(s(i)).resolve,o.reject,!e),"pending"===o.state()||yt(r[i]&&r[i].then)))return o.then();for(;i--;)u(r[i],s(i),o.reject);return o.promise()}});var Ot=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;wt.Deferred.exceptionHook=function(e,i){t.console&&t.console.warn&&e&&Ot.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},wt.readyException=function(e){t.setTimeout(function(){throw e})};var Ht=wt.Deferred();wt.fn.ready=function(t){return Ht.then(t)["catch"](function(t){wt.readyException(t)}),this},wt.extend({isReady:!1,readyWait:1,ready:function(t){(t===!0?--wt.readyWait:wt.isReady)||(wt.isReady=!0,t!==!0&&--wt.readyWait>0||Ht.resolveWith(st,[wt]))}}),wt.ready.then=Ht.then,"complete"===st.readyState||"loading"!==st.readyState&&!st.documentElement.doScroll?t.setTimeout(wt.ready):(st.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Nt=function(t,e,i,r,o,s,a){var l=0,h=t.length,c=null==i;if("object"===n(i)){o=!0;for(l in i)Nt(t,e,l,i[l],!0,s,a)}else if(void 0!==r&&(o=!0,yt(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,i){return c.call(wt(t),i)})),e))for(;l<h;l++)e(t[l],i,a?r:r.call(t[l],l,e(t[l],i)));return o?t:c?e.call(t):h?e(t[0],i):s},Bt=/^-ms-/,Gt=/-([a-z])/g,Ft=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};m.uid=1,m.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Ft(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,r=this.cache(t);if("string"==typeof e)r[f(e)]=i;else for(n in e)r[f(n)]=e[n];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][f(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){Array.isArray(e)?e=e.map(f):(e=f(e),e=e in n?[e]:e.match(kt)||[]),i=e.length;for(;i--;)delete n[e[i]]}(void 0===e||wt.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!wt.isEmptyObject(e)}};var zt=new m,Ut=new m,Vt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,jt=/[A-Z]/g;wt.extend({hasData:function(t){return Ut.hasData(t)||zt.hasData(t)},data:function(t,e,i){return Ut.access(t,e,i)},removeData:function(t,e){Ut.remove(t,e)},_data:function(t,e,i){return zt.access(t,e,i)},_removeData:function(t,e){zt.remove(t,e)}}),wt.fn.extend({data:function(t,e){var i,n,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=Ut.get(o),1===o.nodeType&&!zt.get(o,"hasDataAttrs"))){for(i=s.length;i--;)s[i]&&(n=s[i].name,0===n.indexOf("data-")&&(n=f(n.slice(5)),v(o,n,r[n])));zt.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each(function(){Ut.set(this,t)}):Nt(this,function(e){var i;if(o&&void 0===e){if(i=Ut.get(o,t),void 0!==i)return i;if(i=v(o,t),void 0!==i)return i}else this.each(function(){Ut.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Ut.remove(this,t)})}}),wt.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=zt.get(t,e),i&&(!n||Array.isArray(i)?n=zt.access(t,e,wt.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=wt.queue(t,e),n=i.length,r=i.shift(),o=wt._queueHooks(t,e),s=function(){wt.dequeue(t,e)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete o.stop,r.call(t,s,o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return zt.get(t,i)||zt.access(t,i,{empty:wt.Callbacks("once memory").add(function(){zt.remove(t,[e+"queue",i])})})}}),wt.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?wt.queue(this[0],t):void 0===e?this:this.each(function(){var i=wt.queue(this,t,e);wt._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&wt.dequeue(this,t)})},dequeue:function(t){return this.each(function(){wt.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=wt.Deferred(),o=this,s=this.length,a=function(){--n||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)i=zt.get(o[s],t+"queueHooks"),i&&i.empty&&(n++,i.empty.add(a));return a(),r.promise(e)}});var Wt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Xt=new RegExp("^(?:([+-])=|)("+Wt+")([a-z%]*)$","i"),qt=["Top","Right","Bottom","Left"],Yt=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&wt.contains(t.ownerDocument,t)&&"none"===wt.css(t,"display")},Kt=function(t,e,i,n){var r,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];r=i.apply(t,n||[]);for(o in e)t.style[o]=s[o];return r},Zt={};wt.fn.extend({show:function(){return b(this,!0)},hide:function(){return b(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Yt(this)?wt(this).show():wt(this).hide()})}});var Jt=/^(?:checkbox|radio)$/i,Qt=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,$t=/^$|^module$|\/(?:java|ecma)script/i,te={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,"",""]};te.optgroup=te.option,te.tbody=te.tfoot=te.colgroup=te.caption=te.thead,te.th=te.td;var ee=/<|&#?\w+;/;!function(){var t=st.createDocumentFragment(),e=t.appendChild(st.createElement("div")),i=st.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),vt.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",vt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var ie=st.documentElement,ne=/^key/,re=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,oe=/^([^.]*)(?:\.(.+)|)/;wt.event={global:{},add:function(t,e,i,n,r){var o,s,a,l,h,c,u,d,p,f,m,g=zt.get(t);if(g)for(i.handler&&(o=i,i=o.handler,r=o.selector),r&&wt.find.matchesSelector(ie,r),i.guid||(i.guid=wt.guid++),(l=g.events)||(l=g.events={}),(s=g.handle)||(s=g.handle=function(e){return"undefined"!=typeof wt&&wt.event.triggered!==e.type?wt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(kt)||[""],h=e.length;h--;)a=oe.exec(e[h])||[],p=m=a[1],f=(a[2]||"").split(".").sort(),p&&(u=wt.event.special[p]||{},p=(r?u.delegateType:u.bindType)||p,u=wt.event.special[p]||{},c=wt.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&wt.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=l[p])||(d=l[p]=[],d.delegateCount=0,u.setup&&u.setup.call(t,n,f,s)!==!1||t.addEventListener&&t.addEventListener(p,s)),u.add&&(u.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),wt.event.global[p]=!0)},remove:function(t,e,i,n,r){var o,s,a,l,h,c,u,d,p,f,m,g=zt.hasData(t)&&zt.get(t);if(g&&(l=g.events)){for(e=(e||"").match(kt)||[""],h=e.length;h--;)if(a=oe.exec(e[h])||[],p=m=a[1],f=(a[2]||"").split(".").sort(),p){for(u=wt.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,d=l[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!r&&m!==c.origType||i&&i.guid!==c.guid||a&&!a.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,u.remove&&u.remove.call(t,c));s&&!d.length&&(u.teardown&&u.teardown.call(t,f,g.handle)!==!1||wt.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)wt.event.remove(t,p+e[h],i,n,!0);wt.isEmptyObject(l)&&zt.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,o,s,a=wt.event.fix(t),l=new Array(arguments.length),h=(zt.get(this,"events")||{})[a.type]||[],c=wt.event.special[a.type]||{};for(l[0]=a,e=1;e<arguments.length;e++)l[e]=arguments[e];if(a.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,a)!==!1){for(s=wt.event.handlers.call(this,a,h),e=0;(r=s[e++])&&!a.isPropagationStopped();)for(a.currentTarget=r.elem,i=0;(o=r.handlers[i++])&&!a.isImmediatePropagationStopped();)a.rnamespace&&!a.rnamespace.test(o.namespace)||(a.handleObj=o,a.data=o.data,n=((wt.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,l),void 0!==n&&(a.result=n)===!1&&(a.preventDefault(),a.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,a),a.result}},handlers:function(t,e){var i,n,r,o,s,a=[],l=e.delegateCount,h=t.target;if(l&&h.nodeType&&!("click"===t.type&&t.button>=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==t.type||h.disabled!==!0)){for(o=[],s={},i=0;i<l;i++)n=e[i],r=n.selector+" ",void 0===s[r]&&(s[r]=n.needsContext?wt(r,this).index(h)>-1:wt.find(r,this,null,[h]).length),s[r]&&o.push(n);o.length&&a.push({elem:h,handlers:o})}return h=this,l<e.length&&a.push({elem:h,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(wt.Event.prototype,t,{enumerable:!0,configurable:!0,get:yt(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[wt.expando]?t:new wt.Event(t)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==E()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===E()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&o(this,"input"))return this.click(),!1},_default:function(t){return o(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},wt.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},wt.Event=function(t,e){return this instanceof wt.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?S:M,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&wt.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),void(this[wt.expando]=!0)):new wt.Event(t,e)},wt.Event.prototype={constructor:wt.Event,isDefaultPrevented:M,isPropagationStopped:M,isImmediatePropagationStopped:M,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=S,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=S,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=S,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},wt.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&ne.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&re.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},wt.event.addProp),wt.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){wt.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,o=t.handleObj;return r&&(r===n||wt.contains(n,r))||(t.type=o.origType,i=o.handler.apply(this,arguments),t.type=e),i}}}),wt.fn.extend({on:function(t,e,i,n){return A(this,t,e,i,n)},one:function(t,e,i,n){return A(this,t,e,i,n,1)},off:function(t,e,i){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,wt(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return e!==!1&&"function"!=typeof e||(i=e,e=void 0),i===!1&&(i=M),this.each(function(){wt.event.remove(this,t,i,e)})}});var se=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ae=/<script|<style|<link/i,le=/checked\s*(?:[^=]|=\s*.checked.)/i,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;wt.extend({htmlPrefilter:function(t){return t.replace(se,"<$1></$2>")},clone:function(t,e,i){var n,r,o,s,a=t.cloneNode(!0),l=wt.contains(t.ownerDocument,t);if(!(vt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||wt.isXMLDoc(t)))for(s=x(a),o=x(t),n=0,r=o.length;n<r;n++)R(o[n],s[n]);if(e)if(i)for(o=o||x(t),s=s||x(a),n=0,r=o.length;n<r;n++)L(o[n],s[n]);else L(t,a);return s=x(a,"script"),s.length>0&&w(s,!l&&x(t,"script")),a},cleanData:function(t){for(var e,i,n,r=wt.event.special,o=0;void 0!==(i=t[o]);o++)if(Ft(i)){if(e=i[zt.expando]){if(e.events)for(n in e.events)r[n]?wt.event.remove(i,n):wt.removeEvent(i,n,e.handle);i[zt.expando]=void 0}i[Ut.expando]&&(i[Ut.expando]=void 0)}}}),wt.fn.extend({detach:function(t){return k(this,t,!0)},remove:function(t){return k(this,t)},text:function(t){return Nt(this,function(t){return void 0===t?wt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return I(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=C(this,t);e.appendChild(t)}})},prepend:function(){return I(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=C(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return I(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return I(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(wt.cleanData(x(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return wt.clone(this,t,e)})},html:function(t){return Nt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!ae.test(t)&&!te[(Qt.exec(t)||["",""])[1].toLowerCase()]){t=wt.htmlPrefilter(t);try{for(;i<n;i++)e=this[i]||{},1===e.nodeType&&(wt.cleanData(x(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return I(this,arguments,function(e){var i=this.parentNode;wt.inArray(this,t)<0&&(wt.cleanData(x(this)),i&&i.replaceChild(e,this))},t)}}),wt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){wt.fn[t]=function(t){for(var i,n=[],r=wt(t),o=r.length-1,s=0;s<=o;s++)i=s===o?this:this.clone(!0),wt(r[s])[e](i),ct.apply(n,i.get());return this.pushStack(n)}});var ce=new RegExp("^("+Wt+")(?!px)[a-z%]+$","i"),ue=function(e){var i=e.ownerDocument.defaultView;return i&&i.opener||(i=t),i.getComputedStyle(e)},de=new RegExp(qt.join("|"),"i");!function(){function e(){if(h){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(l).appendChild(h);var e=t.getComputedStyle(h);n="1%"!==e.top,a=12===i(e.marginLeft),h.style.right="60%",s=36===i(e.right),r=36===i(e.width),h.style.position="absolute",o=36===h.offsetWidth||"absolute",ie.removeChild(l),h=null}}function i(t){return Math.round(parseFloat(t))}var n,r,o,s,a,l=st.createElement("div"),h=st.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",vt.clearCloneStyle="content-box"===h.style.backgroundClip,wt.extend(vt,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),o}}))}();var pe=/^(none|table(?!-c[ea]).+)/,fe=/^--/,me={position:"absolute",visibility:"hidden",display:"block"},ge={letterSpacing:"0",fontWeight:"400"},ve=["Webkit","Moz","ms"],ye=st.createElement("div").style;wt.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=O(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=f(e),l=fe.test(e),h=t.style;return l||(e=B(a)),s=wt.cssHooks[e]||wt.cssHooks[a],void 0===i?s&&"get"in s&&void 0!==(r=s.get(t,!1,n))?r:h[e]:(o=typeof i,"string"===o&&(r=Xt.exec(i))&&r[1]&&(i=y(t,e,r),o="number"),null!=i&&i===i&&("number"===o&&(i+=r&&r[3]||(wt.cssNumber[a]?"":"px")),vt.clearCloneStyle||""!==i||0!==e.indexOf("background")||(h[e]="inherit"),s&&"set"in s&&void 0===(i=s.set(t,i,n))||(l?h.setProperty(e,i):h[e]=i)),void 0)}},css:function(t,e,i,n){var r,o,s,a=f(e),l=fe.test(e);return l||(e=B(a)),s=wt.cssHooks[e]||wt.cssHooks[a],s&&"get"in s&&(r=s.get(t,!0,i)),void 0===r&&(r=O(t,e,n)),"normal"===r&&e in ge&&(r=ge[e]),""===i||i?(o=parseFloat(r),i===!0||isFinite(o)?o||0:r):r}}),wt.each(["height","width"],function(t,e){wt.cssHooks[e]={get:function(t,i,n){if(i)return!pe.test(wt.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?z(t,e,n):Kt(t,me,function(){return z(t,e,n)})},set:function(t,i,n){var r,o=ue(t),s="border-box"===wt.css(t,"boxSizing",!1,o),a=n&&F(t,e,n,s,o);return s&&vt.scrollboxSize()===o.position&&(a-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-F(t,e,"border",!1,o)-.5)),a&&(r=Xt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=wt.css(t,e)),G(t,i,a)}}}),wt.cssHooks.marginLeft=H(vt.reliableMarginLeft,function(t,e){if(e)return(parseFloat(O(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),wt.each({margin:"",padding:"",border:"Width"},function(t,e){wt.cssHooks[t+e]={expand:function(i){for(var n=0,r={},o="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+qt[n]+e]=o[n]||o[n-2]||o[0];return r}},"margin"!==t&&(wt.cssHooks[t+e].set=G)}),wt.fn.extend({css:function(t,e){return Nt(this,function(t,e,i){var n,r,o={},s=0;if(Array.isArray(e)){for(n=ue(t),r=e.length;s<r;s++)o[e[s]]=wt.css(t,e[s],!1,n);return o}return void 0!==i?wt.style(t,e,i):wt.css(t,e)},t,e,arguments.length>1)}}),wt.Tween=U,U.prototype={constructor:U,init:function(t,e,i,n,r,o){this.elem=t,this.prop=i,this.easing=r||wt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(wt.cssNumber[i]?"":"px")},cur:function(){var t=U.propHooks[this.prop];return t&&t.get?t.get(this):U.propHooks._default.get(this)},run:function(t){var e,i=U.propHooks[this.prop];return this.options.duration?this.pos=e=wt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):U.propHooks._default.set(this),this}},U.prototype.init.prototype=U.prototype,U.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=wt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){wt.fx.step[t.prop]?wt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[wt.cssProps[t.prop]]&&!wt.cssHooks[t.prop]?t.elem[t.prop]=t.now:wt.style(t.elem,t.prop,t.now+t.unit)}}},U.propHooks.scrollTop=U.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},wt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},wt.fx=U.prototype.init,wt.fx.step={};var _e,be,xe=/^(?:toggle|show|hide)$/,we=/queueHooks$/;wt.Animation=wt.extend(K,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return y(i.elem,t,Xt.exec(e),i),i}]},tweener:function(t,e){yt(t)?(e=t,t=["*"]):t=t.match(kt);for(var i,n=0,r=t.length;n<r;n++)i=t[n],K.tweeners[i]=K.tweeners[i]||[],K.tweeners[i].unshift(e)},prefilters:[q],prefilter:function(t,e){e?K.prefilters.unshift(t):K.prefilters.push(t)}}),wt.speed=function(t,e,i){var n=t&&"object"==typeof t?wt.extend({},t):{complete:i||!i&&e||yt(t)&&t,duration:t,easing:i&&e||e&&!yt(e)&&e};return wt.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in wt.fx.speeds?n.duration=wt.fx.speeds[n.duration]:n.duration=wt.fx.speeds._default),null!=n.queue&&n.queue!==!0||(n.queue="fx"),n.old=n.complete,n.complete=function(){yt(n.old)&&n.old.call(this),n.queue&&wt.dequeue(this,n.queue)},n},wt.fn.extend({fadeTo:function(t,e,i,n){return this.filter(Yt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=wt.isEmptyObject(t),o=wt.speed(e,i,n),s=function(){var e=K(this,wt.extend({},t),o);(r||zt.get(this,"finish"))&&e.stop(!0)};return s.finish=s,r||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,r=null!=t&&t+"queueHooks",o=wt.timers,s=zt.get(this);if(r)s[r]&&s[r].stop&&n(s[r]);else for(r in s)s[r]&&s[r].stop&&we.test(r)&&n(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(i),
e=!1,o.splice(r,1));!e&&i||wt.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,i=zt.get(this),n=i[t+"queue"],r=i[t+"queueHooks"],o=wt.timers,s=n?n.length:0;for(i.finish=!0,wt.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),wt.each(["toggle","show","hide"],function(t,e){var i=wt.fn[e];wt.fn[e]=function(t,n,r){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(W(e,!0),t,n,r)}}),wt.each({slideDown:W("show"),slideUp:W("hide"),slideToggle:W("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){wt.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),wt.timers=[],wt.fx.tick=function(){var t,e=0,i=wt.timers;for(_e=Date.now();e<i.length;e++)t=i[e],t()||i[e]!==t||i.splice(e--,1);i.length||wt.fx.stop(),_e=void 0},wt.fx.timer=function(t){wt.timers.push(t),wt.fx.start()},wt.fx.interval=13,wt.fx.start=function(){be||(be=!0,V())},wt.fx.stop=function(){be=null},wt.fx.speeds={slow:600,fast:200,_default:400},wt.fn.delay=function(e,i){return e=wt.fx?wt.fx.speeds[e]||e:e,i=i||"fx",this.queue(i,function(i,n){var r=t.setTimeout(i,e);n.stop=function(){t.clearTimeout(r)}})},function(){var t=st.createElement("input"),e=st.createElement("select"),i=e.appendChild(st.createElement("option"));t.type="checkbox",vt.checkOn=""!==t.value,vt.optSelected=i.selected,t=st.createElement("input"),t.value="t",t.type="radio",vt.radioValue="t"===t.value}();var Te,Se=wt.expr.attrHandle;wt.fn.extend({attr:function(t,e){return Nt(this,wt.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){wt.removeAttr(this,t)})}}),wt.extend({attr:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?wt.prop(t,e,i):(1===o&&wt.isXMLDoc(t)||(r=wt.attrHooks[e.toLowerCase()]||(wt.expr.match.bool.test(e)?Te:void 0)),void 0!==i?null===i?void wt.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:(n=wt.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!vt.radioValue&&"radio"===e&&o(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(kt);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),Te={set:function(t,e,i){return e===!1?wt.removeAttr(t,i):t.setAttribute(i,i),i}},wt.each(wt.expr.match.bool.source.match(/\w+/g),function(t,e){var i=Se[e]||wt.find.attr;Se[e]=function(t,e,n){var r,o,s=e.toLowerCase();return n||(o=Se[s],Se[s]=r,r=null!=i(t,e,n)?s:null,Se[s]=o),r}});var Me=/^(?:input|select|textarea|button)$/i,Ee=/^(?:a|area)$/i;wt.fn.extend({prop:function(t,e){return Nt(this,wt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[wt.propFix[t]||t]})}}),wt.extend({prop:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&wt.isXMLDoc(t)||(e=wt.propFix[e]||e,r=wt.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=wt.find.attr(t,"tabindex");return e?parseInt(e,10):Me.test(t.nodeName)||Ee.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),vt.optSelected||(wt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),wt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){wt.propFix[this.toLowerCase()]=this}),wt.fn.extend({addClass:function(t){var e,i,n,r,o,s,a,l=0;if(yt(t))return this.each(function(e){wt(this).addClass(t.call(this,e,J(this)))});if(e=Q(t),e.length)for(;i=this[l++];)if(r=J(i),n=1===i.nodeType&&" "+Z(r)+" "){for(s=0;o=e[s++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");a=Z(n),r!==a&&i.setAttribute("class",a)}return this},removeClass:function(t){var e,i,n,r,o,s,a,l=0;if(yt(t))return this.each(function(e){wt(this).removeClass(t.call(this,e,J(this)))});if(!arguments.length)return this.attr("class","");if(e=Q(t),e.length)for(;i=this[l++];)if(r=J(i),n=1===i.nodeType&&" "+Z(r)+" "){for(s=0;o=e[s++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");a=Z(n),r!==a&&i.setAttribute("class",a)}return this},toggleClass:function(t,e){var i=typeof t,n="string"===i||Array.isArray(t);return"boolean"==typeof e&&n?e?this.addClass(t):this.removeClass(t):yt(t)?this.each(function(i){wt(this).toggleClass(t.call(this,i,J(this),e),e)}):this.each(function(){var e,r,o,s;if(n)for(r=0,o=wt(this),s=Q(t);e=s[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==i||(e=J(this),e&&zt.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||t===!1?"":zt.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+Z(J(i))+" ").indexOf(e)>-1)return!0;return!1}});var Ae=/\r/g;wt.fn.extend({val:function(t){var e,i,n,r=this[0];{if(arguments.length)return n=yt(t),this.each(function(i){var r;1===this.nodeType&&(r=n?t.call(this,i,wt(this).val()):t,null==r?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=wt.map(r,function(t){return null==t?"":t+""})),e=wt.valHooks[this.type]||wt.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))});if(r)return e=wt.valHooks[r.type]||wt.valHooks[r.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:(i=r.value,"string"==typeof i?i.replace(Ae,""):null==i?"":i)}}}),wt.extend({valHooks:{option:{get:function(t){var e=wt.find.attr(t,"value");return null!=e?e:Z(wt.text(t))}},select:{get:function(t){var e,i,n,r=t.options,s=t.selectedIndex,a="select-one"===t.type,l=a?null:[],h=a?s+1:r.length;for(n=s<0?h:a?s:0;n<h;n++)if(i=r[n],(i.selected||n===s)&&!i.disabled&&(!i.parentNode.disabled||!o(i.parentNode,"optgroup"))){if(e=wt(i).val(),a)return e;l.push(e)}return l},set:function(t,e){for(var i,n,r=t.options,o=wt.makeArray(e),s=r.length;s--;)n=r[s],(n.selected=wt.inArray(wt.valHooks.option.get(n),o)>-1)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),wt.each(["radio","checkbox"],function(){wt.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=wt.inArray(wt(t).val(),e)>-1}},vt.checkOn||(wt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),vt.focusin="onfocusin"in t;var Ce=/^(?:focusinfocus|focusoutblur)$/,Pe=function(t){t.stopPropagation()};wt.extend(wt.event,{trigger:function(e,i,n,r){var o,s,a,l,h,c,u,d,p=[n||st],f=ft.call(e,"type")?e.type:e,m=ft.call(e,"namespace")?e.namespace.split("."):[];if(s=d=a=n=n||st,3!==n.nodeType&&8!==n.nodeType&&!Ce.test(f+wt.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),h=f.indexOf(":")<0&&"on"+f,e=e[wt.expando]?e:new wt.Event(f,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:wt.makeArray(i,[e]),u=wt.event.special[f]||{},r||!u.trigger||u.trigger.apply(n,i)!==!1)){if(!r&&!u.noBubble&&!_t(n)){for(l=u.delegateType||f,Ce.test(l+f)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(n.ownerDocument||st)&&p.push(a.defaultView||a.parentWindow||t)}for(o=0;(s=p[o++])&&!e.isPropagationStopped();)d=s,e.type=o>1?l:u.bindType||f,c=(zt.get(s,"events")||{})[e.type]&&zt.get(s,"handle"),c&&c.apply(s,i),c=h&&s[h],c&&c.apply&&Ft(s)&&(e.result=c.apply(s,i),e.result===!1&&e.preventDefault());return e.type=f,r||e.isDefaultPrevented()||u._default&&u._default.apply(p.pop(),i)!==!1||!Ft(n)||h&&yt(n[f])&&!_t(n)&&(a=n[h],a&&(n[h]=null),wt.event.triggered=f,e.isPropagationStopped()&&d.addEventListener(f,Pe),n[f](),e.isPropagationStopped()&&d.removeEventListener(f,Pe),wt.event.triggered=void 0,a&&(n[h]=a)),e.result}},simulate:function(t,e,i){var n=wt.extend(new wt.Event,i,{type:t,isSimulated:!0});wt.event.trigger(n,null,e)}}),wt.fn.extend({trigger:function(t,e){return this.each(function(){wt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return wt.event.trigger(t,e,i,!0)}}),vt.focusin||wt.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){wt.event.simulate(e,t.target,wt.event.fix(t))};wt.event.special[e]={setup:function(){var n=this.ownerDocument||this,r=zt.access(n,e);r||n.addEventListener(t,i,!0),zt.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=zt.access(n,e)-1;r?zt.access(n,e,r):(n.removeEventListener(t,i,!0),zt.remove(n,e))}}});var De=t.location,Le=Date.now(),Re=/\?/;wt.parseXML=function(e){var i;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(n){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||wt.error("Invalid XML: "+e),i};var Ie=/\[\]$/,ke=/\r?\n/g,Oe=/^(?:submit|button|image|reset|file)$/i,He=/^(?:input|select|textarea|keygen)/i;wt.param=function(t,e){var i,n=[],r=function(t,e){var i=yt(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(t)||t.jquery&&!wt.isPlainObject(t))wt.each(t,function(){r(this.name,this.value)});else for(i in t)$(i,t[i],e,r);return n.join("&")},wt.fn.extend({serialize:function(){return wt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=wt.prop(this,"elements");return t?wt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!wt(this).is(":disabled")&&He.test(this.nodeName)&&!Oe.test(t)&&(this.checked||!Jt.test(t))}).map(function(t,e){var i=wt(this).val();return null==i?null:Array.isArray(i)?wt.map(i,function(t){return{name:e.name,value:t.replace(ke,"\r\n")}}):{name:e.name,value:i.replace(ke,"\r\n")}}).get()}});var Ne=/%20/g,Be=/#.*$/,Ge=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ze=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ue=/^(?:GET|HEAD)$/,Ve=/^\/\//,je={},We={},Xe="*/".concat("*"),qe=st.createElement("a");qe.href=De.href,wt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:De.href,type:"GET",isLocal:ze.test(De.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Xe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":wt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?it(it(t,wt.ajaxSettings),e):it(wt.ajaxSettings,t)},ajaxPrefilter:tt(je),ajaxTransport:tt(We),ajax:function(e,i){function n(e,i,n,a){var h,d,p,b,x,w=i;c||(c=!0,l&&t.clearTimeout(l),r=void 0,s=a||"",T.readyState=e>0?4:0,h=e>=200&&e<300||304===e,n&&(b=nt(f,T,n)),b=rt(f,b,T,h),h?(f.ifModified&&(x=T.getResponseHeader("Last-Modified"),x&&(wt.lastModified[o]=x),x=T.getResponseHeader("etag"),x&&(wt.etag[o]=x)),204===e||"HEAD"===f.type?w="nocontent":304===e?w="notmodified":(w=b.state,d=b.data,p=b.error,h=!p)):(p=w,!e&&w||(w="error",e<0&&(e=0))),T.status=e,T.statusText=(i||w)+"",h?v.resolveWith(m,[d,w,T]):v.rejectWith(m,[T,w,p]),T.statusCode(_),_=void 0,u&&g.trigger(h?"ajaxSuccess":"ajaxError",[T,f,h?d:p]),y.fireWith(m,[T,w]),u&&(g.trigger("ajaxComplete",[T,f]),--wt.active||wt.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=void 0),i=i||{};var r,o,s,a,l,h,c,u,d,p,f=wt.ajaxSetup({},i),m=f.context||f,g=f.context&&(m.nodeType||m.jquery)?wt(m):wt.event,v=wt.Deferred(),y=wt.Callbacks("once memory"),_=f.statusCode||{},b={},x={},w="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Fe.exec(s);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)T.always(t[T.status]);else for(e in t)_[e]=[_[e],t[e]];return this},abort:function(t){var e=t||w;return r&&r.abort(e),n(0,e),this}};if(v.promise(T),f.url=((e||f.url||De.href)+"").replace(Ve,De.protocol+"//"),f.type=i.method||i.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(kt)||[""],null==f.crossDomain){h=st.createElement("a");try{h.href=f.url,h.href=h.href,f.crossDomain=qe.protocol+"//"+qe.host!=h.protocol+"//"+h.host}catch(S){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=wt.param(f.data,f.traditional)),et(je,f,i,T),c)return T;u=wt.event&&f.global,u&&0===wt.active++&&wt.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ue.test(f.type),o=f.url.replace(Be,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ne,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(Re.test(o)?"&":"?")+f.data,delete f.data),f.cache===!1&&(o=o.replace(Ge,"$1"),p=(Re.test(o)?"&":"?")+"_="+Le++ +p),f.url=o+p),f.ifModified&&(wt.lastModified[o]&&T.setRequestHeader("If-Modified-Since",wt.lastModified[o]),wt.etag[o]&&T.setRequestHeader("If-None-Match",wt.etag[o])),(f.data&&f.hasContent&&f.contentType!==!1||i.contentType)&&T.setRequestHeader("Content-Type",f.contentType),T.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Xe+"; q=0.01":""):f.accepts["*"]);for(d in f.headers)T.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(f.beforeSend.call(m,T,f)===!1||c))return T.abort();if(w="abort",y.add(f.complete),T.done(f.success),T.fail(f.error),r=et(We,f,i,T)){if(T.readyState=1,u&&g.trigger("ajaxSend",[T,f]),c)return T;f.async&&f.timeout>0&&(l=t.setTimeout(function(){T.abort("timeout")},f.timeout));try{c=!1,r.send(b,n)}catch(S){if(c)throw S;n(-1,S)}}else n(-1,"No Transport");return T},getJSON:function(t,e,i){return wt.get(t,e,i,"json")},getScript:function(t,e){return wt.get(t,void 0,e,"script")}}),wt.each(["get","post"],function(t,e){wt[e]=function(t,i,n,r){return yt(i)&&(r=r||n,n=i,i=void 0),wt.ajax(wt.extend({url:t,type:e,dataType:r,data:i,success:n},wt.isPlainObject(t)&&t))}}),wt._evalUrl=function(t){return wt.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},wt.fn.extend({wrapAll:function(t){var e;return this[0]&&(yt(t)&&(t=t.call(this[0])),e=wt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return yt(t)?this.each(function(e){wt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=wt(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=yt(t);return this.each(function(i){wt(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){wt(this).replaceWith(this.childNodes)}),this}}),wt.expr.pseudos.hidden=function(t){return!wt.expr.pseudos.visible(t)},wt.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},wt.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(e){}};var Ye={0:200,1223:204},Ke=wt.ajaxSettings.xhr();vt.cors=!!Ke&&"withCredentials"in Ke,vt.ajax=Ke=!!Ke,wt.ajaxTransport(function(e){var i,n;if(vt.cors||Ke&&!e.crossDomain)return{send:function(r,o){var s,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(s in e.xhrFields)a[s]=e.xhrFields[s];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(s in r)a.setRequestHeader(s,r[s]);i=function(t){return function(){i&&(i=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ye[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=i(),n=a.onerror=a.ontimeout=i("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{a.send(e.hasContent&&e.data||null)}catch(l){if(i)throw l}},abort:function(){i&&i()}}}),wt.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),wt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return wt.globalEval(t),t}}}),wt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),wt.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,r){e=wt("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),st.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Ze=[],Je=/(=)\?(?=&|$)|\?\?/;wt.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ze.pop()||wt.expando+"_"+Le++;return this[t]=!0,t}}),wt.ajaxPrefilter("json jsonp",function(e,i,n){var r,o,s,a=e.jsonp!==!1&&(Je.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Je.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=yt(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Je,"$1"+r):e.jsonp!==!1&&(e.url+=(Re.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return s||wt.error(r+" was not called"),s[0]},e.dataTypes[0]="json",o=t[r],t[r]=function(){s=arguments},n.always(function(){void 0===o?wt(t).removeProp(r):t[r]=o,e[r]&&(e.jsonpCallback=i.jsonpCallback,Ze.push(r)),s&&yt(o)&&o(s[0]),s=o=void 0}),"script"}),vt.createHTMLDocument=function(){var t=st.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),wt.parseHTML=function(t,e,i){if("string"!=typeof t)return[];"boolean"==typeof e&&(i=e,e=!1);var n,r,o;return e||(vt.createHTMLDocument?(e=st.implementation.createHTMLDocument(""),n=e.createElement("base"),n.href=st.location.href,e.head.appendChild(n)):e=st),r=Ct.exec(t),o=!i&&[],r?[e.createElement(r[1])]:(r=T([t],e,o),o&&o.length&&wt(o).remove(),wt.merge([],r.childNodes))},wt.fn.load=function(t,e,i){var n,r,o,s=this,a=t.indexOf(" ");return a>-1&&(n=Z(t.slice(a)),t=t.slice(0,a)),yt(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),s.length>0&&wt.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){o=arguments,s.html(n?wt("<div>").append(wt.parseHTML(t)).find(n):t)}).always(i&&function(t,e){s.each(function(){i.apply(this,o||[t.responseText,e,t])})}),this},wt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){wt.fn[e]=function(t){return this.on(e,t)}}),wt.expr.pseudos.animated=function(t){return wt.grep(wt.timers,function(e){return t===e.elem}).length},wt.offset={setOffset:function(t,e,i){var n,r,o,s,a,l,h,c=wt.css(t,"position"),u=wt(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),o=wt.css(t,"top"),l=wt.css(t,"left"),h=("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1,h?(n=u.position(),s=n.top,r=n.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),yt(e)&&(e=e.call(t,i,wt.extend({},a))),null!=e.top&&(d.top=e.top-a.top+s),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):u.css(d)}},wt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){wt.offset.setOffset(this,t,e)});var e,i,n=this[0];if(n)return n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var t,e,i,n=this[0],r={top:0,left:0};if("fixed"===wt.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===wt.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&(r=wt(t).offset(),r.top+=wt.css(t,"borderTopWidth",!0),r.left+=wt.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-wt.css(n,"marginTop",!0),left:e.left-r.left-wt.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===wt.css(t,"position");)t=t.offsetParent;return t||ie})}}),wt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;wt.fn[t]=function(n){return Nt(this,function(t,n,r){var o;return _t(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r?o?o[e]:t[n]:void(o?o.scrollTo(i?o.pageXOffset:r,i?r:o.pageYOffset):t[n]=r)},t,n,arguments.length)}}),wt.each(["top","left"],function(t,e){wt.cssHooks[e]=H(vt.pixelPosition,function(t,i){if(i)return i=O(t,e),ce.test(i)?wt(t).position()[e]+"px":i})}),wt.each({Height:"height",Width:"width"},function(t,e){wt.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){wt.fn[n]=function(r,o){var s=arguments.length&&(i||"boolean"!=typeof r),a=i||(r===!0||o===!0?"margin":"border");return Nt(this,function(e,i,r){var o;return _t(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?wt.css(e,i,a):wt.style(e,i,r,a)},e,s?r:void 0,s)}})}),wt.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){wt.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),wt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),wt.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}}),wt.proxy=function(t,e){var i,n,r;if("string"==typeof e&&(i=t[e],e=t,t=i),yt(t))return n=lt.call(arguments,2),r=function(){return t.apply(e||this,n.concat(lt.call(arguments)))},r.guid=t.guid=t.guid||wt.guid++,r},wt.holdReady=function(t){t?wt.readyWait++:wt.ready(!0)},wt.isArray=Array.isArray,wt.parseJSON=JSON.parse,wt.nodeName=o,wt.isFunction=yt,wt.isWindow=_t,wt.camelCase=f,wt.type=n,wt.now=Date.now,wt.isNumeric=function(t){var e=wt.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return wt});var Qe=t.jQuery,$e=t.$;return wt.noConflict=function(e){return t.$===wt&&(t.$=$e),e&&t.jQuery===wt&&(t.jQuery=Qe),wt},e||(t.jQuery=t.$=wt),wt}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=r(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function r(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(g.inline?g.dpDiv.parent()[0]:g.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function s(e,i){t.extend(e,i);for(var n in i)null==i[n]&&(e[n]=i[n]);return e}function a(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var l=0,h=Array.prototype.slice;t.cleanData=function(e){return function(i){var n,r,o;for(o=0;null!=(r=i[o]);o++)try{n=t._data(r,"events"),n&&n.remove&&t(r).triggerHandler("remove")}catch(s){}e(i)}}(t.cleanData),t.widget=function(e,i,n){var r,o,s,a={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return n||(n=i,i=t.Widget),t.isArray(n)&&(n=t.extend.apply(null,[{}].concat(n))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},r=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new o(t,e)},t.extend(o,r,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),s=new i,s.options=t.widget.extend({},s.options),t.each(n,function(e,n){return t.isFunction(n)?void(a[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function r(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=r,e=n.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(a[e]=n)}),o.prototype=t.widget.extend(s,{widgetEventPrefix:r?s.widgetEventPrefix||e:e},a,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),r?(t.each(r._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete r._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,r=h.call(arguments,1),o=0,s=r.length;s>o;o++)for(i in r[o])n=r[o][i],r[o].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(r){var o="string"==typeof r,s=h.call(arguments,1),a=this;return o?this.length||"instance"!==r?this.each(function(){var i,o=t.data(this,n);return"instance"===r?(a=o,!1):o?t.isFunction(o[r])&&"_"!==r.charAt(0)?(i=o[r].apply(o,s),i!==o&&void 0!==i?(a=i&&i.jquery?a.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+r+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+r+"'")}):a=void 0:(s.length&&(r=t.widget.extend.apply(null,[r].concat(s))),this.each(function(){var e=t.data(this,n);e?(e.option(r||{}),e._init&&e._init()):t.data(this,n,new i(r,this))})),a}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var n,r,o,s=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(s={},n=e.split("."),e=n.shift(),n.length){for(r=s[e]=t.widget.extend({},this.options[e]),o=0;n.length-1>o;o++)r[n[o]]=r[n[o]]||{},r=r[n[o]];if(e=n.pop(),1===arguments.length)return void 0===r[e]?null:r[e];r[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];s[e]=i}return this._setOptions(s),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,n,r;for(i in e)r=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&r&&r.length&&(n=t(r.get()),this._removeClass(r,i),n.addClass(this._classes({element:n,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var s,a;for(a=0;i.length>a;a++)s=r.classesElementLookup[i[a]]||t(),s=t(e.add?t.unique(s.get().concat(e.element.get())):s.not(e.element).get()),
r.classesElementLookup[i[a]]=s,n.push(i[a]),o&&e.classes[i[a]]&&n.push(e.classes[i[a]])}var n=[],r=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(n,r){-1!==t.inArray(e.target,r)&&(i.classesElementLookup[n]=t(r.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){n="boolean"==typeof n?n:i;var r="string"==typeof t||null===t,o={extra:r?e:i,keys:r?t:e,element:r?this.element:t,add:n};return o.element.toggleClass(this._classes(o),n),this},_on:function(e,i,n){var r,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=r=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),t.each(n,function(n,s){function a(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof s?o[s]:s).apply(o,arguments):void 0}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||t.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?r.on(h,c,a):i.on(h,a)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,n){var r,o,s=this.options[e];if(n=n||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(r in o)r in i||(i[r]=o[r]);return this.element.trigger(i,n),!(t.isFunction(s)&&s.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(n,r,o){"string"==typeof r&&(r={effect:r});var s,a=r?r===!0||"number"==typeof r?i:r.effect||i:e;r=r||{},"number"==typeof r&&(r={duration:r}),s=!t.isEmptyObject(r),r.complete=o,r.delay&&n.delay(r.delay),s&&t.effects&&t.effects.effect[a]?n[e](r):a!==e&&n[a]?n[a](r.duration,r.easing,o):n.queue(function(i){t(this)[e](),o&&o.call(n[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var r,o=Math.max,s=Math.abs,a=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==r)return r;var e,i,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),e=o.offsetWidth,n.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=n[0].clientWidth),n.remove(),r=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),r="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:r?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=t.isWindow(i[0]),r=!!i[0]&&9===i[0].nodeType,o=!n&&!r;return{element:i,isWindow:n,isDocument:r,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(r){if(!r||!r.of)return d.apply(this,arguments);r=t.extend({},r);var u,p,f,m,g,v,y=t(r.of),_=t.position.getWithinInfo(r.within),b=t.position.getScrollInfo(_),x=(r.collision||"flip").split(" "),w={};return v=n(y),y[0].preventDefault&&(r.at="left top"),p=v.width,f=v.height,m=v.offset,g=t.extend({},m),t.each(["my","at"],function(){var t,e,i=(r[this]||"").split(" ");1===i.length&&(i=a.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=a.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],r[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===r.at[0]?g.left+=p:"center"===r.at[0]&&(g.left+=p/2),"bottom"===r.at[1]?g.top+=f:"center"===r.at[1]&&(g.top+=f/2),u=e(w.at,p,f),g.left+=u[0],g.top+=u[1],this.each(function(){var n,a,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),v=i(this,"marginTop"),T=h+d+i(this,"marginRight")+b.width,S=c+v+i(this,"marginBottom")+b.height,M=t.extend({},g),E=e(w.my,l.outerWidth(),l.outerHeight());"right"===r.my[0]?M.left-=h:"center"===r.my[0]&&(M.left-=h/2),"bottom"===r.my[1]?M.top-=c:"center"===r.my[1]&&(M.top-=c/2),M.left+=E[0],M.top+=E[1],n={marginLeft:d,marginTop:v},t.each(["left","top"],function(e,i){t.ui.position[x[e]]&&t.ui.position[x[e]][i](M,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:n,collisionWidth:T,collisionHeight:S,offset:[u[0]+E[0],u[1]+E[1]],my:r.my,at:r.at,within:_,elem:l})}),r.using&&(a=function(t){var e=m.left-M.left,i=e+p-h,n=m.top-M.top,a=n+f-c,u={target:{element:y,left:m.left,top:m.top,width:p,height:f},element:{element:l,left:M.left,top:M.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};h>p&&p>s(e+i)&&(u.horizontal="center"),c>f&&f>s(n+a)&&(u.vertical="middle"),u.important=o(s(e),s(i))>o(s(n),s(a))?"horizontal":"vertical",r.using.call(this,t,u)}),l.offset(t.extend(M,{using:a}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,r=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,a=t.left-e.collisionPosition.marginLeft,l=r-a,h=a+e.collisionWidth-s-r;e.collisionWidth>s?l>0&&0>=h?(i=t.left+l+e.collisionWidth-s-r,t.left+=l-i):t.left=h>0&&0>=l?r:l>h?r+s-e.collisionWidth:r:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-a,t.left)},top:function(t,e){var i,n=e.within,r=n.isWindow?n.scrollTop:n.offset.top,s=e.within.height,a=t.top-e.collisionPosition.marginTop,l=r-a,h=a+e.collisionHeight-s-r;e.collisionHeight>s?l>0&&0>=h?(i=t.top+l+e.collisionHeight-s-r,t.top+=l-i):t.top=h>0&&0>=l?r:l>h?r+s-e.collisionHeight:r:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-a,t.top)}},flip:{left:function(t,e){var i,n,r=e.within,o=r.offset.left+r.scrollLeft,a=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-a-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-a-o,(0>i||s(c)>i)&&(t.left+=d+p+f)):u>0&&(n=t.left-e.collisionPosition.marginLeft+d+p+f-l,(n>0||u>s(n))&&(t.left+=d+p+f))},top:function(t,e){var i,n,r=e.within,o=r.offset.top+r.scrollTop,a=r.height,l=r.isWindow?r.scrollTop:r.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-a-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(n=t.top+p+f+m+e.collisionHeight-a-o,(0>n||s(c)>n)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-l,(i>0||u>s(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var n=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=n.floor?~~t:parseFloat(t),isNaN(t)?e.def:n.mod?(t+n.mod)%n.mod:0>t?0:t>n.max?n.max:t)}function n(i){var n=h(),r=n._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var s,a=o.re.exec(i),l=a&&o.parse(a),h=o.space||"rgba";return l?(s=n[h](l),n[c[h].cache]=s[c[h].cache],r=n._rgba=s._rgba,!1):e}),r.length?("0,0,0,0"===r.join()&&t.extend(r,o.transparent),n):o[i]}function r(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,s="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",a=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,n,r){return new t.Color.fn.parse(e,i,n,r)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(r,s,a,l){if(r===e)return this._rgba=[null,null,null,null],this;(r.jquery||r.nodeType)&&(r=t(r).css(s),s=e);var u=this,d=t.type(r),p=this._rgba=[];return s!==e&&(r=[r,s,a,l],d="array"),"string"===d?this.parse(n(r)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(r[e.idx],e)}),this):"object"===d?(r instanceof h?f(c,function(t,e){r[e.cache]&&(u[e.cache]=r[e.cache].slice())}):f(c,function(e,n){var o=n.cache;f(n.props,function(t,e){if(!u[o]&&n.to){if("alpha"===t||null==r[t])return;u[o]=n.to(u._rgba)}u[o][e.idx]=i(r[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,n.from&&(u._rgba=n.from(u[o])))}),this):e},is:function(t){var i=h(t),n=!0,r=this;return f(c,function(t,o){var s,a=i[o.cache];return a&&(s=r[o.cache]||o.to&&o.to(r._rgba)||[],f(o.props,function(t,i){return null!=a[i.idx]?n=a[i.idx]===s[i.idx]:e})),n}),n},_space:function(){var t=[],e=this;return f(c,function(i,n){e[n.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var n=h(t),r=n._space(),o=c[r],s=0===this.alpha()?h("transparent"):this,a=s[o.cache]||o.to(s._rgba),l=a.slice();return n=n[o.cache],f(o.props,function(t,r){var o=r.idx,s=a[o],h=n[o],c=u[r.type]||{};null!==h&&(null===s?l[o]=h:(c.mod&&(h-s>c.mod/2?s+=c.mod:s-h>c.mod/2&&(s-=c.mod)),l[o]=i((h-s)*e+s,r)))}),this[r](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),r=h(e)._rgba;return h(t.map(i,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),n=i.pop();return e&&i.push(~~(255*n)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=t[3],a=Math.max(n,r,o),l=Math.min(n,r,o),h=a-l,c=a+l,u=.5*c;return e=l===a?0:n===a?60*(r-o)/h+360:r===a?60*(o-n)/h+120:60*(n-r)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==s?1:s]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],n=t[2],o=t[3],s=.5>=n?n*(1+i):n+i-n*i,a=2*n-s;return[Math.round(255*r(a,s,e+1/3)),Math.round(255*r(a,s,e)),Math.round(255*r(a,s,e-1/3)),o]},f(c,function(n,r){var o=r.props,s=r.cache,l=r.to,c=r.from;h.fn[n]=function(n){if(l&&!this[s]&&(this[s]=l(this._rgba)),n===e)return this[s].slice();var r,a=t.type(n),u="array"===a||"object"===a?n:arguments,d=this[s].slice();return f(o,function(t,e){var n=u["object"===a?t:e.idx];null==n&&(n=d[e.idx]),d[e.idx]=i(n,e)}),c?(r=h(c(d)),r[s]=d,r):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(r){var o,s=t.type(r),l="alpha"===e?this._hsla?"hsla":"rgba":n,h=this[l](),c=h[i.idx];return"undefined"===s?c:("function"===s&&(r=r.call(this,c),s=t.type(r)),null==r&&i.empty?this:("string"===s&&(o=a.exec(r),o&&(r=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=r,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,r){var o,s,a="";if("transparent"!==r&&("string"!==t.type(r)||(o=n(r)))){if(r=h(o||r),!d.rgba&&1!==r._rgba[3]){for(s="backgroundColor"===i?e.parentNode:e;(""===a||"transparent"===a)&&s&&s.style;)try{a=t.css(s,"backgroundColor"),s=s.parentNode}catch(l){}r=r.blend(a&&"transparent"!==a?a:"_default")}r=r.toRgbaString()}try{e.style[i]=r}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(s),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,n){e["border"+n+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,n,r=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(r&&r.length&&r[0]&&r[r[0]])for(n=r.length;n--;)i=r[n],"string"==typeof r[i]&&(o[t.camelCase(i)]=r[i]);else for(i in r)"string"==typeof r[i]&&(o[i]=r[i]);return o}function i(e,i){var n,o,s={};for(n in i)o=i[n],e[n]!==o&&(r[n]||(t.fx.step[n]||!isNaN(parseFloat(o)))&&(s[n]=o));return s}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(r,o,s,a){var l=t.speed(o,s,a);return this.queue(function(){var o,s=t(this),a=s.attr("class")||"",h=l.children?s.find("*").addBack():s;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(n,function(t,e){r[e]&&s[e+"Class"](r[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),s.attr("class",a),h=h.map(function(){var e=this,i=t.Deferred(),n=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,n),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(s[0])})})},t.fn.extend({addClass:function(e){return function(i,n,r,o){return n?t.effects.animateClass.call(this,{add:i},n,r,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,n,r,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},n,r,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,n,r,o,s){return"boolean"==typeof n||void 0===n?r?t.effects.animateClass.call(this,n?{add:i}:{remove:i},r,o,s):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},n,r,o)}}(t.fn.toggleClass),switchClass:function(e,i,n,r,o){return t.effects.animateClass.call(this,{add:i,remove:e},n,r,o)}})}(),function(){function e(e,i,n,r){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(r=i,n=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(r=n,n=i,i={}),t.isFunction(n)&&(r=n,n=null),i&&t.extend(e,i),n=n||i.duration,e.duration=t.fx.off?0:"number"==typeof n?n:n in t.fx.speeds?t.fx.speeds[n]:t.fx.speeds._default,e.complete=r||i.complete,e}function i(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||("string"==typeof e&&!t.effects.effect[e]||(!!t.isFunction(e)||"object"==typeof e&&!e.effect))}function n(t,e){var i=e.outerWidth(),n=e.outerHeight(),r=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=r.exec(t)||["",0,i,n,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?n:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,n=e.length;n>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,n=0,r=e.length;r>n;n++)null!==e[n]&&(i=t.data(c+e[n]),t.css(e[n],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},n=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),r={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(s){o=document.body}return e.wrap(n),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),n=e.parent(),"static"===e.css("position")?(n.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,n){i[n]=e.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(r),n.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,n){return n||(n=i,i="effect"),t.effects.effect[e]=n,t.effects.effect[e].mode=i,n},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var n="horizontal"!==i?(e||100)/100:1,r="vertical"!==i?(e||100)/100:1;return{height:t.height()*r,width:t.width()*n,outerHeight:t.outerHeight()*r,outerWidth:t.outerWidth()*n}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var n=t.queue();e>1&&n.splice.apply(n,[1,0].concat(n.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,n;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=t[1]/e.width}return{x:n,y:i}},createPlaceholder:function(e){var i,n=e.css("position"),r=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:n,left:r.left,top:r.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,n,r){return r=r||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(r[i]=o[0]*n+o[1])}),r}}),t.fn.extend({effect:function(){function i(e){function i(){a.removeData(d),t.effects.cleanUp(a),"hide"===n.mode&&a.hide(),s()}function s(){t.isFunction(l)&&l.call(a[0]),t.isFunction(e)&&e()}var a=t(this);n.mode=c.shift(),t.uiBackCompat===!1||o?"none"===n.mode?(a[h](),s()):r.call(a[0],n,i):(a.is(":hidden")?"hide"===h:"show"===h)?(a[h](),s()):r.call(a[0],n,s)}var n=e.apply(this,arguments),r=t.effects.effect[n.effect],o=r.mode,s=n.queue,a=s||"fx",l=n.complete,h=n.mode,c=[],u=function(e){var i=t(this),n=t.effects.mode(i,h)||o;i.data(d,!0),c.push(n),o&&("show"===n||n===o&&"hide"===n)&&i.show(),o&&"none"===n||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!r?h?this[h](n.duration,l):this.each(function(){l&&l.call(this)}):s===!1?this.each(u).each(i):this.queue(a,u).queue(a,i)},show:function(t){return function(n){if(i(n))return t.apply(this,arguments);var r=e.apply(this,arguments);return r.mode="show",this.effect.call(this,r)}}(t.fn.show),hide:function(t){return function(n){if(i(n))return t.apply(this,arguments);var r=e.apply(this,arguments);return r.mode="hide",this.effect.call(this,r)}}(t.fn.hide),toggle:function(t){return function(n){if(i(n)||"boolean"==typeof n)return t.apply(this,arguments);var r=e.apply(this,arguments);return r.mode="toggle",this.effect.call(this,r)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),n=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(n=[parseFloat(i),e])}),n},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):n(this.css("clip"),this)},transfer:function(e,i){var n=t(this),r=t(e.to),o="fixed"===r.css("position"),s=t("body"),a=o?s.scrollTop():0,l=o?s.scrollLeft():0,h=r.offset(),c={top:h.top-a,left:h.left-l,height:r.innerHeight(),width:r.innerWidth()},u=n.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-a,left:u.left-l,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=n(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var n={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},r=t(this),o=e.direction||"up",s=r.cssClip(),a={clip:t.extend({},s)},l=t.effects.createPlaceholder(r);a.clip[n[o][0]]=a.clip[n[o][1]],"show"===e.mode&&(r.cssClip(a.clip),l&&l.css(t.effects.clipToBox(a)),a.clip=s),l&&l.animate(t.effects.clipToBox(a),e.duration,e.easing),r.animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var n,r,o,s=t(this),a=e.mode,l="hide"===a,h="show"===a,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(h||l?1:0),f=e.duration/p,m=e.easing,g="up"===c||"down"===c?"top":"left",v="up"===c||"left"===c,y=0,_=s.queue().length;for(t.effects.createPlaceholder(s),o=s.css(g),u||(u=s["top"===g?"outerHeight":"outerWidth"]()/3),h&&(r={opacity:1},r[g]=o,s.css("opacity",0).css(g,v?2*-u:2*u).animate(r,f,m)),l&&(u/=Math.pow(2,d-1)),r={},r[g]=o;d>y;y++)n={},n[g]=(v?"-=":"+=")+u,s.animate(n,f,m).animate(r,f,m),u=l?2*u:u/2;l&&(n={opacity:0},n[g]=(v?"-=":"+=")+u,s.animate(n,f,m)),s.queue(i),t.effects.unshift(s,_,p+1)}),t.effects.define("clip","hide",function(e,i){var n,r={},o=t(this),s=e.direction||"vertical",a="both"===s,l=a||"horizontal"===s,h=a||"vertical"===s;n=o.cssClip(),r.clip={top:h?(n.bottom-n.top)/2:n.top,right:l?(n.right-n.left)/2:n.right,bottom:h?(n.bottom-n.top)/2:n.bottom,left:l?(n.right-n.left)/2:n.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(r.clip),r.clip=n),o.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var n,r=t(this),o=e.mode,s="show"===o,a=e.direction||"left",l="up"===a||"down"===a?"top":"left",h="up"===a||"left"===a?"-=":"+=",c="+="===h?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(r),n=e.distance||r["top"===l?"outerHeight":"outerWidth"](!0)/2,u[l]=h+n,s&&(r.css(u),u[l]=c+n,u.opacity=1),r.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function n(){_.push(this),_.length===u*d&&r()}function r(){p.css({visibility:"visible"}),t(_).remove(),i()}var o,s,a,l,h,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),y=Math.ceil(p.outerHeight()/u),_=[];for(o=0;u>o;o++)for(l=g.top+o*y,c=o-(u-1)/2,s=0;d>s;s++)a=g.left+s*v,h=s-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*v,top:-o*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:a+(m?h*v:0),top:l+(m?c*y:0),opacity:m?0:1}).animate({left:a+(m?0:h*v),top:l+(m?0:c*y),opacity:m?1:0},e.duration||500,e.easing,n)}),t.effects.define("fade","toggle",function(e,i){var n="show"===e.mode;t(this).css("opacity",n?0:1).animate({opacity:n?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var n=t(this),r=e.mode,o="show"===r,s="hide"===r,a=e.size||15,l=/([0-9]+)%/.exec(a),h=!!e.horizFirst,c=h?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(n),p=n.cssClip(),f={clip:t.extend({},p)},m={clip:t.extend({},p)},g=[p[c[0]],p[c[1]]],v=n.queue().length;l&&(a=parseInt(l[1],10)/100*g[s?0:1]),f.clip[c[0]]=a,m.clip[c[0]]=a,m.clip[c[1]]=0,o&&(n.cssClip(m.clip),d&&d.css(t.effects.clipToBox(m)),m.clip=p),n.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(m),u,e.easing),i()}).animate(f,u,e.easing).animate(m,u,e.easing).queue(i),t.effects.unshift(n,v,4)}),t.effects.define("highlight","show",function(e,i){var n=t(this),r={backgroundColor:n.css("backgroundColor")};"hide"===e.mode&&(r.opacity=0),t.effects.saveStyle(n),n.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var n,r,o,s=t(this),a=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=s.css("position"),m=s.position(),g=t.effects.scaledDimensions(s),v=e.from||g,y=e.to||t.effects.scaledDimensions(s,0);t.effects.createPlaceholder(s),"show"===c&&(o=v,v=y,y=o),r={from:{y:v.height/g.height,x:v.width/g.width},to:{y:y.height/g.height,x:y.width/g.width}},("box"===d||"both"===d)&&(r.from.y!==r.to.y&&(v=t.effects.setTransition(s,l,r.from.y,v),y=t.effects.setTransition(s,l,r.to.y,y)),r.from.x!==r.to.x&&(v=t.effects.setTransition(s,h,r.from.x,v),y=t.effects.setTransition(s,h,r.to.x,y))),("content"===d||"both"===d)&&r.from.y!==r.to.y&&(v=t.effects.setTransition(s,a,r.from.y,v),y=t.effects.setTransition(s,a,r.to.y,y)),p&&(n=t.effects.getBaseline(p,g),v.top=(g.outerHeight-v.outerHeight)*n.y+m.top,v.left=(g.outerWidth-v.outerWidth)*n.x+m.left,y.top=(g.outerHeight-y.outerHeight)*n.y+m.top,y.left=(g.outerWidth-y.outerWidth)*n.x+m.left),s.css(v),("content"===d||"both"===d)&&(l=l.concat(["marginTop","marginBottom"]).concat(a),h=h.concat(["marginLeft","marginRight"]),s.find("*[width]").each(function(){var i=t(this),n=t.effects.scaledDimensions(i),o={height:n.height*r.from.y,width:n.width*r.from.x,outerHeight:n.outerHeight*r.from.y,outerWidth:n.outerWidth*r.from.x},s={height:n.height*r.to.y,width:n.width*r.to.x,outerHeight:n.height*r.to.y,outerWidth:n.width*r.to.x};r.from.y!==r.to.y&&(o=t.effects.setTransition(i,l,r.from.y,o),s=t.effects.setTransition(i,l,r.to.y,s)),r.from.x!==r.to.x&&(o=t.effects.setTransition(i,h,r.from.x,o),s=t.effects.setTransition(i,h,r.to.x,s)),u&&t.effects.saveStyle(i),i.css(o),i.animate(s,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),s.animate(y,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=s.offset();0===y.opacity&&s.css("opacity",v.opacity),u||(s.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(s)),i()}})}),t.effects.define("scale",function(e,i){var n=t(this),r=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==r?0:100),s=t.extend(!0,{from:t.effects.scaledDimensions(n),to:t.effects.scaledDimensions(n,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(s.from.opacity=1,s.to.opacity=0),t.effects.effect.size.call(this,s,i);
}),t.effects.define("puff","hide",function(e,i){var n=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,n,i)}),t.effects.define("pulsate","show",function(e,i){var n=t(this),r=e.mode,o="show"===r,s="hide"===r,a=o||s,l=2*(e.times||5)+(a?1:0),h=e.duration/l,c=0,u=1,d=n.queue().length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),c=1);l>u;u++)n.animate({opacity:c},h,e.easing),c=1-c;n.animate({opacity:c},h,e.easing),n.queue(i),t.effects.unshift(n,d,l+1)}),t.effects.define("shake",function(e,i){var n=1,r=t(this),o=e.direction||"left",s=e.distance||20,a=e.times||3,l=2*a+1,h=Math.round(e.duration/l),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},m=r.queue().length;for(t.effects.createPlaceholder(r),d[c]=(u?"-=":"+=")+s,p[c]=(u?"+=":"-=")+2*s,f[c]=(u?"-=":"+=")+2*s,r.animate(d,h,e.easing);a>n;n++)r.animate(p,h,e.easing).animate(f,h,e.easing);r.animate(p,h,e.easing).animate(d,h/2,e.easing).queue(i),t.effects.unshift(r,m,l+1)}),t.effects.define("slide","show",function(e,i){var n,r,o=t(this),s={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=e.mode,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",c="up"===l||"left"===l,u=e.distance||o["top"===h?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),n=o.cssClip(),r=o.position()[h],d[h]=(c?-1:1)*u+r,d.clip=o.cssClip(),d.clip[s[l][1]]=d.clip[s[l][0]],"show"===a&&(o.cssClip(d.clip),o.css(h,d[h]),d.clip=n,d[h]=r),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,n){var r,o,s,a,l,h=i.nodeName.toLowerCase();return"area"===h?(r=i.parentNode,o=r.name,!(!i.href||!o||"map"!==r.nodeName.toLowerCase())&&(s=t("img[usemap='#"+o+"']"),s.length>0&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(a=!i.disabled,a&&(l=t(i).closest("fieldset")[0],l&&(a=!l.disabled))):a="a"===h?i.href||n:n,a&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function n(e,i,n,o){return t.each(r,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var r="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),s={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?s["inner"+i].call(this):this.each(function(){t(this).css(o,n(this,e)+"px")})},t.fn["outer"+i]=function(e,r){return"number"!=typeof e?s["outer"+i].call(this,e):this.each(function(){t(this).css(o,n(this,e,!0,r)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,n,r,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(r=this.eq(0).parents("label"),n=this.attr("id"),n&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(n)+"']",r=r.add(o.find(i).addBack(i))),this.pushStack(r))},t.fn.scrollParent=function(e){var i=this.css("position"),n="absolute"===i,r=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!n||"static"!==e.css("position"))&&r.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),n=null!=i;return(!n||i>=0)&&t.ui.focusable(e,n)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,n=this.options.icons;n&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+n.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,n.header)._addClass(i,null,n.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?void this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),void("icons"===t&&(this._destroyIcons(),e&&this._createIcons())))},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,n=this.headers.length,r=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(r+1)%n];break;case i.LEFT:case i.UP:o=this.headers[(r-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[n-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,n=i.heightStyle,r=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),n=e.next(),r=n.uniqueId().attr("id");e.attr("aria-controls",r),n.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===n?(e=r.height(),this.element.siblings(":visible").each(function(){var i=t(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,n,r=this.options,o=this.active,s=t(e.currentTarget),a=s[0]===o[0],l=a&&r.collapsible,h=l?t():s.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:l?t():s,newPanel:h};e.preventDefault(),a&&!r.collapsible||this._trigger("beforeActivate",e,u)===!1||(r.active=!l&&this.headers.index(s),this.active=a?t():s,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),r.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,r.icons.activeHeader)._addClass(i,null,r.icons.header)),a||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),r.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,r.icons.header)._addClass(n,null,r.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,n=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,e):(n.hide(),i.show(),this._toggleComplete(e)),n.attr({"aria-hidden":"true"}),n.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&n.length?n.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var n,r,o,s=this,a=0,l=t.css("box-sizing"),h=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=h&&c.down||c,d=function(){s._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(r=u),r=r||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(n=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:r,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:r,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===l&&(a+=i.now):"content"!==s.options.heightStyle&&(i.now=Math.round(n-e.outerHeight()-a),a=0)}})):e.animate(this.hideProps,o,r,d):t.animate(this.showProps,o,r,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),n=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&n.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),n=t(e.currentTarget);i[0]===n[0]&&(this._removeClass(n.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,n))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,n,r,o,s=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:s=!1,n=this.previousFilter||"",o=!1,r=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),r===n?o=!0:r=n+r,i=this._filterMenuItems(r),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(r=String.fromCharCode(e.keyCode),i=this._filterMenuItems(r)),i.length?(this.focus(e,i),this.previousFilter=r,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}s&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,n,r,o,s=this,a=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),n=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),n=t("<span>").data("ui-menu-submenu-caret",!0);s._addClass(n,"ui-menu-icon","ui-icon "+a),i.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(n,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);s._isDivider(e)&&s._addClass(e,"ui-menu-divider","ui-widget-content")}),r=i.not(".ui-menu-item, .ui-menu-divider"),o=r.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(r,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,n,r;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),n=this.active.children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),r=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,n,r,o,s,a;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,r=e.offset().top-this.activeMenu.offset().top-i-n,o=this.activeMenu.scrollTop(),s=this.activeMenu.height(),a=e.outerHeight(),0>r?this.activeMenu.scrollTop(o+r):r+a>s&&this.activeMenu.scrollTop(o+r-s+a))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(e),this._removeClass(n.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=n},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var n;this.active&&(n="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.find(this.options.items)[e]()),this.focus(i,n)},nextPage:function(e){var i,n,r;return this.active?void(this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,r=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-n-r}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var i,n,r;return this.active?void(this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,r=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-n+r>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),n=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return n.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,n,r=this.element[0].nodeName.toLowerCase(),o="textarea"===r,s="input"===r;this.isMultiLine=o||!s&&this._isContentEditable(this.element),this.valueMethod=this.element[o||s?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly"))return e=!0,n=!0,void(i=!0);e=!1,n=!1,i=!1;var o=t.ui.keyCode;switch(r.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",r);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",r);break;case o.UP:e=!0,this._keyEvent("previous",r);break;case o.DOWN:e=!0,this._keyEvent("next",r);break;case o.ENTER:this.menu.active&&(e=!0,r.preventDefault(),this.menu.select(r));break;case o.TAB:this.menu.active&&this.menu.select(r);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(r),r.preventDefault());break;default:i=!0,this._searchTimeout(r)}},keypress:function(n){if(e)return e=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&n.preventDefault());if(!i){var r=t.ui.keyCode;switch(n.keyCode){case r.PAGE_UP:this._move("previousPage",n);break;case r.PAGE_DOWN:this._move("nextPage",n);break;case r.UP:this._keyEvent("previous",n);break;case r.DOWN:this._keyEvent("next",n)}}},input:function(t){return n?(n=!1,void t.preventDefault()):void this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),void this._change(t))}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var n,r;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)})):(r=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:r})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(r.value),n=i.item.attr("aria-label")||r.value,void(n&&t.trim(n).length&&(this.liveRegion.children().hide(),t("<div>").text(n).appendTo(this.liveRegion))))},menuselect:function(e,i){var n=i.item.data("ui-autocomplete-item"),r=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,n=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,n){n(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,r){n.xhr&&n.xhr.abort(),n.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){r(t)},error:function(){r([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),n=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!n)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var n=this;t.each(i,function(t,i){n._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e):void this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var n=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return n.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var m=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap();
},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(n,r){var o,s={};return r?"controlgroupLabel"===n?(o=e.element.find(r),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(o.get()))):void(t.fn[n]&&(s=e["_"+n+"Options"]?e["_"+n+"Options"]("middle"):{classes:{}},e.element.find(r).each(function(){var r=t(this),o=r[n]("instance"),a=t.widget.extend({},s);if("button"!==n||!r.parent(".ui-spinner").length){o||(o=r[n]()[n]("instance")),o&&(a.classes=e._resolveClassesValues(a.classes,o)),r[n](a);var l=r[n]("widget");t.data(l[0],"ui-controlgroup-data",o?o:r[n]("instance")),i.push(l[0])}}))):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),n=i.data("ui-controlgroup-data");n&&n[e]&&n[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",n=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,n)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],n},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var n={};return t.each(e,function(r){var o=i.options.classes[r]||"";o=t.trim(o.replace(m,"")),n[r]=(o+" "+e[r]).replace(/\s+/g," ")}),n},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?void this._callChildMethod(e?"disable":"enable"):void this.refresh()},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,n){var r=e[n]().data("ui-controlgroup-data");if(r&&i["_"+r.widgetName+"Options"]){var o=i["_"+r.widgetName+"Options"](1===e.length?"only":n);o.classes=i._resolveClassesValues(o.classes,r),r.element[r.widgetName](o)}else i._updateCornerClass(e[n](),n)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,n=this,r=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){n.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(r.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(r.disabled=e),r},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,n="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(n):t(n).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e)):void this.refresh()):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var n="iconPosition"!==e,r=n?this.options.iconPosition:i,o="top"===r||"bottom"===r;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(r),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(r))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?void this._super("showLabel",e):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),void this._superApply(arguments))}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var g;t.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return s(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var n,r,o;n=e.nodeName.toLowerCase(),r="div"===n||"span"===n,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),r),o.settings=t.extend({},i||{}),"input"===n?this._connectDatepicker(e,o):r&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?r(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var n=t(e);i.append=t([]),i.trigger=t([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var n,r,o,s=this._get(i,"appendText"),a=this._get(i,"isRTL");i.append&&i.append.remove(),s&&(i.append=t("<span class='"+this._appendClass+"'>"+s+"</span>"),e[a?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),n=this._get(i,"showOn"),("focus"===n||"both"===n)&&e.on("focus",this._showDatepicker),("button"===n||"both"===n)&&(r=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:r,title:r}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:r,title:r}):r)),e[a?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,n,r,o=new Date(2009,11,20),s=this._get(t,"dateFormat");s.match(/[DM]/)&&(e=function(t){for(i=0,n=0,r=0;t.length>r;r++)t[r].length>i&&(i=t[r].length,n=r);return n},o.setMonth(e(this._get(t,s.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,s.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var n=t(e);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,n,r,o){var a,l,h,c,u,d=this._dialogInst;return d||(this.uuid+=1,a="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+a+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),s(d.settings,r||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+c,h/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,n=t(e),r=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(r.append.remove(),r.trigger.remove(),n.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&n.removeClass(this.markerClassName).empty(),g===r&&(g=null))},_enableDatepicker:function(e){var i,n,r=t(e),o=t.data(e,"datepicker");r.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(n=r.children("."+this._inlineClass),n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,n,r=t(e),o=t.data(e,"datepicker");r.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(n=r.children("."+this._inlineClass),n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,n){var r,o,a,l,h=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null:(r=i||{},"string"==typeof i&&(r={},r[i]=n),void(h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),a=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),s(h.settings,r),null!==a&&void 0!==r.dateFormat&&void 0===r.minDate&&(h.settings.minDate=this._formatDate(h,a)),null!==l&&void 0!==r.dateFormat&&void 0===r.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h))))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,n,r,o=t.datepicker._getInst(e.target),s=!0,a=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),s=!1;break;case 13:return r=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),r[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,r[0]),i=t.datepicker._get(o,"onSelect"),i?(n=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[n,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,a?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,a?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,n,r=t.datepicker._getInst(e.target);return t.datepicker._get(r,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(r,"dateFormat")),n=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">n||!i||i.indexOf(n)>-1):void 0},_doKeyUp:function(e){var i,n=t.datepicker._getInst(e.target);if(n.input.val()!==n.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,t.datepicker._getFormatConfig(n)),i&&(t.datepicker._setDateFromField(n),t.datepicker._updateAlternate(n),t.datepicker._updateDatepicker(n))}catch(r){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var n,r,o,a,l,h,c;n=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==n&&(t.datepicker._curInst.dpDiv.stop(!0,!0),n&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),r=t.datepicker._get(n,"beforeShow"),o=r?r.apply(e,[e,n]):{},o!==!1&&(s(n.settings,o),n.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(n),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return a|="fixed"===t(this).css("position"),!a}),l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(n),l=t.datepicker._checkOffset(n,l,a),n.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),n.inline||(h=t.datepicker._get(n,"showAnim"),c=t.datepicker._get(n,"duration"),n.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?n.dpDiv.show(h,t.datepicker._get(n,"showOptions"),c):n.dpDiv[h||"show"](h?c:null),t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),t.datepicker._curInst=n))}},_updateDatepicker:function(e){this.maxRows=4,g=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,n=this._getNumberOfMonths(e),r=n[1],s=17,a=e.dpDiv.find("."+this._dayOverClass+" a");a.length>0&&o.apply(a.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),r>1&&e.dpDiv.addClass("ui-datepicker-multi-"+r).css("width",s*r+"em"),e.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,n){var r=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,a=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:t(document).scrollLeft()),h=document.documentElement.clientHeight+(n?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?r-s:0,i.left-=n&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=n&&i.top===e.input.offset().top+a?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+r>l&&l>r?Math.abs(i.left+r-l):0),i.top-=Math.min(i.top,i.top+o>h&&h>o?Math.abs(o+a):0),i},_findPos:function(e){for(var i,n=this._getInst(e),r=this._get(n,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[r?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,n,r,o,s=this._curInst;!s||e&&s!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(s,"showAnim"),n=this._get(s,"duration"),r=function(){t.datepicker._tidyDialog(s)},t.effects&&(t.effects.effect[i]||t.effects[i])?s.dpDiv.hide(i,t.datepicker._get(s,"showOptions"),n,r):s.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,r),i||r(),this._datepickerShowing=!1,o=this._get(s,"onClose"),o&&o.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),n=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==n)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,n){var r=t(e),o=this._getInst(r[0]);this._isDisabledDatepicker(r[0])||(this._adjustInstDate(o,i+("M"===n?this._get(o,"showCurrentAtPos"):0),n),this._updateDatepicker(o))},_gotoToday:function(e){var i,n=t(e),r=this._getInst(n[0]);this._get(r,"gotoCurrent")&&r.currentDay?(r.selectedDay=r.currentDay,r.drawMonth=r.selectedMonth=r.currentMonth,r.drawYear=r.selectedYear=r.currentYear):(i=new Date,r.selectedDay=i.getDate(),r.drawMonth=r.selectedMonth=i.getMonth(),r.drawYear=r.selectedYear=i.getFullYear()),this._notifyChange(r),this._adjustDate(n)},_selectMonthYear:function(e,i,n){var r=t(e),o=this._getInst(r[0]);o["selected"+("M"===n?"Month":"Year")]=o["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(r)},_selectDay:function(e,i,n,r){var o,s=t(e);t(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||(o=this._getInst(s[0]),o.selectedDay=o.currentDay=t("a",r).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=n,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var n,r=t(e),o=this._getInst(r[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),n=this._get(o,"onSelect"),n?n.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,n,r,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),n=this._getDate(e),r=this.formatDate(i,n,this._getFormatConfig(e)),t(o).val(r))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,n){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var r,o,s,a,l=0,h=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),u=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,d=(n?n.dayNames:null)||this._defaults.dayNames,p=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,f=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,_=!1,b=function(t){var i=e.length>r+1&&e.charAt(r+1)===t;return i&&r++,i},x=function(t){var e=b(t),n="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,r="y"===t?n:1,o=RegExp("^\\d{"+r+","+n+"}"),s=i.substring(l).match(o);if(!s)throw"Missing number at position "+l;return l+=s[0].length,parseInt(s[0],10)},w=function(e,n,r){var o=-1,s=t.map(b(e)?r:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(s,function(t,e){var n=e[1];return i.substr(l,n.length).toLowerCase()===n.toLowerCase()?(o=e[0],l+=n.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},T=function(){if(i.charAt(l)!==e.charAt(r))throw"Unexpected literal at position "+l;l++};for(r=0;e.length>r;r++)if(_)"'"!==e.charAt(r)||b("'")?T():_=!1;else switch(e.charAt(r)){case"d":v=x("d");break;case"D":w("D",u,d);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":a=new Date(x("@")),m=a.getFullYear(),g=a.getMonth()+1,v=a.getDate();break;case"!":a=new Date((x("!")-this._ticksTo1970)/1e4),m=a.getFullYear(),g=a.getMonth()+1,v=a.getDate();break;case"'":b("'")?T():_=!0;break;default:T()}if(i.length>l&&(s=i.substr(l),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=m?0:-100)),y>-1)for(g=1,v=y;o=this._getDaysInMonth(m,g-1),!(o>=v);)g++,v-=o;if(a=this._daylightSavingAdjust(new Date(m,g-1,v)),a.getFullYear()!==m||a.getMonth()+1!==g||a.getDate()!==v)throw"Invalid date";return a},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var n,r=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,s=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,a=(i?i.monthNames:null)||this._defaults.monthNames,l=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},h=function(t,e,i){var n=""+e;if(l(t))for(;i>n.length;)n="0"+n;return n},c=function(t,e,i,n){return l(t)?n[e]:i[e]},u="",d=!1;if(e)for(n=0;t.length>n;n++)if(d)"'"!==t.charAt(n)||l("'")?u+=t.charAt(n):d=!1;else switch(t.charAt(n)){case"d":u+=h("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),r,o);break;case"o":u+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);
break;case"m":u+=h("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),s,a);break;case"y":u+=l("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":d=!0;break;default:u+=t.charAt(n)}return u},_possibleChars:function(t){var e,i="",n=!1,r=function(i){var n=t.length>e+1&&t.charAt(e+1)===i;return n&&e++,n};for(e=0;t.length>e;e++)if(n)"'"!==t.charAt(e)||r("'")?i+=t.charAt(e):n=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":r("'")?i+="'":n=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),n=t.lastVal=t.input?t.input.val():null,r=this._getDefaultDate(t),o=r,s=this._getFormatConfig(t);try{o=this.parseDate(i,n,s)||r}catch(a){n=e?"":n}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=n?o.getDate():0,t.currentMonth=n?o.getMonth():0,t.currentYear=n?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,n){var r=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(n){}for(var r=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=r.getFullYear(),s=r.getMonth(),a=r.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=l.exec(i);h;){switch(h[2]||"d"){case"d":case"D":a+=parseInt(h[1],10);break;case"w":case"W":a+=7*parseInt(h[1],10);break;case"m":case"M":s+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,s));break;case"y":case"Y":o+=parseInt(h[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(o,s))}h=l.exec(i)}return new Date(o,s,a)},s=null==i||""===i?n:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?n:r(i):new Date(i.getTime());return s=s&&"Invalid Date"==""+s?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var n=!e,r=t.selectedMonth,o=t.selectedYear,s=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=s.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=s.getMonth(),t.drawYear=t.selectedYear=t.currentYear=s.getFullYear(),r===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(n?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(n,-i,"M")},next:function(){t.datepicker._adjustDate(n,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(n)},selectDay:function(){return t.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(n,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,n,r,o,s,a,l,h,c,u,d,p,f,m,g,v,y,_,b,x,w,T,S,M,E,A,C,P,D,L,R,I,k,O,H,N,B,G,F=new Date,z=this._daylightSavingAdjust(new Date(F.getFullYear(),F.getMonth(),F.getDate())),U=this._get(t,"isRTL"),V=this._get(t,"showButtonPanel"),j=this._get(t,"hideIfNoPrevNext"),W=this._get(t,"navigationAsDateFormat"),X=this._getNumberOfMonths(t),q=this._get(t,"showCurrentAtPos"),Y=this._get(t,"stepMonths"),K=1!==X[0]||1!==X[1],Z=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),$=t.drawMonth-q,tt=t.drawYear;if(0>$&&($+=12,tt--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-X[0]*X[1]+1,Q.getDate())),e=J&&J>e?J:e;this._daylightSavingAdjust(new Date(tt,$,1))>e;)$--,0>$&&($=11,tt--);for(t.drawMonth=$,t.drawYear=tt,i=this._get(t,"prevText"),i=W?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,$-Y,1)),this._getFormatConfig(t)):i,n=this._canAdjustMonth(t,-1,tt,$)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+i+"</span></a>":j?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+i+"</span></a>",r=this._get(t,"nextText"),r=W?this.formatDate(r,this._daylightSavingAdjust(new Date(tt,$+Y,1)),this._getFormatConfig(t)):r,o=this._canAdjustMonth(t,1,tt,$)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+r+"</span></a>":j?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+r+"</span></a>",s=this._get(t,"currentText"),a=this._get(t,"gotoCurrent")&&t.currentDay?Z:z,s=W?this.formatDate(s,a,this._getFormatConfig(t)):s,l=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",h=V?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?l:"")+(this._isInRange(t,a)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+s+"</button>":"")+(U?"":l)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),y=this._get(t,"selectOtherMonths"),_=this._getDefaultDate(t),b="",w=0;X[0]>w;w++){for(T="",this.maxRows=4,S=0;X[1]>S;S++){if(M=this._daylightSavingAdjust(new Date(tt,$,t.selectedDay)),E=" ui-corner-all",A="",K){if(A+="<div class='ui-datepicker-group",X[1]>1)switch(S){case 0:A+=" ui-datepicker-group-first",E=" ui-corner-"+(U?"right":"left");break;case X[1]-1:A+=" ui-datepicker-group-last",E=" ui-corner-"+(U?"left":"right");break;default:A+=" ui-datepicker-group-middle",E=""}A+="'>"}for(A+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+E+"'>"+(/all|left/.test(E)&&0===w?U?o:n:"")+(/all|right/.test(E)&&0===w?U?n:o:"")+this._generateMonthYearHeader(t,$,tt,J,Q,w>0||S>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead><tr>",C=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",x=0;7>x;x++)P=(x+c)%7,C+="<th scope='col'"+((x+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[P]+"'>"+p[P]+"</span></th>";for(A+=C+"</tr></thead><tbody>",D=this._getDaysInMonth(tt,$),tt===t.selectedYear&&$===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),L=(this._getFirstDayOfMonth(tt,$)-c+7)%7,R=Math.ceil((L+D)/7),I=K&&this.maxRows>R?this.maxRows:R,this.maxRows=I,k=this._daylightSavingAdjust(new Date(tt,$,1-L)),O=0;I>O;O++){for(A+="<tr>",H=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(k)+"</td>":"",x=0;7>x;x++)N=g?g.apply(t.input?t.input[0]:null,[k]):[!0,""],B=k.getMonth()!==$,G=B&&!y||!N[0]||J&&J>k||Q&&k>Q,H+="<td class='"+((x+c+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(k.getTime()===M.getTime()&&$===t.selectedMonth&&t._keyEvent||_.getTime()===k.getTime()&&_.getTime()===M.getTime()?" "+this._dayOverClass:"")+(G?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!v?"":" "+N[1]+(k.getTime()===Z.getTime()?" "+this._currentClass:"")+(k.getTime()===z.getTime()?" ui-datepicker-today":""))+"'"+(B&&!v||!N[2]?"":" title='"+N[2].replace(/'/g,"&#39;")+"'")+(G?"":" data-handler='selectDay' data-event='click' data-month='"+k.getMonth()+"' data-year='"+k.getFullYear()+"'")+">"+(B&&!v?"&#xa0;":G?"<span class='ui-state-default'>"+k.getDate()+"</span>":"<a class='ui-state-default"+(k.getTime()===z.getTime()?" ui-state-highlight":"")+(k.getTime()===Z.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+"' href='#'>"+k.getDate()+"</a>")+"</td>",k.setDate(k.getDate()+1),k=this._daylightSavingAdjust(k);A+=H+"</tr>"}$++,$>11&&($=0,tt++),A+="</tbody></table>"+(K?"</div>"+(X[0]>0&&S===X[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),T+=A}b+=T}return b+=h,t._keyEvent=!1,b},_generateMonthYearHeader:function(t,e,i,n,r,o,s,a){var l,h,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),y=this._get(t,"showMonthAfterYear"),_="<div class='ui-datepicker-title'>",b="";if(o||!g)b+="<span class='ui-datepicker-month'>"+s[e]+"</span>";else{for(l=n&&n.getFullYear()===i,h=r&&r.getFullYear()===i,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=n.getMonth())&&(!h||r.getMonth()>=c)&&(b+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+a[c]+"</option>");b+="</select>"}if(y||(_+=b+(!o&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!v)_+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=n?Math.max(f,n.getFullYear()):f,m=r?Math.min(m,r.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",_+=t.yearshtml,t.yearshtml=null}return _+=this._get(t,"yearSuffix"),y&&(_+=(!o&&g&&v?"":"&#xa0;")+b),_+="</div>"},_adjustInstDate:function(t,e,i){var n=t.selectedYear+("Y"===i?e:0),r=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(n,r))+("D"===i?e:0),s=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(n,r,o)));t.selectedDay=s.getDate(),t.drawMonth=t.selectedMonth=s.getMonth(),t.drawYear=t.selectedYear=s.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),n=this._getMinMaxDate(t,"max"),r=i&&i>e?i:e;return n&&r>n?n:r},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,n){var r=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,n+(0>e?e:r[0]*r[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,n,r=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),s=null,a=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),s=parseInt(i[0],10),a=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(s+=n),i[1].match(/[+\-].*/)&&(a+=n)),(!r||e.getTime()>=r.getTime())&&(!o||e.getTime()<=o.getTime())&&(!s||e.getFullYear()>=s)&&(!a||a>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,n){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var r=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(n,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),r,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new n,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var v=!1;t(document).on("mouseup",function(){v=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!v){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,r=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(n&&!r&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),v=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,v=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,n){var r,o=t.ui[e].prototype;for(r in n)o.plugins[r]=o.plugins[r]||[],o.plugins[r].push([i,n[r]])},call:function(t,e,i,n){var r,o=t.plugins[e];if(o&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(r=0;o.length>r;r++)t.options[o[r][0]]&&o[r][1].apply(t.element,i)}},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),n=t(e.target);n.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(this._trigger("drag",e,n)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,n=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper),r=n?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&r[0]===this.element[0]&&this._setPositionRelative(),r[0]===this.element[0]||/(fixed|absolute)/.test(r.css("position"))||r.css("position","absolute"),r},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,n,r=this.options,o=this.document[0];return this.relativeContainer=null,r.containment?"window"===r.containment?void(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===r.containment?void(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):r.containment.constructor===Array?void(this.containment=r.containment):("parent"===r.containment&&(r.containment=this.helper[0].parentNode),i=t(r.containment),n=i[0],void(n&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i))):void(this.containment=null)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,n,r,o,s=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),s.grid&&(r=s.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,h=i?r-this.offset.click.top>=i[1]||r-this.offset.click.top>i[3]?r:r-this.offset.click.top>=i[1]?r-s.grid[1]:r+s.grid[1]:r,o=s.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-s.grid[0]:o+s.grid[0]:o),"y"===s.axis&&(l=this.originalPageX),"x"===s.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,n){return n=n||this._uiHash(),t.ui.plugin.call(this,e,[i,n,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,n){var r=t.extend({},i,{item:n.element});n.sortables=[],t(n.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,r))})},stop:function(e,i,n){var r=t.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,t.each(n.sortables,function(){var t=this;t.isOver?(t.isOver=0,n.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,r))})},drag:function(e,i,n){t.each(n.sortables,function(){var r=!1,o=this;o.positionAbs=n.positionAbs,o.helperProportions=n.helperProportions,o.offset.click=n.offset.click,o._intersectsWith(o.containerCache)&&(r=!0,t.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(r=!1),r})),r?(o.isOver||(o.isOver=1,n._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=n.offset.click.top,o.offset.click.left=n.offset.click.left,o.offset.parent.left-=n.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=n.offset.parent.top-o.offset.parent.top,n._trigger("toSortable",e),n.dropped=o.element,t.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,o.fromOutside=n),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(e),i.position=n._generatePosition(e,!0),n._trigger("fromSortable",e),n.dropped=!1,t.each(n.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,n){var r=t("body"),o=n.options;r.css("cursor")&&(o._cursor=r.css("cursor")),r.css("cursor",o.cursor)},stop:function(e,i,n){var r=n.options;r._cursor&&t("body").css("cursor",r._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,n){var r=t(i.helper),o=n.options;r.css("opacity")&&(o._opacity=r.css("opacity")),r.css("opacity",o.opacity)},stop:function(e,i,n){var r=n.options;r._opacity&&t(i.helper).css("opacity",r._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,n){var r=n.options,o=!1,s=n.scrollParentNotHidden[0],a=n.document[0];s!==a&&"HTML"!==s.tagName?(r.axis&&"x"===r.axis||(n.overflowOffset.top+s.offsetHeight-e.pageY<r.scrollSensitivity?s.scrollTop=o=s.scrollTop+r.scrollSpeed:e.pageY-n.overflowOffset.top<r.scrollSensitivity&&(s.scrollTop=o=s.scrollTop-r.scrollSpeed)),r.axis&&"y"===r.axis||(n.overflowOffset.left+s.offsetWidth-e.pageX<r.scrollSensitivity?s.scrollLeft=o=s.scrollLeft+r.scrollSpeed:e.pageX-n.overflowOffset.left<r.scrollSensitivity&&(s.scrollLeft=o=s.scrollLeft-r.scrollSpeed))):(r.axis&&"x"===r.axis||(e.pageY-t(a).scrollTop()<r.scrollSensitivity?o=t(a).scrollTop(t(a).scrollTop()-r.scrollSpeed):t(window).height()-(e.pageY-t(a).scrollTop())<r.scrollSensitivity&&(o=t(a).scrollTop(t(a).scrollTop()+r.scrollSpeed))),
r.axis&&"y"===r.axis||(e.pageX-t(a).scrollLeft()<r.scrollSensitivity?o=t(a).scrollLeft(t(a).scrollLeft()-r.scrollSpeed):t(window).width()-(e.pageX-t(a).scrollLeft())<r.scrollSensitivity&&(o=t(a).scrollLeft(t(a).scrollLeft()+r.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!r.dropBehaviour&&t.ui.ddmanager.prepareOffsets(n,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,n){var r=n.options;n.snapElements=[],t(r.snap.constructor!==String?r.snap.items||":data(ui-draggable)":r.snap).each(function(){var e=t(this),i=e.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,n){var r,o,s,a,l,h,c,u,d,p,f=n.options,m=f.snapTolerance,g=i.offset.left,v=g+n.helperProportions.width,y=i.offset.top,_=y+n.helperProportions.height;for(d=n.snapElements.length-1;d>=0;d--)l=n.snapElements[d].left-n.margins.left,h=l+n.snapElements[d].width,c=n.snapElements[d].top-n.margins.top,u=c+n.snapElements[d].height,l-m>v||g>h+m||c-m>_||y>u+m||!t.contains(n.snapElements[d].item.ownerDocument,n.snapElements[d].item)?(n.snapElements[d].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(r=m>=Math.abs(c-_),o=m>=Math.abs(u-y),s=m>=Math.abs(l-v),a=m>=Math.abs(h-g),r&&(i.position.top=n._convertPositionTo("relative",{top:c-n.helperProportions.height,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),s&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h}).left)),p=r||o||s||a,"outer"!==f.snapMode&&(r=m>=Math.abs(c-y),o=m>=Math.abs(u-_),s=m>=Math.abs(l-g),a=m>=Math.abs(h-v),r&&(i.position.top=n._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),s&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h-n.helperProportions.width}).left)),!n.snapElements[d].snapping&&(r||o||s||a||p)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=r||o||s||a||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,n){var r,o=n.options,s=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(r=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(e){t(this).css("zIndex",r+e)}),this.css("zIndex",r+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,n){var r=t(i.helper),o=n.options;r.css("zIndex")&&(o._zIndex=r.css("zIndex")),r.css("zIndex",o.zIndex)},stop:function(e,i,n){var r=n.options;r._zIndex&&t(i.helper).css("zIndex",r._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return e[n]>0||(e[n]=1,r=e[n]>0,e[n]=0,r)},_create:function(){var e,i=this.options,n=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var e,i,n,r,o,s=this.options,a=this;if(this.handles=s.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;n.length>i;i++)e=t.trim(n[i]),r="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+r),o.css({zIndex:s.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,n,r,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),r=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(r,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=o&&o[1]?o[1]:"se")}),s.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,n,r=!1;for(i in this.handles)n=t(this.handles[i])[0],(n===e.target||t.contains(n,e.target))&&(r=!0);return!this.options.disabled&&r},_mouseStart:function(e){var i,n,r,o=this.options,s=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,r=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===r?this.axis+"-resize":r),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,n,r=this.originalMousePosition,o=this.axis,s=e.pageX-r.left||0,a=e.pageY-r.top||0,l=this._change[o];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[e,s,a]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,n,r,o,s,a,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,n=i.length&&/textarea/i.test(i[0].nodeName),r=n&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=n?0:c.sizeDiff.width,s={width:c.helper.width()-o,height:c.helper.height()-r},a=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,l=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(s,{top:l,left:a})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,n,r,o,s=this.options;o={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,r=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>r&&(o.maxHeight=r)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,n=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,n=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,r=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,s=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),s&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),r&&(t.height=e.maxHeight),o&&h&&(t.left=a-e.minWidth),n&&h&&(t.left=a-e.maxWidth),s&&c&&(t.top=l-e.minHeight),r&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],n=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],r=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(n[e])||0,i[e]+=parseFloat(r[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,n=this.originalPosition;return{left:n.left+e,width:i.width-e}},n:function(t,e,i){var n=this.originalSize,r=this.originalPosition;return{top:r.top+i,height:n.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},sw:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,n]))},ne:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},nw:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,n]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),n=i.options,r=i._proportionallyResizeElements,o=r.length&&/textarea/i.test(r[0].nodeName),s=o&&i._hasScroll(r[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.size.width-a,height:i.size.height-s},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};r&&r.length&&t(r[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,n,r,o,s,a,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){i[t]=l._num(e.css("padding"+n))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},n=l.containerOffset,r=l.containerSize.height,o=l.containerSize.width,s=l._hasScroll(d,"left")?d.scrollWidth:o,a=l._hasScroll(d)?d.scrollHeight:r,l.parentData={element:d,left:n.left,top:n.top,width:s,height:a}))},resize:function(e){var i,n,r,o,s=t(this).resizable("instance"),a=s.options,l=s.containerOffset,h=s.position,c=s._aspectRatio||e.shiftKey,u={top:0,left:0},d=s.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),h.left<(s._helper?l.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-l.left:s.position.left-u.left),c&&(s.size.height=s.size.width/s.aspectRatio,p=!1),s.position.left=a.helper?l.left:0),h.top<(s._helper?l.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-l.top:s.position.top),c&&(s.size.width=s.size.height*s.aspectRatio,p=!1),s.position.top=s._helper?l.top:0),r=s.containerElement.get(0)===s.element.parent().get(0),o=/relative|absolute/.test(s.containerElement.css("position")),r&&o?(s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top):(s.offset.left=s.element.offset().left,s.offset.top=s.element.offset().top),i=Math.abs(s.sizeDiff.width+(s._helper?s.offset.left-u.left:s.offset.left-l.left)),n=Math.abs(s.sizeDiff.height+(s._helper?s.offset.top-u.top:s.offset.top-l.top)),i+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-i,c&&(s.size.height=s.size.width/s.aspectRatio,p=!1)),n+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-n,c&&(s.size.width=s.size.height*s.aspectRatio,p=!1)),p||(s.position.left=s.prevPosition.left,s.position.top=s.prevPosition.top,s.size.width=s.prevSize.width,s.size.height=s.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,n=e.containerOffset,r=e.containerPosition,o=e.containerElement,s=t(e.helper),a=s.offset(),l=s.outerWidth()-e.sizeDiff.width,h=s.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:a.left-r.left-n.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:a.left-r.left-n.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var n=t(this).resizable("instance"),r=n.options,o=n.originalSize,s=n.originalPosition,a={height:n.size.height-o.height||0,width:n.size.width-o.width||0,top:n.position.top-s.top||0,left:n.position.left-s.left||0};t(r.alsoResize).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),r={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(a[e]||0);i&&i>=0&&(r[e]=i||null)}),e.css(r)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),n=i.options,r=i.size,o=i.originalSize,s=i.originalPosition,a=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,h=l[0]||1,c=l[1]||1,u=Math.round((r.width-o.width)/h)*h,d=Math.round((r.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=n.maxWidth&&p>n.maxWidth,g=n.maxHeight&&f>n.maxHeight,v=n.minWidth&&n.minWidth>p,y=n.minHeight&&n.minHeight>f;n.grid=l,v&&(p+=h),y&&(f+=c),m&&(p-=h),g&&(f-=c),/^(se|s|e)$/.test(a)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(a)?(i.size.width=p,i.size.height=f,i.position.top=s.top-d):/^(sw)$/.test(a)?(i.size.width=p,i.size.height=f,i.position.left=s.left-u):((0>=f-c||0>=p-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=s.top-d):(f=c-e.height,i.size.height=f,i.position.top=s.top+o.height-f),p-h>0?(i.size.width=p,i.position.left=s.left-u):(p=h-e.width,i.size.width=p,i.position.left=s.left+o.width-p))}}),t.ui.resizable,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var n=!1,r=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,r);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),n=!0),n&&!i&&this._trigger("focus",e),n},open:function(){var e=this;return this._isOpen?void(this._moveToTop()&&this._focusTabbable()):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),void this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),r=i.filter(":last");e.target!==r[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==n[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){r.trigger("focus")}),e.preventDefault()):(this._delay(function(){n.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?void this._removeClass(this.uiDialog,"ui-dialog-buttons"):(t.each(i,function(i,n){var r,o;n=t.isFunction(n)?{click:n,text:i}:n,n=t.extend({type:"button"},n),r=n.click,o={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,t("<button></button>",n).button(o).appendTo(e.uiButtonSet).on("click",function(){r.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),void this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,r){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",n,e(r))},drag:function(t,n){i._trigger("drag",t,e(n))},stop:function(r,o){var s=o.offset.left-i.document.scrollLeft(),a=o.offset.top-i.document.scrollTop();n.position={my:"left top",at:"left"+(s>=0?"+":"")+s+" top"+(a>=0?"+":"")+a,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",r,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,n=this.options,r=n.resizable,o=this.uiDialog.css("position"),s="string"==typeof r?r:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:s,start:function(n,r){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",n,e(r))},resize:function(t,n){i._trigger("resize",t,e(n))},stop:function(r,o){var s=i.uiDialog.offset(),a=s.left-i.document.scrollLeft(),l=s.top-i.document.scrollTop();n.height=i.uiDialog.height(),n.width=i.uiDialog.width(),n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(l>=0?"+":"")+l,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",r,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,n=!1,r={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(n=!0),t in i.resizableRelatedOptions&&(r[t]=e)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",r)},_setOption:function(e,i){var n,r,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(n=o.is(":data(ui-draggable)"),n&&!i&&o.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(r=o.is(":data(ui-resizable)"),r&&!i&&o.resizable("destroy"),r&&"string"==typeof i&&o.resizable("option","handles",i),r||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),e=Math.max(0,n.minHeight-t),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-t):"none","auto"===n.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-t)),
this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,n=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(n)?n:function(t){return t.is(n)},this.proportions=function(){return arguments.length?void(e=arguments[0]):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var n=t.ui.ddmanager.droppables[this.options.scope];this._splice(n),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var n=i||t.ui.ddmanager.current,r=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===n.options.scope&&i.accept.call(i.element[0],n.currentItem||n.element)&&y(n,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(r=!0,!1):void 0}),!r&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(n)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var y=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,n,r){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,s=(e.positionAbs||e.position.absolute).top+e.margins.top,a=o+e.helperProportions.width,l=s+e.helperProportions.height,h=i.offset.left,c=i.offset.top,u=h+i.proportions().width,d=c+i.proportions().height;switch(n){case"fit":return o>=h&&u>=a&&s>=c&&d>=l;case"intersect":return o+e.helperProportions.width/2>h&&u>a-e.helperProportions.width/2&&s+e.helperProportions.height/2>c&&d>l-e.helperProportions.height/2;case"pointer":return t(r.pageY,c,i.proportions().height)&&t(r.pageX,h,i.proportions().width);case"touch":return(s>=c&&d>=s||l>=c&&d>=l||c>s&&l>d)&&(o>=h&&u>=o||a>=h&&u>=a||h>o&&a>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var n,r,o=t.ui.ddmanager.droppables[e.options.scope]||[],s=i?i.type:null,a=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(n=0;o.length>n;n++)if(!(o[n].options.disabled||e&&!o[n].accept.call(o[n].element[0],e.currentItem||e.element))){for(r=0;a.length>r;r++)if(a[r]===o[n].element[0]){o[n].proportions().height=0;continue t}o[n].visible="none"!==o[n].element.css("display"),o[n].visible&&("mousedown"===s&&o[n]._activate.call(o[n],i),o[n].offset=o[n].element.offset(),o[n].proportions({width:o[n].element[0].offsetWidth,height:o[n].element[0].offsetHeight}))}},drop:function(e,i){var n=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&y(e,this,this.options.tolerance,i)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,r,o,s=y(e,this,this.options.tolerance,i),a=!s&&this.isover?"isout":s&&!this.isover?"isover":null;a&&(this.options.greedy&&(r=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===r}),o.length&&(n=t(o[0]).droppable("instance"),n.greedyChild="isover"===a)),n&&"isover"===a&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,i),n&&"isout"===a&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),void this._refreshValue())},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),n=i.offset(),r={left:n.left-e.elementPos.left,top:n.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:r.left,top:r.top,right:r.left+i.outerWidth(),bottom:r.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,n=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(n.filter,this.element[0]),this._trigger("start",e),t(n.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=t.data(this,"selectable-item");n.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",e,{unselecting:n.element}))}),t(e.target).parents().addBack().each(function(){var n,r=t.data(this,"selectable-item");return r?(n=!e.metaKey&&!e.ctrlKey||!r.$element.hasClass("ui-selected"),i._removeClass(r.$element,n?"ui-unselecting":"ui-selected")._addClass(r.$element,n?"ui-selecting":"ui-unselecting"),r.unselecting=!n,r.selecting=n,r.selected=n,n?i._trigger("selecting",e,{selecting:r.element}):i._trigger("unselecting",e,{unselecting:r.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,n=this,r=this.options,o=this.opos[0],s=this.opos[1],a=e.pageX,l=e.pageY;return o>a&&(i=a,a=o,o=i),s>l&&(i=l,l=s,s=i),this.helper.css({left:o,top:s,width:a-o,height:l-s}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1,c={};i&&i.element!==n.element[0]&&(c.left=i.left+n.elementPos.left,c.right=i.right+n.elementPos.left,c.top=i.top+n.elementPos.top,c.bottom=i.bottom+n.elementPos.top,"touch"===r.tolerance?h=!(c.left>a||o>c.right||c.top>l||s>c.bottom):"fit"===r.tolerance&&(h=c.left>o&&a>c.right&&c.top>s&&l>c.bottom),h?(i.selected&&(n._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(n._addClass(i.$element,"ui-selecting"),i.selecting=!0,n._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,n._addClass(i.$element,"ui-selected"),i.selected=!0):(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var n=t.data(this,"selectable-item");i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",e,{unselected:n.element})}),t(".ui-selecting",this.element[0]).each(function(){var n=t.data(this,"selectable-item");i._removeClass(n.$element,"ui-selecting")._addClass(n.$element,"ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",e,{selected:n.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,n=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(n).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var n=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&n.index!==e.focusIndex&&(e._trigger("focus",t,{item:n}),e.isOpen||e._select(n,t)),e.focusIndex=n.index,e.button.attr("aria-activedescendant",e.menuItems.eq(n.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var n=this,r="";t.each(i,function(i,o){var s;o.optgroup!==r&&(s=t("<li>",{text:o.optgroup}),n._addClass(s,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),s.appendTo(e),r=o.optgroup),n._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var n=t("<li>"),r=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(n,null,"ui-state-disabled"),this._setText(r,i.label),n.append(r).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,n,r=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),r+=":not(.ui-state-disabled)"),n="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](r).eq(-1):i[t+"All"](r).eq(0),n.length&&this.menuInstance.focus(e,n)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?void this.button.css("width",""):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),void this.button.outerWidth(t))},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,n=[];e.each(function(e,r){n.push(i._parseOption(t(r),e))}),this.items=n},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,n=this.options,r=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",s=[];for(i=n.values&&n.values.length||1,r.length>i&&(r.slice(i).remove(),r=r.slice(0,i)),e=r.length;i>e;e++)s.push(o);this.handles=r.add(t(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,n,r,o,s,a,l,h,c=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(i),r=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(n-c.values(e));(r>i||r===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(r=i,o=t(this),s=e)}),a=this._start(e,s),a!==!1&&(this._mouseSliding=!0,this._handleIndex=s,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,n,r,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/e,n>1&&(n=1),0>n&&(n=0),"vertical"===this.orientation&&(n=1-n),r=this._valueMax()-this._valueMin(),o=this._valueMin()+n*r,this._trimAlignValue(o)},_uiHash:function(t,e,i){var n={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(n.value=void 0!==e?e:this.values(t),n.values=i||this.values()),n},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var n,r,o=this.value(),s=this.values();this._hasMultipleValues()&&(r=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(r,i):Math.max(r,i)),s[e]=i),i!==o&&(n=this._trigger("slide",t,this._uiHash(e,i,s)),n!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var n,r,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(n=this.options.values,r=arguments[0],o=0;n.length>o;o+=1)n[o]=this._trimAlignValue(r[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var n,r=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(r=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=r-1;n>=0;n--)this._change(null,n);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,n;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),n=0;i.length>n;n+=1)i[n]=this._trimAlignValue(i[n]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,n=t-i;return 2*Math.abs(i)>=e&&(n+=i>0?e:-e),parseFloat(n.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,n=Math.round((t-e)/i)*i;t=n+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,n,r,o,s=this.options.range,a=this.options,l=this,h=!this._animateOff&&a.animate,c={};this._hasMultipleValues()?this.handles.each(function(n){i=100*((l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,a.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},a.animate),1===n&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===n&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},a.animate),1===n&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(n=this.value(),r=this._valueMin(),
o=this._valueMax(),i=o!==r?100*((n-r)/(o-r)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},a.animate),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(e){var i,n,r,o,s=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,s),i===!1))return}switch(o=this.options.step,n=r=this._hasMultipleValues()?this.values(s):this.value(),e.keyCode){case t.ui.keyCode.HOME:r=this._valueMin();break;case t.ui.keyCode.END:r=this._valueMax();break;case t.ui.keyCode.PAGE_UP:r=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:r=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;r=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;r=this._trimAlignValue(n-o)}this._slide(e,s,r)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var n=null,r=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(n=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(n=t(e.target)),!!n&&(!(this.options.handle&&!i&&(t(this.options.handle,n).find("*").addBack().each(function(){this===e.target&&(r=!0)}),!r))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,i,n){var r,o,s=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",s.cursor),this.storedStylesheet=t("<style>*{ cursor: "+s.cursor+" !important; }</style>").appendTo(o)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(r=this.containers.length-1;r>=0;r--)this.containers[r]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,n,r,o,s=this.options,a=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-this.overflowOffset.top<s.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-s.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-this.overflowOffset.left<s.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-s.scrollSpeed)):(e.pageY-this.document.scrollTop()<s.scrollSensitivity?a=this.document.scrollTop(this.document.scrollTop()-s.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<s.scrollSensitivity&&(a=this.document.scrollTop(this.document.scrollTop()+s.scrollSpeed)),e.pageX-this.document.scrollLeft()<s.scrollSensitivity?a=this.document.scrollLeft(this.document.scrollLeft()-s.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<s.scrollSensitivity&&(a=this.document.scrollLeft(this.document.scrollLeft()+s.scrollSpeed))),a!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=this.items[i],r=n.item[0],o=this._intersectsWithPointer(n),o&&n.instance===this.currentContainer&&r!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==r&&!t.contains(this.placeholder[0],r)&&("semi-dynamic"!==this.options.type||!t.contains(this.element[0],r))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var n=this,r=this.placeholder.offset(),o=this.options.axis,s={};o&&"x"!==o||(s.left=r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(s.top=r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&n.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},i.each(function(){n.push(t(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,r=n+this.helperProportions.height,o=t.left,s=o+t.width,a=t.top,l=a+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||n+h>a&&l>n+h,d="y"===this.options.axis||e+c>o&&s>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&s>i-this.helperProportions.width/2&&n+this.helperProportions.height/2>a&&l>r-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,n="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=n&&r;return!!o&&(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"===r&&i||"left"===r&&!i:n&&("down"===n&&e||"up"===n&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){a.push(this)}var n,r,o,s,a=[],l=[],h=this._connectWith();if(h&&e)for(n=h.length-1;n>=0;n--)for(o=t(h[n],this.document[0]),r=o.length-1;r>=0;r--)s=t.data(o[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&l.push([t.isFunction(s.options.items)?s.options.items.call(s.element):t(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=l.length-1;n>=0;n--)l[n][0].each(i);return t(a)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,n,r,o,s,a,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(r=t(d[i],this.document[0]),n=r.length-1;n>=0;n--)o=t.data(r[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(s=u[i][1],a=u[i][0],n=0,h=a.length;h>n;n++)l=t(a[n]),l.data(this.widgetName+"-item",s),c.push({item:l,instance:s,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,r,o;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(r=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item,e||(n.width=r.outerWidth(),n.height=r.outerHeight()),o=r.offset(),n.left=o.left,n.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,n=e.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=e.currentItem[0].nodeName.toLowerCase(),r=t("<"+n+">",e.document[0]);return e._addClass(r,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(r,"ui-sortable-helper"),"tbody"===n?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(r)):"tr"===n?e._createTrPlaceholder(e.currentItem,r):"img"===n&&r.attr("src",e.currentItem.attr("src")),i||r.css("visibility","hidden"),r},update:function(t,r){(!i||n.forcePlaceholderSize)&&(r.height()||r.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var n=this;e.children().each(function(){t("<td>&#160;</td>",n.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,n,r,o,s,a,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(r=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),s=c?"left":"top",a=c?"width":"height",u=c?"pageX":"pageY",n=this.items.length-1;n>=0;n--)t.contains(this.containers[p].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(l=this.items[n].item.offset()[s],h=!1,e[u]-l>this.items[n][a]/2&&(h=!0),r>Math.abs(e[u]-l)&&(r=Math.abs(e[u]-l),o=this.items[n],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return void(this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!n[0].style.width||i.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||i.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,n,r=this.options;"parent"===r.containment&&(r.containment=this.helper[0].parentNode),("document"===r.containment||"window"===r.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===r.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===r.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(r.containment)||(e=t(r.containment)[0],i=t(r.containment).offset(),n="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var n="absolute"===e?1:-1,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(r[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:r.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:r.scrollLeft())*n}},_generatePosition:function(e){var i,n,r=this.options,o=e.pageX,s=e.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),r.grid&&(i=this.originalPageY+Math.round((s-this.originalPageY)/r.grid[1])*r.grid[1],s=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-r.grid[1]:i+r.grid[1]:i,n=this.originalPageX+Math.round((o-this.originalPageX)/r.grid[0])*r.grid[0],o=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-r.grid[0]:n+r.grid[0]:n)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay(function(){r===this.counter&&this.refreshPositions(!n)})},_clear:function(t,e){function i(t,e,i){return function(n){i._trigger(t,n,e._uiHash(e))}}this.reverting=!1;var n,r=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)("auto"===this._storedCSS[n]||"static"===this._storedCSS[n])&&(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&r.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||r.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(r.push(function(t){this._trigger("remove",t,this._uiHash())}),r.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||r.push(i("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(r.push(i("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;r.length>n;n++)r[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,n){var r=i.attr(n);null!=r&&r.length&&(e[n]=r)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?void delete this.cancelBlur:(this._stop(),this._refresh(),void(this.previous!==this.element.val()&&this._trigger("change",t)))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)!==!1&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,n=t.ui.keyCode;switch(e.keyCode){case n.UP:return this._repeat(null,1,e),!0;case n.DOWN:return this._repeat(null,-1,e),!0;case n.PAGE_UP:return this._repeat(null,i.page,e),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return!(!this.spinning&&this._trigger("start",t)===!1)&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,n=this.options;return e=null!==n.min?n.min:0,i=t-e,i=Math.round(i/n.step)*n.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==n.max&&t>n.max?n.max:null!==n.min&&n.min>t?n.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,n,r;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i))):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(n=this.buttons.first().find(".ui-icon"),this._removeClass(n,null,this.options.icons.up),this._addClass(n,null,e.up),r=this.buttons.last().find(".ui-icon"),this._removeClass(r,null,this.options.icons.down),this._addClass(r,null,e.down)),void this._super(t,e))},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:a(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),
""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:a(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:a(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:a(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:a(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?void a(this._value).call(this,t):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,n;i=e.href.replace(t,""),n=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(r){}try{n=decodeURIComponent(n)}catch(r){}return e.hash.length>1&&i===n}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===e&&(n&&this.tabs.each(function(i,r){return t(r).attr("aria-controls")===n?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=!!this.tabs.length&&0)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=!i&&0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),n=this.tabs.index(i),r=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:r=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}e.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,r),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function n(){return e>r&&(e=0),0>e&&(e=r),e}for(var r=this.tabs.length-1;-1!==t.inArray(n(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?void this._activate(e):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),void("heightStyle"===t&&this._setupHeightStyle(e)))},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,n=this.anchors,r=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,n){var r,o,s,a=t(n).uniqueId().attr("id"),l=t(n).closest("li"),h=l.attr("aria-controls");e._isLocal(n)?(r=n.hash,s=r.substring(1),o=e.element.find(e._sanitizeSelector(r))):(s=l.attr("aria-controls")||t({}).uniqueId()[0].id,r="#"+s,o=e.element.find(r),o.length||(o=e._createPanel(s),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":s,"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(n.not(this.anchors)),this._off(r.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,n,r;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),r=0;n=this.tabs[r];r++)i=t(n),e===!0||-1!==t.inArray(r,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,n=this.element.parent();"fill"===e?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),n=e.css("position");"absolute"!==n&&"fixed"!==n&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,n=this.active,r=t(e.currentTarget),o=r.closest("li"),s=o[0]===n[0],a=s&&i.collapsible,l=a?t():this._getPanelForTab(o),h=n.length?this._getPanelForTab(n):t(),c={oldTab:n,oldPanel:h,newTab:a?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||s&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=!a&&this.tabs.index(o),this.active=s?t():o,this.xhr&&this.xhr.abort(),h.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function n(){o.running=!1,o._trigger("activate",e,i)}function r(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&o.options.show?o._show(s,o.options.show,n):(s.show(),n())}var o=this,s=i.newPanel,a=i.oldPanel;this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a.hide(),r()),a.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&a.length?i.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,n=this._findActive(e);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var n=this,r=this.tabs.eq(e),o=r.find(".ui-tabs-anchor"),s=this._getPanelForTab(r),a={tab:r,panel:s},l=function(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(r,"ui-tabs-loading"),s.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,a)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(r,"ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.done(function(t,e,r){setTimeout(function(){s.html(t),n._trigger("load",i,a),l(r,e)},1)}).fail(function(t,e){setTimeout(function(){l(t,e)},1)})))},_ajaxSettings:function(e,i,n){var r=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return r._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},n))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var n=(e.attr("aria-describedby")||"").split(/\s+/);n.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(n.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),n=(e.attr("aria-describedby")||"").split(/\s+/),r=t.inArray(i,n);-1!==r&&n.splice(r,1),e.removeData("ui-tooltip-id"),n=t.trim(n.join(" ")),n?e.attr("aria-describedby",n):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var n=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){n._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,n){var r=t.Event("blur");r.target=r.currentTarget=n.element[0],e.close(r,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,n=t(e?e.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&n.parents().each(function(){var e,n=t(this);n.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._registerCloseHandlers(e,n),this._updateContent(n,e))},_updateContent:function(t,e){var i,n=this.options.content,r=this,o=e?e.type:null;return"string"==typeof n||n.nodeType||n.jquery?this._open(e,t,n):(i=n.call(t[0],function(i){r._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),void(i&&this._open(e,t,i)))},_open:function(e,i,n){function r(t){h.of=t,s.is(":hidden")||s.position(h)}var o,s,a,l,h=t.extend({},this.options.position);if(n){if(o=this._find(i))return void o.tooltip.find(".ui-tooltip-content").html(n);i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),s=o.tooltip,this._addDescribedBy(i,s.attr("id")),s.find(".ui-tooltip-content").html(n),this.liveRegion.children().hide(),l=t("<div>").html(s.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:r}),r(e)):s.position(t.extend({of:i},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(a=this.delayedShow=setInterval(function(){s.is(":visible")&&(r(h.of),clearInterval(a))},t.fx.interval)),this._trigger("open",e,{tooltip:s})}},_registerCloseHandlers:function(e,i){var n={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var n=t.Event(e);n.currentTarget=i[0],this.close(n,!0)}}};i[0]!==this.element[0]&&(n.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(n.mouseleave="close"),e&&"focusin"!==e.type||(n.focusout="close"),this._on(!0,i,n)},close:function(e){var i,n=this,r=t(e?e.currentTarget:this.element),o=this._find(r);return o?(i=o.tooltip,void(o.closing||(clearInterval(this.delayedShow),r.data("ui-tooltip-title")&&!r.attr("title")&&r.attr("title",r.data("ui-tooltip-title")),this._removeDescribedBy(r),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){n._removeTooltip(t(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete n.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)))):void r.removeData("ui-tooltip-open")},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),n=t("<div>").appendTo(i),r=i.uniqueId().attr("id");return this._addClass(n,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[r]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,n){var r=t.Event("blur"),o=n.element;r.target=r.currentTarget=o[0],e.close(r,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}),!function(t){"use strict";var e,i,n,r=t.fn.animate,o=t.fn.stop,s=!0,a=function(t){var e,i={};for(e in t)i[e]=t[e];return i},l={overwrite:1,delay:1,useFrames:1,runBackwards:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,autoCSS:1},h=",scrollTop,scrollLeft,show,hide,toggle,",c=h,u=function(t,e){for(var i in l)l[i]&&void 0!==t[i]&&(e[i]=t[i])},d=function(t){return function(e){return t.getRatio(e)}},p={},f=function(){var r,o,s,a=window.GreenSockGlobals||window;if(e=a.TweenMax||a.TweenLite,e&&(r=(e.version+".0.0").split("."),o=!(Number(r[0])>0&&Number(r[1])>7),a=a.com.greensock,i=a.plugins.CSSPlugin,p=a.easing.Ease.map||{}),!e||!i||o)return e=null,void(!n&&window.console&&(window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s)."+(o?" Version "+r.join(".")+" is too old.":"")),n=!0));if(t.easing){for(s in p)t.easing[s]=d(p[s]);f=!1}};t.fn.animate=function(n,o,l,h){if(n=n||{},f&&(f(),!e||!i))return r.call(this,n,o,l,h);if(!s||n.skipGSAP===!0||"object"==typeof o&&"function"==typeof o.step)return r.call(this,n,o,l,h);var d,m,g,v,y=t.speed(o,l,h),_={ease:p[y.easing]||(y.easing===!1?p.linear:p.swing)},b=this,x="object"==typeof o?o.specialEasing:null;for(m in n){if(d=n[m],d instanceof Array&&p[d[1]]&&(x=x||{},x[m]=d[1],d=d[0]),"show"===d||"hide"===d||"toggle"===d||-1!==c.indexOf(m)&&-1!==c.indexOf(","+m+","))return r.call(this,n,o,l,h);_[-1===m.indexOf("-")?m:t.camelCase(m)]=d}if(x){_=a(_),v=[];for(m in x)d=v[v.length]={},u(_,d),d.ease=p[x[m]]||_.ease,-1!==m.indexOf("-")&&(m=t.camelCase(m)),d[m]=_[m],delete _[m];0===v.length&&(v=null)}return g=function(i){var n,r=a(_);if(v)for(n=v.length;--n>-1;)e.to(this,t.fx.off?0:y.duration/1e3,v[n]);r.onComplete=function(){i?i():y.old&&t(this).each(y.old)},e.to(this,t.fx.off?0:y.duration/1e3,r)},y.queue!==!1?(b.queue(y.queue,g),"function"==typeof y.old&&t(b[b.length-1]).queue(y.queue,function(t){y.old.call(b),t()})):g.call(b),b},t.fn.stop=function(t,i){if(o.call(this,t,i),e){if(i)for(var n,r=e.getTweensOf(this),s=r.length;--s>-1;)n=r[s].totalTime()/r[s].totalDuration(),n>0&&1>n&&r[s].seek(r[s].totalDuration());e.killTweensOf(this)}return this},t.gsap={enabled:function(t){s=t},version:"0.1.12",legacyProps:function(t){c=h+t+","}}}(jQuery),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t=t||self,e(t.THREE={}))}(this,function(t){"use strict";function e(){}function i(t,e){this.x=t||0,this.y=e||0}function n(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function r(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}function o(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function s(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function a(t,e,n,r,o,l,h,c,u,d){Object.defineProperty(this,"id",{value:ql++}),this.uuid=jl.generateUUID(),this.name="",this.image=void 0!==t?t:a.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:a.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:wa,this.wrapT=void 0!==r?r:wa,this.magFilter=void 0!==o?o:Aa,this.minFilter=void 0!==l?l:Pa,this.anisotropy=void 0!==u?u:1,this.format=void 0!==h?h:ja,this.type=void 0!==c?c:Da,this.offset=new i(0,0),this.repeat=new i(1,1),this.center=new i(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new s,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==d?d:Rl,this.version=0,this.onUpdate=null}function l(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function h(t,e,i){this.width=t,this.height=e,this.scissor=new l(0,0,t,e),this.scissorTest=!1,this.viewport=new l(0,0,t,e),i=i||{},this.texture=new a((void 0),(void 0),i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:Aa,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function c(t,e,i){h.call(this,t,e,i),this.samples=4}function u(t,e,i){h.call(this,t,e,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function d(t,e,i,n,r,o,s,l,h,c,u,d){a.call(this,null,o,s,l,h,c,n,r,u,d),this.image={data:t,width:e,height:i},this.magFilter=void 0!==h?h:Sa,this.minFilter=void 0!==c?c:Sa,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function p(t,e){this.min=void 0!==t?t:new o((+(1/0)),(+(1/0)),(+(1/0))),this.max=void 0!==e?e:new o((-(1/0)),(-(1/0)),(-(1/0)))}function f(t,e){this.center=void 0!==t?t:new o,this.radius=void 0!==e?e:0}function m(t,e){this.normal=void 0!==t?t:new o(1,0,0),this.constant=void 0!==e?e:0}function g(t,e,i,n,r,o){this.planes=[void 0!==t?t:new m,void 0!==e?e:new m,void 0!==i?i:new m,void 0!==n?n:new m,void 0!==r?r:new m,void 0!==o?o:new m]}function v(t){var e={};for(var i in t){e[i]={};for(var n in t[i]){var r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function y(t){for(var e={},i=0;i<t.length;i++){var n=v(t[i]);for(var r in n)e[r]=n[r]}return e}function _(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function b(){function t(r,o){i!==!1&&(n(r,o),e.requestAnimationFrame(t))}var e=null,i=!1,n=null;return{start:function(){i!==!0&&null!==n&&(e.requestAnimationFrame(t),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){n=t},setContext:function(t){e=t}}}function x(t){function e(e,i){var n=e.array,r=e.dynamic?35048:35044,o=t.createBuffer();t.bindBuffer(i,o),t.bufferData(i,n,r),e.onUploadCallback();var s=5126;return n instanceof Float32Array?s=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?s=5123:n instanceof Int16Array?s=5122:n instanceof Uint32Array?s=5125:n instanceof Int32Array?s=5124:n instanceof Int8Array?s=5120:n instanceof Uint8Array&&(s=5121),{buffer:o,type:s,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function i(e,i,n){var r=i.array,o=i.updateRange;t.bindBuffer(n,e),i.dynamic===!1?t.bufferData(n,r,35044):o.count===-1?t.bufferSubData(n,0,r):0===o.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(n,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}function n(t){return t.isInterleavedBufferAttribute&&(t=t.data),s.get(t)}function r(e){e.isInterleavedBufferAttribute&&(e=e.data);var i=s.get(e);i&&(t.deleteBuffer(i.buffer),s["delete"](e))}function o(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var r=s.get(t);void 0===r?s.set(t,e(t,n)):r.version<t.version&&(i(r.buffer,t,n),r.version=t.version)}var s=new WeakMap;return{get:n,remove:r,update:o}}function w(t,e,i,n,r,s){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new o,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new _,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==s?s:0}function T(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||T.DefaultOrder}function S(){this.mask=1}function M(){function t(){l.setFromEuler(a,!1)}function e(){a.setFromQuaternion(l,void 0,!1)}Object.defineProperty(this,"id",{value:cu++}),this.uuid=jl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=M.DefaultUp.clone();var i=new o,a=new T,l=new r,h=new o(1,1,1);a.onChange(t),l.onChange(e),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:i},rotation:{configurable:!0,enumerable:!0,value:a},quaternion:{configurable:!0,enumerable:!0,value:l},scale:{configurable:!0,enumerable:!0,value:h},modelViewMatrix:{value:new n},normalMatrix:{value:new s}}),this.matrix=new n,this.matrixWorld=new n,this.matrixAutoUpdate=M.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new S,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function E(){Object.defineProperty(this,"id",{value:uu+=2}),this.uuid=jl.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function A(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function C(t,e,i){A.call(this,new Int8Array(t),e,i)}function P(t,e,i){A.call(this,new Uint8Array(t),e,i)}function D(t,e,i){A.call(this,new Uint8ClampedArray(t),e,i)}function L(t,e,i){A.call(this,new Int16Array(t),e,i)}function R(t,e,i){A.call(this,new Uint16Array(t),e,i)}function I(t,e,i){A.call(this,new Int32Array(t),e,i)}function k(t,e,i){A.call(this,new Uint32Array(t),e,i)}function O(t,e,i){A.call(this,new Float32Array(t),e,i)}function H(t,e,i){A.call(this,new Float64Array(t),e,i)}function N(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function B(t){if(0===t.length)return-(1/0);for(var e=t[0],i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}function G(){Object.defineProperty(this,"id",{value:du+=2}),this.uuid=jl.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function F(t,e,i,n,r,o){E.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new z(t,e,i,n,r,o)),this.mergeVertices()}function z(t,e,i,n,r,s){function a(t,e,i,n,r,s,a,m,g,v,y){var _,b,x=s/g,w=a/v,T=s/2,S=a/2,M=m/2,E=g+1,A=v+1,C=0,P=0,D=new o;for(b=0;b<A;b++){var L=b*w-S;for(_=0;_<E;_++){var R=_*x-T;D[t]=R*n,D[e]=L*r,D[i]=M,c.push(D.x,D.y,D.z),D[t]=0,D[e]=0,D[i]=m>0?1:-1,u.push(D.x,D.y,D.z),d.push(_/g),d.push(1-b/v),C+=1}}for(b=0;b<v;b++)for(_=0;_<g;_++){var I=p+_+E*b,k=p+_+E*(b+1),O=p+(_+1)+E*(b+1),H=p+(_+1)+E*b;h.push(I,k,H),h.push(k,O,H),P+=6}l.addGroup(f,P,y),f+=P,p+=C}G.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};var l=this;t=t||1,e=e||1,i=i||1,n=Math.floor(n)||1,r=Math.floor(r)||1,s=Math.floor(s)||1;var h=[],c=[],u=[],d=[],p=0,f=0;a("z","y","x",-1,-1,i,e,t,s,r,0),a("z","y","x",1,-1,i,e,-t,s,r,1),a("x","z","y",1,1,t,i,e,n,s,2),a("x","z","y",1,-1,t,i,-e,n,s,3),a("x","y","z",1,-1,t,e,i,n,r,4),a("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(h),this.addAttribute("position",new O(c,3)),this.addAttribute("normal",new O(u,3)),this.addAttribute("uv",new O(d,2))}function U(t,e,i,n){E.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new V(t,e,i,n)),this.mergeVertices()}function V(t,e,i,n){G.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},t=t||1,e=e||1;var r,o,s=t/2,a=e/2,l=Math.floor(i)||1,h=Math.floor(n)||1,c=l+1,u=h+1,d=t/l,p=e/h,f=[],m=[],g=[],v=[];for(o=0;o<u;o++){var y=o*p-a;for(r=0;r<c;r++){var _=r*d-s;m.push(_,-y,0),g.push(0,0,1),v.push(r/l),v.push(1-o/h)}}for(o=0;o<h;o++)for(r=0;r<l;r++){var b=r+c*o,x=r+c*(o+1),w=r+1+c*(o+1),T=r+1+c*o;f.push(b,x,T),f.push(x,w,T)}this.setIndex(f),this.addAttribute("position",new O(m,3)),this.addAttribute("normal",new O(g,3)),this.addAttribute("uv",new O(v,2))}function j(){Object.defineProperty(this,"id",{value:pu++}),this.uuid=jl.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Ps,this.side=bs,this.flatShading=!1,this.vertexColors=Ms,this.opacity=1,this.transparent=!1,this.blendSrc=Vs,this.blendDst=js,this.blendEquation=ks,
this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=$s,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function W(t){j.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function X(t,e){this.origin=void 0!==t?t:new o,this.direction=void 0!==e?e:new o}function q(t,e,i){this.a=void 0!==t?t:new o,this.b=void 0!==e?e:new o,this.c=void 0!==i?i:new o}function Y(t){j.call(this),this.type="MeshBasicMaterial",this.color=new _(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function K(t,e){M.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new G,this.material=void 0!==e?e:new Y({color:16777215*Math.random()}),this.drawMode=Pl,this.updateMorphTargets()}function Z(t,e,i,n){function r(e,n,r,d){var p=n.background;if(null===p?(o(l,h),c=null,u=0):p&&p.isColor&&(o(p,1),d=!0,c=null,u=0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLRenderTargetCube)){void 0===a&&(a=new K(new z(1,1,1),new W({type:"BackgroundCubeMaterial",uniforms:v(hu.cube.uniforms),vertexShader:hu.cube.vertexShader,fragmentShader:hu.cube.fragmentShader,side:xs,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.removeAttribute("normal"),a.geometry.removeAttribute("uv"),a.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.tCube.value}}),i.update(a));var f=p.isWebGLRenderTargetCube?p.texture:p;a.material.uniforms.tCube.value=f,a.material.uniforms.tFlip.value=p.isWebGLRenderTargetCube?1:-1,c===p&&u===f.version||(a.material.needsUpdate=!0,c=p,u=f.version),e.unshift(a,a.geometry,a.material,0,0,null)}else p&&p.isTexture&&(void 0===s&&(s=new K(new V(2,2),new W({type:"BackgroundMaterial",uniforms:v(hu.background.uniforms),vertexShader:hu.background.vertexShader,fragmentShader:hu.background.fragmentShader,side:bs,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.removeAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(s)),s.material.uniforms.t2D.value=p,p.matrixAutoUpdate===!0&&p.updateMatrix(),s.material.uniforms.uvTransform.value.copy(p.matrix),c===p&&u===p.version||(s.material.needsUpdate=!0,c=p,u=p.version),e.unshift(s,s.geometry,s.material,0,0,null))}function o(t,i){e.buffers.color.setClear(t.r,t.g,t.b,i,n)}var s,a,l=new _(0),h=0,c=null,u=0;return{getClearColor:function(){return l},setClearColor:function(t,e){l.set(t),h=void 0!==e?e:1,o(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,o(l,h)},render:r}}function J(t,e,i,n){function r(t){a=t}function o(e,n){t.drawArrays(a,e,n),i.update(n,a)}function s(r,o,s){var l;if(n.isWebGL2)l=t;else if(l=e.get("ANGLE_instanced_arrays"),null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[n.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](a,o,s,r.maxInstancedCount),i.update(s,a,r.maxInstancedCount)}var a;this.setMode=r,this.render=o,this.renderInstances=s}function Q(t,e,i){function n(){if(void 0!==o)return o;var i=e.get("EXT_texture_filter_anisotropic");return o=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o,s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==i.precision?i.precision:"highp",l=r(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);var h=i.logarithmicDepthBuffer===!0,c=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=u>0,_=s||!!e.get("OES_texture_float"),b=y&&_,x=s?t.getParameter(36183):0;return{isWebGL2:s,getMaxAnisotropy:n,getMaxPrecision:r,precision:a,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:_,floatVertexTextures:b,maxSamples:x}}function $(){function t(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),i.numPlanes=r,i.numIntersection=0}function e(t,e,n,r){var o=null!==t?t.length:0,s=null;if(0!==o){if(s=c.value,r!==!0||null===s){var a=n+4*o,u=e.matrixWorldInverse;h.getNormalMatrix(u),(null===s||s.length<a)&&(s=new Float32Array(a));for(var d=0,p=n;d!==o;++d,p+=4)l.copy(t[d]).applyMatrix4(u,h),l.normal.toArray(s,p),s[p+3]=l.constant}c.value=s,c.needsUpdate=!0}return i.numPlanes=o,s}var i=this,n=null,r=0,o=!1,a=!1,l=new m,h=new s,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(t,i,s){var a=0!==t.length||i||0!==r||o;return o=i,n=e(t,s,0),r=t.length,a},this.beginShadows=function(){a=!0,e(null)},this.endShadows=function(){a=!1,t()},this.setState=function(i,s,l,h,u,d){if(!o||null===i||0===i.length||a&&!l)a?e(null):t();else{var p=a?0:r,f=4*p,m=u.clippingState||null;c.value=m,m=e(i,h,f,d);for(var g=0;g!==f;++g)m[g]=n[g];u.clippingState=m,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=p}}}function tt(t){var e={};return{get:function(i){if(void 0!==e[i])return e[i];var n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return null===n&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),e[i]=n,n}}}function et(t,e,i){function n(t){var r=t.target,o=a[r.id];null!==o.index&&e.remove(o.index);for(var s in o.attributes)e.remove(o.attributes[s]);r.removeEventListener("dispose",n),delete a[r.id];var h=l[o.id];h&&(e.remove(h),delete l[o.id]),i.memory.geometries--}function r(t,e){var r=a[e.id];return r?r:(e.addEventListener("dispose",n),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new G).setFromObject(t)),r=e._bufferGeometry),a[e.id]=r,i.memory.geometries++,r)}function o(t){var i=t.index,n=t.attributes;null!==i&&e.update(i,34963);for(var r in n)e.update(n[r],34962);var o=t.morphAttributes;for(var r in o)for(var s=o[r],a=0,l=s.length;a<l;a++)e.update(s[a],34962)}function s(t){var i=l[t.id];if(i)return i;var n=[],r=t.index,o=t.attributes;if(null!==r)for(var s=r.array,a=0,h=s.length;a<h;a+=3){var c=s[a+0],u=s[a+1],d=s[a+2];n.push(c,u,u,d,d,c)}else for(var s=o.position.array,a=0,h=s.length/3-1;a<h;a+=3){var c=a+0,u=a+1,d=a+2;n.push(c,u,u,d,d,c)}return i=new(B(n)>65535?k:R)(n,1),e.update(i,34963),l[t.id]=i,i}var a={},l={};return{get:r,update:o,getWireframeAttribute:s}}function it(t,e,i,n){function r(t){l=t}function o(t){h=t.type,c=t.bytesPerElement}function s(e,n){t.drawElements(l,n,h,e*c),i.update(n,l)}function a(r,o,s){var a;if(n.isWebGL2)a=t;else{var a=e.get("ANGLE_instanced_arrays");if(null===a)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")}a[n.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](l,s,h,o*c,r.maxInstancedCount),i.update(s,l,r.maxInstancedCount)}var l,h,c;this.setMode=r,this.setIndex=o,this.render=s,this.renderInstances=a}function nt(t){function e(t,e,i){switch(i=i||1,r.calls++,e){case 4:r.triangles+=i*(t/3);break;case 5:case 6:r.triangles+=i*(t-2);break;case 1:r.lines+=i*(t/2);break;case 3:r.lines+=i*(t-1);break;case 2:r.lines+=i*t;break;case 0:r.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}function i(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0}var n={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:n,render:r,programs:null,autoReset:!0,reset:i,update:e}}function rt(t,e){return Math.abs(e[1])-Math.abs(t[1])}function ot(t){function e(e,r,o,s){var a=e.morphTargetInfluences,l=a.length,h=i[r.id];if(void 0===h){h=[];for(var c=0;c<l;c++)h[c]=[c,0];i[r.id]=h}for(var u=o.morphTargets&&r.morphAttributes.position,d=o.morphNormals&&r.morphAttributes.normal,c=0;c<l;c++){var p=h[c];0!==p[1]&&(u&&r.removeAttribute("morphTarget"+c),d&&r.removeAttribute("morphNormal"+c))}for(var c=0;c<l;c++){var p=h[c];p[0]=c,p[1]=a[c]}h.sort(rt);for(var c=0;c<8;c++){var p=h[c];if(p){var f=p[0],m=p[1];if(m){u&&r.addAttribute("morphTarget"+c,u[f]),d&&r.addAttribute("morphNormal"+c,d[f]),n[c]=m;continue}}n[c]=0}s.getUniforms().setValue(t,"morphTargetInfluences",n)}var i={},n=new Float32Array(8);return{update:e}}function st(t,e){function i(i){var n=e.render.frame,o=i.geometry,s=t.get(i,o);return r[s.id]!==n&&(o.isGeometry&&s.updateFromObject(i),t.update(s),r[s.id]=n),s}function n(){r={}}var r={};return{update:i,dispose:n}}function at(t,e,i,n,r,o,s,l,h,c){t=void 0!==t?t:[],e=void 0!==e?e:fa,a.call(this,t,e,i,n,r,o,s,l,h,c),this.flipY=!1}function lt(t,e,i,n){a.call(this,null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=Sa,this.minFilter=Sa,this.generateMipmaps=!1,this.flipY=!1}function ht(){this.seq=[],this.map={}}function ct(t,e,i){var n=t[0];if(n<=0||n>0)return t;var r=e*i,o=vu[r];if(void 0===o&&(o=new Float32Array(r),vu[r]=o),0!==e){n.toArray(o,0);for(var s=1,a=0;s!==e;++s)a+=i,t[s].toArray(o,a)}return o}function ut(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function dt(t,e){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]}function pt(t,e){var i=yu[e];void 0===i&&(i=new Int32Array(e),yu[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i}function ft(t,e){var i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function mt(t,e){var i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function gt(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(ut(i,e))return;t.uniform2fv(this.addr,e),dt(i,e)}}function vt(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(ut(i,e))return;t.uniform3fv(this.addr,e),dt(i,e)}}function yt(t,e){var i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(ut(i,e))return;t.uniform4fv(this.addr,e),dt(i,e)}}function _t(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(ut(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),dt(i,e)}else{if(ut(i,n))return;xu.set(n),t.uniformMatrix2fv(this.addr,!1,xu),dt(i,n)}}function bt(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(ut(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),dt(i,e)}else{if(ut(i,n))return;bu.set(n),t.uniformMatrix3fv(this.addr,!1,bu),dt(i,n)}}function xt(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(ut(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),dt(i,e)}else{if(ut(i,n))return;_u.set(n),t.uniformMatrix4fv(this.addr,!1,_u),dt(i,n)}}function wt(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(e||fu,r)}function Tt(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||mu,r)}function St(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(e||gu,r)}function Mt(t,e){var i=this.cache;ut(i,e)||(t.uniform2iv(this.addr,e),dt(i,e))}function Et(t,e){var i=this.cache;ut(i,e)||(t.uniform3iv(this.addr,e),dt(i,e))}function At(t,e){var i=this.cache;ut(i,e)||(t.uniform4iv(this.addr,e),dt(i,e))}function Ct(t){switch(t){case 5126:return ft;case 35664:return gt;case 35665:return vt;case 35666:return yt;case 35674:return _t;case 35675:return bt;case 35676:return xt;case 35678:case 36198:return wt;case 35679:return Tt;case 35680:return St;case 5124:case 35670:return mt;case 35667:case 35671:return Mt;case 35668:case 35672:return Et;case 35669:case 35673:return At}}function Pt(t,e){var i=this.cache;ut(i,e)||(t.uniform1fv(this.addr,e),dt(i,e))}function Dt(t,e){var i=this.cache;ut(i,e)||(t.uniform1iv(this.addr,e),dt(i,e))}function Lt(t,e){var i=this.cache,n=ct(e,this.size,2);ut(i,n)||(t.uniform2fv(this.addr,n),this.updateCache(n))}function Rt(t,e){var i=this.cache,n=ct(e,this.size,3);ut(i,n)||(t.uniform3fv(this.addr,n),this.updateCache(n))}function It(t,e){var i=this.cache,n=ct(e,this.size,4);ut(i,n)||(t.uniform4fv(this.addr,n),this.updateCache(n))}function kt(t,e){var i=this.cache,n=ct(e,this.size,4);ut(i,n)||(t.uniformMatrix2fv(this.addr,!1,n),this.updateCache(n))}function Ot(t,e){var i=this.cache,n=ct(e,this.size,9);ut(i,n)||(t.uniformMatrix3fv(this.addr,!1,n),this.updateCache(n))}function Ht(t,e){var i=this.cache,n=ct(e,this.size,16);ut(i,n)||(t.uniformMatrix4fv(this.addr,!1,n),this.updateCache(n))}function Nt(t,e,i){var n=this.cache,r=e.length,o=pt(i,r);ut(n,o)===!1&&(t.uniform1iv(this.addr,o),dt(n,o));for(var s=0;s!==r;++s)i.setTexture2D(e[s]||fu,o[s])}function Bt(t,e,i){var n=this.cache,r=e.length,o=pt(i,r);ut(n,o)===!1&&(t.uniform1iv(this.addr,o),dt(n,o));for(var s=0;s!==r;++s)i.setTextureCube(e[s]||gu,o[s])}function Gt(t){switch(t){case 5126:return Pt;case 35664:return Lt;case 35665:return Rt;case 35666:return It;case 35674:return kt;case 35675:return Ot;case 35676:return Ht;case 35678:return Nt;case 35680:return Bt;case 5124:case 35670:return Dt;case 35667:case 35671:return Mt;case 35668:case 35672:return Et;case 35669:case 35673:return At}}function Ft(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=Ct(e.type)}function zt(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=Gt(e.type)}function Ut(t){this.id=t,ht.call(this)}function Vt(t,e){t.seq.push(e),t.map[e.id]=e}function jt(t,e,i){var n=t.name,r=n.length;for(wu.lastIndex=0;;){var o=wu.exec(n),s=wu.lastIndex,a=o[1],l="]"===o[2],h=o[3];if(l&&(a=0|a),void 0===h||"["===h&&s+2===r){Vt(i,void 0===h?new Ft(a,t,e):new zt(a,t,e));break}var c=i.map,u=c[a];void 0===u&&(u=new Ut(a),Vt(i,u)),i=u}}function Wt(t,e,i){ht.call(this),this.renderer=i;for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var o=t.getActiveUniform(e,r),s=t.getUniformLocation(e,o.name);jt(o,s,this)}}function Xt(t){for(var e=t.split("\n"),i=0;i<e.length;i++)e[i]=i+1+": "+e[i];return e.join("\n")}function qt(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,35713)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(n),Xt(i)),n}function Yt(t){switch(t){case Rl:return["Linear","( value )"];case Il:return["sRGB","( value )"];case Ol:return["RGBE","( value )"];case Nl:return["RGBM","( value, 7.0 )"];case Bl:return["RGBM","( value, 16.0 )"];case Gl:return["RGBD","( value, 256.0 )"];case kl:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Kt(t,e){var i=Yt(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Zt(t,e){var i=Yt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function Jt(t,e){var i;switch(e){case la:i="Linear";break;case ha:i="Reinhard";break;case ca:i="Uncharted2";break;case ua:i="OptimizedCineon";break;case da:i="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Qt(t,e,i){t=t||{};var n=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return n.filter(ee).join("\n")}function $t(t){var e=[];for(var i in t){var n=t[i];n!==!1&&e.push("#define "+i+" "+n)}return e.join("\n")}function te(t,e){for(var i={},n=t.getProgramParameter(e,35721),r=0;r<n;r++){var o=t.getActiveAttrib(e,r),s=o.name;i[s]=t.getAttribLocation(e,s)}return i}function ee(t){return""!==t}function ie(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function ne(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function re(t){function e(t,e){var i=ou[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return re(i)}var i=/^[ \t]*#include +<([\w\d.\/]+)>/gm;return t.replace(i,e)}function oe(t){function e(t,e,i,n){for(var r="",o=parseInt(e);o<parseInt(i);o++)r+=n.replace(/\[ i \]/g,"[ "+o+" ]");return r}var i=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(i,e)}function se(t,e,i,n,r,o,s){var a=t.context,l=n.defines,h=r.vertexShader,c=r.fragmentShader,u="SHADOWMAP_TYPE_BASIC";o.shadowMapType===ys?u="SHADOWMAP_TYPE_PCF":o.shadowMapType===_s&&(u="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(n.envMap.mapping){case fa:case ma:d="ENVMAP_TYPE_CUBE";break;case _a:case ba:d="ENVMAP_TYPE_CUBE_UV";break;case ga:case va:d="ENVMAP_TYPE_EQUIREC";break;case ya:d="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case ma:case va:p="ENVMAP_MODE_REFRACTION"}switch(n.combine){case ra:f="ENVMAP_BLENDING_MULTIPLY";break;case oa:f="ENVMAP_BLENDING_MIX";break;case sa:f="ENVMAP_BLENDING_ADD"}}var m,g,v=t.gammaFactor>0?t.gammaFactor:1,y=s.isWebGL2?"":Qt(n.extensions,o,e),_=$t(l),b=a.createProgram();if(n.isRawShaderMaterial?(m=[_].filter(ee).join("\n"),m.length>0&&(m+="\n"),g=[y,_].filter(ee).join("\n"),g.length>0&&(g+="\n")):(m=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,_,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&o.flatShading===!1?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(s.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ee).join("\n"),g=[y,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,_,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(s.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(s.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==aa?"#define TONE_MAPPING":"",o.toneMapping!==aa?ou.tonemapping_pars_fragment:"",o.toneMapping!==aa?Jt("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?ou.encodings_pars_fragment:"",o.mapEncoding?Kt("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?Kt("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?Kt("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Kt("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?Zt("linearToOutputTexel",o.outputEncoding):"",o.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(ee).join("\n")),h=re(h),h=ie(h,o),h=ne(h,o),c=re(c),c=ie(c,o),c=ne(c,o),h=oe(h),c=oe(c),s.isWebGL2&&!n.isRawShaderMaterial){var x=!1,w=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==h.match(w)&&null!==c.match(w)&&(x=!0,h=h.replace(w,""),c=c.replace(w,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#version 300 es\n","#define varying in",x?"":"out highp vec4 pc_fragColor;",x?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g}var T=m+h,S=g+c,M=qt(a,35633,T),E=qt(a,35632,S);a.attachShader(b,M),a.attachShader(b,E),void 0!==n.index0AttributeName?a.bindAttribLocation(b,0,n.index0AttributeName):o.morphTargets===!0&&a.bindAttribLocation(b,0,"position"),a.linkProgram(b);var A=a.getProgramInfoLog(b).trim(),C=a.getShaderInfoLog(M).trim(),P=a.getShaderInfoLog(E).trim(),D=!0,L=!0;a.getProgramParameter(b,35714)===!1?(D=!1,console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(b,35715),"gl.getProgramInfoLog",A,C,P)):""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==C&&""!==P||(L=!1),L&&(this.diagnostics={runnable:D,material:n,programLog:A,vertexShader:{log:C,prefix:m},fragmentShader:{log:P,prefix:g}}),a.deleteShader(M),a.deleteShader(E);var R;this.getUniforms=function(){return void 0===R&&(R=new Wt(a,b,t)),R};var I;return this.getAttributes=function(){return void 0===I&&(I=te(a,b)),I},this.destroy=function(){a.deleteProgram(b),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=Tu++,this.code=i,this.usedTimes=1,this.program=b,this.vertexShader=M,this.fragmentShader=E,this}function ae(t,e,i){function n(t){var e=t.skeleton,n=e.bones;if(i.floatVertexTextures)return 1024;var r=i.maxVertexUniforms,o=Math.floor((r-20)/4),s=Math.min(o,n.length);return s<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+s+"."),0):s}function r(t,e){var i;return t?t.isTexture?i=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=t.texture.encoding):i=Rl,i===Rl&&e&&(i=kl),i}var o=[],s={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},a=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];this.getParameters=function(e,o,a,l,h,c,u){var d=s[e.type],p=u.isSkinnedMesh?n(u):0,f=i.precision;null!==e.precision&&(f=i.getMaxPrecision(e.precision),f!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",f,"instead."));var m=t.getRenderTarget(),g={shaderID:d,precision:f,supportsVertexTextures:i.vertexTextures,outputEncoding:r(m?m.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:r(e.map,t.gammaInput),matcap:!!e.matcap,matcapEncoding:r(e.matcap,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:r(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===_a||e.envMap.mapping===ba),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:r(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Vl,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!l,useFog:e.fog,fogExp:l&&l.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:i.logarithmicDepthBuffer,skinning:e.skinning&&p>0,maxBones:p,useVertexTexture:i.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numClippingPlanes:h,numClipIntersection:c,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&a.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===ws,flipSided:e.side===xs,depthPacking:void 0!==e.depthPacking&&e.depthPacking};return g},this.getProgramCode=function(e,i){var n=[];if(i.shaderID?n.push(i.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);for(var o=0;o<a.length;o++)n.push(i[a[o]]);return n.push(e.onBeforeCompile.toString()),n.push(t.gammaOutput),n.push(t.gammaFactor),n.join()},this.acquireProgram=function(n,r,s,a){for(var l,h=0,c=o.length;h<c;h++){var u=o[h];if(u.code===a){l=u,++l.usedTimes;break}}return void 0===l&&(l=new se(t,e,a,n,r,s,i),o.push(l)),l},this.releaseProgram=function(t){if(0===--t.usedTimes){var e=o.indexOf(t);o[e]=o[o.length-1],o.pop(),t.destroy()}},this.programs=o}function le(){function t(t){var e=r.get(t);return void 0===e&&(e={},r.set(t,e)),e}function e(t){r["delete"](t)}function i(t,e,i){r.get(t)[e]=i;
}function n(){r=new WeakMap}var r=new WeakMap;return{get:t,remove:e,update:i,dispose:n}}function he(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function ce(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function ue(){function t(){s=0,a.length=0,l.length=0}function e(t,e,i,n,r,a){var l=o[s];return void 0===l?(l={id:t.id,object:t,geometry:e,material:i,program:i.program,groupOrder:n,renderOrder:t.renderOrder,z:r,group:a},o[s]=l):(l.id=t.id,l.object=t,l.geometry=e,l.material=i,l.program=i.program,l.groupOrder=n,l.renderOrder=t.renderOrder,l.z=r,l.group=a),s++,l}function i(t,i,n,r,o,s){var h=e(t,i,n,r,o,s);(n.transparent===!0?l:a).push(h)}function n(t,i,n,r,o,s){var h=e(t,i,n,r,o,s);(n.transparent===!0?l:a).unshift(h)}function r(){a.length>1&&a.sort(he),l.length>1&&l.sort(ce)}var o=[],s=0,a=[],l=[];return{opaque:a,transparent:l,init:t,push:i,unshift:n,sort:r}}function de(){function t(e){var i=e.target;i.removeEventListener("dispose",t),delete n[i.id]}function e(e,i){var r,o=n[e.id];return void 0===o?(r=new ue,n[e.id]={},n[e.id][i.id]=r,e.addEventListener("dispose",t)):(r=o[i.id],void 0===r&&(r=new ue,o[i.id]=r)),r}function i(){n={}}var n={};return{get:e,dispose:i}}function pe(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new o,color:new _,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":n={position:new o,direction:new o,color:new _,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":n={position:new o,color:new _,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new o,skyColor:new _,groundColor:new _};break;case"RectAreaLight":n={color:new _,position:new o,halfWidth:new o,halfHeight:new o}}return t[e.id]=n,n}}}function fe(){function t(t,n,o){for(var l=0,h=0,c=0,u=0,d=0,p=0,f=0,m=0,g=o.matrixWorldInverse,v=0,y=t.length;v<y;v++){var _=t[v],b=_.color,x=_.intensity,w=_.distance,T=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)l+=b.r*x,h+=b.g*x,c+=b.b*x;else if(_.isDirectionalLight){var S=e.get(_);if(S.color.copy(_.color).multiplyScalar(_.intensity),S.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),S.direction.sub(r),S.direction.transformDirection(g),S.shadow=_.castShadow,_.castShadow){var M=_.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize}i.directionalShadowMap[u]=T,i.directionalShadowMatrix[u]=_.shadow.matrix,i.directional[u]=S,u++}else if(_.isSpotLight){var S=e.get(_);if(S.position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),S.color.copy(b).multiplyScalar(x),S.distance=w,S.direction.setFromMatrixPosition(_.matrixWorld),r.setFromMatrixPosition(_.target.matrixWorld),S.direction.sub(r),S.direction.transformDirection(g),S.coneCos=Math.cos(_.angle),S.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),S.decay=_.decay,S.shadow=_.castShadow,_.castShadow){var M=_.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize}i.spotShadowMap[p]=T,i.spotShadowMatrix[p]=_.shadow.matrix,i.spot[p]=S,p++}else if(_.isRectAreaLight){var S=e.get(_);S.color.copy(b).multiplyScalar(x),S.position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),a.identity(),s.copy(_.matrixWorld),s.premultiply(g),a.extractRotation(s),S.halfWidth.set(.5*_.width,0,0),S.halfHeight.set(0,.5*_.height,0),S.halfWidth.applyMatrix4(a),S.halfHeight.applyMatrix4(a),i.rectArea[f]=S,f++}else if(_.isPointLight){var S=e.get(_);if(S.position.setFromMatrixPosition(_.matrixWorld),S.position.applyMatrix4(g),S.color.copy(_.color).multiplyScalar(_.intensity),S.distance=_.distance,S.decay=_.decay,S.shadow=_.castShadow,_.castShadow){var M=_.shadow;S.shadowBias=M.bias,S.shadowRadius=M.radius,S.shadowMapSize=M.mapSize,S.shadowCameraNear=M.camera.near,S.shadowCameraFar=M.camera.far}i.pointShadowMap[d]=T,i.pointShadowMatrix[d]=_.shadow.matrix,i.point[d]=S,d++}else if(_.isHemisphereLight){var S=e.get(_);S.direction.setFromMatrixPosition(_.matrixWorld),S.direction.transformDirection(g),S.direction.normalize(),S.skyColor.copy(_.color).multiplyScalar(x),S.groundColor.copy(_.groundColor).multiplyScalar(x),i.hemi[m]=S,m++}}i.ambient[0]=l,i.ambient[1]=h,i.ambient[2]=c,i.directional.length=u,i.spot.length=p,i.rectArea.length=f,i.point.length=d,i.hemi.length=m,i.hash.stateID=i.id,i.hash.directionalLength=u,i.hash.pointLength=d,i.hash.spotLength=p,i.hash.rectAreaLength=f,i.hash.hemiLength=m,i.hash.shadowsLength=n.length}var e=new pe,i={id:Su++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},r=new o,s=new n,a=new n;return{setup:t,state:i}}function me(){function t(){o.length=0,s.length=0}function e(t){o.push(t)}function i(t){s.push(t)}function n(t){r.setup(o,s,t)}var r=new fe,o=[],s=[],a={lightsArray:o,shadowsArray:s,lights:r};return{init:t,state:a,setupLights:n,pushLight:e,pushShadow:i}}function ge(){function t(e){var i=e.target;i.removeEventListener("dispose",t),delete n[i.id]}function e(e,i){var r;return void 0===n[e.id]?(r=new me,n[e.id]={},n[e.id][i.id]=r,e.addEventListener("dispose",t)):void 0===n[e.id][i.id]?(r=new me,n[e.id][i.id]=r):r=n[e.id][i.id],r}function i(){n={}}var n={};return{get:e,dispose:i}}function ve(t){j.call(this),this.type="MeshDepthMaterial",this.depthPacking=Fl,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function ye(t){j.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new o,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function _e(t,e,r){function s(e,i,n,r,o,s){var a=e.geometry,l=null,h=b,c=e.customDepthMaterial;if(n&&(h=x,c=e.customDistanceMaterial),c)l=c;else{var u=!1;i.morphTargets&&(a&&a.isBufferGeometry?u=a.morphAttributes&&a.morphAttributes.position&&a.morphAttributes.position.length>0:a&&a.isGeometry&&(u=a.morphTargets&&a.morphTargets.length>0)),e.isSkinnedMesh&&i.skinning===!1&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var d=e.isSkinnedMesh&&i.skinning,p=0;u&&(p|=v),d&&(p|=y),l=h[p]}if(t.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var f=l.uuid,m=i.uuid,g=w[f];void 0===g&&(g={},w[f]=g);var _=g[m];void 0===_&&(_=l.clone(),g[m]=_),l=_}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=null!=i.shadowSide?i.shadowSide:T[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,n&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(r),l.nearDistance=o,l.farDistance=s),l}function a(i,n,r,o){if(i.visible!==!1){var l=i.layers.test(n.layers);if(l&&(i.isMesh||i.isLine||i.isPoints)&&i.castShadow&&(!i.frustumCulled||c.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,i.matrixWorld);var h=e.update(i),u=i.material;if(Array.isArray(u))for(var d=h.groups,p=0,f=d.length;p<f;p++){var g=d[p],v=u[g.materialIndex];if(v&&v.visible){var y=s(i,v,o,m,r.near,r.far);t.renderBufferDirect(r,null,h,y,i,g)}}else if(u.visible){var y=s(i,u,o,m,r.near,r.far);t.renderBufferDirect(r,null,h,y,i,null)}}for(var _=i.children,b=0,x=_.length;b<x;b++)a(_[b],n,r,o)}}for(var c=new g,u=new n,d=new i,p=new i(r,r),f=new o,m=new o,v=1,y=2,_=(v|y)+1,b=new Array(_),x=new Array(_),w={},T={0:xs,1:bs,2:ws},S=[new o(1,0,0),new o((-1),0,0),new o(0,0,1),new o(0,0,(-1)),new o(0,1,0),new o(0,(-1),0)],M=[new o(0,1,0),new o(0,1,0),new o(0,1,0),new o(0,1,0),new o(0,0,1),new o(0,0,(-1))],E=[new l,new l,new l,new l,new l,new l],A=0;A!==_;++A){var C=0!==(A&v),P=0!==(A&y),D=new ve({depthPacking:zl,morphTargets:C,skinning:P});b[A]=D;var L=new ye({morphTargets:C,skinning:P});x[A]=L}var R=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ys,this.render=function(e,i,n){if(R.enabled!==!1&&(R.autoUpdate!==!1||R.needsUpdate!==!1)&&0!==e.length){var r=t.state;r.setBlending(Cs),r.buffers.color.setClear(1,1,1,1),r.buffers.depth.setTest(!0),r.setScissorTest(!1);for(var o,s=0,l=e.length;s<l;s++){var g=e[s],v=g.shadow,y=g&&g.isPointLight;if(void 0!==v){var _=v.camera;if(d.copy(v.mapSize),d.min(p),y){var b=d.x,x=d.y;E[0].set(2*b,x,b,x),E[1].set(0,x,b,x),E[2].set(3*b,x,b,x),E[3].set(b,x,b,x),E[4].set(3*b,0,b,x),E[5].set(b,0,b,x),d.x*=4,d.y*=2}if(null===v.map){var w={minFilter:Sa,magFilter:Sa,format:ja};v.map=new h(d.x,d.y,w),v.map.texture.name=g.name+".shadowMap",_.updateProjectionMatrix()}v.isSpotLightShadow&&v.update(g);var T=v.map,A=v.matrix;m.setFromMatrixPosition(g.matrixWorld),_.position.copy(m),y?(o=6,A.makeTranslation(-m.x,-m.y,-m.z)):(o=1,f.setFromMatrixPosition(g.target.matrixWorld),_.lookAt(f),_.updateMatrixWorld(),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(_.projectionMatrix),A.multiply(_.matrixWorldInverse)),t.setRenderTarget(T),t.clear();for(var C=0;C<o;C++){if(y){f.copy(_.position),f.add(S[C]),_.up.copy(M[C]),_.lookAt(f),_.updateMatrixWorld();var P=E[C];r.viewport(P)}u.multiplyMatrices(_.projectionMatrix,_.matrixWorldInverse),c.setFromMatrix(u),a(i,n,_,y)}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}R.needsUpdate=!1}}}function be(t,e,i,n){function r(){var e=!1,i=new l,n=null,r=new l(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,o,s,a){a===!0&&(e*=s,n*=s,o*=s),i.set(e,n,o,s),r.equals(i)===!1&&(t.clearColor(e,n,o,s),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}}function o(){var e=!1,i=null,n=null,r=null;return{setTest:function(t){t?p(2929):f(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case Zs:t.depthFunc(512);break;case Js:t.depthFunc(519);break;case Qs:t.depthFunc(513);break;case $s:t.depthFunc(515);break;case ta:t.depthFunc(514);break;case ea:t.depthFunc(518);break;case ia:t.depthFunc(516);break;case na:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}}function s(){var e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,h=null;return{setTest:function(t){t?p(2960):f(2960)},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,s){n===e&&r===i&&o===s||(t.stencilFunc(e,i,s),n=e,r=i,o=s)},setOp:function(e,i,n){s===e&&a===i&&l===n||(t.stencilOp(e,i,n),s=e,a=i,l=n)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,h=null}}}function a(e,i,n){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var s=0;s<n;s++)t.texImage2D(i+s,0,6408,1,1,0,6408,5121,r);return o}function h(){for(var t=0,e=H.length;t<e;t++)H[t]=0}function c(t){u(t,0)}function u(i,r){if(H[i]=1,0===N[i]&&(t.enableVertexAttribArray(i),N[i]=1),B[i]!==r){var o=n.isWebGL2?t:e.get("ANGLE_instanced_arrays");o[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),B[i]=r}}function d(){for(var e=0,i=N.length;e!==i;++e)N[e]!==H[e]&&(t.disableVertexAttribArray(e),N[e]=0)}function p(e){G[e]!==!0&&(t.enable(e),G[e]=!0)}function f(e){G[e]!==!1&&(t.disable(e),G[e]=!1)}function m(){if(null===F&&(F=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var i=t.getParameter(34467),n=0;n<i.length;n++)F.push(i[n]);return F}function g(e){return z!==e&&(t.useProgram(e),z=e,!0)}function v(e,n,r,o,s,a,l,h){if(e===Cs)return void(U&&(f(3042),U=!1));if(U||(p(3042),U=!0),e===Is)s=s||n,a=a||r,l=l||o,n===j&&s===q||(t.blendEquationSeparate(i.convert(n),i.convert(s)),j=n,q=s),r===W&&o===X&&a===Y&&l===K||(t.blendFuncSeparate(i.convert(r),i.convert(o),i.convert(a),i.convert(l)),W=r,X=o,Y=a,K=l),V=e,Z=null;else if(e!==V||h!==Z){if(j===ks&&q===ks||(t.blendEquation(32774),j=ks,q=ks),h)switch(e){case Ps:t.blendFuncSeparate(1,771,1,771);break;case Ds:t.blendFunc(1,1);break;case Ls:t.blendFuncSeparate(0,0,769,771);break;case Rs:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case Ps:t.blendFuncSeparate(770,771,1,771);break;case Ds:t.blendFunc(770,1);break;case Ls:t.blendFunc(0,769);break;case Rs:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}W=null,X=null,Y=null,K=null,V=e,Z=h}}function y(t,e){t.side===ws?f(2884):p(2884);var i=t.side===xs;e&&(i=!i),_(i),t.blending===Ps&&t.transparent===!1?v(Cs):v(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),I.setFunc(t.depthFunc),I.setTest(t.depthTest),I.setMask(t.depthWrite),R.setMask(t.colorWrite),w(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function _(e){J!==e&&(e?t.frontFace(2304):t.frontFace(2305),J=e)}function b(e){e!==us?(p(2884),e!==Q&&(e===ds?t.cullFace(1029):e===ps?t.cullFace(1028):t.cullFace(1032))):f(2884),Q=e}function x(e){e!==$&&(nt&&t.lineWidth(e),$=e)}function w(e,i,n){e?(p(32823),tt===i&&et===n||(t.polygonOffset(i,n),tt=i,et=n)):f(32823)}function T(t){t?p(3089):f(3089)}function S(e){void 0===e&&(e=33984+it-1),st!==e&&(t.activeTexture(e),st=e)}function M(e,i){null===st&&S();var n=at[st];void 0===n&&(n={type:void 0,texture:void 0},at[st]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||ct[e]),n.type=e,n.texture=i)}function E(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function A(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function C(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function P(e){lt.equals(e)===!1&&(t.scissor(e.x,e.y,e.z,e.w),lt.copy(e))}function D(e){ht.equals(e)===!1&&(t.viewport(e.x,e.y,e.z,e.w),ht.copy(e))}function L(){for(var e=0;e<N.length;e++)1===N[e]&&(t.disableVertexAttribArray(e),N[e]=0);G={},F=null,st=null,at={},z=null,V=null,J=null,Q=null,R.reset(),I.reset(),k.reset()}var R=new r,I=new o,k=new s,O=t.getParameter(34921),H=new Uint8Array(O),N=new Uint8Array(O),B=new Uint8Array(O),G={},F=null,z=null,U=null,V=null,j=null,W=null,X=null,q=null,Y=null,K=null,Z=!1,J=null,Q=null,$=null,tt=null,et=null,it=t.getParameter(35661),nt=!1,rt=0,ot=t.getParameter(7938);ot.indexOf("WebGL")!==-1?(rt=parseFloat(/^WebGL\ ([0-9])/.exec(ot)[1]),nt=rt>=1):ot.indexOf("OpenGL ES")!==-1&&(rt=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ot)[1]),nt=rt>=2);var st=null,at={},lt=new l,ht=new l,ct={};return ct[3553]=a(3553,3553,1),ct[34067]=a(34067,34069,6),R.setClear(0,0,0,1),I.setClear(1),k.setClear(0),p(2929),I.setFunc($s),_(!1),b(ds),p(2884),v(Cs),{buffers:{color:R,depth:I,stencil:k},initAttributes:h,enableAttribute:c,enableAttributeAndDivisor:u,disableUnusedAttributes:d,enable:p,disable:f,getCompressedTextureFormats:m,useProgram:g,setBlending:v,setMaterial:y,setFlipSided:_,setCullFace:b,setLineWidth:x,setPolygonOffset:w,setScissorTest:T,activeTexture:S,bindTexture:M,compressedTexImage2D:E,texImage2D:A,texImage3D:C,scissor:P,viewport:D,reset:L}}function xe(t,e,i,n,r,o,s){function a(t,e,i,n){var r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||e===!0){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap){void 0===I&&(I=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));var o=i?document.createElementNS("http://www.w3.org/1999/xhtml","canvas"):I,s=e?jl.floorPowerOfTwo:Math.floor;o.width=s(r*t.width),o.height=s(r*t.height);var a=o.getContext("2d");return a.drawImage(t,0,0,o.width,o.height),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o.width+"x"+o.height+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function l(t){return jl.isPowerOfTwo(t.width)&&jl.isPowerOfTwo(t.height)}function h(t){return!r.isWebGL2&&(t.wrapS!==wa||t.wrapT!==wa||t.minFilter!==Sa&&t.minFilter!==Aa)}function c(t,e){return t.generateMipmaps&&e&&t.minFilter!==Sa&&t.minFilter!==Aa}function u(e,i,r,o){t.generateMipmap(e);var s=n.get(i);s.__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function d(t,i){if(!r.isWebGL2)return t;var n=t;return 6403===t&&(5126===i&&(n=33326),5131===i&&(n=33325),5121===i&&(n=33321)),6407===t&&(5126===i&&(n=34837),5131===i&&(n=34843),5121===i&&(n=32849)),6408===t&&(5126===i&&(n=34836),5131===i&&(n=34842),5121===i&&(n=32856)),33325===n||33326===n||34842===n||34836===n?e.get("EXT_color_buffer_float"):34843!==n&&34837!==n||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),n}function p(t){return t===Sa||t===Ma||t===Ea?9728:9729}function f(t){var e=t.target;e.removeEventListener("dispose",f),g(e),e.isVideoTexture&&delete k[e.id],s.memory.textures--}function m(t){var e=t.target;e.removeEventListener("dispose",m),v(e),s.memory.textures--}function g(e){var i=n.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}n.remove(e)}function v(e){var i=n.get(e),r=n.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[o]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);n.remove(e.texture),n.remove(e)}}function y(t,e){var r=n.get(t);if(t.isVideoTexture&&R(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(o.complete!==!1)return void T(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function _(t,e){var r=n.get(t);return t.version>0&&r.__version!==t.version?void T(r,t,e):(i.activeTexture(33984+e),void i.bindTexture(32879,r.__webglTexture))}function b(e,h){var p=n.get(e);if(6===e.image.length)if(e.version>0&&p.__version!==e.version){p.__image__webglTextureCube||(e.addEventListener("dispose",f),p.__image__webglTextureCube=t.createTexture(),s.memory.textures++),i.activeTexture(33984+h),i.bindTexture(34067,p.__image__webglTextureCube),t.pixelStorei(37440,e.flipY);for(var m=e&&e.isCompressedTexture,g=e.image[0]&&e.image[0].isDataTexture,v=[],y=0;y<6;y++)m||g?v[y]=g?e.image[y].image:e.image[y]:v[y]=a(e.image[y],!1,!0,r.maxCubemapSize);var _=v[0],b=l(_)||r.isWebGL2,x=o.convert(e.format),T=o.convert(e.type),S=d(x,T);w(34067,e,b);for(var y=0;y<6;y++)if(m)for(var M,E=v[y].mipmaps,A=0,C=E.length;A<C;A++)M=E[A],e.format!==ja&&e.format!==Va?i.getCompressedTextureFormats().indexOf(x)>-1?i.compressedTexImage2D(34069+y,A,S,M.width,M.height,0,M.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+y,A,S,M.width,M.height,0,x,T,M.data);else g?i.texImage2D(34069+y,0,S,v[y].width,v[y].height,0,x,T,v[y].data):i.texImage2D(34069+y,0,S,x,T,v[y]);m?p.__maxMipLevel=E.length-1:p.__maxMipLevel=0,c(e,b)&&u(34067,e,_.width,_.height),p.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(33984+h),i.bindTexture(34067,p.__image__webglTextureCube)}function x(t,e){i.activeTexture(33984+e),i.bindTexture(34067,n.get(t).__webglTexture)}function w(i,s,a){var l;if(a?(t.texParameteri(i,10242,o.convert(s.wrapS)),t.texParameteri(i,10243,o.convert(s.wrapT)),t.texParameteri(i,10240,o.convert(s.magFilter)),t.texParameteri(i,10241,o.convert(s.minFilter))):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),s.wrapS===wa&&s.wrapT===wa||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,p(s.magFilter)),t.texParameteri(i,10241,p(s.minFilter)),s.minFilter!==Sa&&s.minFilter!==Aa&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),l=e.get("EXT_texture_filter_anisotropic")){if(s.type===Ha&&null===e.get("OES_texture_float_linear"))return;if(s.type===Na&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function T(e,n,p){var m;m=n.isDataTexture3D?32879:3553,void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",f),e.__webglTexture=t.createTexture(),s.memory.textures++),i.activeTexture(33984+p),i.bindTexture(m,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var g=h(n)&&l(n.image)===!1,v=a(n.image,g,!1,r.maxTextureSize),y=l(v)||r.isWebGL2,_=o.convert(n.format),b=o.convert(n.type),x=d(_,b);w(m,n,y);var T,S=n.mipmaps;if(n.isDepthTexture){if(x=6402,n.type===Ha){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");x=36012}else r.isWebGL2&&(x=33189);n.format===Ya&&6402===x&&n.type!==Ia&&n.type!==Oa&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Ia,b=o.convert(n.type)),n.format===Ka&&(x=34041,n.type!==za&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=za,b=o.convert(n.type))),i.texImage2D(3553,0,x,v.width,v.height,0,_,b,null)}else if(n.isDataTexture)if(S.length>0&&y){for(var M=0,E=S.length;M<E;M++)T=S[M],i.texImage2D(3553,M,x,T.width,T.height,0,_,b,T.data);n.generateMipmaps=!1,e.__maxMipLevel=S.length-1}else i.texImage2D(3553,0,x,v.width,v.height,0,_,b,v.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(var M=0,E=S.length;M<E;M++)T=S[M],n.format!==ja&&n.format!==Va?i.getCompressedTextureFormats().indexOf(_)>-1?i.compressedTexImage2D(3553,M,x,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,M,x,T.width,T.height,0,_,b,T.data);e.__maxMipLevel=S.length-1}else if(n.isDataTexture3D)i.texImage3D(32879,0,x,v.width,v.height,v.depth,0,_,b,v.data),e.__maxMipLevel=0;else if(S.length>0&&y){for(var M=0,E=S.length;M<E;M++)T=S[M],i.texImage2D(3553,M,x,_,b,T);n.generateMipmaps=!1,e.__maxMipLevel=S.length-1}else i.texImage2D(3553,0,x,_,b,v),e.__maxMipLevel=0;c(n,y)&&u(3553,n,v.width,v.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function S(e,r,s,a){var l=o.convert(r.texture.format),h=o.convert(r.texture.type),c=d(l,h);i.texImage2D(a,0,c,r.width,r.height,0,l,h,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,s,a,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function M(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){if(n){var r=L(i);t.renderbufferStorageMultisample(36161,r,33189,i.width,i.height)}else t.renderbufferStorage(36161,33189,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){if(n){var r=L(i);t.renderbufferStorageMultisample(36161,r,34041,i.width,i.height)}else t.renderbufferStorage(36161,34041,i.width,i.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var s=o.convert(i.texture.format),a=o.convert(i.texture.type),l=d(s,a);if(n){var r=L(i);t.renderbufferStorageMultisample(36161,r,l,i.width,i.height)}else t.renderbufferStorage(36161,l,i.width,i.height)}t.bindRenderbuffer(36161,null)}function E(e,i){var r=i&&i.isWebGLRenderTargetCube;if(r)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),y(i.depthTexture,0);var o=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Ya)t.framebufferTexture2D(36160,36096,3553,o,0);else{if(i.depthTexture.format!==Ka)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,o,0)}}function A(e){var i=n.get(e),r=e.isWebGLRenderTargetCube===!0;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");E(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=t.createRenderbuffer(),M(i.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),M(i.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}function C(e){var a=n.get(e),h=n.get(e.texture);e.addEventListener("dispose",m),h.__webglTexture=t.createTexture(),s.memory.textures++;var p=e.isWebGLRenderTargetCube===!0,f=e.isWebGLMultisampleRenderTarget===!0,g=l(e)||r.isWebGL2;if(p){a.__webglFramebuffer=[];for(var v=0;v<6;v++)a.__webglFramebuffer[v]=t.createFramebuffer()}else if(a.__webglFramebuffer=t.createFramebuffer(),f)if(r.isWebGL2){a.__webglMultisampledFramebuffer=t.createFramebuffer(),a.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,a.__webglColorRenderbuffer);var y=o.convert(e.texture.format),_=o.convert(e.texture.type),b=d(y,_),x=L(e);t.renderbufferStorageMultisample(36161,x,b,e.width,e.height),t.bindFramebuffer(36160,a.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,a.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(a.__webglDepthRenderbuffer=t.createRenderbuffer(),M(a.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(p){i.bindTexture(34067,h.__webglTexture),w(34067,e.texture,g);for(var v=0;v<6;v++)S(a.__webglFramebuffer[v],e,36064,34069+v);c(e.texture,g)&&u(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,h.__webglTexture),w(3553,e.texture,g),S(a.__webglFramebuffer,e,36064,3553),c(e.texture,g)&&u(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&A(e)}function P(t){var e=t.texture,o=l(t)||r.isWebGL2;if(c(e,o)){var s=t.isWebGLRenderTargetCube?34067:3553,a=n.get(e).__webglTexture;i.bindTexture(s,a),u(s,e,t.width,t.height),i.bindTexture(s,null)}}function D(e){if(e.isWebGLMultisampleRenderTarget)if(r.isWebGL2){var i=n.get(e);t.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,i.__webglFramebuffer);var o=e.width,s=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,o,s,0,0,o,s,a,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function L(t){return r.isWebGL2&&t.isWebGLMultisampleRenderTarget?Math.min(r.maxSamples,t.samples):0}function R(t){var e=t.id,i=s.render.frame;k[e]!==i&&(k[e]=i,t.update())}var I,k={};this.setTexture2D=y,this.setTexture3D=_,this.setTextureCube=b,this.setTextureCubeDynamic=x,this.setupRenderTarget=C,this.updateRenderTargetMipmap=P,this.updateMultisampleRenderTarget=D}function we(t,e,i){function n(t){var n;if(t===xa)return 10497;if(t===wa)return 33071;if(t===Ta)return 33648;if(t===Sa)return 9728;if(t===Ma)return 9984;if(t===Ea)return 9986;if(t===Aa)return 9729;if(t===Ca)return 9985;if(t===Pa)return 9987;if(t===Da)return 5121;if(t===Ba)return 32819;if(t===Ga)return 32820;if(t===Fa)return 33635;if(t===La)return 5120;if(t===Ra)return 5122;if(t===Ia)return 5123;if(t===ka)return 5124;if(t===Oa)return 5125;if(t===Ha)return 5126;if(t===Na){if(i.isWebGL2)return 5131;if(n=e.get("OES_texture_half_float"),null!==n)return n.HALF_FLOAT_OES}if(t===Ua)return 6406;if(t===Va)return 6407;if(t===ja)return 6408;if(t===Wa)return 6409;if(t===Xa)return 6410;if(t===Ya)return 6402;if(t===Ka)return 34041;if(t===Za)return 6403;if(t===ks)return 32774;if(t===Os)return 32778;if(t===Hs)return 32779;if(t===Gs)return 0;if(t===Fs)return 1;if(t===zs)return 768;if(t===Us)return 769;if(t===Vs)return 770;if(t===js)return 771;if(t===Ws)return 772;if(t===Xs)return 773;if(t===qs)return 774;if(t===Ys)return 775;if(t===Ks)return 776;if((t===Ja||t===Qa||t===$a||t===tl)&&(n=e.get("WEBGL_compressed_texture_s3tc"),null!==n)){if(t===Ja)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Qa)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===$a)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===tl)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===el||t===il||t===nl||t===rl)&&(n=e.get("WEBGL_compressed_texture_pvrtc"),null!==n)){if(t===el)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===il)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===nl)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===rl)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ol&&(n=e.get("WEBGL_compressed_texture_etc1"),null!==n))return n.COMPRESSED_RGB_ETC1_WEBGL;if((t===sl||t===al||t===ll||t===hl||t===cl||t===ul||t===dl||t===pl||t===fl||t===ml||t===gl||t===vl||t===yl||t===_l)&&(n=e.get("WEBGL_compressed_texture_astc"),null!==n))return t;if(t===Ns||t===Bs){if(i.isWebGL2){if(t===Ns)return 32775;if(t===Bs)return 32776}if(n=e.get("EXT_blend_minmax"),null!==n){if(t===Ns)return n.MIN_EXT;if(t===Bs)return n.MAX_EXT}}if(t===za){if(i.isWebGL2)return 34042;if(n=e.get("WEBGL_depth_texture"),null!==n)return n.UNSIGNED_INT_24_8_WEBGL}return 0}return{convert:n}}function Te(){M.call(this),this.type="Group"}function Se(){M.call(this),this.type="Camera",this.matrixWorldInverse=new n,this.projectionMatrix=new n,this.projectionMatrixInverse=new n}function Me(t,e,i,n){Se.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Ee(t){Me.call(this),this.cameras=t||[]}function Ae(t,e,i){Mu.setFromMatrixPosition(e.matrixWorld),Eu.setFromMatrixPosition(i.matrixWorld);var n=Mu.distanceTo(Eu),r=e.projectionMatrix.elements,o=i.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],h=(r[9]-1)/r[5],c=(r[8]-1)/r[0],u=(o[8]+1)/o[0],d=s*c,p=s*u,f=n/(-c+u),m=f*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=s+f,v=a+f,y=d-m,_=p+(n-m),b=l*a/v*g,x=h*a/v*g;t.projectionMatrix.makePerspective(y,_,b,x,g,v)}function Ce(t){
function e(){return null!==c&&c.isPresenting===!0}function i(){if(e()){var i=c.getEyeParameters("left"),n=i.renderWidth*g,r=i.renderHeight*g;E=t.getPixelRatio(),M=t.getSize(),t.setDrawingBufferSize(2*n,r,1),C.start()}else h.enabled&&t.setDrawingBufferSize(M.width,M.height,E),C.stop()}function s(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),i=0,n=0,r=e.length;i<r;i++){var o=e[i];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(n===t)return o;n++}}}function a(){for(var t=0;t<p.length;t++){var e=p[t],i=s(t);if(void 0!==i&&void 0!==i.pose){if(null===i.pose)return;var n=i.pose;n.hasPosition===!1&&e.position.set(.2,-.6,-.05),null!==n.position&&e.position.fromArray(n.position),null!==n.orientation&&e.quaternion.fromArray(n.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(f),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===i.id?0:1;A[t]!==i.buttons[r].pressed&&(A[t]=i.buttons[r].pressed,A[t]===!0?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}var h=this,c=null,u=null,d=null,p=[],f=new n,m=new n,g=1,v="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(u=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",i,!1));var y=new n,_=new r,x=new o,w=new Me;w.bounds=new l(0,0,.5,1),w.layers.enable(1);var T=new Me;T.bounds=new l(.5,0,.5,1),T.layers.enable(2);var S=new Ee([w,T]);S.layers.enable(1),S.layers.enable(2);var M,E,A=[];this.enabled=!1,this.getController=function(t){var e=p[t];return void 0===e&&(e=new Te,e.matrixAutoUpdate=!1,e.visible=!1,p[t]=e),e},this.getDevice=function(){return c},this.setDevice=function(t){void 0!==t&&(c=t),C.setContext(t)},this.setFramebufferScaleFactor=function(t){g=t},this.setFrameOfReferenceType=function(t){v=t},this.setPoseTarget=function(t){void 0!==t&&(d=t)},this.getCamera=function(t){var e="stage"===v?1.6:0;if(null===c)return t.position.set(0,e,0),t;if(c.depthNear=t.near,c.depthFar=t.far,c.getFrameData(u),"stage"===v){var i=c.stageParameters;i?f.fromArray(i.sittingToStandingTransform):f.makeTranslation(0,e,0)}var n=u.pose,r=null!==d?d:t;if(r.matrix.copy(f),r.matrix.decompose(r.position,r.quaternion,r.scale),null!==n.orientation&&(_.fromArray(n.orientation),r.quaternion.multiply(_)),null!==n.position&&(_.setFromRotationMatrix(f),x.fromArray(n.position),x.applyQuaternion(_),r.position.add(x)),r.updateMatrixWorld(),c.isPresenting===!1)return t;w.near=t.near,T.near=t.near,w.far=t.far,T.far=t.far,w.matrixWorldInverse.fromArray(u.leftViewMatrix),T.matrixWorldInverse.fromArray(u.rightViewMatrix),m.getInverse(f),"stage"===v&&(w.matrixWorldInverse.multiply(m),T.matrixWorldInverse.multiply(m));var o=r.parent;null!==o&&(y.getInverse(o.matrixWorld),w.matrixWorldInverse.multiply(y),T.matrixWorldInverse.multiply(y)),w.matrixWorld.getInverse(w.matrixWorldInverse),T.matrixWorld.getInverse(T.matrixWorldInverse),w.projectionMatrix.fromArray(u.leftProjectionMatrix),T.projectionMatrix.fromArray(u.rightProjectionMatrix),Ae(S,w,T);var s=c.getLayers();if(s.length){var l=s[0];null!==l.leftBounds&&4===l.leftBounds.length&&w.bounds.fromArray(l.leftBounds),null!==l.rightBounds&&4===l.rightBounds.length&&T.bounds.fromArray(l.rightBounds)}return a(),S},this.getStandingMatrix=function(){return f},this.isPresenting=e;var C=new b;this.setAnimationLoop=function(t){C.setAnimationLoop(t)},this.submitFrame=function(){e()&&c.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",i)}}function Pe(t){function e(){return null!==h&&null!==u}function i(t){var e=f[m.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function n(){t.setFramebuffer(null),x.stop()}function r(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}function o(t,e){if(p=e.getDevicePose(u),null!==p)for(var i=h.baseLayer,n=e.views,r=0;r<n.length;r++){var o=n[r],s=i.getViewport(o),a=p.getViewMatrix(o),l=y.cameras[r];l.matrix.fromArray(a).getInverse(l.matrix),l.projectionMatrix.fromArray(o.projectionMatrix),l.viewport.set(s.x,s.y,s.width,s.height),0===r&&y.matrix.copy(l.matrix)}for(var r=0;r<f.length;r++){var c=f[r],d=m[r];if(d){var g=e.getInputPose(d,u);if(null!==g){"targetRay"in g?c.matrix.elements=g.targetRay.transformMatrix:"pointerMatrix"in g&&(c.matrix.elements=g.pointerMatrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.visible=!0;continue}}c.visible=!1}_&&_(t)}var s=t.context,a=null,h=null,c=1,u=null,d="stage",p=null,f=[],m=[],g=new Me;g.layers.enable(1),g.viewport=new l;var v=new Me;v.layers.enable(2),v.viewport=new l;var y=new Ee([g,v]);y.layers.enable(1),y.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=f[t];return void 0===e&&(e=new Te,e.matrixAutoUpdate=!1,e.visible=!1,f[t]=e),e},this.getDevice=function(){return a},this.setDevice=function(t){void 0!==t&&(a=t),t instanceof XRDevice&&s.setCompatibleXRDevice(t)},this.setFramebufferScaleFactor=function(t){c=t},this.setFrameOfReferenceType=function(t){d=t},this.setSession=function(e){h=e,null!==h&&(h.addEventListener("select",i),h.addEventListener("selectstart",i),h.addEventListener("selectend",i),h.addEventListener("end",n),h.baseLayer=new XRWebGLLayer(h,s,{framebufferScaleFactor:c}),h.requestFrameOfReference(d).then(function(e){u=e,t.setFramebuffer(h.baseLayer.framebuffer),x.setContext(h),x.start()}),m=h.getInputSources(),h.addEventListener("inputsourceschange",function(){m=h.getInputSources(),console.log(m);for(var t=0;t<f.length;t++){var e=f[t];e.userData.inputSource=m[t]}}))},this.getCamera=function(t){if(e()){var i=t.parent,n=y.cameras;r(y,i);for(var o=0;o<n.length;o++)r(n[o],i);t.matrixWorld.copy(y.matrixWorld);for(var s=t.children,o=0,a=s.length;o<a;o++)s[o].updateMatrixWorld(!0);return Ae(y,g,v),y}return t},this.isPresenting=e;var _=null,x=new b;x.setAnimationLoop(o),this.setAnimationLoop=function(t){_=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}function De(t){function e(){return null===dt?St:1}function i(){Ht=new tt(lt),Nt=new Q(lt,Ht,t),Nt.isWebGL2||(Ht.get("WEBGL_depth_texture"),Ht.get("OES_texture_float"),Ht.get("OES_texture_half_float"),Ht.get("OES_texture_half_float_linear"),Ht.get("OES_standard_derivatives"),Ht.get("OES_element_index_uint"),Ht.get("ANGLE_instanced_arrays")),Ht.get("OES_texture_float_linear"),$t=new we(lt,Ht,Nt),Bt=new be(lt,Ht,$t,Nt),Bt.scissor(_t.copy(Et).multiplyScalar(St)),Bt.viewport(yt.copy(Mt).multiplyScalar(St)),Gt=new nt(lt),Ft=new le,zt=new xe(lt,Ht,Bt,Ft,Nt,$t,Gt),Ut=new x(lt),Vt=new et(lt,Ut,Gt),jt=new st(Vt,Gt),Zt=new ot(lt),Xt=new ae(ht,Ht,Nt),qt=new de,Yt=new ge,Kt=new Z(ht,Bt,jt,q),Jt=new J(lt,Ht,Gt,Nt),Qt=new it(lt,Ht,Gt,Nt),Gt.programs=Xt.programs,ht.context=lt,ht.capabilities=Nt,ht.extensions=Ht,ht.properties=Ft,ht.renderLists=qt,ht.state=Bt,ht.info=Gt}function r(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),ct=!0}function s(){console.log("THREE.WebGLRenderer: Context Restored."),ct=!1,i()}function a(t){var e=t.target;e.removeEventListener("dispose",a),h(e)}function h(t){c(t),Ft.remove(t)}function c(t){var e=Ft.get(t).program;t.program=void 0,void 0!==e&&Xt.releaseProgram(e)}function u(t,e){t.render(function(t){ht.renderBufferImmediate(t,e)})}function p(t,e,i){if(i&&i.isInstancedBufferGeometry&!Nt.isWebGL2&&null===Ht.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");Bt.initAttributes();var n=i.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var s in r){var a=r[s];if(a>=0){var l=n[s];if(void 0!==l){var h=l.normalized,c=l.itemSize,u=Ut.get(l);if(void 0===u)continue;var d=u.buffer,p=u.type,f=u.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,g=m.stride,v=l.offset;m&&m.isInstancedInterleavedBuffer?(Bt.enableAttributeAndDivisor(a,m.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=m.meshPerAttribute*m.count)):Bt.enableAttribute(a),lt.bindBuffer(34962,d),lt.vertexAttribPointer(a,c,p,h,g*f,v*f)}else l.isInstancedBufferAttribute?(Bt.enableAttributeAndDivisor(a,l.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):Bt.enableAttribute(a),lt.bindBuffer(34962,d),lt.vertexAttribPointer(a,c,p,h,0,0)}else if(void 0!==o){var y=o[s];if(void 0!==y)switch(y.length){case 2:lt.vertexAttrib2fv(a,y);break;case 3:lt.vertexAttrib3fv(a,y);break;case 4:lt.vertexAttrib4fv(a,y);break;default:lt.vertexAttrib1fv(a,y)}}}}Bt.disableUnusedAttributes()}function f(t){te.isPresenting()||ie&&ie(t)}function m(t,e,i,n){if(t.visible!==!1){var r=t.layers.test(e.layers);if(r)if(t.isGroup)i=t.renderOrder;else if(t.isLight)at.pushLight(t),t.castShadow&&at.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Ct.intersectsSprite(t)){n&&It.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Rt);var o=jt.update(t),s=t.material;rt.push(t,o,s,i,It.z,null)}}else if(t.isImmediateRenderObject)n&&It.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Rt),rt.push(t,null,t.material,i,It.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||Ct.intersectsObject(t))){n&&It.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Rt);var o=jt.update(t),s=t.material;if(Array.isArray(s))for(var a=o.groups,l=0,h=a.length;l<h;l++){var c=a[l],u=s[c.materialIndex];u&&u.visible&&rt.push(t,o,u,i,It.z,c)}else s.visible&&rt.push(t,o,s,i,It.z,null)}for(var d=t.children,l=0,h=d.length;l<h;l++)m(d[l],e,i,n)}}function y(t,e,i,n){for(var r=0,o=t.length;r<o;r++){var s=t[r],a=s.object,l=s.geometry,h=void 0===n?s.material:n,c=s.group;if(i.isArrayCamera){vt=i;for(var u=i.cameras,d=0,p=u.length;d<p;d++){var f=u[d];if(a.layers.test(f.layers)){if("viewport"in f)Bt.viewport(yt.copy(f.viewport));else{var m=f.bounds,g=m.x*wt,v=m.y*Tt,y=m.z*wt,b=m.w*Tt;Bt.viewport(yt.set(g,v,y,b).multiplyScalar(St))}at.setupLights(f),_(a,e,f,l,h,c)}}}else vt=null,_(a,e,i,l,h,c)}}function _(t,e,i,n,r,o){if(t.onBeforeRender(ht,e,i,n,r,o),at=Yt.get(e,vt||i),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){Bt.setMaterial(r);var s=T(i,e.fog,r,t);mt.geometry=null,mt.program=null,mt.wireframe=!1,u(t,s)}else ht.renderBufferDirect(i,e.fog,n,r,t,o);t.onAfterRender(ht,e,i,n,r,o),at=Yt.get(e,vt||i)}function w(t,e,i){var n=Ft.get(t),r=at.state.lights,o=at.state.shadowsArray,s=n.lightsHash,l=r.state.hash,h=Xt.getParameters(t,r.state,o,e,Pt.numPlanes,Pt.numIntersection,i),u=Xt.getProgramCode(t,h),d=n.program,p=!0;if(void 0===d)t.addEventListener("dispose",a);else if(d.code!==u)c(t);else if(s.stateID!==l.stateID||s.directionalLength!==l.directionalLength||s.pointLength!==l.pointLength||s.spotLength!==l.spotLength||s.rectAreaLength!==l.rectAreaLength||s.hemiLength!==l.hemiLength||s.shadowsLength!==l.shadowsLength)s.stateID=l.stateID,s.directionalLength=l.directionalLength,s.pointLength=l.pointLength,s.spotLength=l.spotLength,s.rectAreaLength=l.rectAreaLength,s.hemiLength=l.hemiLength,s.shadowsLength=l.shadowsLength,p=!1;else{if(void 0!==h.shaderID)return;p=!1}if(p){if(h.shaderID){var f=hu[h.shaderID];n.shader={name:t.type,uniforms:v(f.uniforms),vertexShader:f.vertexShader,fragmentShader:f.fragmentShader}}else n.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(n.shader,ht),u=Xt.getProgramCode(t,h),d=Xt.acquireProgram(t,n.shader,h,u),n.program=d,t.program=d}var m=d.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var g=0;g<ht.maxMorphTargets;g++)m["morphTarget"+g]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var g=0;g<ht.maxMorphNormals;g++)m["morphNormal"+g]>=0&&t.numSupportedMorphNormals++}var y=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&t.clipping!==!0||(n.numClippingPlanes=Pt.numPlanes,n.numIntersection=Pt.numIntersection,y.clippingPlanes=Pt.uniform),n.fog=e,void 0===s&&(n.lightsHash=s={}),s.stateID=l.stateID,s.directionalLength=l.directionalLength,s.pointLength=l.pointLength,s.spotLength=l.spotLength,s.rectAreaLength=l.rectAreaLength,s.hemiLength=l.hemiLength,s.shadowsLength=l.shadowsLength,t.lights&&(y.ambientLightColor.value=r.state.ambient,y.directionalLights.value=r.state.directional,y.spotLights.value=r.state.spot,y.rectAreaLights.value=r.state.rectArea,y.pointLights.value=r.state.point,y.hemisphereLights.value=r.state.hemi,y.directionalShadowMap.value=r.state.directionalShadowMap,y.directionalShadowMatrix.value=r.state.directionalShadowMatrix,y.spotShadowMap.value=r.state.spotShadowMap,y.spotShadowMatrix.value=r.state.spotShadowMatrix,y.pointShadowMap.value=r.state.pointShadowMap,y.pointShadowMatrix.value=r.state.pointShadowMatrix);var _=n.program.getUniforms(),b=Wt.seqWithValue(_.seq,y);n.uniformsList=b}function T(t,e,i,n){xt=0;var r=Ft.get(i),o=at.state.lights,s=r.lightsHash,a=o.state.hash;if(Dt&&(Lt||t!==gt)){var l=t===gt&&i.id===ft;Pt.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,r,l)}i.needsUpdate===!1&&(void 0===r.program?i.needsUpdate=!0:i.fog&&r.fog!==e?i.needsUpdate=!0:!i.lights||s.stateID===a.stateID&&s.directionalLength===a.directionalLength&&s.pointLength===a.pointLength&&s.spotLength===a.spotLength&&s.rectAreaLength===a.rectAreaLength&&s.hemiLength===a.hemiLength&&s.shadowsLength===a.shadowsLength?void 0===r.numClippingPlanes||r.numClippingPlanes===Pt.numPlanes&&r.numIntersection===Pt.numIntersection||(i.needsUpdate=!0):i.needsUpdate=!0),i.needsUpdate&&(w(i,e,n),i.needsUpdate=!1);var h=!1,c=!1,u=!1,p=r.program,f=p.getUniforms(),m=r.shader.uniforms;if(Bt.useProgram(p.program)&&(h=!0,c=!0,u=!0),i.id!==ft&&(ft=i.id,c=!0),h||gt!==t){if(f.setValue(lt,"projectionMatrix",t.projectionMatrix),Nt.logarithmicDepthBuffer&&f.setValue(lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),gt!==t&&(gt=t,c=!0,u=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var g=f.map.cameraPosition;void 0!==g&&g.setValue(lt,It.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&f.setValue(lt,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){f.setOptional(lt,n,"bindMatrix"),f.setOptional(lt,n,"bindMatrixInverse");var v=n.skeleton;if(v){var y=v.bones;if(Nt.floatVertexTextures){if(void 0===v.boneTexture){var _=Math.sqrt(4*y.length);_=jl.ceilPowerOfTwo(_),_=Math.max(_,4);var b=new Float32Array(_*_*4);b.set(v.boneMatrices);var x=new d(b,_,_,ja,Ha);x.needsUpdate=!0,v.boneMatrices=b,v.boneTexture=x,v.boneTextureSize=_}f.setValue(lt,"boneTexture",v.boneTexture),f.setValue(lt,"boneTextureSize",v.boneTextureSize)}else f.setOptional(lt,v,"boneMatrices")}}return c&&(f.setValue(lt,"toneMappingExposure",ht.toneMappingExposure),f.setValue(lt,"toneMappingWhitePoint",ht.toneMappingWhitePoint),i.lights&&G(m,u),e&&i.fog&&P(m,e),i.isMeshBasicMaterial?S(m,i):i.isMeshLambertMaterial?(S(m,i),D(m,i)):i.isMeshPhongMaterial?(S(m,i),i.isMeshToonMaterial?R(m,i):L(m,i)):i.isMeshStandardMaterial?(S(m,i),i.isMeshPhysicalMaterial?k(m,i):I(m,i)):i.isMeshMatcapMaterial?(S(m,i),O(m,i)):i.isMeshDepthMaterial?(S(m,i),H(m,i)):i.isMeshDistanceMaterial?(S(m,i),N(m,i)):i.isMeshNormalMaterial?(S(m,i),B(m,i)):i.isLineBasicMaterial?(M(m,i),i.isLineDashedMaterial&&E(m,i)):i.isPointsMaterial?A(m,i):i.isSpriteMaterial?C(m,i):i.isShadowMaterial&&(m.color.value=i.color,m.opacity.value=i.opacity),void 0!==m.ltc_1&&(m.ltc_1.value=lu.LTC_1),void 0!==m.ltc_2&&(m.ltc_2.value=lu.LTC_2),Wt.upload(lt,r.uniformsList,m,ht)),i.isShaderMaterial&&i.uniformsNeedUpdate===!0&&(Wt.upload(lt,r.uniformsList,m,ht),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&f.setValue(lt,"center",n.center),f.setValue(lt,"modelViewMatrix",n.modelViewMatrix),f.setValue(lt,"normalMatrix",n.normalMatrix),f.setValue(lt,"modelMatrix",n.matrixWorld),p}function S(t,e){t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=Ft.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var i;e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),i.matrixAutoUpdate===!0&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function M(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function E(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function A(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*St,t.scale.value=.5*Tt,t.map.value=e.map,null!==e.map&&(e.map.matrixAutoUpdate===!0&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}function C(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(e.map.matrixAutoUpdate===!0&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}function P(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function D(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function L(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===xs&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===xs&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function R(t,e){L(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function I(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===xs&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===xs&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function k(t,e){I(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}function O(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===xs&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===xs&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function H(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function N(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function B(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===xs&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===xs&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function G(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function F(){var t=xt;return t>=Nt.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+Nt.maxTextures),xt+=1,t}console.log("THREE.WebGLRenderer",hs),t=t||{};var z=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),U=void 0!==t.context?t.context:null,V=void 0!==t.alpha&&t.alpha,j=void 0===t.depth||t.depth,W=void 0===t.stencil||t.stencil,X=void 0!==t.antialias&&t.antialias,q=void 0===t.premultipliedAlpha||t.premultipliedAlpha,Y=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,K=void 0!==t.powerPreference?t.powerPreference:"default",rt=null,at=null;this.domElement=z,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=la,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var lt,ht=this,ct=!1,ut=null,dt=null,pt=null,ft=-1,mt={geometry:null,program:null,wireframe:!1},gt=null,vt=null,yt=new l,_t=new l,bt=null,xt=0,wt=z.width,Tt=z.height,St=1,Mt=new l(0,0,wt,Tt),Et=new l(0,0,wt,Tt),At=!1,Ct=new g,Pt=new $,Dt=!1,Lt=!1,Rt=new n,It=new o;try{var kt={alpha:V,depth:j,stencil:W,antialias:X,premultipliedAlpha:q,preserveDrawingBuffer:Y,powerPreference:K};if(z.addEventListener("webglcontextlost",r,!1),z.addEventListener("webglcontextrestored",s,!1),lt=U||z.getContext("webgl",kt)||z.getContext("experimental-webgl",kt),null===lt)throw null!==z.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===lt.getShaderPrecisionFormat&&(lt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(Ot){console.error("THREE.WebGLRenderer: "+Ot.message)}var Ht,Nt,Bt,Gt,Ft,zt,Ut,Vt,jt,Xt,qt,Yt,Kt,Zt,Jt,Qt,$t;i();var te=null;"undefined"!=typeof navigator&&(te="xr"in navigator?new Pe(ht):new Ce(ht)),this.vr=te;var ee=new _e(ht,jt,Nt.maxTextureSize);this.shadowMap=ee,this.getContext=function(){return lt},this.getContextAttributes=function(){return lt.getContextAttributes()},this.forceContextLoss=function(){var t=Ht.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=Ht.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return St},this.setPixelRatio=function(t){void 0!==t&&(St=t,this.setSize(wt,Tt,!1))},this.getSize=function(){return{width:wt,height:Tt}},this.setSize=function(t,e,i){return te.isPresenting()?void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(wt=t,Tt=e,z.width=t*St,z.height=e*St,i!==!1&&(z.style.width=t+"px",z.style.height=e+"px"),void this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(){return{width:wt*St,height:Tt*St}},this.setDrawingBufferSize=function(t,e,i){wt=t,Tt=e,St=i,z.width=t*i,z.height=e*i,this.setViewport(0,0,t,e)},this.getCurrentViewport=function(){return yt},this.setViewport=function(t,e,i,n){Mt.set(t,Tt-e-n,i,n),Bt.viewport(yt.copy(Mt).multiplyScalar(St))},this.setScissor=function(t,e,i,n){Et.set(t,Tt-e-n,i,n),Bt.scissor(_t.copy(Et).multiplyScalar(St))},this.setScissorTest=function(t){Bt.setScissorTest(At=t)},this.getClearColor=function(){return Kt.getClearColor()},this.setClearColor=function(){Kt.setClearColor.apply(Kt,arguments)},this.getClearAlpha=function(){return Kt.getClearAlpha()},this.setClearAlpha=function(){Kt.setClearAlpha.apply(Kt,arguments)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),lt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){z.removeEventListener("webglcontextlost",r,!1),z.removeEventListener("webglcontextrestored",s,!1),qt.dispose(),Yt.dispose(),Ft.dispose(),jt.dispose(),te.dispose(),ne.stop()},this.renderBufferImmediate=function(t,e){Bt.initAttributes();var i=Ft.get(t);t.hasPositions&&!i.position&&(i.position=lt.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=lt.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=lt.createBuffer()),t.hasColors&&!i.color&&(i.color=lt.createBuffer());var n=e.getAttributes();t.hasPositions&&(lt.bindBuffer(34962,i.position),lt.bufferData(34962,t.positionArray,35048),Bt.enableAttribute(n.position),lt.vertexAttribPointer(n.position,3,5126,!1,0,0)),t.hasNormals&&(lt.bindBuffer(34962,i.normal),lt.bufferData(34962,t.normalArray,35048),Bt.enableAttribute(n.normal),lt.vertexAttribPointer(n.normal,3,5126,!1,0,0)),t.hasUvs&&(lt.bindBuffer(34962,i.uv),lt.bufferData(34962,t.uvArray,35048),Bt.enableAttribute(n.uv),lt.vertexAttribPointer(n.uv,2,5126,!1,0,0)),t.hasColors&&(lt.bindBuffer(34962,i.color),lt.bufferData(34962,t.colorArray,35048),Bt.enableAttribute(n.color),lt.vertexAttribPointer(n.color,3,5126,!1,0,0)),Bt.disableUnusedAttributes(),lt.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,i,n,r,o,s){var a=o.isMesh&&o.normalMatrix.determinant()<0;Bt.setMaterial(r,a);var l=T(t,i,r,o),h=!1;mt.geometry===n.id&&mt.program===l.id&&mt.wireframe===(r.wireframe===!0)||(mt.geometry=n.id,mt.program=l.id,mt.wireframe=r.wireframe===!0,h=!0),o.morphTargetInfluences&&(Zt.update(o,n,r,l),h=!0);var c=n.index,u=n.attributes.position,d=1;r.wireframe===!0&&(c=Vt.getWireframeAttribute(n),d=2);var f,m=Jt;null!==c&&(f=Ut.get(c),m=Qt,m.setIndex(f)),h&&(p(r,l,n),null!==c&&lt.bindBuffer(34963,f.buffer));var g=1/0;null!==c?g=c.count:void 0!==u&&(g=u.count);var v=n.drawRange.start*d,y=n.drawRange.count*d,_=null!==s?s.start*d:0,b=null!==s?s.count*d:1/0,x=Math.max(v,_),w=Math.min(g,v+y,_+b)-1,S=Math.max(0,w-x+1);if(0!==S){if(o.isMesh)if(r.wireframe===!0)Bt.setLineWidth(r.wireframeLinewidth*e()),m.setMode(1);else switch(o.drawMode){case Pl:m.setMode(4);break;case Dl:m.setMode(5);break;case Ll:m.setMode(6)}else if(o.isLine){var M=r.linewidth;void 0===M&&(M=1),Bt.setLineWidth(M*e()),o.isLineSegments?m.setMode(1):o.isLineLoop?m.setMode(2):m.setMode(3)}else o.isPoints?m.setMode(0):o.isSprite&&m.setMode(4);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&m.renderInstances(n,x,S):m.render(x,S)}},this.compile=function(t,e){at=Yt.get(t,e),at.init(),t.traverse(function(t){t.isLight&&(at.pushLight(t),t.castShadow&&at.pushShadow(t))}),at.setupLights(e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i<e.material.length;i++)w(e.material[i],t.fog,e);else w(e.material,t.fog,e)})};var ie=null,ne=new b;ne.setAnimationLoop(f),"undefined"!=typeof window&&ne.setContext(window),this.setAnimationLoop=function(t){ie=t,te.setAnimationLoop(t),ne.start()},this.render=function(t,e,i,n){if(!e||!e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!ct){mt.geometry=null,mt.program=null,mt.wireframe=!1,ft=-1,gt=null,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),te.enabled&&(e=te.getCamera(e)),at=Yt.get(t,e),at.init(),t.onBeforeRender(ht,t,e,i),Rt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Ct.setFromMatrix(Rt),Lt=this.localClippingEnabled,Dt=Pt.init(this.clippingPlanes,Lt,e),rt=qt.get(t,e),rt.init(),m(t,e,0,ht.sortObjects),ht.sortObjects===!0&&rt.sort(),Dt&&Pt.beginShadows();var r=at.state.shadowsArray;ee.render(r,t,e),at.setupLights(e),Dt&&Pt.endShadows(),this.info.autoReset&&this.info.reset(),void 0===i&&(i=null),this.setRenderTarget(i),Kt.render(rt,t,e,n);var o=rt.opaque,s=rt.transparent;if(t.overrideMaterial){var a=t.overrideMaterial;o.length&&y(o,t,e,a),s.length&&y(s,t,e,a)}else o.length&&y(o,t,e),s.length&&y(s,t,e);i&&(zt.updateRenderTargetMipmap(i),zt.updateMultisampleRenderTarget(i)),Bt.buffers.depth.setTest(!0),Bt.buffers.depth.setMask(!0),Bt.buffers.color.setMask(!0),Bt.setPolygonOffset(!1),t.onAfterRender(ht,t,e),te.enabled&&te.submitFrame(),rt=null,at=null}},this.allocTextureUnit=F,this.setTexture2D=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),zt.setTexture2D(e,i)}}(),this.setTexture3D=function(){return function(t,e){zt.setTexture3D(t,e)}}(),this.setTexture=function(){var t=!1;return function(e,i){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),zt.setTexture2D(e,i)}}(),this.setTextureCube=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?zt.setTextureCube(e,i):zt.setTextureCubeDynamic(e,i)}}(),this.setFramebuffer=function(t){ut=t},this.getRenderTarget=function(){return dt},this.setRenderTarget=function(t){dt=t,t&&void 0===Ft.get(t).__webglFramebuffer&&zt.setupRenderTarget(t);var e=ut,i=!1;if(t){var n=Ft.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=n[t.activeCubeFace],i=!0):e=t.isWebGLMultisampleRenderTarget?Ft.get(t).__webglMultisampledFramebuffer:n,yt.copy(t.viewport),_t.copy(t.scissor),bt=t.scissorTest}else yt.copy(Mt).multiplyScalar(St),_t.copy(Et).multiplyScalar(St),bt=At;if(pt!==e&&(lt.bindFramebuffer(36160,e),pt=e),Bt.viewport(yt),Bt.scissor(_t),Bt.setScissorTest(bt),i){var r=Ft.get(t.texture);lt.framebufferTexture2D(36160,36064,34069+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,i,n,r,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=Ft.get(t).__webglFramebuffer;if(s){var a=!1;s!==pt&&(lt.bindFramebuffer(36160,s),a=!0);try{var l=t.texture,h=l.format,c=l.type;if(h!==ja&&$t.convert(h)!==lt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===Da||$t.convert(c)===lt.getParameter(35738)||c===Ha&&(Nt.isWebGL2||Ht.get("OES_texture_float")||Ht.get("WEBGL_color_buffer_float"))||c===Na&&(Nt.isWebGL2?Ht.get("EXT_color_buffer_float"):Ht.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===lt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&lt.readPixels(e,i,n,r,$t.convert(h),$t.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
}finally{a&&lt.bindFramebuffer(36160,pt)}}},this.copyFramebufferToTexture=function(t,e,i){var n=e.image.width,r=e.image.height,o=$t.convert(e.format);this.setTexture2D(e,0),lt.copyTexImage2D(3553,i||0,o,t.x,t.y,n,r,0)},this.copyTextureToTexture=function(t,e,i,n){var r=e.image.width,o=e.image.height,s=$t.convert(i.format),a=$t.convert(i.type);this.setTexture2D(i,0),e.isDataTexture?lt.texSubImage2D(3553,n||0,t.x,t.y,r,o,s,a,e.image.data):lt.texSubImage2D(3553,n||0,t.x,t.y,s,a,e.image)}}function Le(t,e){this.name="",this.color=new _(t),this.density=void 0!==e?e:25e-5}function Re(t,e,i){this.name="",this.color=new _(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function Ie(){M.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function ke(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Oe(t,e,i,n){this.data=t,this.itemSize=e,this.offset=i,this.normalized=n===!0}function He(t){j.call(this),this.type="SpriteMaterial",this.color=new _(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function Ne(t){if(M.call(this),this.type="Sprite",void 0===Au){Au=new G;var e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new ke(e,5);Au.setIndex([0,1,2,0,2,3]),Au.addAttribute("position",new Oe(n,3,0,(!1))),Au.addAttribute("uv",new Oe(n,2,3,(!1)))}this.geometry=Au,this.material=void 0!==t?t:new He,this.center=new i(.5,.5)}function Be(){M.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Ge(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),K.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new n,this.bindMatrixInverse=new n}function Fe(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new n)}}function ze(){M.call(this),this.type="Bone"}function Ue(t){j.call(this),this.type="LineBasicMaterial",this.color=new _(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Ve(t,e,i){1===i&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),M.call(this),this.type="Line",this.geometry=void 0!==t?t:new G,this.material=void 0!==e?e:new Ue({color:16777215*Math.random()})}function je(t,e){Ve.call(this,t,e),this.type="LineSegments"}function We(t,e){Ve.call(this,t,e),this.type="LineLoop"}function Xe(t){j.call(this),this.type="PointsMaterial",this.color=new _(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function qe(t,e){M.call(this),this.type="Points",this.geometry=void 0!==t?t:new G,this.material=void 0!==e?e:new Xe({color:16777215*Math.random()})}function Ye(t,e,i,n,r,o,s,l,h){a.call(this,t,e,i,n,r,o,s,l,h),this.format=void 0!==s?s:Va,this.minFilter=void 0!==o?o:Aa,this.magFilter=void 0!==r?r:Aa,this.generateMipmaps=!1}function Ke(t,e,i,n,r,o,s,l,h,c,u,d){a.call(this,null,o,s,l,h,c,n,r,u,d),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ze(t,e,i,n,r,o,s,l,h){a.call(this,t,e,i,n,r,o,s,l,h),this.needsUpdate=!0}function Je(t,e,i,n,r,o,s,l,h,c){if(c=void 0!==c?c:Ya,c!==Ya&&c!==Ka)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===Ya&&(i=Ia),void 0===i&&c===Ka&&(i=za),a.call(this,null,n,r,o,s,l,c,i,h),this.image={width:t,height:e},this.magFilter=void 0!==s?s:Sa,this.minFilter=void 0!==l?l:Sa,this.flipY=!1,this.generateMipmaps=!1}function Qe(t){G.call(this),this.type="WireframeGeometry";var e,i,n,r,s,a,l,h,c,u,d=[],p=[0,0],f={},m=["a","b","c"];if(t&&t.isGeometry){var g=t.faces;for(e=0,n=g.length;e<n;e++){var v=g[e];for(i=0;i<3;i++)l=v[m[i]],h=v[m[(i+1)%3]],p[0]=Math.min(l,h),p[1]=Math.max(l,h),c=p[0]+","+p[1],void 0===f[c]&&(f[c]={index1:p[0],index2:p[1]})}for(c in f)a=f[c],u=t.vertices[a.index1],d.push(u.x,u.y,u.z),u=t.vertices[a.index2],d.push(u.x,u.y,u.z)}else if(t&&t.isBufferGeometry){var y,_,b,x,w,T,S,M;if(u=new o,null!==t.index){for(y=t.attributes.position,_=t.index,b=t.groups,0===b.length&&(b=[{start:0,count:_.count,materialIndex:0}]),r=0,s=b.length;r<s;++r)for(x=b[r],w=x.start,T=x.count,e=w,n=w+T;e<n;e+=3)for(i=0;i<3;i++)l=_.getX(e+i),h=_.getX(e+(i+1)%3),p[0]=Math.min(l,h),p[1]=Math.max(l,h),c=p[0]+","+p[1],void 0===f[c]&&(f[c]={index1:p[0],index2:p[1]});for(c in f)a=f[c],u.fromBufferAttribute(y,a.index1),d.push(u.x,u.y,u.z),u.fromBufferAttribute(y,a.index2),d.push(u.x,u.y,u.z)}else for(y=t.attributes.position,e=0,n=y.count/3;e<n;e++)for(i=0;i<3;i++)S=3*e+i,u.fromBufferAttribute(y,S),d.push(u.x,u.y,u.z),M=3*e+(i+1)%3,u.fromBufferAttribute(y,M),d.push(u.x,u.y,u.z)}this.addAttribute("position",new O(d,3))}function $e(t,e,i){E.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new ti(t,e,i)),this.mergeVertices()}function ti(t,e,i){G.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};var n,r,s=[],a=[],l=[],h=[],c=1e-5,u=new o,d=new o,p=new o,f=new o,m=new o;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var g=e+1;for(n=0;n<=i;n++){var v=n/i;for(r=0;r<=e;r++){var y=r/e;t(y,v,d),a.push(d.x,d.y,d.z),y-c>=0?(t(y-c,v,p),f.subVectors(d,p)):(t(y+c,v,p),f.subVectors(p,d)),v-c>=0?(t(y,v-c,p),m.subVectors(d,p)):(t(y,v+c,p),m.subVectors(p,d)),u.crossVectors(f,m).normalize(),l.push(u.x,u.y,u.z),h.push(y,v)}}for(n=0;n<i;n++)for(r=0;r<e;r++){var _=n*g+r,b=n*g+r+1,x=(n+1)*g+r+1,w=(n+1)*g+r;s.push(_,b,w),s.push(b,x,w)}this.setIndex(s),this.addAttribute("position",new O(a,3)),this.addAttribute("normal",new O(l,3)),this.addAttribute("uv",new O(h,2))}function ei(t,e,i,n){E.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new ii(t,e,i,n)),this.mergeVertices()}function ii(t,e,n,r){function s(t){for(var i=new o,n=new o,r=new o,s=0;s<e.length;s+=3)d(e[s+0],i),d(e[s+1],n),d(e[s+2],r),a(i,n,r,t)}function a(t,e,i,n){var r,o,s=Math.pow(2,n),a=[];for(r=0;r<=s;r++){a[r]=[];var l=t.clone().lerp(i,r/s),h=e.clone().lerp(i,r/s),c=s-r;for(o=0;o<=c;o++)0===o&&r===s?a[r][o]=l:a[r][o]=l.clone().lerp(h,o/c)}for(r=0;r<s;r++)for(o=0;o<2*(s-r)-1;o++){var d=Math.floor(o/2);o%2===0?(u(a[r][d+1]),u(a[r+1][d]),u(a[r][d])):(u(a[r][d+1]),u(a[r+1][d+1]),u(a[r+1][d]))}}function l(t){for(var e=new o,i=0;i<v.length;i+=3)e.x=v[i+0],e.y=v[i+1],e.z=v[i+2],e.normalize().multiplyScalar(t),v[i+0]=e.x,v[i+1]=e.y,v[i+2]=e.z}function h(){for(var t=new o,e=0;e<v.length;e+=3){t.x=v[e+0],t.y=v[e+1],t.z=v[e+2];var i=m(t)/2/Math.PI+.5,n=g(t)/Math.PI+.5;y.push(i,1-n)}p(),c()}function c(){for(var t=0;t<y.length;t+=6){var e=y[t+0],i=y[t+2],n=y[t+4],r=Math.max(e,i,n),o=Math.min(e,i,n);r>.9&&o<.1&&(e<.2&&(y[t+0]+=1),i<.2&&(y[t+2]+=1),n<.2&&(y[t+4]+=1))}}function u(t){v.push(t.x,t.y,t.z)}function d(e,i){var n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function p(){for(var t=new o,e=new o,n=new o,r=new o,s=new i,a=new i,l=new i,h=0,c=0;h<v.length;h+=9,c+=6){t.set(v[h+0],v[h+1],v[h+2]),e.set(v[h+3],v[h+4],v[h+5]),n.set(v[h+6],v[h+7],v[h+8]),s.set(y[c+0],y[c+1]),a.set(y[c+2],y[c+3]),l.set(y[c+4],y[c+5]),r.copy(t).add(e).add(n).divideScalar(3);var u=m(r);f(s,c+0,t,u),f(a,c+2,e,u),f(l,c+4,n,u)}}function f(t,e,i,n){n<0&&1===t.x&&(y[e]=t.x-1),0===i.x&&0===i.z&&(y[e]=n/2/Math.PI+.5)}function m(t){return Math.atan2(t.z,-t.x)}function g(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}G.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1,r=r||0;var v=[],y=[];s(r),l(n),h(),this.addAttribute("position",new O(v,3)),this.addAttribute("normal",new O(v.slice(),3)),this.addAttribute("uv",new O(y,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function ni(t,e){E.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ri(t,e)),this.mergeVertices()}function ri(t,e){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];ii.call(this,i,n,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function oi(t,e){E.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new si(t,e)),this.mergeVertices()}function si(t,e){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];ii.call(this,i,n,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ai(t,e){E.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new li(t,e)),this.mergeVertices()}function li(t,e){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],r=[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];ii.call(this,n,r,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function hi(t,e){E.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ci(t,e)),this.mergeVertices()}function ci(t,e){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];ii.call(this,r,o,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ui(t,e,i,n,r,o){E.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var s=new di(t,e,i,n,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals,this.fromBufferGeometry(s),this.mergeVertices()}function di(t,e,n,r,s){function a(){for(d=0;d<e;d++)l(d);l(s===!1?e:0),c(),h()}function l(i){v=t.getPointAt(i/e,v);var o=u.normals[i],s=u.binormals[i];for(p=0;p<=r;p++){var a=p/r*Math.PI*2,l=Math.sin(a),h=-Math.cos(a);m.x=h*o.x+l*s.x,m.y=h*o.y+l*s.y,m.z=h*o.z+l*s.z,m.normalize(),_.push(m.x,m.y,m.z),f.x=v.x+n*m.x,f.y=v.y+n*m.y,f.z=v.z+n*m.z,y.push(f.x,f.y,f.z)}}function h(){for(p=1;p<=e;p++)for(d=1;d<=r;d++){var t=(r+1)*(p-1)+(d-1),i=(r+1)*p+(d-1),n=(r+1)*p+d,o=(r+1)*(p-1)+d;x.push(t,i,o),x.push(i,n,o)}}function c(){for(d=0;d<=e;d++)for(p=0;p<=r;p++)g.x=d/e,g.y=p/r,b.push(g.x,g.y)}G.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:s},e=e||64,n=n||1,r=r||8,s=s||!1;var u=t.computeFrenetFrames(e,s);this.tangents=u.tangents,this.normals=u.normals,this.binormals=u.binormals;var d,p,f=new o,m=new o,g=new i,v=new o,y=[],_=[],b=[],x=[];a(),this.setIndex(x),this.addAttribute("position",new O(y,3)),this.addAttribute("normal",new O(_,3)),this.addAttribute("uv",new O(b,2))}function pi(t,e,i,n,r,o,s){E.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new fi(t,e,i,n,r,o)),this.mergeVertices()}function fi(t,e,i,n,r,s){function a(t,e,i,n,r){var o=Math.cos(t),s=Math.sin(t),a=i/e*t,l=Math.cos(a);r.x=n*(2+l)*.5*o,r.y=n*(2+l)*s*.5,r.z=n*Math.sin(a)*.5}G.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:s},t=t||1,e=e||.4,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,s=s||3;var l,h,c=[],u=[],d=[],p=[],f=new o,m=new o,g=new o,v=new o,y=new o,_=new o,b=new o;for(l=0;l<=i;++l){var x=l/i*r*Math.PI*2;for(a(x,r,s,t,g),a(x+.01,r,s,t,v),_.subVectors(v,g),b.addVectors(v,g),y.crossVectors(_,b),b.crossVectors(y,_),y.normalize(),b.normalize(),h=0;h<=n;++h){var w=h/n*Math.PI*2,T=-e*Math.cos(w),S=e*Math.sin(w);f.x=g.x+(T*b.x+S*y.x),f.y=g.y+(T*b.y+S*y.y),f.z=g.z+(T*b.z+S*y.z),u.push(f.x,f.y,f.z),m.subVectors(f,g).normalize(),d.push(m.x,m.y,m.z),p.push(l/i),p.push(h/n)}}for(h=1;h<=i;h++)for(l=1;l<=n;l++){var M=(n+1)*(h-1)+(l-1),E=(n+1)*h+(l-1),A=(n+1)*h+l,C=(n+1)*(h-1)+l;c.push(M,E,C),c.push(E,A,C)}this.setIndex(c),this.addAttribute("position",new O(u,3)),this.addAttribute("normal",new O(d,3)),this.addAttribute("uv",new O(p,2))}function mi(t,e,i,n,r){E.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new gi(t,e,i,n,r)),this.mergeVertices()}function gi(t,e,i,n,r){G.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||1,e=e||.4,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var s,a,l=[],h=[],c=[],u=[],d=new o,p=new o,f=new o;for(s=0;s<=i;s++)for(a=0;a<=n;a++){var m=a/n*r,g=s/i*Math.PI*2;p.x=(t+e*Math.cos(g))*Math.cos(m),p.y=(t+e*Math.cos(g))*Math.sin(m),p.z=e*Math.sin(g),h.push(p.x,p.y,p.z),d.x=t*Math.cos(m),d.y=t*Math.sin(m),f.subVectors(p,d).normalize(),c.push(f.x,f.y,f.z),u.push(a/n),u.push(s/i)}for(s=1;s<=i;s++)for(a=1;a<=n;a++){var v=(n+1)*s+a-1,y=(n+1)*(s-1)+a-1,_=(n+1)*(s-1)+a,b=(n+1)*s+a;l.push(v,y,b),l.push(y,_,b)}this.setIndex(l),this.addAttribute("position",new O(h,3)),this.addAttribute("normal",new O(c,3)),this.addAttribute("uv",new O(u,2))}function vi(t,e,i,n,r){var o,s;if(r===ji(t,e,i,n)>0)for(o=e;o<i;o+=n)s=zi(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=zi(o,t[o],t[o+1],s);return s&&Oi(s,s.next)&&(Ui(s),s=s.next),s}function yi(t,e){if(!t)return t;e||(e=t);var i,n=t;do if(i=!1,n.steiner||!Oi(n,n.next)&&0!==ki(n.prev,n,n.next))n=n.next;else{if(Ui(n),n=e=n.prev,n===n.next)break;i=!0}while(i||n!==e);return e}function _i(t,e,i,n,r,o,s){if(t){!s&&o&&Ci(t,n,r,o);for(var a,l,h=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?xi(t,n,r,o):bi(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Ui(t),t=l.next,h=l.next;else if(t=l,t===h){s?1===s?(t=wi(t,e,i),_i(t,e,i,n,r,o,2)):2===s&&Ti(t,e,i,n,r,o):_i(yi(t),e,i,n,r,o,1);break}}}function bi(t){var e=t.prev,i=t,n=t.next;if(ki(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Ri(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&ki(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function xi(t,e,i,n){var r=t.prev,o=t,s=t.next;if(ki(r,o,s)>=0)return!1;for(var a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,h=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,c=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,u=Di(a,l,e,i,n),d=Di(h,c,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&Ri(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&ki(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&Ri(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&ki(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function wi(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!Oi(r,o)&&Hi(r,n,n.next,o)&&Bi(r,o)&&Bi(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Ui(n),Ui(n.next),n=t=o),n=n.next}while(n!==t);return n}function Ti(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Ii(s,a)){var l=Fi(s,a);return s=yi(s,s.next),l=yi(l,l.next),_i(s,e,i,n,r,o),void _i(l,e,i,n,r,o)}a=a.next}s=s.next}while(s!==t)}function Si(t,e,i,n){var r,o,s,a,l,h=[];for(r=0,o=e.length;r<o;r++)s=e[r]*n,a=r<o-1?e[r+1]*n:t.length,l=vi(t,s,a,n,!1),l===l.next&&(l.steiner=!0),h.push(Li(l));for(h.sort(Mi),r=0;r<h.length;r++)Ei(h[r],i),i=yi(i,i.next);return i}function Mi(t,e){return t.x-e.x}function Ei(t,e){if(e=Ai(t,e)){var i=Fi(e,t);yi(i,i.next)}}function Ai(t,e){var i,n=e,r=t.x,o=t.y,s=-(1/0);do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s){if(s=a,a===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===s)return i.prev;var l,h=i,c=i.x,u=i.y,d=1/0;for(n=i.next;n!==h;)r>=n.x&&n.x>=c&&r!==n.x&&Ri(o<u?r:s,o,c,u,o<u?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),(l<d||l===d&&n.x>i.x)&&Bi(n,t)&&(i=n,d=l)),n=n.next;return i}function Ci(t,e,i,n){var r=t;do null===r.z&&(r.z=Di(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Pi(r)}function Pi(t){var e,i,n,r,o,s,a,l,h=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<h&&(a++,n=n.nextZ,n);e++);for(l=h;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,h*=2}while(s>1);return t}function Di(t,e,i,n,r){return t=32767*(t-i)*r,e=32767*(e-n)*r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Li(t){var e=t,i=t;do e.x<i.x&&(i=e),e=e.next;while(e!==t);return i}function Ri(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function Ii(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Ni(t,e)&&Bi(t,e)&&Bi(e,t)&&Gi(t,e)}function ki(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Oi(t,e){return t.x===e.x&&t.y===e.y}function Hi(t,e,i,n){return!!(Oi(t,e)&&Oi(i,n)||Oi(t,n)&&Oi(i,e))||ki(t,e,i)>0!=ki(t,e,n)>0&&ki(i,n,t)>0!=ki(i,n,e)>0}function Ni(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Hi(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Bi(t,e){return ki(t.prev,t,t.next)<0?ki(t,e,t.next)>=0&&ki(t,t.prev,e)>=0:ki(t,e,t.prev)<0||ki(t,t.next,e)<0}function Gi(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==t);return n}function Fi(t,e){var i=new Vi(t.i,t.x,t.y),n=new Vi(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function zi(t,e,i,n){var r=new Vi(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Ui(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Vi(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ji(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}function Wi(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Xi(t,e){for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}function qi(t,e){E.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Yi(t,e)),this.mergeVertices()}function Yi(t,e){function n(t){function n(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}function l(t,e,n){var r,o,s,a=t.x-e.x,l=t.y-e.y,h=n.x-t.x,c=n.y-t.y,u=a*a+l*l,d=a*c-l*h;if(Math.abs(d)>Number.EPSILON){var p=Math.sqrt(u),f=Math.sqrt(h*h+c*c),m=e.x-l/p,g=e.y+a/p,v=n.x-c/f,y=n.y+h/f,_=((v-m)*c-(y-g)*h)/(a*c-l*h);r=m+a*_-t.x,o=g+l*_-t.y;var b=r*r+o*o;if(b<=2)return new i(r,o);s=Math.sqrt(b/2)}else{var x=!1;a>Number.EPSILON?h>Number.EPSILON&&(x=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(x=!0):Math.sign(l)===Math.sign(c)&&(x=!0),x?(r=-l,o=a,s=Math.sqrt(u)):(r=a,o=l,s=Math.sqrt(u/2))}return new i(r/s,o/s)}function h(){var t=s.length/3;if(x){var e=0,i=Y*e;for(J=0;J<K;J++)q=F[J],p(q[2]+i,q[1]+i,q[0]+i);for(e=_+2*S,i=Y*e,J=0;J<K;J++)q=F[J],p(q[0]+i,q[1]+i,q[2]+i)}else{for(J=0;J<K;J++)q=F[J],p(q[2],q[1],q[0]);for(J=0;J<K;J++)q=F[J],p(q[0]+Y*_,q[1]+Y*_,q[2]+Y*_)}r.addGroup(t,s.length/3-t,0)}function c(){var t=s.length/3,e=0;for(u(z,e),e+=z.length,k=0,O=B.length;k<O;k++)I=B[k],u(I,e),e+=I.length;r.addGroup(t,s.length/3-t,1)}function u(t,e){var i,n;for(J=t.length;--J>=0;){i=J,n=J-1,n<0&&(n=t.length-1);var r=0,o=_+2*S;for(r=0;r<o;r++){var s=Y*r,a=Y*(r+1),l=e+i+s,h=e+n+s,c=e+n+a,u=e+i+a;f(l,h,c,u)}}}function d(t,e,i){v.push(t),v.push(e),v.push(i)}function p(t,e,i){m(t),m(e),m(i);var n=s.length/3,o=E.generateTopUV(r,s,n-3,n-2,n-1);g(o[0]),g(o[1]),g(o[2])}function f(t,e,i,n){m(t),m(e),m(n),m(e),m(i),m(n);var o=s.length/3,a=E.generateSideWallUV(r,s,o-6,o-3,o-2,o-1);g(a[0]),g(a[1]),g(a[3]),g(a[1]),g(a[2]),g(a[3])}function m(t){s.push(v[3*t+0]),s.push(v[3*t+1]),s.push(v[3*t+2])}function g(t){a.push(t.x),a.push(t.y)}var v=[],y=void 0!==e.curveSegments?e.curveSegments:12,_=void 0!==e.steps?e.steps:1,b=void 0!==e.depth?e.depth:100,x=void 0===e.bevelEnabled||e.bevelEnabled,w=void 0!==e.bevelThickness?e.bevelThickness:6,T=void 0!==e.bevelSize?e.bevelSize:w-2,S=void 0!==e.bevelSegments?e.bevelSegments:3,M=e.extrudePath,E=void 0!==e.UVGenerator?e.UVGenerator:Du;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),b=e.amount);var A,C,P,D,L,R=!1;M&&(A=M.getSpacedPoints(_),R=!0,x=!1,C=M.computeFrenetFrames(_,!1),P=new o,D=new o,L=new o),x||(S=0,w=0,T=0);var I,k,O,H=t.extractPoints(y),N=H.shape,B=H.holes,G=!Pu.isClockWise(N);if(G)for(N=N.reverse(),k=0,O=B.length;k<O;k++)I=B[k],Pu.isClockWise(I)&&(B[k]=I.reverse());var F=Pu.triangulateShape(N,B),z=N;for(k=0,O=B.length;k<O;k++)I=B[k],N=N.concat(I);for(var U,V,j,W,X,q,Y=N.length,K=F.length,Z=[],J=0,Q=z.length,$=Q-1,tt=J+1;J<Q;J++,$++,tt++)$===Q&&($=0),tt===Q&&(tt=0),Z[J]=l(z[J],z[$],z[tt]);var et,it=[],nt=Z.concat();for(k=0,O=B.length;k<O;k++){for(I=B[k],et=[],J=0,Q=I.length,$=Q-1,tt=J+1;J<Q;J++,$++,tt++)$===Q&&($=0),tt===Q&&(tt=0),et[J]=l(I[J],I[$],I[tt]);it.push(et),nt=nt.concat(et)}for(U=0;U<S;U++){for(j=U/S,W=w*Math.cos(j*Math.PI/2),V=T*Math.sin(j*Math.PI/2),J=0,Q=z.length;J<Q;J++)X=n(z[J],Z[J],V),d(X.x,X.y,-W);for(k=0,O=B.length;k<O;k++)for(I=B[k],et=it[k],J=0,Q=I.length;J<Q;J++)X=n(I[J],et[J],V),d(X.x,X.y,-W)}for(V=T,J=0;J<Y;J++)X=x?n(N[J],nt[J],V):N[J],R?(D.copy(C.normals[0]).multiplyScalar(X.x),P.copy(C.binormals[0]).multiplyScalar(X.y),L.copy(A[0]).add(D).add(P),d(L.x,L.y,L.z)):d(X.x,X.y,0);var rt;for(rt=1;rt<=_;rt++)for(J=0;J<Y;J++)X=x?n(N[J],nt[J],V):N[J],R?(D.copy(C.normals[rt]).multiplyScalar(X.x),P.copy(C.binormals[rt]).multiplyScalar(X.y),L.copy(A[rt]).add(D).add(P),d(L.x,L.y,L.z)):d(X.x,X.y,b/_*rt);for(U=S-1;U>=0;U--){for(j=U/S,W=w*Math.cos(j*Math.PI/2),V=T*Math.sin(j*Math.PI/2),J=0,Q=z.length;J<Q;J++)X=n(z[J],Z[J],V),d(X.x,X.y,b+W);for(k=0,O=B.length;k<O;k++)for(I=B[k],et=it[k],J=0,Q=I.length;J<Q;J++)X=n(I[J],et[J],V),R?d(X.x,X.y+A[_-1].y,A[_-1].x+W):d(X.x,X.y,b+W)}h(),c()}G.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var r=this,s=[],a=[],l=0,h=t.length;l<h;l++){var c=t[l];n(c)}this.addAttribute("position",new O(s,3)),this.addAttribute("uv",new O(a,2)),this.computeVertexNormals()}function Ki(t,e,i){if(i.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var o=t[n];i.shapes.push(o.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}function Zi(t,e){E.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Ji(t,e)),this.mergeVertices()}function Ji(t,e){e=e||{};var i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new E;var n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Yi.call(this,n,e),this.type="TextBufferGeometry"}function Qi(t,e,i,n,r,o,s){E.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new $i(t,e,i,n,r,o,s)),this.mergeVertices()}function $i(t,e,i,n,r,s,a){G.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI,s=void 0!==s?s:0,a=void 0!==a?a:Math.PI;var l,h,c=s+a,u=0,d=[],p=new o,f=new o,m=[],g=[],v=[],y=[];for(h=0;h<=i;h++){var _=[],b=h/i;for(l=0;l<=e;l++){var x=l/e;p.x=-t*Math.cos(n+x*r)*Math.sin(s+b*a),p.y=t*Math.cos(s+b*a),p.z=t*Math.sin(n+x*r)*Math.sin(s+b*a),g.push(p.x,p.y,p.z),f.set(p.x,p.y,p.z).normalize(),v.push(f.x,f.y,f.z),y.push(x,1-b),_.push(u++)}d.push(_)}for(h=0;h<i;h++)for(l=0;l<e;l++){var w=d[h][l+1],T=d[h][l],S=d[h+1][l],M=d[h+1][l+1];(0!==h||s>0)&&m.push(w,T,M),(h!==i-1||c<Math.PI)&&m.push(T,S,M)}this.setIndex(m),this.addAttribute("position",new O(g,3)),this.addAttribute("normal",new O(v,3)),this.addAttribute("uv",new O(y,2))}function tn(t,e,i,n,r,o){E.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new en(t,e,i,n,r,o)),this.mergeVertices()}function en(t,e,n,r,s,a){G.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:s,thetaLength:a},t=t||.5,e=e||1,s=void 0!==s?s:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):1;var l,h,c,u=[],d=[],p=[],f=[],m=t,g=(e-t)/r,v=new o,y=new i;for(h=0;h<=r;h++){for(c=0;c<=n;c++)l=s+c/n*a,v.x=m*Math.cos(l),v.y=m*Math.sin(l),d.push(v.x,v.y,v.z),p.push(0,0,1),y.x=(v.x/e+1)/2,y.y=(v.y/e+1)/2,f.push(y.x,y.y);m+=g}for(h=0;h<r;h++){var _=h*(n+1);for(c=0;c<n;c++){l=c+_;var b=l,x=l+n+1,w=l+n+2,T=l+1;u.push(b,x,T),u.push(x,w,T)}}this.setIndex(u),this.addAttribute("position",new O(d,3)),this.addAttribute("normal",new O(p,3)),this.addAttribute("uv",new O(f,2))}function nn(t,e,i,n){E.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new rn(t,e,i,n)),this.mergeVertices()}function rn(t,e,n,r){G.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=jl.clamp(r,0,2*Math.PI);var s,a,l,h=[],c=[],u=[],d=1/e,p=new o,f=new i;for(a=0;a<=e;a++){var m=n+a*d*r,g=Math.sin(m),v=Math.cos(m);for(l=0;l<=t.length-1;l++)p.x=t[l].x*g,p.y=t[l].y,p.z=t[l].x*v,c.push(p.x,p.y,p.z),f.x=a/e,f.y=l/(t.length-1),u.push(f.x,f.y)}for(a=0;a<e;a++)for(l=0;l<t.length-1;l++){s=l+a*t.length;var y=s,_=s+t.length,b=s+t.length+1,x=s+1;h.push(y,_,x),h.push(_,b,x)}if(this.setIndex(h),this.addAttribute("position",new O(c,3)),this.addAttribute("uv",new O(u,2)),this.computeVertexNormals(),r===2*Math.PI){var w=this.attributes.normal.array,T=new o,S=new o,M=new o;for(s=e*t.length*3,a=0,l=0;a<t.length;a++,l+=3)T.x=w[l+0],T.y=w[l+1],T.z=w[l+2],S.x=w[s+l+0],S.y=w[s+l+1],S.z=w[s+l+2],M.addVectors(T,S).normalize(),w[l+0]=w[s+l+0]=M.x,w[l+1]=w[s+l+1]=M.y,w[l+2]=w[s+l+2]=M.z}}function on(t,e){E.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new sn(t,e)),this.mergeVertices()}function sn(t,e){function i(t){var i,a,h,c=r.length/3,u=t.extractPoints(e),d=u.shape,p=u.holes;for(Pu.isClockWise(d)===!1&&(d=d.reverse()),i=0,a=p.length;i<a;i++)h=p[i],Pu.isClockWise(h)===!0&&(p[i]=h.reverse());var f=Pu.triangulateShape(d,p);for(i=0,a=p.length;i<a;i++)h=p[i],d=d.concat(h);for(i=0,a=d.length;i<a;i++){var m=d[i];r.push(m.x,m.y,0),o.push(0,0,1),s.push(m.x,m.y)}for(i=0,a=f.length;i<a;i++){var g=f[i],v=g[0]+c,y=g[1]+c,_=g[2]+c;n.push(v,y,_),l+=3}}G.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],o=[],s=[],a=0,l=0;if(Array.isArray(t)===!1)i(t);else for(var h=0;h<t.length;h++)i(t[h]),this.addGroup(a,l,h),a+=l,l=0;this.setIndex(n),this.addAttribute("position",new O(r,3)),this.addAttribute("normal",new O(o,3)),this.addAttribute("uv",new O(s,2))}function an(t,e){if(e.shapes=[],Array.isArray(t))for(var i=0,n=t.length;i<n;i++){var r=t[i];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function ln(t,e){G.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var i,n,r,o,s=[],a=Math.cos(jl.DEG2RAD*e),l=[0,0],h={},c=["a","b","c"];t.isBufferGeometry?(o=new E,o.fromBufferGeometry(t)):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var u=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)i=m[c[g]],n=m[c[(g+1)%3]],l[0]=Math.min(i,n),l[1]=Math.max(i,n),r=l[0]+","+l[1],void 0===h[r]?h[r]={index1:l[0],index2:l[1],face1:p,face2:void 0}:h[r].face2=p;for(r in h){var v=h[r];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=a){var y=u[v.index1];s.push(y.x,y.y,y.z),y=u[v.index2],s.push(y.x,y.y,y.z)}}this.addAttribute("position",new O(s,3))}function hn(t,e,i,n,r,o,s,a){E.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a},this.fromBufferGeometry(new cn(t,e,i,n,r,o,s,a)),this.mergeVertices()}function cn(t,e,n,r,s,a,l,h){function c(){var i,a,c=new o,u=new o,x=0,w=(e-t)/n;for(a=0;a<=s;a++){var T=[],S=a/s,M=S*(e-t)+t;for(i=0;i<=r;i++){var E=i/r,A=E*h+l,C=Math.sin(A),P=Math.cos(A);u.x=M*C,u.y=-S*n+_,u.z=M*P,f.push(u.x,u.y,u.z),c.set(C,w,P).normalize(),m.push(c.x,c.y,c.z),g.push(E,1-S),T.push(v++)}y.push(T)}for(i=0;i<r;i++)for(a=0;a<s;a++){var D=y[a][i],L=y[a+1][i],R=y[a+1][i+1],I=y[a][i+1];p.push(D,L,I),p.push(L,R,I),x+=6}d.addGroup(b,x,0),b+=x}function u(n){var s,a,c,u=new i,y=new o,x=0,w=n===!0?t:e,T=n===!0?1:-1;for(a=v,s=1;s<=r;s++)f.push(0,_*T,0),m.push(0,T,0),g.push(.5,.5),v++;for(c=v,s=0;s<=r;s++){var S=s/r,M=S*h+l,E=Math.cos(M),A=Math.sin(M);y.x=w*A,y.y=_*T,y.z=w*E,f.push(y.x,y.y,y.z),m.push(0,T,0),u.x=.5*E+.5,u.y=.5*A*T+.5,g.push(u.x,u.y),v++}for(s=0;s<r;s++){var C=a+s,P=c+s;n===!0?p.push(P,P+1,C):p.push(P+1,P,C),x+=3}d.addGroup(b,x,n===!0?1:2),b+=x}G.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:l,thetaLength:h};var d=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,s=Math.floor(s)||1,a=void 0!==a&&a,l=void 0!==l?l:0,h=void 0!==h?h:2*Math.PI;var p=[],f=[],m=[],g=[],v=0,y=[],_=n/2,b=0;c(),a===!1&&(t>0&&u(!0),e>0&&u(!1)),this.setIndex(p),this.addAttribute("position",new O(f,3)),this.addAttribute("normal",new O(m,3)),this.addAttribute("uv",new O(g,2))}function un(t,e,i,n,r,o,s){hn.call(this,0,t,e,i,n,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function dn(t,e,i,n,r,o,s){cn.call(this,0,t,e,i,n,r,o,s),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function pn(t,e,i,n){E.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new fn(t,e,i,n)),this.mergeVertices()}function fn(t,e,n,r){G.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var s,a,l=[],h=[],c=[],u=[],d=new o,p=new i;
for(h.push(0,0,0),c.push(0,0,1),u.push(.5,.5),a=0,s=3;a<=e;a++,s+=3){var f=n+a/e*r;d.x=t*Math.cos(f),d.y=t*Math.sin(f),h.push(d.x,d.y,d.z),c.push(0,0,1),p.x=(h[s]/t+1)/2,p.y=(h[s+1]/t+1)/2,u.push(p.x,p.y)}for(s=1;s<=e;s++)l.push(s,s+1,0);this.setIndex(l),this.addAttribute("position",new O(h,3)),this.addAttribute("normal",new O(c,3)),this.addAttribute("uv",new O(u,2))}function mn(t){j.call(this),this.type="ShadowMaterial",this.color=new _(0),this.transparent=!0,this.setValues(t)}function gn(t){W.call(this,t),this.type="RawShaderMaterial"}function vn(t){j.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function yn(t){vn.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function _n(t){j.call(this),this.type="MeshPhongMaterial",this.color=new _(16777215),this.specular=new _(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function bn(t){_n.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function xn(t){j.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function wn(t){j.call(this),this.type="MeshLambertMaterial",this.color=new _(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ra,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Tn(t){j.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ul,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function Sn(t){Ue.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Mn(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function En(t,e,i,n){Mn.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function An(t,e,i,n){Mn.call(this,t,e,i,n)}function Cn(t,e,i,n){Mn.call(this,t,e,i,n)}function Pn(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Iu.convertArray(e,this.TimeBufferType),this.values=Iu.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function Dn(t,e,i){Pn.call(this,t,e,i)}function Ln(t,e,i,n){Pn.call(this,t,e,i,n)}function Rn(t,e,i,n){Pn.call(this,t,e,i,n)}function In(t,e,i,n){Mn.call(this,t,e,i,n)}function kn(t,e,i,n){Pn.call(this,t,e,i,n)}function On(t,e,i,n){Pn.call(this,t,e,i,n)}function Hn(t,e,i,n){Pn.call(this,t,e,i,n)}function Nn(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=jl.generateUUID(),this.duration<0&&this.resetDuration()}function Bn(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Rn;case"vector":case"vector2":case"vector3":case"vector4":return Hn;case"color":return Ln;case"quaternion":return kn;case"bool":case"boolean":return Dn;case"string":return On}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function Gn(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=Bn(t.type);if(void 0===t.times){var i=[],n=[];Iu.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}function Fn(t,e,i){var n=this,r=!1,o=0,s=0,a=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){s++,r===!1&&void 0!==n.onStart&&n.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,s),o===s&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this}}function zn(t){this.manager=void 0!==t?t:Ou}function Un(t){this.manager=void 0!==t?t:Ou}function Vn(t){this.manager=void 0!==t?t:Ou,this._parser=null}function jn(t){this.manager=void 0!==t?t:Ou,this._parser=null}function Wn(t){this.manager=void 0!==t?t:Ou}function Xn(t){this.manager=void 0!==t?t:Ou}function qn(t){this.manager=void 0!==t?t:Ou}function Yn(){this.type="Curve",this.arcLengthDivisions=200}function Kn(t,e,i,n,r,o,s,a){Yn.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function Zn(t,e,i,n,r,o){Kn.call(this,t,e,i,i,n,r,o),this.type="ArcCurve"}function Jn(){function t(t,o,s,a){e=t,i=s,n=-3*t+3*o-2*s-a,r=2*t-2*o+s+a}var e=0,i=0,n=0,r=0;return{initCatmullRom:function(e,i,n,r,o){t(i,n,o*(n-e),o*(r-i))},initNonuniformCatmullRom:function(e,i,n,r,o,s,a){var l=(i-e)/o-(n-e)/(o+s)+(n-i)/s,h=(n-i)/s-(r-i)/(s+a)+(r-n)/a;l*=s,h*=s,t(i,n,l,h)},calc:function(t){var o=t*t,s=o*t;return e+i*t+n*o+r*s}}}function Qn(t,e,i,n){Yn.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=i||"centripetal",this.tension=n||.5}function $n(t,e,i,n,r){var o=.5*(n-e),s=.5*(r-i),a=t*t,l=t*a;return(2*i-2*n+o+s)*l+(-3*i+3*n-2*o-s)*a+o*t+i}function tr(t,e){var i=1-t;return i*i*e}function er(t,e){return 2*(1-t)*t*e}function ir(t,e){return t*t*e}function nr(t,e,i,n){return tr(t,e)+er(t,i)+ir(t,n)}function rr(t,e){var i=1-t;return i*i*i*e}function or(t,e){var i=1-t;return 3*i*i*t*e}function sr(t,e){return 3*(1-t)*t*t*e}function ar(t,e){return t*t*t*e}function lr(t,e,i,n,r){return rr(t,e)+or(t,i)+sr(t,n)+ar(t,r)}function hr(t,e,n,r){Yn.call(this),this.type="CubicBezierCurve",this.v0=t||new i,this.v1=e||new i,this.v2=n||new i,this.v3=r||new i}function cr(t,e,i,n){Yn.call(this),this.type="CubicBezierCurve3",this.v0=t||new o,this.v1=e||new o,this.v2=i||new o,this.v3=n||new o}function ur(t,e){Yn.call(this),this.type="LineCurve",this.v1=t||new i,this.v2=e||new i}function dr(t,e){Yn.call(this),this.type="LineCurve3",this.v1=t||new o,this.v2=e||new o}function pr(t,e,n){Yn.call(this),this.type="QuadraticBezierCurve",this.v0=t||new i,this.v1=e||new i,this.v2=n||new i}function fr(t,e,i){Yn.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new o,this.v1=e||new o,this.v2=i||new o}function mr(t){Yn.call(this),this.type="SplineCurve",this.points=t||[]}function gr(){Yn.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function vr(t){gr.call(this),this.type="Path",this.currentPoint=new i,t&&this.setFromPoints(t)}function yr(t){vr.call(this,t),this.uuid=jl.generateUUID(),this.type="Shape",this.holes=[]}function _r(t,e){M.call(this),this.type="Light",this.color=new _(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function br(t,e,i){_r.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(M.DefaultUp),this.updateMatrix(),this.groundColor=new _(e)}function xr(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new n}function wr(){xr.call(this,new Me(50,1,.5,500))}function Tr(t,e,i,n,r,o){_r.call(this,t,e),this.type="SpotLight",this.position.copy(M.DefaultUp),this.updateMatrix(),this.target=new M,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new wr}function Sr(t,e,i,n){_r.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new xr(new Me(90,1,.5,500))}function Mr(t,e,i,n,r,o){Se.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==i?i:1,this.bottom=void 0!==n?n:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Er(){xr.call(this,new Mr((-5),5,5,(-5),.5,500))}function Ar(t,e){_r.call(this,t,e),this.type="DirectionalLight",this.position.copy(M.DefaultUp),this.updateMatrix(),this.target=new M,this.shadow=new Er}function Cr(t,e){_r.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Pr(t,e,i,n){_r.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function Dr(t){this.manager=void 0!==t?t:Ou,this.textures={}}function Lr(t){this.manager=void 0!==t?t:Ou}function Rr(t){this.manager=void 0!==t?t:Ou,this.resourcePath=""}function Ir(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==t?t:Ou,this.options=void 0}function kr(){this.type="ShapePath",this.color=new _,this.subPaths=[],this.currentPath=null}function Or(t){this.type="Font",this.data=t}function Hr(t,e,i){for(var n=Array.from?Array.from(t):String(t).split(""),r=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,s=[],a=0,l=0,h=0;h<n.length;h++){var c=n[h];if("\n"===c)a=0,l-=o;else{var u=Nr(c,r,a,l,i);a+=u.offsetX,s.push(u.path)}}return s}function Nr(t,e,i,n,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var s,a,l,h,c,u,d,p,f=new kr;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,v=m.length;g<v;){var y=m[g++];switch(y){case"m":s=m[g++]*e+i,a=m[g++]*e+n,f.moveTo(s,a);break;case"l":s=m[g++]*e+i,a=m[g++]*e+n,f.lineTo(s,a);break;case"q":l=m[g++]*e+i,h=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,f.quadraticCurveTo(c,u,l,h);break;case"b":l=m[g++]*e+i,h=m[g++]*e+n,c=m[g++]*e+i,u=m[g++]*e+n,d=m[g++]*e+i,p=m[g++]*e+n,f.bezierCurveTo(c,u,d,p,l,h)}}return{offsetX:o.ha*e,path:f}}}function Br(t){this.manager=void 0!==t?t:Ou}function Gr(){}function Fr(t){this.manager=void 0!==t?t:Ou}function zr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Me,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Me,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Ur(t,e,i,n){M.call(this),this.type="CubeCamera";var r=90,s=1,a=new Me(r,s,t,e);a.up.set(0,-1,0),a.lookAt(new o(1,0,0)),this.add(a);var l=new Me(r,s,t,e);l.up.set(0,-1,0),l.lookAt(new o((-1),0,0)),this.add(l);var h=new Me(r,s,t,e);h.up.set(0,0,1),h.lookAt(new o(0,1,0)),this.add(h);var c=new Me(r,s,t,e);c.up.set(0,0,-1),c.lookAt(new o(0,(-1),0)),this.add(c);var d=new Me(r,s,t,e);d.up.set(0,-1,0),d.lookAt(new o(0,0,1)),this.add(d);var p=new Me(r,s,t,e);p.up.set(0,-1,0),p.lookAt(new o(0,0,(-1))),this.add(p),n=n||{format:Va,magFilter:Aa,minFilter:Aa},this.renderTarget=new u(i,i,n),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var i=t.getRenderTarget(),n=this.renderTarget,r=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,a,n),n.activeCubeFace=1,t.render(e,l,n),n.activeCubeFace=2,t.render(e,h,n),n.activeCubeFace=3,t.render(e,c,n),n.activeCubeFace=4,t.render(e,d,n),n.texture.generateMipmaps=r,n.activeCubeFace=5,t.render(e,p,n),t.setRenderTarget(i)},this.clear=function(t,e,i,n){for(var r=t.getRenderTarget(),o=this.renderTarget,s=0;s<6;s++)o.activeCubeFace=s,t.setRenderTarget(o),t.clear(e,i,n);t.setRenderTarget(r)}}function Vr(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function jr(){M.call(this),this.type="AudioListener",this.context=Yu.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function Wr(t){M.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Xr(t){Wr.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function qr(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Yr(t,e,i){this.binding=t,this.valueSize=i;var n,r=Float64Array;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":r=Array,n=this._select;break;default:n=this._lerp}this.buffer=new r(4*i),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Kr(t,e,i){var n=i||Zr.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Zr(t,e,i){this.path=e,this.parsedPath=i||Zr.parseTrackName(e),this.node=Zr.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Jr(){this.uuid=jl.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function Qr(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null;for(var n=e.tracks,r=n.length,o=new Array(r),s={endingStart:El,endingEnd:El},a=0;a!==r;++a){var l=n[a].createInterpolant(null);o[a]=l,l.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=xl,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function $r(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function to(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function eo(){G.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function io(t,e,i){ke.call(this,t,e),this.meshPerAttribute=i||1}function no(t,e,i,n){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),A.call(this,t,e,i),this.meshPerAttribute=n||1}function ro(t,e,i,n){this.ray=new X(t,e),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function oo(t,e){return t.distance-e.distance}function so(t,e,i,n){if(t.visible!==!1&&(t.raycast(e,i),n===!0))for(var r=t.children,o=0,s=r.length;o<s;o++)so(r[o],e,i,!0)}function ao(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}function lo(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}function ho(t,e){this.min=void 0!==t?t:new i((+(1/0)),(+(1/0))),this.max=void 0!==e?e:new i((-(1/0)),(-(1/0)))}function co(t,e){this.start=void 0!==t?t:new o,this.end=void 0!==e?e:new o}function uo(t){M.call(this),this.material=t,this.render=function(){}}function po(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16711680,o=void 0!==n?n:1,s=0,a=this.object.geometry;a&&a.isGeometry?s=3*a.faces.length:a&&a.isBufferGeometry&&(s=a.attributes.normal.count);var l=new G,h=new O(2*s*3,3);l.addAttribute("position",h),je.call(this,l,new Ue({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function fo(t,e){M.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var i=new G,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1,s=32;r<s;r++,o++){var a=r/s*Math.PI*2,l=o/s*Math.PI*2;n.push(Math.cos(a),Math.sin(a),1,Math.cos(l),Math.sin(l),1)}i.addAttribute("position",new O(n,3));var h=new Ue({fog:!1});this.cone=new je(i,h),this.add(this.cone),this.update()}function mo(t){var e=[];t&&t.isBone&&e.push(t);for(var i=0;i<t.children.length;i++)e.push.apply(e,mo(t.children[i]));return e}function go(t){for(var e=mo(t),i=new G,n=[],r=[],o=new _(0,0,1),s=new _(0,1,0),a=0;a<e.length;a++){var l=e[a];l.parent&&l.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}i.addAttribute("position",new O(n,3)),i.addAttribute("color",new O(r,3));var h=new Ue({vertexColors:As,depthTest:!1,depthWrite:!1,transparent:!0});je.call(this,i,h),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function vo(t,e,i){this.light=t,this.light.updateMatrixWorld(),this.color=i;var n=new $i(e,4,2),r=new Y({wireframe:!0,fog:!1});K.call(this,n,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function yo(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var i=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],n=new G;n.addAttribute("position",new O(i,3)),n.computeBoundingSphere();var r=new Ue({fog:!1});Ve.call(this,n,r);var o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],s=new G;s.addAttribute("position",new O(o,3)),s.computeBoundingSphere(),this.add(new K(s,new Y({side:xs,fog:!1}))),this.update()}function _o(t,e,i){M.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;var n=new si(e);n.rotateY(.5*Math.PI),this.material=new Y({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=As);var r=n.getAttribute("position"),o=new Float32Array(3*r.count);n.addAttribute("color",new A(o,3)),this.add(new K(n,this.material)),this.update()}function bo(t,e,i,n){t=t||10,e=e||10,i=new _(void 0!==i?i:4473924),n=new _(void 0!==n?n:8947848);for(var r=e/2,o=t/e,s=t/2,a=[],l=[],h=0,c=0,u=-s;h<=e;h++,u+=o){a.push(-s,0,u,s,0,u),a.push(u,0,-s,u,0,s);var d=h===r?i:n;d.toArray(l,c),c+=3,d.toArray(l,c),c+=3,d.toArray(l,c),c+=3,d.toArray(l,c),c+=3}var p=new G;p.addAttribute("position",new O(a,3)),p.addAttribute("color",new O(l,3));var f=new Ue({vertexColors:As});je.call(this,p,f)}function xo(t,e,i,n,r,o){t=t||10,e=e||16,i=i||8,n=n||64,r=new _(void 0!==r?r:4473924),o=new _(void 0!==o?o:8947848);var s,a,l,h,c,u,d,p=[],f=[];for(h=0;h<=e;h++)l=h/e*(2*Math.PI),s=Math.sin(l)*t,a=Math.cos(l)*t,p.push(0,0,0),p.push(s,0,a),d=1&h?r:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(h=0;h<=i;h++)for(d=1&h?r:o,u=t-t/i*h,c=0;c<n;c++)l=c/n*(2*Math.PI),s=Math.sin(l)*u,a=Math.cos(l)*u,p.push(s,0,a),f.push(d.r,d.g,d.b),l=(c+1)/n*(2*Math.PI),s=Math.sin(l)*u,a=Math.cos(l)*u,p.push(s,0,a),f.push(d.r,d.g,d.b);var m=new G;m.addAttribute("position",new O(p,3)),m.addAttribute("color",new O(f,3));var g=new Ue({vertexColors:As});je.call(this,m,g)}function wo(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16776960,o=void 0!==n?n:1,s=0,a=this.object.geometry;a&&a.isGeometry?s=a.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var l=new G,h=new O(2*s*3,3);l.addAttribute("position",h),je.call(this,l,new Ue({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function To(t,e,i){M.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);var n=new G;n.addAttribute("position",new O([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new Ue({fog:!1});this.lightPlane=new Ve(n,r),this.add(this.lightPlane),n=new G,n.addAttribute("position",new O([0,0,0,0,0,1],3)),this.targetLine=new Ve(n,r),this.add(this.targetLine),this.update()}function So(t){function e(t,e,n){i(t,n),i(e,n)}function i(t,e){o.push(0,0,0),s.push(e.r,e.g,e.b),void 0===a[t]&&(a[t]=[]),a[t].push(o.length/3-1)}var n=new G,r=new Ue({color:16777215,vertexColors:Es}),o=[],s=[],a={},l=new _(16755200),h=new _(16711680),c=new _(43775),u=new _(16777215),d=new _(3355443);e("n1","n2",l),e("n2","n4",l),e("n4","n3",l),e("n3","n1",l),e("f1","f2",l),e("f2","f4",l),e("f4","f3",l),e("f3","f1",l),e("n1","f1",l),e("n2","f2",l),e("n3","f3",l),e("n4","f4",l),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",c),e("u2","u3",c),e("u3","u1",c),e("c","t",u),e("p","c",d),e("cn1","cn2",d),e("cn3","cn4",d),e("cf1","cf2",d),e("cf3","cf4",d),n.addAttribute("position",new O(o,3)),n.addAttribute("color",new O(s,3)),je.call(this,n,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function Mo(t,e){this.object=t,void 0===e&&(e=16776960);var i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new G;r.setIndex(new A(i,1)),r.addAttribute("position",new A(n,3)),je.call(this,r,new Ue({color:e})),this.matrixAutoUpdate=!1,this.update()}function Eo(t,e){this.type="Box3Helper",this.box=t;var i=void 0!==e?e:16776960,n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],o=new G;o.setIndex(new A(n,1)),o.addAttribute("position",new O(r,3)),je.call(this,o,new Ue({color:i})),this.geometry.computeBoundingSphere()}function Ao(t,e,i){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var n=void 0!==i?i:16776960,r=[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,0,1,0,0,0],o=new G;o.addAttribute("position",new O(r,3)),o.computeBoundingSphere(),Ve.call(this,o,new Ue({color:n}));var s=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],a=new G;a.addAttribute("position",new O(s,3)),a.computeBoundingSphere(),this.add(new K(a,new Y({color:n,opacity:.2,transparent:!0,depthWrite:!1})))}function Co(t,e,i,n,r,s){M.call(this),void 0===t&&(t=new o(0,0,1)),void 0===e&&(e=new o(0,0,0)),void 0===i&&(i=1),void 0===n&&(n=16776960),void 0===r&&(r=.2*i),void 0===s&&(s=.2*r),void 0===Zu&&(Zu=new G,Zu.addAttribute("position",new O([0,0,0,0,1,0],3)),Ju=new cn(0,.5,1,5,1),Ju.translate(0,-.5,0)),this.position.copy(e),this.line=new Ve(Zu,new Ue({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new K(Ju,new Y({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,s)}function Po(t){t=t||1;var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new G;n.addAttribute("position",new O(e,3)),n.addAttribute("color",new O(i,3));var r=new Ue({vertexColors:As});je.call(this,n,r)}function Do(t,e,i,n,r,o,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new w(t,e,i,r,o,s)}function Lo(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Ro(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Io(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new qe(t,e)}function ko(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Ne(t)}function Oo(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new qe(t,e)}function Ho(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Xe(t)}function No(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Xe(t)}function Bo(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Xe(t)}function Go(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new o(t,e,i)}function Fo(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new A(t,e).setDynamic(!0)}function zo(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new C(t,e)}function Uo(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new P(t,e)}function Vo(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new D(t,e)}function jo(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new L(t,e)}function Wo(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new R(t,e)}function Xo(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new I(t,e)}function qo(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new k(t,e)}function Yo(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new O(t,e)}function Ko(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new H(t,e)}function Zo(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Qn.call(this,t),this.type="catmullrom",this.closed=!0}function Jo(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Qn.call(this,t),this.type="catmullrom"}function Qo(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Qn.call(this,t),this.type="catmullrom"}function $o(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Po(t)}function ts(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Mo(t,e)}function es(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new je(new ln(t.geometry),new Ue({color:void 0!==e?e:16777215}))}function is(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new je(new Qe(t.geometry),new Ue({color:void 0!==e?e:16777215}))}function ns(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new zn(t)}function rs(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new jn(t)}function os(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function ss(){console.error("THREE.CanvasRenderer has been removed")}function as(){console.error("THREE.JSONLoader has been removed.")}function ls(){console.error("THREE.LensFlare has been moved to /examples/js/objects/Lensflare.js")}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&!function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(void 0!==n&&null!==n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}}(),Object.assign(e.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&i[t].indexOf(e)!==-1},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners,n=i[t];if(void 0!==n){var r=n.indexOf(e);r!==-1&&n.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,i=e[t.type];if(void 0!==i){t.target=this;for(var n=i.slice(0),r=0,o=n.length;r<o;r++)n[r].call(this,t)}}}});var hs="101",cs={LEFT:0,MIDDLE:1,RIGHT:2},us=0,ds=1,ps=2,fs=3,ms=0,gs=1,vs=0,ys=1,_s=2,bs=0,xs=1,ws=2,Ts=1,Ss=2,Ms=0,Es=1,As=2,Cs=0,Ps=1,Ds=2,Ls=3,Rs=4,Is=5,ks=100,Os=101,Hs=102,Ns=103,Bs=104,Gs=200,Fs=201,zs=202,Us=203,Vs=204,js=205,Ws=206,Xs=207,qs=208,Ys=209,Ks=210,Zs=0,Js=1,Qs=2,$s=3,ta=4,ea=5,ia=6,na=7,ra=0,oa=1,sa=2,aa=0,la=1,ha=2,ca=3,ua=4,da=5,pa=300,fa=301,ma=302,ga=303,va=304,ya=305,_a=306,ba=307,xa=1e3,wa=1001,Ta=1002,Sa=1003,Ma=1004,Ea=1005,Aa=1006,Ca=1007,Pa=1008,Da=1009,La=1010,Ra=1011,Ia=1012,ka=1013,Oa=1014,Ha=1015,Na=1016,Ba=1017,Ga=1018,Fa=1019,za=1020,Ua=1021,Va=1022,ja=1023,Wa=1024,Xa=1025,qa=ja,Ya=1026,Ka=1027,Za=1028,Ja=33776,Qa=33777,$a=33778,tl=33779,el=35840,il=35841,nl=35842,rl=35843,ol=36196,sl=37808,al=37809,ll=37810,hl=37811,cl=37812,ul=37813,dl=37814,pl=37815,fl=37816,ml=37817,gl=37818,vl=37819,yl=37820,_l=37821,bl=2200,xl=2201,wl=2202,Tl=2300,Sl=2301,Ml=2302,El=2400,Al=2401,Cl=2402,Pl=0,Dl=1,Ll=2,Rl=3e3,Il=3001,kl=3007,Ol=3002,Hl=3003,Nl=3004,Bl=3005,Gl=3006,Fl=3200,zl=3201,Ul=0,Vl=1,jl={
DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,o=t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&n|128]+t[n>>8&255]+"-"+t[n>>16&255]+t[n>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255];return o.toUpperCase()}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*(3-2*t))},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*t*(t*(6*t-15)+10))},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*jl.DEG2RAD},radToDeg:function(t){return t*jl.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(i.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t=new i,e=new i;return function(i,n){return t.set(i,i),e.set(n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}}),Object.assign(n.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,o,s,a,l,h,c,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new n).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(){var t=new o;return function(e){var i=this.elements,n=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),s=1/t.setFromMatrixColumn(e,2).length();return i[0]=n[0]*r,i[1]=n[1]*r,i[2]=n[2]*r,i[3]=0,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[7]=0,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){var u=o*h,d=o*c,p=s*h,f=s*c;e[0]=a*h,e[4]=-a*c,e[8]=l,e[1]=d+p*l,e[5]=u-f*l,e[9]=-s*a,e[2]=f-u*l,e[6]=p+d*l,e[10]=o*a}else if("YXZ"===t.order){var m=a*h,g=a*c,v=l*h,y=l*c;e[0]=m+y*s,e[4]=v*s-g,e[8]=o*l,e[1]=o*c,e[5]=o*h,e[9]=-s,e[2]=g*s-v,e[6]=y+m*s,e[10]=o*a}else if("ZXY"===t.order){var m=a*h,g=a*c,v=l*h,y=l*c;e[0]=m-y*s,e[4]=-o*c,e[8]=v+g*s,e[1]=g+v*s,e[5]=o*h,e[9]=y-m*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){var u=o*h,d=o*c,p=s*h,f=s*c;e[0]=a*h,e[4]=p*l-d,e[8]=u*l+f,e[1]=a*c,e[5]=f*l+u,e[9]=d*l-p,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){var _=o*a,b=o*l,x=s*a,w=s*l;e[0]=a*h,e[4]=w-_*c,e[8]=x*c+b,e[1]=c,e[5]=o*h,e[9]=-s*h,e[2]=-l*h,e[6]=b*c+x,e[10]=_-w*c}else if("XZY"===t.order){var _=o*a,b=o*l,x=s*a,w=s*l;e[0]=a*h,e[4]=-c,e[8]=l*h,e[1]=_*c+w,e[5]=o*h,e[9]=b*c-x,e[2]=x*c-b,e[6]=s*h,e[10]=w*c+_}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(){var t=new o(0,0,0),e=new o(1,1,1);return function(i){return this.compose(t,i,e)}}(),lookAt:function(){var t=new o,e=new o,i=new o;return function(n,r,o){var s=this.elements;return i.subVectors(n,r),0===i.lengthSq()&&(i.z=1),i.normalize(),t.crossVectors(o,i),0===t.lengthSq()&&(1===Math.abs(o.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),t.crossVectors(o,i)),t.normalize(),e.crossVectors(i,t),s[0]=t.x,s[4]=e.x,s[8]=i.x,s[1]=t.y,s[5]=e.y,s[9]=i.y,s[2]=t.z,s[6]=e.z,s[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],h=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],_=i[11],b=i[15],x=n[0],w=n[4],T=n[8],S=n[12],M=n[1],E=n[5],A=n[9],C=n[13],P=n[2],D=n[6],L=n[10],R=n[14],I=n[3],k=n[7],O=n[11],H=n[15];return r[0]=o*x+s*M+a*P+l*I,r[4]=o*w+s*E+a*D+l*k,r[8]=o*T+s*A+a*L+l*O,r[12]=o*S+s*C+a*R+l*H,r[1]=h*x+c*M+u*P+d*I,r[5]=h*w+c*E+u*D+d*k,r[9]=h*T+c*A+u*L+d*O,r[13]=h*S+c*C+u*R+d*H,r[2]=p*x+f*M+m*P+g*I,r[6]=p*w+f*E+m*D+g*k,r[10]=p*T+f*A+m*L+g*O,r[14]=p*S+f*C+m*R+g*H,r[3]=v*x+y*M+_*P+b*I,r[7]=v*w+y*E+_*D+b*k,r[11]=v*T+y*A+_*L+b*O,r[15]=v*S+y*C+_*R+b*H,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new o;return function(e){for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix4(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],h=t[2],c=t[6],u=t[10],d=t[14],p=t[3],f=t[7],m=t[11],g=t[15];return p*(+r*a*c-n*l*c-r*s*u+i*l*u+n*s*d-i*a*d)+f*(+e*a*d-e*l*u+r*o*u-n*o*d+n*l*h-r*a*h)+m*(+e*l*c-e*s*d-r*o*c+i*o*d+r*s*h-i*l*h)+g*(-n*s*h-e*a*c+e*s*u+n*o*c-i*o*u+i*a*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i=this.elements,n=t.elements,r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],h=n[5],c=n[6],u=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],_=n[15],b=p*y*u-v*f*u+v*c*m-h*y*m-p*c*_+h*f*_,x=g*f*u-d*y*u-g*c*m+l*y*m+d*c*_-l*f*_,w=d*v*u-g*p*u+g*h*m-l*v*m-d*h*_+l*p*_,T=g*p*c-d*v*c-g*h*f+l*v*f+d*h*y-l*p*y,S=r*b+o*x+s*w+a*T;if(0===S){var M="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(e===!0)throw new Error(M);return console.warn(M),this.identity()}var E=1/S;return i[0]=b*E,i[1]=(v*f*a-p*y*a-v*s*m+o*y*m+p*s*_-o*f*_)*E,i[2]=(h*y*a-v*c*a+v*s*u-o*y*u-h*s*_+o*c*_)*E,i[3]=(p*c*a-h*f*a-p*s*u+o*f*u+h*s*m-o*c*m)*E,i[4]=x*E,i[5]=(d*y*a-g*f*a+g*s*m-r*y*m-d*s*_+r*f*_)*E,i[6]=(g*c*a-l*y*a-g*s*u+r*y*u+l*s*_-r*c*_)*E,i[7]=(l*f*a-d*c*a+d*s*u-r*f*u-l*s*m+r*c*m)*E,i[8]=w*E,i[9]=(g*p*a-d*v*a-g*o*m+r*v*m+d*o*_-r*p*_)*E,i[10]=(l*v*a-g*h*a+g*o*u-r*v*u-l*o*_+r*h*_)*E,i[11]=(d*h*a-l*p*a-d*o*u+r*p*u+l*o*m-r*h*m)*E,i[12]=T*E,i[13]=(d*v*s-g*p*s+g*o*f-r*v*f-d*o*y+r*p*y)*E,i[14]=(g*h*s-l*v*s-g*o*c+r*v*c+l*o*y-r*h*y)*E,i[15]=(l*p*s-d*h*s+d*o*c-r*p*c-l*o*f+r*h*f)*E,this},scale:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,s=t.y,a=t.z,l=r*o,h=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,h*s+i,h*a-n*o,0,l*a-n*s,h*a+n*o,r*a*a+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){var n=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,h=o+o,c=s+s,u=r*l,d=r*h,p=r*c,f=o*h,m=o*c,g=s*c,v=a*l,y=a*h,_=a*c,b=i.x,x=i.y,w=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+_)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-_)*x,n[5]=(1-(u+g))*x,n[6]=(m+v)*x,n[7]=0,n[8]=(p+y)*w,n[9]=(m-v)*w,n[10]=(1-(u+f))*w,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(){var t=new o,e=new n;return function(i,n,r){var o=this.elements,s=t.set(o[0],o[1],o[2]).length(),a=t.set(o[4],o[5],o[6]).length(),l=t.set(o[8],o[9],o[10]).length(),h=this.determinant();h<0&&(s=-s),i.x=o[12],i.y=o[13],i.z=o[14],e.copy(this);var c=1/s,u=1/a,d=1/l;return e.elements[0]*=c,e.elements[1]*=c,e.elements[2]*=c,e.elements[4]*=u,e.elements[5]*=u,e.elements[6]*=u,e.elements[8]*=d,e.elements[9]*=d,e.elements[10]*=d,n.setFromRotationMatrix(e),r.x=s,r.y=a,r.z=l,this}}(),makePerspective:function(t,e,i,n,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var s=this.elements,a=2*r/(e-t),l=2*r/(i-n),h=(e+t)/(e-t),c=(i+n)/(i-n),u=-(o+r)/(o-r),d=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=h,s[12]=0,s[1]=0,s[5]=l,s[9]=c,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,e,i,n,r,o){var s=this.elements,a=1/(e-t),l=1/(i-n),h=1/(o-r),c=(e+t)*a,u=(i+n)*l,d=(o+r)*h;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-c,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*h,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}),Object.assign(r,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,o,s){var a=i[n+0],l=i[n+1],h=i[n+2],c=i[n+3],u=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(c!==f||a!==u||l!==d||h!==p){var m=1-s,g=a*u+l*d+h*p+c*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var _=Math.sqrt(y),b=Math.atan2(_,g*v);m=Math.sin(m*b)/_,s=Math.sin(s*b)/_}var x=s*v;if(a=a*m+u*x,l=l*m+d*x,h=h*m+p*x,c=c*m+f*x,m===1-s){var w=1/Math.sqrt(a*a+l*l+h*h+c*c);a*=w,l*=w,h*=w,c*=w}}t[e]=a,t[e+1]=l,t[e+2]=h,t[e+3]=c}}),Object.defineProperties(r.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(r.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=t._x,n=t._y,r=t._z,o=t.order,s=Math.cos,a=Math.sin,l=s(i/2),h=s(n/2),c=s(r/2),u=a(i/2),d=a(n/2),p=a(r/2);return"XYZ"===o?(this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p):"YXZ"===o?(this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p):"ZXY"===o?(this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p):"ZYX"===o?(this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p):"YZX"===o?(this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p):"XZY"===o&&(this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p),e!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,n=i[0],r=i[4],o=i[8],s=i[1],a=i[5],l=i[9],h=i[2],c=i[6],u=i[10],d=n+a+u;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(c-l)*e,this._y=(o-h)*e,this._z=(s-r)*e):n>a&&n>u?(e=2*Math.sqrt(1+n-a-u),this._w=(c-l)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(o+h)/e):a>u?(e=2*Math.sqrt(1+a-n-u),this._w=(o-h)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(l+c)/e):(e=2*Math.sqrt(1+u-n-a),this._w=(s-r)/e,this._x=(o+h)/e,this._y=(l+c)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new o,i=1e-6;return function(n,r){return void 0===e&&(e=new o),t=n.dot(r)+1,t<i?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,r),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),angleTo:function(t){return 2*Math.acos(Math.abs(jl.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,h=e._w;return this._x=i*h+o*s+n*l-r*a,this._y=n*h+o*a+r*s-i*l,this._z=r*h+o*l+i*a-n*s,this._w=o*h-i*s-n*a-r*l,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,o=this._w,s=o*t._w+i*t._x+n*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;var a=1-s*s;if(a<=Number.EPSILON){var l=1-e;return this._w=l*o+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*r+e*this._z,this.normalize()}var h=Math.sqrt(a),c=Math.atan2(h,s),u=Math.sin((1-e)*c)/h,d=Math.sin(e*c)/h;return this._w=o*u+this._w*d,this._x=i*u+this._x*d,this._y=n*u+this._y*d,this._z=r*u+this._z*d,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(o.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t=new r;return function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t=new r;return function(e,i){return this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*n-s*i,h=a*i+s*e-r*n,c=a*n+r*i-o*e,u=-r*e-o*i-s*n;return this.x=l*a+u*-r+h*-s-c*-o,this.y=h*a+u*-o+c*-r-l*-s,this.z=c*a+u*-s+l*-o-h*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(){var t=new n;return function(e){return this.applyMatrix4(t.getInverse(e.projectionMatrix)).applyMatrix4(e.matrixWorld)}}(),transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new o,e=new o;return function(i,n){return t.set(i,i,i),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new o;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new o;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(jl.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(s.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,s,a,l){var h=this.elements;return h[0]=t,h[1]=n,h[2]=s,h[3]=e,h[4]=r,h[5]=a,h[6]=i,h[7]=o,h[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new o;return function(e){for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix3(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],h=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],_=n[7],b=n[2],x=n[5],w=n[8];return r[0]=o*f+s*v+a*b,r[3]=o*m+s*y+a*x,r[6]=o*g+s*_+a*w,r[1]=l*f+h*v+c*b,r[4]=l*m+h*y+c*x,r[7]=l*g+h*_+c*w,r[2]=u*f+d*v+p*b,r[5]=u*m+d*y+p*x,r[8]=u*g+d*_+p*w,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],h=t[8];return e*o*h-e*s*l-i*r*h+i*s*a+n*r*l-n*o*a},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var i=t.elements,n=this.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],h=i[5],c=i[6],u=i[7],d=i[8],p=d*l-h*u,f=h*c-d*a,m=u*a-l*c,g=r*p+o*f+s*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(e===!0)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return n[0]=p*y,n[1]=(s*u-d*o)*y,n[2]=(h*o-s*l)*y,n[3]=f*y,n[4]=(d*r-s*c)*y,n[5]=(s*a-h*r)*y,n[6]=m*y,n[7]=(o*c-u*r)*y,n[8]=(l*r-o*a)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,o,s){var a=Math.cos(r),l=Math.sin(r);this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-n*l,n*a,-n*(-l*o+a*s)+s+e,0,0,1)},scale:function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],s=n[6],a=n[1],l=n[4],h=n[7];return n[0]=e*r+i*a,n[3]=e*o+i*l,n[6]=e*s+i*h,n[1]=-i*r+e*a,n[4]=-i*o+e*l,n[7]=-i*s+e*h,this},translate:function(t,e){var i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}});var Wl,Xl={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Wl&&(Wl=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Wl.width=t.width,Wl.height=t.height;var i=Wl.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Wl}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},ql=0;a.DEFAULT_IMAGE=void 0,a.DEFAULT_MAPPING=pa,a.prototype=Object.assign(Object.create(e.prototype),{constructor:a,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y);
},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=jl.generateUUID()),!e&&void 0===t.images[n.uuid]){var r;if(Array.isArray(n)){r=[];for(var o=0,s=n.length;o<s;o++)r.push(Xl.getDataURL(n[o]))}else r=Xl.getDataURL(n);t.images[n.uuid]={uuid:n.uuid,url:r}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==pa)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case xa:t.x=t.x-Math.floor(t.x);break;case wa:t.x=t.x<0?0:1;break;case Ta:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case xa:t.y=t.y-Math.floor(t.y);break;case wa:t.y=t.y<0?0:1;break;case Ta:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(a.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(l.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r,o=.01,s=.1,a=t.elements,l=a[0],h=a[4],c=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(h-u)<o&&Math.abs(c-f)<o&&Math.abs(p-m)<o){if(Math.abs(h+u)<s&&Math.abs(c+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;var v=(l+1)/2,y=(d+1)/2,_=(g+1)/2,b=(h+u)/4,x=(c+f)/4,w=(p+m)/4;return v>y&&v>_?v<o?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(v),n=b/i,r=x/i):y>_?y<o?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(y),i=b/n,r=w/n):_<o?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(_),i=x/r,n=w/r),this.set(i,n,r,e),this}var T=Math.sqrt((m-p)*(m-p)+(c-f)*(c-f)+(u-h)*(u-h));return Math.abs(T)<.001&&(T=1),this.x=(m-p)/T,this.y=(c-f)/T,this.z=(u-h)/T,this.w=Math.acos((l+d+g-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new l,e=new l),t.set(i,i,i,i),e.set(n,n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength: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()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),h.prototype=Object.assign(Object.create(e.prototype),{constructor:h,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),c.prototype=Object.assign(Object.create(h.prototype),{constructor:c,isWebGLMultisampleRenderTarget:!0,copy:function(t){return h.prototype.copy.call(this,t),this.samples=t.samples,this}}),u.prototype=Object.create(h.prototype),u.prototype.constructor=u,u.prototype.isWebGLRenderTargetCube=!0,d.prototype=Object.create(a.prototype),d.prototype.constructor=d,d.prototype.isDataTexture=!0,Object.assign(p.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=+(1/0),i=+(1/0),n=+(1/0),r=-(1/0),o=-(1/0),s=-(1/0),a=0,l=t.length;a<l;a+=3){var h=t[a],c=t[a+1],u=t[a+2];h<e&&(e=h),c<i&&(i=c),u<n&&(n=u),h>r&&(r=h),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){for(var e=+(1/0),i=+(1/0),n=+(1/0),r=-(1/0),o=-(1/0),s=-(1/0),a=0,l=t.count;a<l;a++){var h=t.getX(a),c=t.getY(a),u=t.getZ(a);h<e&&(e=h),c<i&&(i=c),u<n&&(n=u),h>r&&(r=h),c>o&&(o=c),u>s&&(s=u)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new o;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new o),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new o),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){function t(t){var o=t.geometry;if(void 0!==o)if(o.isGeometry){var s=o.vertices;for(i=0,n=s.length;i<n;i++)r.copy(s[i]),r.applyMatrix4(t.matrixWorld),e.expandByPoint(r)}else if(o.isBufferGeometry){var a=o.attributes.position;if(void 0!==a)for(i=0,n=a.count;i<n;i++)r.fromBufferAttribute(a,i).applyMatrix4(t.matrixWorld),e.expandByPoint(r)}}var e,i,n,r=new o;return function(i){return e=this,i.updateMatrixWorld(!0),i.traverse(t),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new o),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t=new o;return function(e){return this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(){function t(t){var r,o;for(r=0,o=t.length-3;r<=o;r+=3){l.fromArray(t,r);var s=c.x*Math.abs(l.x)+c.y*Math.abs(l.y)+c.z*Math.abs(l.z),a=e.dot(l),h=i.dot(l),u=n.dot(l);if(Math.max(-Math.max(a,h,u),Math.min(a,h,u))>s)return!1}return!0}var e=new o,i=new o,n=new o,r=new o,s=new o,a=new o,l=new o,h=new o,c=new o,u=new o;return function(o){if(this.isEmpty())return!1;this.getCenter(h),c.subVectors(this.max,h),e.subVectors(o.a,h),i.subVectors(o.b,h),n.subVectors(o.c,h),r.subVectors(i,e),s.subVectors(n,i),a.subVectors(e,n);var l=[0,-r.z,r.y,0,-s.z,s.y,0,-a.z,a.y,r.z,0,-r.x,s.z,0,-s.x,a.z,0,-a.x,-r.y,r.x,0,-s.y,s.x,0,-a.y,a.x,0];return!!t(l)&&(l=[1,0,0,0,1,0,0,0,1],!!t(l)&&(u.crossVectors(r,s),l=[u.x,u.y,u.z],t(l)))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new o),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new o;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),getBoundingSphere:function(){var t=new o;return function(e){return void 0===e&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),e=new f),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new o,new o,new o,new o,new o,new o,new o,new o];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(f.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new p;return function(e,i){var n=this.center;void 0!==i?n.copy(i):t.setFromPoints(e).getCenter(n);for(var r=0,o=0,s=e.length;o<s;o++)r=Math.max(r,n.distanceToSquared(e[o]));return this.radius=Math.sqrt(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new o),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new p),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(m.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new o,e=new o;return function(i,n,r){var o=t.subVectors(r,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new o),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new o;return function(e,i){void 0===i&&(console.warn("THREE.Plane: .intersectLine() target is now required"),i=new o);var n=e.delta(t),r=this.normal.dot(n);if(0!==r){var s=-(e.start.dot(this.normal)+this.constant)/r;if(!(s<0||s>1))return i.copy(n).multiplyScalar(s).add(e.start)}else if(0===this.distanceToPoint(e.start))return i.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new o),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new o,e=new s;return function(i,n){var r=n||e.getNormalMatrix(i),o=this.coplanarPoint(t).applyMatrix4(i),s=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(s),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(g.prototype,{set:function(t,e,i,n,r,o){var s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6],c=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(s-n,c-a,f-u,y-m).normalize(),e[1].setComponents(s+n,c+a,f+u,y+m).normalize(),e[2].setComponents(s+r,c+l,f+d,y+g).normalize(),e[3].setComponents(s-r,c-l,f-d,y-g).normalize(),e[4].setComponents(s-o,c-h,f-p,y-v).normalize(),e[5].setComponents(s+o,c+h,f+p,y+v).normalize(),this},intersectsObject:function(){var t=new f;return function(e){var i=e.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),t.copy(i.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new f;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){var o=e[r].distanceToPoint(i);if(o<n)return!1}return!0},intersectsBox:function(){var t=new o;return function(e){for(var i=this.planes,n=0;n<6;n++){var r=i[n];if(t.x=r.normal.x>0?e.max.x:e.min.x,t.y=r.normal.y>0?e.max.y:e.min.y,t.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(t)<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});var Yl="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",Kl="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",Zl="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",Jl="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",Ql="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",$l="vec3 transformed = vec3( position );",th="vec3 objectNormal = vec3( normal );",eh="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE  = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS  = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick( specularColor, dotNV );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",ih="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",nh="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",rh="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",oh="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",sh="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",ah="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",lh="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",hh="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",ch="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",uh="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",dh="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",ph="vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif",fh="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",mh="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",gh="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",vh="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",yh="gl_FragColor = linearToOutputTexel( gl_FragColor );",_h="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",bh="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",xh="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",wh="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",Th="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",Sh="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",Mh="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",Eh="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",Ah="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",Ch="#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",Ph="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",Dh="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Lh="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",Rh="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",Ih="#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",kh="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Oh="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",Hh="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",Nh="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor;\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Bh="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",Gh="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",Fh="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",zh="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",Uh="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",Vh="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",jh="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",Wh="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",Xh="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",qh="#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",Yh="#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",Kh="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",Zh="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",Jh="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",Qh="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",$h="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",tc="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif",ec="#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",ic="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",nc="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",rc="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",oc="vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",sc="#if defined( DITHERING )\n  gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",ac="#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",lc="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",hc="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",cc="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",uc="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",dc="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",pc="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",fc="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",mc="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",gc="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",vc="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif",yc="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",_c="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",bc="#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",xc="#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",wc="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",Tc="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",Sc="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",Mc="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Ec="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",Ac="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",Cc="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",Pc="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Dc="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",Lc="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Rc="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",Ic="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",kc="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",Oc="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",Hc="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",Nc="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Bc="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Gc="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Fc="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",zc="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Uc="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",Vc="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",jc="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Wc="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",Xc="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",qc="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Yc="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Kc="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Zc="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Jc="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",Qc="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",$c="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",tu="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",eu="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",iu="#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",nu="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",ru="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",ou={
alphamap_fragment:Yl,alphamap_pars_fragment:Kl,alphatest_fragment:Zl,aomap_fragment:Jl,aomap_pars_fragment:Ql,begin_vertex:$l,beginnormal_vertex:th,bsdfs:eh,bumpmap_pars_fragment:ih,clipping_planes_fragment:nh,clipping_planes_pars_fragment:rh,clipping_planes_pars_vertex:oh,clipping_planes_vertex:sh,color_fragment:ah,color_pars_fragment:lh,color_pars_vertex:hh,color_vertex:ch,common:uh,cube_uv_reflection_fragment:dh,defaultnormal_vertex:ph,displacementmap_pars_vertex:fh,displacementmap_vertex:mh,emissivemap_fragment:gh,emissivemap_pars_fragment:vh,encodings_fragment:yh,encodings_pars_fragment:_h,envmap_fragment:bh,envmap_pars_fragment:xh,envmap_pars_vertex:wh,envmap_physical_pars_fragment:Ih,envmap_vertex:Th,fog_vertex:Sh,fog_pars_vertex:Mh,fog_fragment:Eh,fog_pars_fragment:Ah,gradientmap_pars_fragment:Ch,lightmap_fragment:Ph,lightmap_pars_fragment:Dh,lights_lambert_vertex:Lh,lights_pars_begin:Rh,lights_phong_fragment:kh,lights_phong_pars_fragment:Oh,lights_physical_fragment:Hh,lights_physical_pars_fragment:Nh,lights_fragment_begin:Bh,lights_fragment_maps:Gh,lights_fragment_end:Fh,logdepthbuf_fragment:zh,logdepthbuf_pars_fragment:Uh,logdepthbuf_pars_vertex:Vh,logdepthbuf_vertex:jh,map_fragment:Wh,map_pars_fragment:Xh,map_particle_fragment:qh,map_particle_pars_fragment:Yh,metalnessmap_fragment:Kh,metalnessmap_pars_fragment:Zh,morphnormal_vertex:Jh,morphtarget_pars_vertex:Qh,morphtarget_vertex:$h,normal_fragment_begin:tc,normal_fragment_maps:ec,normalmap_pars_fragment:ic,packing:nc,premultiplied_alpha_fragment:rc,project_vertex:oc,dithering_fragment:sc,dithering_pars_fragment:ac,roughnessmap_fragment:lc,roughnessmap_pars_fragment:hc,shadowmap_pars_fragment:cc,shadowmap_pars_vertex:uc,shadowmap_vertex:dc,shadowmask_pars_fragment:pc,skinbase_vertex:fc,skinning_pars_vertex:mc,skinning_vertex:gc,skinnormal_vertex:vc,specularmap_fragment:yc,specularmap_pars_fragment:_c,tonemapping_fragment:bc,tonemapping_pars_fragment:xc,uv_pars_fragment:wc,uv_pars_vertex:Tc,uv_vertex:Sc,uv2_pars_fragment:Mc,uv2_pars_vertex:Ec,uv2_vertex:Ac,worldpos_vertex:Cc,background_frag:Pc,background_vert:Dc,cube_frag:Lc,cube_vert:Rc,depth_frag:Ic,depth_vert:kc,distanceRGBA_frag:Oc,distanceRGBA_vert:Hc,equirect_frag:Nc,equirect_vert:Bc,linedashed_frag:Gc,linedashed_vert:Fc,meshbasic_frag:zc,meshbasic_vert:Uc,meshlambert_frag:Vc,meshlambert_vert:jc,meshmatcap_frag:Wc,meshmatcap_vert:Xc,meshphong_frag:qc,meshphong_vert:Yc,meshphysical_frag:Kc,meshphysical_vert:Zc,normal_frag:Jc,normal_vert:Qc,points_frag:$c,points_vert:tu,shadow_frag:eu,shadow_vert:iu,sprite_frag:nu,sprite_vert:ru},su={clone:v,merge:y},au={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,rebeccapurple:6697881,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};Object.assign(_.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,n){if(e=jl.euclideanModulo(e,1),i=jl.clamp(i,0,1),n=jl.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,o=2*n-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var s=parseFloat(n[1])/360,a=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(s,a,l)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var h=i[1],c=h.length;if(3===c)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(t&&t.length>0){var h=au[t];void 0!==h?this.setHex(h):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function t(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),copyLinearToSRGB:function(){function t(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,i,n=this.r,r=this.g,o=this.b,s=Math.max(n,r,o),a=Math.min(n,r,o),l=(a+s)/2;if(a===s)e=0,i=0;else{var h=s-a;switch(i=l<=.5?h/(s+a):h/(2-s-a),s){case n:e=(r-o)/h+(r<o?6:0);break;case r:e=(o-n)/h+2;break;case o:e=(n-r)/h+4}e/=6}return t.h=e,t.s=i,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(){var t={};return function(e,i,n){return this.getHSL(t),t.h+=e,t.s+=i,t.l+=n,this.setHSL(t.h,t.s,t.l),this}}(),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(){var t={h:0,s:0,l:0},e={h:0,s:0,l:0};return function(i,n){this.getHSL(t),i.getHSL(e);var r=jl.lerp(t.h,e.h,n),o=jl.lerp(t.s,e.s,n),s=jl.lerp(t.l,e.l,n);return this.setHSL(r,o,s),this}}(),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var lu={common:{diffuse:{value:new _(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new s},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new i(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new _(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new _(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new s}},sprite:{diffuse:{value:new _(15658734)},opacity:{value:1},center:{value:new i(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new s}}},hu={basic:{uniforms:y([lu.common,lu.specularmap,lu.envmap,lu.aomap,lu.lightmap,lu.fog]),vertexShader:ou.meshbasic_vert,fragmentShader:ou.meshbasic_frag},lambert:{uniforms:y([lu.common,lu.specularmap,lu.envmap,lu.aomap,lu.lightmap,lu.emissivemap,lu.fog,lu.lights,{emissive:{value:new _(0)}}]),vertexShader:ou.meshlambert_vert,fragmentShader:ou.meshlambert_frag},phong:{uniforms:y([lu.common,lu.specularmap,lu.envmap,lu.aomap,lu.lightmap,lu.emissivemap,lu.bumpmap,lu.normalmap,lu.displacementmap,lu.gradientmap,lu.fog,lu.lights,{emissive:{value:new _(0)},specular:{value:new _(1118481)},shininess:{value:30}}]),vertexShader:ou.meshphong_vert,fragmentShader:ou.meshphong_frag},standard:{uniforms:y([lu.common,lu.envmap,lu.aomap,lu.lightmap,lu.emissivemap,lu.bumpmap,lu.normalmap,lu.displacementmap,lu.roughnessmap,lu.metalnessmap,lu.fog,lu.lights,{emissive:{value:new _(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:ou.meshphysical_vert,fragmentShader:ou.meshphysical_frag},matcap:{uniforms:y([lu.common,lu.bumpmap,lu.normalmap,lu.displacementmap,lu.fog,{matcap:{value:null}}]),vertexShader:ou.meshmatcap_vert,fragmentShader:ou.meshmatcap_frag},points:{uniforms:y([lu.points,lu.fog]),vertexShader:ou.points_vert,fragmentShader:ou.points_frag},dashed:{uniforms:y([lu.common,lu.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ou.linedashed_vert,fragmentShader:ou.linedashed_frag},depth:{uniforms:y([lu.common,lu.displacementmap]),vertexShader:ou.depth_vert,fragmentShader:ou.depth_frag},normal:{uniforms:y([lu.common,lu.bumpmap,lu.normalmap,lu.displacementmap,{opacity:{value:1}}]),vertexShader:ou.normal_vert,fragmentShader:ou.normal_frag},sprite:{uniforms:y([lu.sprite,lu.fog]),vertexShader:ou.sprite_vert,fragmentShader:ou.sprite_frag},background:{uniforms:{uvTransform:{value:new s},t2D:{value:null}},vertexShader:ou.background_vert,fragmentShader:ou.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ou.cube_vert,fragmentShader:ou.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ou.equirect_vert,fragmentShader:ou.equirect_frag},distanceRGBA:{uniforms:y([lu.common,lu.displacementmap,{referencePosition:{value:new o},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ou.distanceRGBA_vert,fragmentShader:ou.distanceRGBA_frag},shadow:{uniforms:y([lu.lights,lu.fog,{color:{value:new _(0)},opacity:{value:1}}]),vertexShader:ou.shadow_vert,fragmentShader:ou.shadow_frag}};hu.physical={uniforms:y([hu.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ou.meshphysical_vert,fragmentShader:ou.meshphysical_frag},Object.assign(w.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),T.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],T.DefaultOrder="XYZ",Object.defineProperties(T.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(T.prototype,{isEuler:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=jl.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],l=r[1],h=r[5],c=r[9],u=r[2],d=r[6],p=r[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,h)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===e?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,h))):"YZX"===e?(this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p))):"XZY"===e?(this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(d,h),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new n;return function(e,i,n){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,i,n)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new r;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new o(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(S.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!==(this.mask&t.mask)}});var cu=0;M.DefaultUp=new o(0,1,0),M.DefaultMatrixAutoUpdate=!0,M.prototype=Object.assign(Object.create(e.prototype),{constructor:M,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new r;return function(e,i){return t.setFromAxisAngle(e,i),this.quaternion.multiply(t),this}}(),rotateOnWorldAxis:function(){var t=new r;return function(e,i){return t.setFromAxisAngle(e,i),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new o(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new o(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new o(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new o;return function(e,i){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(i)),this}}(),translateX:function(){var t=new o(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new o(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new o(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new n;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new r,e=new n,i=new o,s=new o;return function(n,r,o){n.isVector3?i.copy(n):i.set(n,r,o);var a=this.parent;this.updateWorldMatrix(!0,!1),s.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?e.lookAt(s,i,this.up):e.lookAt(i,s,this.up),this.quaternion.setFromRotationMatrix(e),a&&(e.extractRotation(a.matrixWorld),t.setFromRotationMatrix(e),this.quaternion.premultiply(t.inverse()))}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var i=this.children.indexOf(t);return i!==-1&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(i,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i],o=r.getObjectByProperty(t,e);if(void 0!==o)return o}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new o),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new o,e=new o;return function(i){return void 0===i&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),i=new r),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,i,e),i}}(),getWorldScale:function(){var t=new o,e=new r;return function(i){return void 0===i&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),i=new o),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,i),i}}(),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new o),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(this.visible!==!1){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var i=this.parent;if(t===!0&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0)for(var n=this.children,r=0,o=n.length;r<o;r++)n[r].updateWorldMatrix(!1,!0)},toJSON:function(t){function e(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}function i(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}var n=void 0===t||"string"==typeof t,r={};n&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var o={};if(o.uuid=this.uuid,o.type=this.type,""!==this.name&&(o.name=this.name),this.castShadow===!0&&(o.castShadow=!0),this.receiveShadow===!0&&(o.receiveShadow=!0),this.visible===!1&&(o.visible=!1),this.frustumCulled===!1&&(o.frustumCulled=!1),0!==this.renderOrder&&(o.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(o.userData=this.userData),o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(o.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==Pl&&(o.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){o.geometry=e(t.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var l=0,h=a.length;l<h;l++){var c=a[l];e(t.shapes,c)}else e(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var u=[],l=0,h=this.material.length;l<h;l++)u.push(e(t.materials,this.material[l]));o.material=u}else o.material=e(t.materials,this.material);if(this.children.length>0){o.children=[];for(var l=0;l<this.children.length;l++)o.children.push(this.children[l].toJSON(t).object)}if(n){var d=i(t.geometries),p=i(t.materials),f=i(t.textures),m=i(t.images),a=i(t.shapes);d.length>0&&(r.geometries=d),p.length>0&&(r.materials=p),f.length>0&&(r.textures=f),m.length>0&&(r.images=m),a.length>0&&(r.shapes=a)}return r.object=o,r},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}});var uu=0;E.prototype=Object.assign(Object.create(e.prototype),{constructor:E,isGeometry:!0,applyMatrix:function(t){for(var e=(new s).getNormalMatrix(t),i=0,n=this.vertices.length;i<n;i++){var r=this.vertices[i];r.applyMatrix4(t)}for(var i=0,n=this.faces.length;i<n;i++){var o=this.faces[i];o.normal.applyMatrix3(e).normalize();for(var a=0,l=o.vertexNormals.length;a<l;a++)o.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new n;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new n;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new n;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new n;return function(e,i,n){return t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t=new n;return function(e,i,n){return t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new M;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,r,s){var a=void 0===h?[]:[n.colors[t].clone(),n.colors[e].clone(),n.colors[r].clone()],d=void 0===l?[]:[(new o).fromArray(l,3*t),(new o).fromArray(l,3*e),(new o).fromArray(l,3*r)],p=new w(t,e,r,d,a,s);n.faces.push(p),void 0!==c&&n.faceVertexUvs[0].push([(new i).fromArray(c,2*t),(new i).fromArray(c,2*e),(new i).fromArray(c,2*r)]),void 0!==u&&n.faceVertexUvs[1].push([(new i).fromArray(u,2*t),(new i).fromArray(u,2*e),(new i).fromArray(u,2*r)])}var n=this,r=null!==t.index?t.index.array:void 0,s=t.attributes,a=s.position.array,l=void 0!==s.normal?s.normal.array:void 0,h=void 0!==s.color?s.color.array:void 0,c=void 0!==s.uv?s.uv.array:void 0,u=void 0!==s.uv2?s.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var d=0,p=0;d<a.length;d+=3,p+=2)n.vertices.push((new o).fromArray(a,d)),void 0!==h&&n.colors.push((new _).fromArray(h,d));var f=t.groups;if(f.length>0)for(var d=0;d<f.length;d++)for(var m=f[d],g=m.start,v=m.count,p=g,y=g+v;p<y;p+=3)void 0!==r?e(r[p],r[p+1],r[p+2],m.materialIndex):e(p,p+1,p+2,m.materialIndex);else if(void 0!==r)for(var d=0;d<r.length;d+=3)e(r[d],r[d+1],r[d+2]);else for(var d=0;d<a.length/3;d+=3)e(d,d+1,d+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){var t=new o;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,r=new n;return r.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=new o,e=new o,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],s=this.vertices[r.a],a=this.vertices[r.b],l=this.vertices[r.c];t.subVectors(l,a),e.subVectors(s,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,i,n,r,s,a;for(a=new Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)a[e]=new o;if(t){var l,h,c,u=new o,d=new o;for(n=0,r=this.faces.length;n<r;n++)s=this.faces[n],l=this.vertices[s.a],h=this.vertices[s.b],c=this.vertices[s.c],u.subVectors(c,h),d.subVectors(l,h),u.cross(d),a[s.a].add(u),a[s.b].add(u),a[s.c].add(u)}else for(this.computeFaceNormals(),n=0,r=this.faces.length;n<r;n++)s=this.faces[n],a[s.a].add(s.normal),a[s.b].add(s.normal),a[s.c].add(s.normal);for(e=0,i=this.vertices.length;e<i;e++)a[e].normalize();for(n=0,r=this.faces.length;n<r;n++){s=this.faces[n];var p=s.vertexNormals;3===p.length?(p[0].copy(a[s.a]),p[1].copy(a[s.b]),p[2].copy(a[s.c])):(p[0]=a[s.a].clone(),p[1]=a[s.b].clone(),p[2]=a[s.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){i=this.faces[t];var n=i.vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for(r=this.faces[i],r.__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var s=new E;for(s.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a,l,h=this.morphNormals[t].faceNormals,c=this.morphNormals[t].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)a=new o,l={a:new o,b:new o,c:new o},h.push(a),c.push(l)}var u=this.morphNormals[t];s.vertices=this.morphTargets[t].vertices,s.computeFaceNormals(),s.computeVertexNormals();var a,l;for(i=0,n=this.faces.length;i<n;i++)r=this.faces[i],a=u.faceNormals[i],l=u.vertexNormals[i],a.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)r=this.faces[i],
r.normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new p),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new f),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var n,r=this.vertices.length,o=this.vertices,a=t.vertices,l=this.faces,h=t.faces,c=this.faceVertexUvs[0],u=t.faceVertexUvs[0],d=this.colors,p=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new s).getNormalMatrix(e));for(var f=0,m=a.length;f<m;f++){var g=a[f],v=g.clone();void 0!==e&&v.applyMatrix4(e),o.push(v)}for(var f=0,m=p.length;f<m;f++)d.push(p[f].clone());for(f=0,m=h.length;f<m;f++){var y,_,b,x=h[f],T=x.vertexNormals,S=x.vertexColors;y=new w(x.a+r,x.b+r,x.c+r),y.normal.copy(x.normal),void 0!==n&&y.normal.applyMatrix3(n).normalize();for(var M=0,E=T.length;M<E;M++)_=T[M].clone(),void 0!==n&&_.applyMatrix3(n).normalize(),y.vertexNormals.push(_);y.color.copy(x.color);for(var M=0,E=S.length;M<E;M++)b=S[M],y.vertexColors.push(b.clone());y.materialIndex=x.materialIndex+i,l.push(y)}for(f=0,m=u.length;f<m;f++){var A=u[f],C=[];if(void 0!==A){for(var M=0,E=A.length;M<E;M++)C.push(A[M].clone());c.push(C)}}},mergeMesh:function(t){return t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),void this.merge(t.geometry,t.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,i,n,r,o,s,a,l={},h=[],c=[],u=4,d=Math.pow(10,u);for(i=0,n=this.vertices.length;i<n;i++)t=this.vertices[i],e=Math.round(t.x*d)+"_"+Math.round(t.y*d)+"_"+Math.round(t.z*d),void 0===l[e]?(l[e]=i,h.push(this.vertices[i]),c[i]=h.length-1):c[i]=c[l[e]];var p=[];for(i=0,n=this.faces.length;i<n;i++){r=this.faces[i],r.a=c[r.a],r.b=c[r.b],r.c=c[r.c],o=[r.a,r.b,r.c];for(var f=0;f<3;f++)if(o[f]===o[(f+1)%3]){p.push(i);break}}for(i=p.length-1;i>=0;i--){var m=p[i];for(this.faces.splice(m,1),s=0,a=this.faceVertexUvs.length;s<a;s++)this.faceVertexUvs[s].splice(m,1)}var g=this.vertices.length-h.length;return this.vertices=h,g},setFromPoints:function(t){this.vertices=[];for(var e=0,i=t.length;e<i;e++){var n=t[e];this.vertices.push(new o(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,i=e.length,n=0;n<i;n++)e[n]._id=n;e.sort(t);var r,o,s=this.faceVertexUvs[0],a=this.faceVertexUvs[1];s&&s.length===i&&(r=[]),a&&a.length===i&&(o=[]);for(var n=0;n<i;n++){var l=e[n]._id;r&&r.push(s[l]),o&&o.push(a[l])}r&&(this.faceVertexUvs[0]=r),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function t(t,e,i){return i?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==d[e]?d[e]:(d[e]=u.length/3,u.push(t.x,t.y,t.z),d[e])}function i(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]?f[e]:(f[e]=p.length,p.push(t.getHex()),f[e])}function n(t){var e=t.x.toString()+t.y.toString();return void 0!==g[e]?g[e]:(g[e]=m.length/2,m.push(t.x,t.y),g[e])}var r={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var o=this.parameters;for(var s in o)void 0!==o[s]&&(r[s]=o[s]);return r}for(var a=[],l=0;l<this.vertices.length;l++){var h=this.vertices[l];a.push(h.x,h.y,h.z)}for(var c=[],u=[],d={},p=[],f={},m=[],g={},l=0;l<this.faces.length;l++){var v=this.faces[l],y=!0,_=!1,b=void 0!==this.faceVertexUvs[0][l],x=v.normal.length()>0,w=v.vertexNormals.length>0,T=1!==v.color.r||1!==v.color.g||1!==v.color.b,S=v.vertexColors.length>0,M=0;if(M=t(M,0,0),M=t(M,1,y),M=t(M,2,_),M=t(M,3,b),M=t(M,4,x),M=t(M,5,w),M=t(M,6,T),M=t(M,7,S),c.push(M),c.push(v.a,v.b,v.c),c.push(v.materialIndex),b){var E=this.faceVertexUvs[0][l];c.push(n(E[0]),n(E[1]),n(E[2]))}if(x&&c.push(e(v.normal)),w){var A=v.vertexNormals;c.push(e(A[0]),e(A[1]),e(A[2]))}if(T&&c.push(i(v.color)),S){var C=v.vertexColors;c.push(i(C[0]),i(C[1]),i(C[2]))}}return r.data={},r.data.vertices=a,r.data.normals=u,p.length>0&&(r.data.colors=p),m.length>0&&(r.data.uvs=[m]),r.data.faces=c,r},clone:function(){return(new E).copy(this)},copy:function(t){var e,i,n,r,o,s;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var a=t.vertices;for(e=0,i=a.length;e<i;e++)this.vertices.push(a[e].clone());var l=t.colors;for(e=0,i=l.length;e<i;e++)this.colors.push(l[e].clone());var h=t.faces;for(e=0,i=h.length;e<i;e++)this.faces.push(h[e].clone());for(e=0,i=t.faceVertexUvs.length;e<i;e++){var c=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,r=c.length;n<r;n++){var u=c[n],d=[];for(o=0,s=u.length;o<s;o++){var p=u[o];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,i=f.length;e<i;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],n=0,r=f[e].vertices.length;n<r;n++)m.vertices.push(f[e].vertices[n].clone());if(void 0!==f[e].normals)for(m.normals=[],n=0,r=f[e].normals.length;n<r;n++)m.normals.push(f[e].normals[n].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,i=g.length;e<i;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],n=0,r=g[e].vertexNormals.length;n<r;n++){var y=g[e].vertexNormals[n],_={};_.a=y.a.clone(),_.b=y.b.clone(),_.c=y.c.clone(),v.vertexNormals.push(_)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],n=0,r=g[e].faceNormals.length;n<r;n++)v.faceNormals.push(g[e].faceNormals[n].clone());this.morphNormals.push(v)}var b=t.skinWeights;for(e=0,i=b.length;e<i;e++)this.skinWeights.push(b[e].clone());var x=t.skinIndices;for(e=0,i=x.length;e<i;e++)this.skinIndices.push(x[e].clone());var w=t.lineDistances;for(e=0,i=w.length;e<i;e++)this.lineDistances.push(w[e]);var T=t.boundingBox;null!==T&&(this.boundingBox=T.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(A.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(A.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),o=new _),e[i++]=o.r,e[i++]=o.g,e[i++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,r=0,o=t.length;r<o;r++){var s=t[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),s=new i),e[n++]=s.x,e[n++]=s.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var s=t[n];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),s=new o),e[i++]=s.x,e[i++]=s.y,e[i++]=s.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),o=new l),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z,e[i++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),C.prototype=Object.create(A.prototype),C.prototype.constructor=C,P.prototype=Object.create(A.prototype),P.prototype.constructor=P,D.prototype=Object.create(A.prototype),D.prototype.constructor=D,L.prototype=Object.create(A.prototype),L.prototype.constructor=L,R.prototype=Object.create(A.prototype),R.prototype.constructor=R,I.prototype=Object.create(A.prototype),I.prototype.constructor=I,k.prototype=Object.create(A.prototype),k.prototype.constructor=k,O.prototype=Object.create(A.prototype),O.prototype.constructor=O,H.prototype=Object.create(A.prototype),H.prototype.constructor=H,Object.assign(N.prototype,{computeGroups:function(t){for(var e,i=[],n=void 0,r=t.faces,o=0;o<r.length;o++){var s=r[o];s.materialIndex!==n&&(n=s.materialIndex,void 0!==e&&(e.count=3*o-e.start,i.push(e)),e={start:3*o,materialIndex:n})}void 0!==e&&(e.count=3*o-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,o=t.faceVertexUvs,s=o[0]&&o[0].length>0,a=o[1]&&o[1].length>0,l=t.morphTargets,h=l.length;if(h>0){e=[];for(var c=0;c<h;c++)e[c]={name:l[c].name,data:[]};this.morphTargets.position=e}var u,d=t.morphNormals,p=d.length;if(p>0){u=[];for(var c=0;c<p;c++)u[c]={name:d[c].name,data:[]};this.morphTargets.normal=u}var f=t.skinIndices,m=t.skinWeights,g=f.length===r.length,v=m.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var c=0;c<n.length;c++){var y=n[c];this.vertices.push(r[y.a],r[y.b],r[y.c]);var _=y.vertexNormals;if(3===_.length)this.normals.push(_[0],_[1],_[2]);else{var b=y.normal;this.normals.push(b,b,b)}var x=y.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=y.color;this.colors.push(w,w,w)}if(s===!0){var T=o[0][c];void 0!==T?this.uvs.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new i,new i,new i))}if(a===!0){var T=o[1][c];void 0!==T?this.uvs2.push(T[0],T[1],T[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new i,new i,new i))}for(var S=0;S<h;S++){var M=l[S].vertices;e[S].data.push(M[y.a],M[y.b],M[y.c])}for(var S=0;S<p;S++){var E=d[S].vertexNormals[c];u[S].data.push(E.a,E.b,E.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var du=1;G.prototype=Object.assign(Object.create(e.prototype),{constructor:G,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(B(t)>65535?k:R)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new A(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new s).getNormalMatrix(t);n.applyToBufferAttribute(i),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new n;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new n;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new n;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new n;return function(e,i,n){return t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t=new n;return function(e,i,n){return t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new M;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new o;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var i=new O(3*e.vertices.length,3),n=new O(3*e.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new O(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new O(e,3)),this},updateFromObject:function(t){var e=t.geometry;if(t.isMesh){var i=e.__directGeometry;if(e.elementsNeedUpdate===!0&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}var n;return e.verticesNeedUpdate===!0&&(n=this.attributes.position,void 0!==n&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),e.normalsNeedUpdate===!0&&(n=this.attributes.normal,void 0!==n&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),e.colorsNeedUpdate===!0&&(n=this.attributes.color,void 0!==n&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(n=this.attributes.uv,void 0!==n&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(n=this.attributes.lineDistance,void 0!==n&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new N).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new A(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var i=new Float32Array(3*t.normals.length);this.addAttribute("normal",new A(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new A(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new A(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new A(o,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(var s in t.morphTargets){for(var a=[],l=t.morphTargets[s],h=0,c=l.length;h<c;h++){var u=l[h],d=new O(3*u.data.length,3);d.name=u.name,a.push(d.copyVector3sArray(u.data))}this.morphAttributes[s]=a}if(t.skinIndices.length>0){var p=new O(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new O(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new p);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new p,e=new o;return function(){null===this.boundingSphere&&(this.boundingSphere=new f);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;t.setFromBufferAttribute(i),t.getCenter(n);for(var r=0,o=0,s=i.count;o<s;o++)e.x=i.getX(o),e.y=i.getY(o),e.z=i.getZ(o),r=Math.max(r,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new A(new Float32Array(i.length),3));else for(var n=e.normal.array,r=0,s=n.length;r<s;r++)n[r]=0;var a,l,h,c=e.normal.array,u=new o,d=new o,p=new o,f=new o,m=new o;if(t)for(var g=t.array,r=0,s=t.count;r<s;r+=3)a=3*g[r+0],l=3*g[r+1],h=3*g[r+2],u.fromArray(i,a),d.fromArray(i,l),p.fromArray(i,h),f.subVectors(p,d),m.subVectors(u,d),f.cross(m),c[a]+=f.x,c[a+1]+=f.y,c[a+2]+=f.z,c[l]+=f.x,c[l+1]+=f.y,c[l+2]+=f.z,c[h]+=f.x,c[h+1]+=f.y,c[h+2]+=f.z;else for(var r=0,s=i.length;r<s;r+=9)u.fromArray(i,r),d.fromArray(i,r+3),p.fromArray(i,r+6),f.subVectors(p,d),m.subVectors(u,d),f.cross(m),c[r]=f.x,c[r+1]=f.y,c[r+2]=f.z,c[r+3]=f.x,c[r+4]=f.y,c[r+5]=f.z,c[r+6]=f.x,c[r+7]=f.y,c[r+8]=f.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var i=this.attributes;for(var n in i)if(void 0!==t.attributes[n])for(var r=i[n],o=r.array,s=t.attributes[n],a=s.array,l=s.itemSize,h=0,c=l*e;h<a.length;h++,c++)o[c]=a[h];return this},normalizeNormals:function(){var t=new o;return function(){for(var e=this.attributes.normal,i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.normalize(),e.setXYZ(i,t.x,t.y,t.z)}}(),toNonIndexed:function(){function t(t,e){for(var i=t.array,n=t.itemSize,r=new i.constructor(e.length*n),o=0,s=0,a=0,l=e.length;a<l;a++){o=e[a]*n;for(var h=0;h<n;h++)r[s++]=i[o++]}return new A(r,n)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new G,i=this.index.array,n=this.attributes;for(var r in n){var o=n[r],s=t(o,i);e.addAttribute(r,s)}var a=this.morphAttributes;for(r in a){for(var l=[],h=a[r],c=0,u=h.length;c<u;c++){var o=h[c],s=t(o,i);l.push(s)}e.morphAttributes[r]=l}for(var d=this.groups,c=0,p=d.length;c<p;c++){var f=d[c];e.addGroup(f.start,f.count,f.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var r=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:r}}var o=this.attributes;for(var i in o){var s=o[i],r=Array.prototype.slice.call(s.array);t.data.attributes[i]={itemSize:s.itemSize,type:s.array.constructor.name,array:r,normalized:s.normalized}}var a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));var l=this.boundingSphere;return null!==l&&(t.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),t},clone:function(){return(new G).copy(this)},copy:function(t){var e,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var s=o[e];this.addAttribute(e,s.clone())}var a=t.morphAttributes;for(e in a){var l=[],h=a[e];for(i=0,n=h.length;i<n;i++)l.push(h[i].clone());this.morphAttributes[e]=l}var c=t.groups;for(i=0,n=c.length;i<n;i++){var u=c[i];this.addGroup(u.start,u.count,u.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),F.prototype=Object.create(E.prototype),F.prototype.constructor=F,z.prototype=Object.create(G.prototype),z.prototype.constructor=z,U.prototype=Object.create(E.prototype),U.prototype.constructor=U,V.prototype=Object.create(G.prototype),V.prototype.constructor=V;var pu=0;j.prototype=Object.assign(Object.create(e.prototype),{constructor:j,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i)if("shading"!==e){var n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===Ts;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}var i=void 0===t||"string"==typeof t;i&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ps&&(n.blending=this.blending),this.flatShading===!0&&(n.flatShading=this.flatShading),this.side!==bs&&(n.side=this.side),this.vertexColors!==Ms&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),this.morphTargets===!0&&(n.morphTargets=!0),this.skinning===!0&&(n.skinning=!0),this.visible===!1&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),i){var r=e(t.textures),o=e(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),W.prototype=Object.create(j.prototype),W.prototype.constructor=W,W.prototype.isShaderMaterial=!0,W.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=v(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},W.prototype.toJSON=function(t){var e=j.prototype.toJSON.call(this,t);e.uniforms={};for(var i in this.uniforms){var n=this.uniforms[i],r=n.value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var o={};for(var s in this.extensions)this.extensions[s]===!0&&(o[s]=!0);return Object.keys(o).length>0&&(e.extensions=o),e},Object.assign(X.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new o),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new o;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new o),e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new o;return function(e){var i=t.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new o,e=new o,i=new o;return function(n,r,o,s){t.copy(n).add(r).multiplyScalar(.5),e.copy(r).sub(n).normalize(),i.copy(this.origin).sub(t);var a,l,h,c,u=.5*n.distanceTo(r),d=-this.direction.dot(e),p=i.dot(this.direction),f=-i.dot(e),m=i.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(a=d*f-p,l=d*p-f,c=u*g,a>=0)if(l>=-c)if(l<=c){var v=1/g;a*=v,l*=v,h=a*(a+d*l+2*p)+l*(d*a+l+2*f)+m}else l=u,a=Math.max(0,-(d*l+p)),h=-a*a+l*(l+2*f)+m;else l=-u,a=Math.max(0,-(d*l+p)),h=-a*a+l*(l+2*f)+m;else l<=-c?(a=Math.max(0,-(-d*u+p)),l=a>0?-u:Math.min(Math.max(-u,-f),u),h=-a*a+l*(l+2*f)+m):l<=c?(a=0,l=Math.min(Math.max(-u,-f),u),h=l*(l+2*f)+m):(a=Math.max(0,-(d*u+p)),l=a>0?u:Math.min(Math.max(-u,-f),u),h=-a*a+l*(l+2*f)+m);else l=d>0?-u:u,a=Math.max(0,-(d*l+p)),
h=-a*a+l*(l+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(a).add(this.origin),s&&s.copy(e).multiplyScalar(l).add(t),h}}(),intersectSphere:function(){var t=new o;return function(e,i){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),r=t.dot(t)-n*n,o=e.radius*e.radius;if(r>o)return null;var s=Math.sqrt(o-r),a=n-s,l=n+s;return a<0&&l<0?null:a<0?this.at(l,i):this.at(a,i)}}(),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var i=t.normal.dot(this.direction);return i*e<0},intersectBox:function(t,e){var i,n,r,o,s,a,l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),h>=0?(r=(t.min.y-u.y)*h,o=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,o=(t.min.y-u.y)*h),i>o||r>n?null:((r>i||i!==i)&&(i=r),(o<n||n!==n)&&(n=o),c>=0?(s=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(s=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||s>n?null:((s>i||i!==i)&&(i=s),(a<n||n!==n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))},intersectsBox:function(){var t=new o;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new o,e=new o,i=new o,n=new o;return function(r,o,s,a,l){e.subVectors(o,r),i.subVectors(s,r),n.crossVectors(e,i);var h,c=this.direction.dot(n);if(c>0){if(a)return null;h=1}else{if(!(c<0))return null;h=-1,c=-c}t.subVectors(this.origin,r);var u=h*this.direction.dot(i.crossVectors(t,i));if(u<0)return null;var d=h*this.direction.dot(e.cross(t));if(d<0)return null;if(u+d>c)return null;var p=-h*t.dot(n);return p<0?null:this.at(p/c,l)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(q,{getNormal:function(){var t=new o;return function(e,i,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new o),r.subVectors(n,i),t.subVectors(e,i),r.cross(t);var s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}}(),getBarycoord:function(){var t=new o,e=new o,i=new o;return function(n,r,s,a,l){t.subVectors(a,r),e.subVectors(s,r),i.subVectors(n,r);var h=t.dot(t),c=t.dot(e),u=t.dot(i),d=e.dot(e),p=e.dot(i),f=h*d-c*c;if(void 0===l&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),l=new o),0===f)return l.set(-2,-1,-1);var m=1/f,g=(d*u-c*p)*m,v=(h*p-c*u)*m;return l.set(1-g-v,v,g)}}(),containsPoint:function(){var t=new o;return function(e,i,n,r){return q.getBarycoord(e,i,n,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:function(){var t=new o;return function(e,i,n,r,o,s,a,l){return this.getBarycoord(e,i,n,r,t),l.set(0,0),l.addScaledVector(o,t.x),l.addScaledVector(s,t.y),l.addScaledVector(a,t.z),l}}()}),Object.assign(q.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new o,e=new o;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new o),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return q.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new o),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return q.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return q.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,i,n,r){return q.getUV(t,this.a,this.b,this.c,e,i,n,r)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(){var t=new o,e=new o,i=new o,n=new o,r=new o,s=new o;return function(a,l){void 0===l&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),l=new o);var h,c,u=this.a,d=this.b,p=this.c;t.subVectors(d,u),e.subVectors(p,u),n.subVectors(a,u);var f=t.dot(n),m=e.dot(n);if(f<=0&&m<=0)return l.copy(u);r.subVectors(a,d);var g=t.dot(r),v=e.dot(r);if(g>=0&&v<=g)return l.copy(d);var y=f*v-g*m;if(y<=0&&f>=0&&g<=0)return h=f/(f-g),l.copy(u).addScaledVector(t,h);s.subVectors(a,p);var _=t.dot(s),b=e.dot(s);if(b>=0&&_<=b)return l.copy(p);var x=_*m-f*b;if(x<=0&&m>=0&&b<=0)return c=m/(m-b),l.copy(u).addScaledVector(e,c);var w=g*b-_*v;if(w<=0&&v-g>=0&&_-b>=0)return i.subVectors(p,d),c=(v-g)/(v-g+(_-b)),l.copy(d).addScaledVector(i,c);var T=1/(w+x+y);return h=x*T,c=y*T,l.copy(u).addScaledVector(t,h).addScaledVector(e,c)}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Y.prototype=Object.create(j.prototype),Y.prototype.constructor=Y,Y.prototype.isMeshBasicMaterial=!0,Y.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},K.prototype=Object.assign(Object.create(M.prototype),{constructor:K,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return M.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,o=Object.keys(r);if(o.length>0){var s=r[o[0]];if(void 0!==s)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)i=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}else{var a=n.morphTargets;void 0!==a&&a.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(){function t(t,e,i,n,r,o,s,a){var l;if(l=e.side===xs?n.intersectTriangle(s,o,r,!0,a):n.intersectTriangle(r,o,s,e.side!==ws,a),null===l)return null;_.copy(a),_.applyMatrix4(t.matrixWorld);var h=i.ray.origin.distanceTo(_);return h<i.near||h>i.far?null:{distance:h,point:_.clone(),object:t}}function e(e,n,r,o,s,a,u,d,p){l.fromBufferAttribute(s,u),h.fromBufferAttribute(s,d),c.fromBufferAttribute(s,p);var f=t(e,n,r,o,l,h,c,y);if(f){a&&(m.fromBufferAttribute(a,u),g.fromBufferAttribute(a,d),v.fromBufferAttribute(a,p),f.uv=q.getUV(y,l,h,c,m,g,v,new i));var _=new w(u,d,p);q.getNormal(l,h,c,_.normal),f.face=_}return f}var r=new n,s=new X,a=new f,l=new o,h=new o,c=new o,u=new o,d=new o,p=new o,m=new i,g=new i,v=new i,y=new o,_=new o;return function(n,o){var f=this.geometry,_=this.material,b=this.matrixWorld;if(void 0!==_&&(null===f.boundingSphere&&f.computeBoundingSphere(),a.copy(f.boundingSphere),a.applyMatrix4(b),n.ray.intersectsSphere(a)!==!1&&(r.getInverse(b),s.copy(n.ray).applyMatrix4(r),null===f.boundingBox||s.intersectsBox(f.boundingBox)!==!1))){var x;if(f.isBufferGeometry){var w,T,S,M,E,A,C,P,D,L,R,I=f.index,k=f.attributes.position,O=f.attributes.uv,H=f.groups,N=f.drawRange;if(null!==I)if(Array.isArray(_))for(M=0,A=H.length;M<A;M++)for(P=H[M],D=_[P.materialIndex],L=Math.max(P.start,N.start),R=Math.min(P.start+P.count,N.start+N.count),E=L,C=R;E<C;E+=3)w=I.getX(E),T=I.getX(E+1),S=I.getX(E+2),x=e(this,D,n,s,k,O,w,T,S),x&&(x.faceIndex=Math.floor(E/3),x.face.materialIndex=P.materialIndex,o.push(x));else for(L=Math.max(0,N.start),R=Math.min(I.count,N.start+N.count),M=L,A=R;M<A;M+=3)w=I.getX(M),T=I.getX(M+1),S=I.getX(M+2),x=e(this,_,n,s,k,O,w,T,S),x&&(x.faceIndex=Math.floor(M/3),o.push(x));else if(void 0!==k)if(Array.isArray(_))for(M=0,A=H.length;M<A;M++)for(P=H[M],D=_[P.materialIndex],L=Math.max(P.start,N.start),R=Math.min(P.start+P.count,N.start+N.count),E=L,C=R;E<C;E+=3)w=E,T=E+1,S=E+2,x=e(this,D,n,s,k,O,w,T,S),x&&(x.faceIndex=Math.floor(E/3),x.face.materialIndex=P.materialIndex,o.push(x));else for(L=Math.max(0,N.start),R=Math.min(k.count,N.start+N.count),M=L,A=R;M<A;M+=3)w=M,T=M+1,S=M+2,x=e(this,_,n,s,k,O,w,T,S),x&&(x.faceIndex=Math.floor(M/3),o.push(x))}else if(f.isGeometry){var B,G,F,z,U=Array.isArray(_),V=f.vertices,j=f.faces,W=f.faceVertexUvs[0];W.length>0&&(z=W);for(var X=0,Y=j.length;X<Y;X++){var K=j[X],Z=U?_[K.materialIndex]:_;if(void 0!==Z){if(B=V[K.a],G=V[K.b],F=V[K.c],Z.morphTargets===!0){var J=f.morphTargets,Q=this.morphTargetInfluences;l.set(0,0,0),h.set(0,0,0),c.set(0,0,0);for(var $=0,tt=J.length;$<tt;$++){var et=Q[$];if(0!==et){var it=J[$].vertices;l.addScaledVector(u.subVectors(it[K.a],B),et),h.addScaledVector(d.subVectors(it[K.b],G),et),c.addScaledVector(p.subVectors(it[K.c],F),et)}}l.add(B),h.add(G),c.add(F),B=l,G=h,F=c}if(x=t(this,Z,n,s,B,G,F,y)){if(z&&z[X]){var nt=z[X];m.copy(nt[0]),g.copy(nt[1]),v.copy(nt[2]),x.uv=q.getUV(y,B,G,F,m,g,v,new i)}x.face=K,x.faceIndex=X,o.push(x)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),at.prototype=Object.create(a.prototype),at.prototype.constructor=at,at.prototype.isCubeTexture=!0,Object.defineProperty(at.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),lt.prototype=Object.create(a.prototype),lt.prototype.constructor=lt,lt.prototype.isDataTexture3D=!0;var fu=new a,mu=new lt,gu=new at,vu=[],yu=[],_u=new Float32Array(16),bu=new Float32Array(9),xu=new Float32Array(4);zt.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),dt(e,t)},Ut.prototype.setValue=function(t,e,i){for(var n=this.seq,r=0,o=n.length;r!==o;++r){var s=n[r];s.setValue(t,e[s.id],i)}};var wu=/([\w\d_]+)(\])?(\[|\.)?/g;Wt.prototype.setValue=function(t,e,i){var n=this.map[e];void 0!==n&&n.setValue(t,i,this.renderer)},Wt.prototype.setOptional=function(t,e,i){var n=e[i];void 0!==n&&this.setValue(t,i,n)},Wt.upload=function(t,e,i,n){for(var r=0,o=e.length;r!==o;++r){var s=e[r],a=i[s.id];a.needsUpdate!==!1&&s.setValue(t,a.value,n)}},Wt.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var o=t[n];o.id in e&&i.push(o)}return i};var Tu=0,Su=0;ve.prototype=Object.create(j.prototype),ve.prototype.constructor=ve,ve.prototype.isMeshDepthMaterial=!0,ve.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},ye.prototype=Object.create(j.prototype),ye.prototype.constructor=ye,ye.prototype.isMeshDistanceMaterial=!0,ye.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Te.prototype=Object.assign(Object.create(M.prototype),{constructor:Te,isGroup:!0}),Se.prototype=Object.assign(Object.create(M.prototype),{constructor:Se,isCamera:!0,copy:function(t,e){return M.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new o),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){M.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Me.prototype=Object.assign(Object.create(Se.prototype),{constructor:Me,isPerspectiveCamera:!0,copy:function(t,e){return Se.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*jl.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*jl.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*jl.RAD2DEG*Math.atan(Math.tan(.5*jl.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*jl.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var s=o.fullWidth,a=o.fullHeight;r+=o.offsetX*n/s,e-=o.offsetY*i/a,n*=o.width/s,i*=o.height/a}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=M.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Ee.prototype=Object.assign(Object.create(Me.prototype),{constructor:Ee,isArrayCamera:!0});var Mu=new o,Eu=new o;Le.prototype.isFogExp2=!0,Le.prototype.clone=function(){return new Le(this.color,this.density)},Le.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Re.prototype.isFog=!0,Re.prototype.clone=function(){return new Re(this.color,this.near,this.far)},Re.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Ie.prototype=Object.assign(Object.create(M.prototype),{constructor:Ie,isScene:!0,copy:function(t,e){return M.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=M.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ke.prototype,"needsUpdate",{set:function(t){t===!0&&this.version++}}),Object.assign(ke.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(var n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Oe.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Oe.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}}),He.prototype=Object.create(j.prototype),He.prototype.constructor=He,He.prototype.isSpriteMaterial=!0,He.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var Au;Ne.prototype=Object.assign(Object.create(M.prototype),{constructor:Ne,isSprite:!0,raycast:function(){function t(t,e,i,n,r,o){a.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(l.x=o*a.x-r*a.y,l.y=r*a.x+o*a.y):l.copy(a),t.copy(e),t.x+=l.x,t.y+=l.y,t.applyMatrix4(h)}var e=new o,r=new o,s=new o,a=new i,l=new i,h=new n,c=new o,u=new o,d=new o,p=new i,f=new i,m=new i;return function(n,o){r.setFromMatrixScale(this.matrixWorld),h.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),s.setFromMatrixPosition(this.modelViewMatrix);var a,l,g=this.material.rotation;0!==g&&(l=Math.cos(g),a=Math.sin(g));var v=this.center;t(c.set(-.5,-.5,0),s,v,r,a,l),t(u.set(.5,-.5,0),s,v,r,a,l),t(d.set(.5,.5,0),s,v,r,a,l),p.set(0,0),f.set(1,0),m.set(1,1);var y=n.ray.intersectTriangle(c,u,d,!1,e);if(null!==y||(t(u.set(-.5,.5,0),s,v,r,a,l),f.set(0,1),y=n.ray.intersectTriangle(c,d,u,!1,e),null!==y)){var _=n.ray.origin.distanceTo(e);_<n.near||_>n.far||o.push({distance:_,point:e.clone(),uv:q.getUV(e,c,u,d,p,f,m,new i),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return M.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Be.prototype=Object.assign(Object.create(M.prototype),{constructor:Be,copy:function(t){M.prototype.copy.call(this,t,!1);for(var e=t.levels,i=0,n=e.length;i<n;i++){var r=e[i];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,n=0;n<i.length&&!(e<i[n].distance);n++);i.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object},raycast:function(){var t=new o;return function(e,i){t.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(t);this.getObjectForDistance(n).raycast(e,i)}}(),update:function(){var t=new o,e=new o;return function(i){var n=this.levels;if(n.length>1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);n[0].object.visible=!0;for(var o=1,s=n.length;o<s&&r>=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;o<s;o++)n[o].object.visible=!1}}}(),toJSON:function(t){var e=M.prototype.toJSON.call(this,t);e.object.levels=[];for(var i=this.levels,n=0,r=i.length;n<r;n++){var o=i[n];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Ge.prototype=Object.assign(Object.create(K.prototype),{constructor:Ge,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new l,e=this.geometry.attributes.skinWeight,i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);var r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){K.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(Fe.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new n;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},pose:function(){var t,e,i;for(e=0,i=this.bones.length;e<i;e++)t=this.bones[e],t&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,i=this.bones.length;e<i;e++)t=this.bones[e],t&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new n,e=new n;return function(){for(var i=this.bones,n=this.boneInverses,r=this.boneMatrices,o=this.boneTexture,s=0,a=i.length;s<a;s++){var l=i[s]?i[s].matrixWorld:e;t.multiplyMatrices(l,n[s]),t.toArray(r,16*s)}void 0!==o&&(o.needsUpdate=!0)}}(),clone:function(){return new Fe(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,i=this.bones.length;e<i;e++){var n=this.bones[e];if(n.name===t)return n}}}),ze.prototype=Object.assign(Object.create(M.prototype),{constructor:ze,isBone:!0}),Ue.prototype=Object.create(j.prototype),Ue.prototype.constructor=Ue,Ue.prototype.isLineBasicMaterial=!0,Ue.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Ve.prototype=Object.assign(Object.create(M.prototype),{constructor:Ve,isLine:!0,computeLineDistances:function(){var t=new o,e=new o;return function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var n=i.attributes.position,r=[0],o=1,s=n.count;o<s;o++)t.fromBufferAttribute(n,o-1),e.fromBufferAttribute(n,o),r[o]=r[o-1],r[o]+=t.distanceTo(e);i.addAttribute("lineDistance",new O(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(i.isGeometry){var a=i.vertices,r=i.lineDistances;r[0]=0;for(var o=1,s=a.length;o<s;o++)r[o]=r[o-1],r[o]+=a[o-1].distanceTo(a[o])}return this}}(),raycast:function(){var t=new n,e=new X,i=new f;return function(n,r){var s=n.linePrecision,a=this.geometry,l=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(l),i.radius+=s,n.ray.intersectsSphere(i)!==!1){t.getInverse(l),e.copy(n.ray).applyMatrix4(t);var h=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=h*h,u=new o,d=new o,p=new o,f=new o,m=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var g=a.index,v=a.attributes,y=v.position.array;if(null!==g)for(var _=g.array,b=0,x=_.length-1;b<x;b+=m){var w=_[b],T=_[b+1];u.fromArray(y,3*w),d.fromArray(y,3*T);var S=e.distanceSqToSegment(u,d,f,p);if(!(S>c)){f.applyMatrix4(this.matrixWorld);var M=n.ray.origin.distanceTo(f);M<n.near||M>n.far||r.push({distance:M,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else for(var b=0,x=y.length/3-1;b<x;b+=m){u.fromArray(y,3*b),d.fromArray(y,3*b+3);var S=e.distanceSqToSegment(u,d,f,p);if(!(S>c)){f.applyMatrix4(this.matrixWorld);var M=n.ray.origin.distanceTo(f);M<n.near||M>n.far||r.push({distance:M,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}else if(a.isGeometry)for(var E=a.vertices,A=E.length,b=0;b<A-1;b+=m){var S=e.distanceSqToSegment(E[b],E[b+1],f,p);if(!(S>c)){f.applyMatrix4(this.matrixWorld);var M=n.ray.origin.distanceTo(f);M<n.near||M>n.far||r.push({distance:M,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}}}(),copy:function(t){return M.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),je.prototype=Object.assign(Object.create(Ve.prototype),{constructor:je,isLineSegments:!0,computeLineDistances:function(){var t=new o,e=new o;return function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var n=i.attributes.position,r=[],o=0,s=n.count;o<s;o+=2)t.fromBufferAttribute(n,o),e.fromBufferAttribute(n,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);i.addAttribute("lineDistance",new O(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(i.isGeometry)for(var a=i.vertices,r=i.lineDistances,o=0,s=a.length;o<s;o+=2)t.copy(a[o]),e.copy(a[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);return this}}()}),We.prototype=Object.assign(Object.create(Ve.prototype),{constructor:We,isLineLoop:!0}),Xe.prototype=Object.create(j.prototype),Xe.prototype.constructor=Xe,Xe.prototype.isPointsMaterial=!0,Xe.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},qe.prototype=Object.assign(Object.create(M.prototype),{constructor:qe,isPoints:!0,raycast:function(){var t=new n,e=new X,i=new f;return function(n,r){function s(t,i){var o=e.distanceSqToPoint(t);if(o<d){e.closestPointToPoint(t,f),f.applyMatrix4(h);var s=n.ray.origin.distanceTo(f);if(s<n.near||s>n.far)return;r.push({distance:s,distanceToRay:Math.sqrt(o),point:f.clone(),index:i,face:null,object:a})}}var a=this,l=this.geometry,h=this.matrixWorld,c=n.params.Points.threshold;if(null===l.boundingSphere&&l.computeBoundingSphere(),i.copy(l.boundingSphere),i.applyMatrix4(h),i.radius+=c,n.ray.intersectsSphere(i)!==!1){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),d=u*u,p=new o,f=new o;if(l.isBufferGeometry){var m=l.index,g=l.attributes,v=g.position.array;if(null!==m)for(var y=m.array,_=0,b=y.length;_<b;_++){var x=y[_];p.fromArray(v,3*x),s(p,x)}else for(var _=0,w=v.length/3;_<w;_++)p.fromArray(v,3*_),s(p,_)}else for(var T=l.vertices,_=0,w=T.length;_<w;_++)s(T[_],_)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ye.prototype=Object.assign(Object.create(a.prototype),{constructor:Ye,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Ke.prototype=Object.create(a.prototype),Ke.prototype.constructor=Ke,Ke.prototype.isCompressedTexture=!0,Ze.prototype=Object.create(a.prototype),Ze.prototype.constructor=Ze,Ze.prototype.isCanvasTexture=!0,Je.prototype=Object.create(a.prototype),Je.prototype.constructor=Je,Je.prototype.isDepthTexture=!0,Qe.prototype=Object.create(G.prototype),Qe.prototype.constructor=Qe,$e.prototype=Object.create(E.prototype),$e.prototype.constructor=$e,ti.prototype=Object.create(G.prototype),ti.prototype.constructor=ti,ei.prototype=Object.create(E.prototype),ei.prototype.constructor=ei,ii.prototype=Object.create(G.prototype),ii.prototype.constructor=ii,ni.prototype=Object.create(E.prototype),ni.prototype.constructor=ni,ri.prototype=Object.create(ii.prototype),ri.prototype.constructor=ri,oi.prototype=Object.create(E.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(ii.prototype),si.prototype.constructor=si,ai.prototype=Object.create(E.prototype),ai.prototype.constructor=ai,li.prototype=Object.create(ii.prototype),li.prototype.constructor=li,hi.prototype=Object.create(E.prototype),hi.prototype.constructor=hi,ci.prototype=Object.create(ii.prototype),ci.prototype.constructor=ci,ui.prototype=Object.create(E.prototype),ui.prototype.constructor=ui,di.prototype=Object.create(G.prototype),di.prototype.constructor=di,pi.prototype=Object.create(E.prototype),pi.prototype.constructor=pi,fi.prototype=Object.create(G.prototype),fi.prototype.constructor=fi,mi.prototype=Object.create(E.prototype),mi.prototype.constructor=mi,gi.prototype=Object.create(G.prototype),gi.prototype.constructor=gi;var Cu={triangulate:function(t,e,i){i=i||2;var n=e&&e.length,r=n?e[0]*i:t.length,o=vi(t,0,r,i,!0),s=[];if(!o)return s;var a,l,h,c,u,d,p;if(n&&(o=Si(t,e,o,i)),t.length>80*i){a=h=t[0],l=c=t[1];for(var f=i;f<r;f+=i)u=t[f],d=t[f+1],u<a&&(a=u),d<l&&(l=d),u>h&&(h=u),d>c&&(c=d);p=Math.max(h-a,c-l),p=0!==p?1/p:0}return _i(o,s,i,a,l,p),s}},Pu={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},isClockWise:function(t){return Pu.area(t)<0},triangulateShape:function(t,e){var i=[],n=[],r=[];Wi(t),Xi(i,t);var o=t.length;e.forEach(Wi);for(var s=0;s<e.length;s++)n.push(o),o+=e[s].length,Xi(i,e[s]);for(var a=Cu.triangulate(i,n),s=0;s<a.length;s+=3)r.push(a.slice(s,s+3));return r}};qi.prototype=Object.create(E.prototype),qi.prototype.constructor=qi,qi.prototype.toJSON=function(){var t=E.prototype.toJSON.call(this),e=this.parameters.shapes,i=this.parameters.options;return Ki(e,i,t)},Yi.prototype=Object.create(G.prototype),Yi.prototype.constructor=Yi,Yi.prototype.toJSON=function(){var t=G.prototype.toJSON.call(this),e=this.parameters.shapes,i=this.parameters.options;return Ki(e,i,t)};var Du={generateTopUV:function(t,e,n,r,o){var s=e[3*n],a=e[3*n+1],l=e[3*r],h=e[3*r+1],c=e[3*o],u=e[3*o+1];return[new i(s,a),new i(l,h),new i(c,u)]},generateSideWallUV:function(t,e,n,r,o,s){var a=e[3*n],l=e[3*n+1],h=e[3*n+2],c=e[3*r],u=e[3*r+1],d=e[3*r+2],p=e[3*o],f=e[3*o+1],m=e[3*o+2],g=e[3*s],v=e[3*s+1],y=e[3*s+2];return Math.abs(l-u)<.01?[new i(a,1-h),new i(c,1-d),new i(p,1-m),new i(g,1-y)]:[new i(l,1-h),new i(u,1-d),new i(f,1-m),new i(v,1-y)]}};Zi.prototype=Object.create(E.prototype),Zi.prototype.constructor=Zi,Ji.prototype=Object.create(Yi.prototype),Ji.prototype.constructor=Ji,Qi.prototype=Object.create(E.prototype),Qi.prototype.constructor=Qi,$i.prototype=Object.create(G.prototype),$i.prototype.constructor=$i,tn.prototype=Object.create(E.prototype),tn.prototype.constructor=tn,en.prototype=Object.create(G.prototype),en.prototype.constructor=en,nn.prototype=Object.create(E.prototype),nn.prototype.constructor=nn,rn.prototype=Object.create(G.prototype),rn.prototype.constructor=rn,
on.prototype=Object.create(E.prototype),on.prototype.constructor=on,on.prototype.toJSON=function(){var t=E.prototype.toJSON.call(this),e=this.parameters.shapes;return an(e,t)},sn.prototype=Object.create(G.prototype),sn.prototype.constructor=sn,sn.prototype.toJSON=function(){var t=G.prototype.toJSON.call(this),e=this.parameters.shapes;return an(e,t)},ln.prototype=Object.create(G.prototype),ln.prototype.constructor=ln,hn.prototype=Object.create(E.prototype),hn.prototype.constructor=hn,cn.prototype=Object.create(G.prototype),cn.prototype.constructor=cn,un.prototype=Object.create(hn.prototype),un.prototype.constructor=un,dn.prototype=Object.create(cn.prototype),dn.prototype.constructor=dn,pn.prototype=Object.create(E.prototype),pn.prototype.constructor=pn,fn.prototype=Object.create(G.prototype),fn.prototype.constructor=fn;var Lu=Object.freeze({WireframeGeometry:Qe,ParametricGeometry:$e,ParametricBufferGeometry:ti,TetrahedronGeometry:ni,TetrahedronBufferGeometry:ri,OctahedronGeometry:oi,OctahedronBufferGeometry:si,IcosahedronGeometry:ai,IcosahedronBufferGeometry:li,DodecahedronGeometry:hi,DodecahedronBufferGeometry:ci,PolyhedronGeometry:ei,PolyhedronBufferGeometry:ii,TubeGeometry:ui,TubeBufferGeometry:di,TorusKnotGeometry:pi,TorusKnotBufferGeometry:fi,TorusGeometry:mi,TorusBufferGeometry:gi,TextGeometry:Zi,TextBufferGeometry:Ji,SphereGeometry:Qi,SphereBufferGeometry:$i,RingGeometry:tn,RingBufferGeometry:en,PlaneGeometry:U,PlaneBufferGeometry:V,LatheGeometry:nn,LatheBufferGeometry:rn,ShapeGeometry:on,ShapeBufferGeometry:sn,ExtrudeGeometry:qi,ExtrudeBufferGeometry:Yi,EdgesGeometry:ln,ConeGeometry:un,ConeBufferGeometry:dn,CylinderGeometry:hn,CylinderBufferGeometry:cn,CircleGeometry:pn,CircleBufferGeometry:fn,BoxGeometry:F,BoxBufferGeometry:z});mn.prototype=Object.create(j.prototype),mn.prototype.constructor=mn,mn.prototype.isShadowMaterial=!0,mn.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this},gn.prototype=Object.create(W.prototype),gn.prototype.constructor=gn,gn.prototype.isRawShaderMaterial=!0,vn.prototype=Object.create(j.prototype),vn.prototype.constructor=vn,vn.prototype.isMeshStandardMaterial=!0,vn.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},yn.prototype=Object.create(vn.prototype),yn.prototype.constructor=yn,yn.prototype.isMeshPhysicalMaterial=!0,yn.prototype.copy=function(t){return vn.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},_n.prototype=Object.create(j.prototype),_n.prototype.constructor=_n,_n.prototype.isMeshPhongMaterial=!0,_n.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},bn.prototype=Object.create(_n.prototype),bn.prototype.constructor=bn,bn.prototype.isMeshToonMaterial=!0,bn.prototype.copy=function(t){return _n.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},xn.prototype=Object.create(j.prototype),xn.prototype.constructor=xn,xn.prototype.isMeshNormalMaterial=!0,xn.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},wn.prototype=Object.create(j.prototype),wn.prototype.constructor=wn,wn.prototype.isMeshLambertMaterial=!0,wn.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Tn.prototype=Object.create(j.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isMeshMatcapMaterial=!0,Tn.prototype.copy=function(t){return j.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Sn.prototype=Object.create(Ue.prototype),Sn.prototype.constructor=Sn,Sn.prototype.isLineDashedMaterial=!0,Sn.prototype.copy=function(t){return Ue.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Ru=Object.freeze({ShadowMaterial:mn,SpriteMaterial:He,RawShaderMaterial:gn,ShaderMaterial:W,PointsMaterial:Xe,MeshPhysicalMaterial:yn,MeshStandardMaterial:vn,MeshPhongMaterial:_n,MeshToonMaterial:bn,MeshNormalMaterial:xn,MeshLambertMaterial:wn,MeshDepthMaterial:ve,MeshDistanceMaterial:ye,MeshBasicMaterial:Y,MeshMatcapMaterial:Tn,LineDashedMaterial:Sn,LineBasicMaterial:Ue,Material:j}),Iu={arraySlice:function(t,e,i){return Iu.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}for(var i=t.length,n=new Array(i),r=0;r!==i;++r)n[r]=r;return n.sort(e),n},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),o=0,s=0;s!==n;++o)for(var a=i[o]*e,l=0;l!==e;++l)r[s++]=t[a+l];return r},flattenJSON:function(t,e,i,n){for(var r=1,o=t[0];void 0!==o&&void 0===o[n];)o=t[r++];if(void 0!==o){var s=o[n];if(void 0!==s)if(Array.isArray(s)){do s=o[n],void 0!==s&&(e.push(o.time),i.push.apply(i,s)),o=t[r++];while(void 0!==o)}else if(void 0!==s.toArray){do s=o[n],void 0!==s&&(e.push(o.time),s.toArray(i,i.length)),o=t[r++];while(void 0!==o)}else do s=o[n],void 0!==s&&(e.push(o.time),i.push(s)),o=t[r++];while(void 0!==o)}}};Object.assign(Mn.prototype,{evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{var o;i:{n:if(!(t<n)){for(var s=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===s)break;if(r=n,n=e[++i],t<n)break e}o=e.length;break i}{if(t>=r)break t;var a=e[1];t<a&&(i=2,r=a);for(var s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===s)break;if(n=r,r=e[--i-1],t>=r)break e}o=i,i=0}}for(;i<o;){var l=i+o>>>1;t<e[l]?o=l:i=l+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n,o=0;o!==n;++o)e[o]=i[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Mn.prototype,{beforeStart_:Mn.prototype.copySampleValue_,afterEnd_:Mn.prototype.copySampleValue_}),En.prototype=Object.assign(Object.create(Mn.prototype),{constructor:En,DefaultSettings_:{endingStart:El,endingEnd:El},intervalChanged_:function(t,e,i){var n=this.parameterPositions,r=t-2,o=t+1,s=n[r],a=n[o];if(void 0===s)switch(this.getSettings_().endingStart){case Al:r=t,s=2*e-i;break;case Cl:r=n.length-2,s=e+n[r]-n[r+1];break;default:r=t,s=i}if(void 0===a)switch(this.getSettings_().endingEnd){case Al:o=t,a=2*i-e;break;case Cl:o=1,a=i+n[1]-n[0];break;default:o=t-1,a=e}var l=.5*(i-e),h=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(a-i),this._offsetPrev=r*h,this._offsetNext=o*h},interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,h=this._offsetPrev,c=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,_=d*m-d*f,b=0;b!==s;++b)r[b]=g*o[h+b]+v*o[l+b]+y*o[a+b]+_*o[c+b];return r}}),An.prototype=Object.assign(Object.create(Mn.prototype),{constructor:An,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,h=(i-e)/(n-e),c=1-h,u=0;u!==s;++u)r[u]=o[l+u]*c+o[a+u]*h;return r}}),Cn.prototype=Object.assign(Object.create(Mn.prototype),{constructor:Cn,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Pn,{toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:Iu.convertArray(t.times,Array),values:Iu.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}),Object.assign(Pn.prototype,{constructor:Pn,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Sl,InterpolantFactoryMethodDiscrete:function(t){return new Cn(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new An(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new En(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Tl:e=this.InterpolantFactoryMethodDiscrete;break;case Sl:e=this.InterpolantFactoryMethodLinear;break;case Ml:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Tl;case this.InterpolantFactoryMethodLinear:return Sl;case this.InterpolantFactoryMethodSmooth:return Ml}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,n=i.length,r=0,o=n-1;r!==n&&i[r]<t;)++r;for(;o!==-1&&i[o]>e;)--o;if(++o,0!==r||o!==n){r>=o&&(o=Math.max(o,1),r=o-1);var s=this.getValueSize();this.times=Iu.arraySlice(i,r,o),this.values=Iu.arraySlice(this.values,r*s,o*s)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,s=0;s!==r;s++){var a=i[s];if("number"==typeof a&&isNaN(a)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,a),t=!1;break}if(null!==o&&o>a){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,a,o),t=!1;break}o=a}if(void 0!==n&&Iu.isTypedArray(n))for(var s=0,l=n.length;s!==l;++s){var h=n[s];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=this.getInterpolation()===Ml,r=1,o=t.length-1,s=1;s<o;++s){var a=!1,l=t[s],h=t[s+1];if(l!==h&&(1!==s||l!==l[0]))if(n)a=!0;else for(var c=s*i,u=c-i,d=c+i,p=0;p!==i;++p){var f=e[c+p];if(f!==e[u+p]||f!==e[d+p]){a=!0;break}}if(a){if(s!==r){t[r]=t[s];for(var m=s*i,g=r*i,p=0;p!==i;++p)e[g+p]=e[m+p]}++r}}if(o>0){t[r]=t[o];for(var m=o*i,g=r*i,p=0;p!==i;++p)e[g+p]=e[m+p];++r}return r!==t.length&&(this.times=Iu.arraySlice(t,0,r),this.values=Iu.arraySlice(e,0,r*i)),this},clone:function(){var t=Iu.arraySlice(this.times,0),e=Iu.arraySlice(this.values,0),i=this.constructor,n=new i(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Dn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Dn,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Tl,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ln.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Ln,ValueTypeName:"color"}),Rn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Rn,ValueTypeName:"number"}),In.prototype=Object.assign(Object.create(Mn.prototype),{constructor:In,interpolate_:function(t,e,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=t*a,h=(i-e)/(n-e),c=l+a;l!==c;l+=4)r.slerpFlat(o,0,s,l-a,s,l,h);return o}}),kn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:kn,ValueTypeName:"quaternion",DefaultInterpolation:Sl,InterpolantFactoryMethodLinear:function(t){return new In(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),On.prototype=Object.assign(Object.create(Pn.prototype),{constructor:On,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Tl,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Hn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Hn,ValueTypeName:"vector"}),Object.assign(Nn,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,o=i.length;r!==o;++r)e.push(Gn(i[r]).scale(n));return new Nn(t.name,t.duration,e)},toJSON:function(t){for(var e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=i.length;r!==o;++r)e.push(Pn.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,o=[],s=0;s<r;s++){var a=[],l=[];a.push((s+r-1)%r,s,(s+1)%r),l.push(0,1,0);var h=Iu.getKeyframeOrder(a);a=Iu.sortedArray(a,1,h),l=Iu.sortedArray(l,1,h),n||0!==a[0]||(a.push(r),l.push(l[0])),o.push(new Rn(".morphTargetInfluences["+e[s].name+"]",a,l).scale(1/i))}return new Nn(t,(-1),o)},findByName:function(t,e){var i=t;if(!Array.isArray(t)){var n=t;i=n.geometry&&n.geometry.animations||n.animations}for(var r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,o=0,s=t.length;o<s;o++){var a=t[o],l=a.name.match(r);if(l&&l.length>1){var h=l[1],c=n[h];c||(n[h]=c=[]),c.push(a)}}var u=[];for(var h in n)u.push(Nn.CreateFromMorphTargetSequence(h,n[h],e,i));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var i=function(t,e,i,n,r){if(0!==i.length){var o=[],s=[];Iu.flattenJSON(i,o,s,n),0!==o.length&&r.push(new t(e,o,s))}},n=[],r=t.name||"default",o=t.length||-1,s=t.fps||30,a=t.hierarchy||[],l=0;l<a.length;l++){var h=a[l].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var c={},u=0;u<h.length;u++)if(h[u].morphTargets)for(var d=0;d<h[u].morphTargets.length;d++)c[h[u].morphTargets[d]]=-1;for(var p in c){for(var f=[],m=[],d=0;d!==h[u].morphTargets.length;++d){var g=h[u];f.push(g.time),m.push(g.morphTarget===p?1:0)}n.push(new Rn(".morphTargetInfluence["+p+"]",f,m))}o=c.length*(s||1)}else{var v=".bones["+e[l].name+"]";i(Hn,v+".position",h,"pos",n),i(kn,v+".quaternion",h,"rot",n),i(Hn,v+".scale",h,"scl",n)}}if(0===n.length)return null;var y=new Nn(r,o,n);return y}}),Object.assign(Nn.prototype,{resetDuration:function(){for(var t=this.tracks,e=0,i=0,n=t.length;i!==n;++i){var r=this.tracks[i];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Nn(this.name,this.duration,t)}});var ku={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Ou=new Fn,Hu={};Object.assign(zn.prototype,{load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=ku.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;if(void 0!==Hu[t])return void Hu[t].push({onLoad:e,onProgress:i,onError:n});var s=/^data:(.*?)(;base64)?,(.*)$/,a=t.match(s);if(a){var l=a[1],h=!!a[2],c=a[3];c=decodeURIComponent(c),h&&(c=atob(c));try{var u,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":for(var p=new Uint8Array(c.length),f=0;f<c.length;f++)p[f]=c.charCodeAt(f);u="blob"===d?new Blob([p.buffer],{type:l}):p.buffer;break;case"document":var m=new DOMParser;u=m.parseFromString(c,l);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout(function(){e&&e(u),r.manager.itemEnd(t)},0)}catch(g){setTimeout(function(){n&&n(g),r.manager.itemError(t),r.manager.itemEnd(t)},0)}}else{Hu[t]=[],Hu[t].push({onLoad:e,onProgress:i,onError:n});var v=new XMLHttpRequest;v.open("GET",t,!0),v.addEventListener("load",function(e){var i=this.response;ku.add(t,i);var n=Hu[t];if(delete Hu[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var o=0,s=n.length;o<s;o++){var a=n[o];a.onLoad&&a.onLoad(i)}r.manager.itemEnd(t)}else{for(var o=0,s=n.length;o<s;o++){var a=n[o];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}},!1),v.addEventListener("progress",function(e){for(var i=Hu[t],n=0,r=i.length;n<r;n++){var o=i[n];o.onProgress&&o.onProgress(e)}},!1),v.addEventListener("error",function(e){var i=Hu[t];delete Hu[t];for(var n=0,o=i.length;n<o;n++){var s=i[n];s.onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!1),v.addEventListener("abort",function(e){var i=Hu[t];delete Hu[t];for(var n=0,o=i.length;n<o;n++){var s=i[n];s.onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(var y in this.requestHeader)v.setRequestHeader(y,this.requestHeader[y]);v.send(null)}return r.manager.itemStart(t),v},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(Un.prototype,{load:function(t,e,i,n){var r=this,o=new zn(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t,e){for(var i=[],n=0;n<t.length;n++){var r=Nn.parse(t[n]);i.push(r)}e(i)},setPath:function(t){return this.path=t,this}}),Object.assign(Vn.prototype,{load:function(t,e,i,n){function r(r){l.load(t[r],function(t){var i=o._parser(t,!0);s[r]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},h+=1,6===h&&(1===i.mipmapCount&&(a.minFilter=Aa),a.format=i.format,a.needsUpdate=!0,e&&e(a))},i,n)}var o=this,s=[],a=new Ke;a.image=s;var l=new zn(this.manager);if(l.setPath(this.path),l.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,c=0,u=t.length;c<u;++c)r(c);else l.load(t,function(t){var i=o._parser(t,!0);if(i.isCubemap)for(var n=i.mipmaps.length/i.mipmapCount,r=0;r<n;r++){s[r]={mipmaps:[]};for(var l=0;l<i.mipmapCount;l++)s[r].mipmaps.push(i.mipmaps[r*i.mipmapCount+l]),s[r].format=i.format,s[r].width=i.width,s[r].height=i.height}else a.image.width=i.width,a.image.height=i.height,a.mipmaps=i.mipmaps;1===i.mipmapCount&&(a.minFilter=Aa),a.format=i.format,a.needsUpdate=!0,e&&e(a)},i,n);return a},setPath:function(t){return this.path=t,this}}),Object.assign(jn.prototype,{load:function(t,e,i,n){var r=this,o=new d,s=new zn(this.manager);return s.setResponseType("arraybuffer"),s.setPath(this.path),s.load(t,function(t){var i=r._parser(t);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:wa,o.wrapT=void 0!==i.wrapT?i.wrapT:wa,o.magFilter=void 0!==i.magFilter?i.magFilter:Aa,o.minFilter=void 0!==i.minFilter?i.minFilter:Pa,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps),1===i.mipmapCount&&(o.minFilter=Aa),o.needsUpdate=!0,e&&e(o,i))},i,n),o},setPath:function(t){return this.path=t,this}}),Object.assign(Wn.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){function r(){l.removeEventListener("load",r,!1),l.removeEventListener("error",o,!1),ku.add(t,this),e&&e(this),s.manager.itemEnd(t)}function o(e){l.removeEventListener("load",r,!1),l.removeEventListener("error",o,!1),n&&n(e),s.manager.itemError(t),s.manager.itemEnd(t)}void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var s=this,a=ku.get(t);if(void 0!==a)return s.manager.itemStart(t),setTimeout(function(){e&&e(a),s.manager.itemEnd(t)},0),a;var l=document.createElementNS("http://www.w3.org/1999/xhtml","img");return l.addEventListener("load",r,!1),l.addEventListener("error",o,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(t),l.src=t,l},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Xn.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){function r(i){s.load(t[i],function(t){o.images[i]=t,a++,6===a&&(o.needsUpdate=!0,e&&e(o))},void 0,n)}var o=new at,s=new Wn(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);for(var a=0,l=0;l<t.length;++l)r(l);return o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(qn.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){var r=new a,o=new Wn(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(i){r.image=i;var n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?Va:ja,r.needsUpdate=!0,void 0!==e&&e(r)},i,n),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Yn.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),o=0;for(n.push(0),i=1;i<=t;i++)e=this.getPoint(i/t),o+=e.distanceTo(r),n.push(o),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n=this.getLengths(),r=0,o=n.length;i=e?e:t*n[o-1];for(var s,a=0,l=o-1;a<=l;)if(r=Math.floor(a+(l-a)/2),s=n[r]-i,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,n[r]===i)return r/(o-1);var h=n[r],c=n[r+1],u=c-h,d=(i-h)/u,p=(r+d)/(o-1);return p},getTangent:function(t){var e=1e-4,i=t-e,n=t+e;i<0&&(i=0),n>1&&(n=1);var r=this.getPoint(i),o=this.getPoint(n),s=o.clone().sub(r);return s.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var i,r,s,a=new o,l=[],h=[],c=[],u=new o,d=new n;for(i=0;i<=t;i++)r=i/t,l[i]=this.getTangentAt(r),l[i].normalize();h[0]=new o,c[0]=new o;var p=Number.MAX_VALUE,f=Math.abs(l[0].x),m=Math.abs(l[0].y),g=Math.abs(l[0].z);for(f<=p&&(p=f,a.set(1,0,0)),m<=p&&(p=m,a.set(0,1,0)),g<=p&&a.set(0,0,1),u.crossVectors(l[0],a).normalize(),h[0].crossVectors(l[0],u),c[0].crossVectors(l[0],h[0]),i=1;i<=t;i++)h[i]=h[i-1].clone(),c[i]=c[i-1].clone(),u.crossVectors(l[i-1],l[i]),u.length()>Number.EPSILON&&(u.normalize(),s=Math.acos(jl.clamp(l[i-1].dot(l[i]),-1,1)),h[i].applyMatrix4(d.makeRotationAxis(u,s))),c[i].crossVectors(l[i],h[i]);if(e===!0)for(s=Math.acos(jl.clamp(h[0].dot(h[t]),-1,1)),s/=t,l[0].dot(u.crossVectors(h[0],h[t]))>0&&(s=-s),i=1;i<=t;i++)h[i].applyMatrix4(d.makeRotationAxis(l[i],s*i)),c[i].crossVectors(l[i],h[i]);return{tangents:l,normals:h,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Kn.prototype=Object.create(Yn.prototype),Kn.prototype.constructor=Kn,Kn.prototype.isEllipseCurve=!0,Kn.prototype.getPoint=function(t,e){for(var n=e||new i,r=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)<Number.EPSILON;o<0;)o+=r;for(;o>r;)o-=r;o<Number.EPSILON&&(o=s?0:r),this.aClockwise!==!0||s||(o===r?o=-r:o-=r);var a=this.aStartAngle+t*o,l=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,p=h-this.aY;l=d*c-p*u+this.aX,h=d*u+p*c+this.aY}return n.set(l,h)},Kn.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Kn.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Kn.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Zn.prototype=Object.create(Kn.prototype),Zn.prototype.constructor=Zn,Zn.prototype.isArcCurve=!0;var Nu=new o,Bu=new Jn,Gu=new Jn,Fu=new Jn;Qn.prototype=Object.create(Yn.prototype),Qn.prototype.constructor=Qn,Qn.prototype.isCatmullRomCurve3=!0,Qn.prototype.getPoint=function(t,e){var i=e||new o,n=this.points,r=n.length,s=(r-(this.closed?0:1))*t,a=Math.floor(s),l=s-a;this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/r)+1)*r:0===l&&a===r-1&&(a=r-2,l=1);var h,c,u,d;if(this.closed||a>0?h=n[(a-1)%r]:(Nu.subVectors(n[0],n[1]).add(n[0]),h=Nu),c=n[a%r],u=n[(a+1)%r],this.closed||a+2<r?d=n[(a+2)%r]:(Nu.subVectors(n[r-1],n[r-2]).add(n[r-1]),d=Nu),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,f=Math.pow(h.distanceToSquared(c),p),m=Math.pow(c.distanceToSquared(u),p),g=Math.pow(u.distanceToSquared(d),p);m<1e-4&&(m=1),f<1e-4&&(f=m),g<1e-4&&(g=m),Bu.initNonuniformCatmullRom(h.x,c.x,u.x,d.x,f,m,g),Gu.initNonuniformCatmullRom(h.y,c.y,u.y,d.y,f,m,g),Fu.initNonuniformCatmullRom(h.z,c.z,u.z,d.z,f,m,g)}else"catmullrom"===this.curveType&&(Bu.initCatmullRom(h.x,c.x,u.x,d.x,this.tension),Gu.initCatmullRom(h.y,c.y,u.y,d.y,this.tension),Fu.initCatmullRom(h.z,c.z,u.z,d.z,this.tension));return i.set(Bu.calc(l),Gu.calc(l),Fu.calc(l)),i},Qn.prototype.copy=function(t){Yn.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Qn.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Qn.prototype.fromJSON=function(t){Yn.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push((new o).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},hr.prototype=Object.create(Yn.prototype),hr.prototype.constructor=hr,hr.prototype.isCubicBezierCurve=!0,hr.prototype.getPoint=function(t,e){var n=e||new i,r=this.v0,o=this.v1,s=this.v2,a=this.v3;return n.set(lr(t,r.x,o.x,s.x,a.x),lr(t,r.y,o.y,s.y,a.y)),n},hr.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},hr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),
t.v3=this.v3.toArray(),t},hr.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},cr.prototype=Object.create(Yn.prototype),cr.prototype.constructor=cr,cr.prototype.isCubicBezierCurve3=!0,cr.prototype.getPoint=function(t,e){var i=e||new o,n=this.v0,r=this.v1,s=this.v2,a=this.v3;return i.set(lr(t,n.x,r.x,s.x,a.x),lr(t,n.y,r.y,s.y,a.y),lr(t,n.z,r.z,s.z,a.z)),i},cr.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},cr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},cr.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},ur.prototype=Object.create(Yn.prototype),ur.prototype.constructor=ur,ur.prototype.isLineCurve=!0,ur.prototype.getPoint=function(t,e){var n=e||new i;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},ur.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},ur.prototype.getTangent=function(){var t=this.v2.clone().sub(this.v1);return t.normalize()},ur.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ur.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ur.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},dr.prototype=Object.create(Yn.prototype),dr.prototype.constructor=dr,dr.prototype.isLineCurve3=!0,dr.prototype.getPoint=function(t,e){var i=e||new o;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},dr.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},dr.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},dr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},dr.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},pr.prototype=Object.create(Yn.prototype),pr.prototype.constructor=pr,pr.prototype.isQuadraticBezierCurve=!0,pr.prototype.getPoint=function(t,e){var n=e||new i,r=this.v0,o=this.v1,s=this.v2;return n.set(nr(t,r.x,o.x,s.x),nr(t,r.y,o.y,s.y)),n},pr.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},pr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},pr.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},fr.prototype=Object.create(Yn.prototype),fr.prototype.constructor=fr,fr.prototype.isQuadraticBezierCurve3=!0,fr.prototype.getPoint=function(t,e){var i=e||new o,n=this.v0,r=this.v1,s=this.v2;return i.set(nr(t,n.x,r.x,s.x),nr(t,n.y,r.y,s.y),nr(t,n.z,r.z,s.z)),i},fr.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},fr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},fr.prototype.fromJSON=function(t){return Yn.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},mr.prototype=Object.create(Yn.prototype),mr.prototype.constructor=mr,mr.prototype.isSplineCurve=!0,mr.prototype.getPoint=function(t,e){var n=e||new i,r=this.points,o=(r.length-1)*t,s=Math.floor(o),a=o-s,l=r[0===s?s:s-1],h=r[s],c=r[s>r.length-2?r.length-1:s+1],u=r[s>r.length-3?r.length-1:s+2];return n.set($n(a,l.x,h.x,c.x,u.x),$n(a,l.y,h.y,c.y,u.y)),n},mr.prototype.copy=function(t){Yn.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this},mr.prototype.toJSON=function(){var t=Yn.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t},mr.prototype.fromJSON=function(t){Yn.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new i).fromArray(r))}return this};var zu=Object.freeze({ArcCurve:Zn,CatmullRomCurve3:Qn,CubicBezierCurve:hr,CubicBezierCurve3:cr,EllipseCurve:Kn,LineCurve:ur,LineCurve3:dr,QuadraticBezierCurve:pr,QuadraticBezierCurve3:fr,SplineCurve:mr});gr.prototype=Object.assign(Object.create(Yn.prototype),{constructor:gr,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ur(e,t))},getPoint:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=e){var r=i[n]-e,o=this.curves[n],s=o.getLength(),a=0===s?0:1-r/s;return o.getPointAt(a)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,i=[],n=0,r=this.curves;n<r.length;n++)for(var o=r[n],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s),l=0;l<a.length;l++){var h=a[l];e&&e.equals(h)||(i.push(h),e=h)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(t){Yn.prototype.copy.call(this,t),this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Yn.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,i=this.curves.length;e<i;e++){var n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){Yn.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push((new zu[n.type]).fromJSON(n))}return this}}),vr.prototype=Object.assign(Object.create(gr.prototype),{constructor:vr,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new ur(this.currentPoint.clone(),new i(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,r){var o=new pr(this.currentPoint.clone(),new i(t,e),new i(n,r));this.curves.push(o),this.currentPoint.set(n,r)},bezierCurveTo:function(t,e,n,r,o,s){var a=new hr(this.currentPoint.clone(),new i(t,e),new i(n,r),new i(o,s));this.curves.push(a),this.currentPoint.set(o,s)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),i=new mr(e);this.curves.push(i),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,i,n,r,o){var s=this.currentPoint.x,a=this.currentPoint.y;this.absarc(t+s,e+a,i,n,r,o)},absarc:function(t,e,i,n,r,o){this.absellipse(t,e,i,i,n,r,o)},ellipse:function(t,e,i,n,r,o,s,a){var l=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(t+l,e+h,i,n,r,o,s,a)},absellipse:function(t,e,i,n,r,o,s,a){var l=new Kn(t,e,i,n,r,o,s,a);if(this.curves.length>0){var h=l.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(l);var c=l.getPoint(1);this.currentPoint.copy(c)},copy:function(t){return gr.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=gr.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return gr.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),yr.prototype=Object.assign(Object.create(vr.prototype),{constructor:yr,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){vr.prototype.copy.call(this,t),this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){var t=vr.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,i=this.holes.length;e<i;e++){var n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){vr.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push((new vr).fromJSON(n))}return this}}),_r.prototype=Object.assign(Object.create(M.prototype),{constructor:_r,isLight:!0,copy:function(t){return M.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=M.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),br.prototype=Object.assign(Object.create(_r.prototype),{constructor:br,isHemisphereLight:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(xr.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),wr.prototype=Object.assign(Object.create(xr.prototype),{constructor:wr,isSpotLightShadow:!0,update:function(t){var e=this.camera,i=2*jl.RAD2DEG*t.angle,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix())}}),Tr.prototype=Object.assign(Object.create(_r.prototype),{constructor:Tr,isSpotLight:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Sr.prototype=Object.assign(Object.create(_r.prototype),{constructor:Sr,isPointLight:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Mr.prototype=Object.assign(Object.create(Se.prototype),{constructor:Mr,isOrthographicCamera:!0,copy:function(t,e){return Se.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-t,o=i+t,s=n+e,a=n-e;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;r+=c*(this.view.offsetX/l),o=r+c*(this.view.width/l),s-=u*(this.view.offsetY/h),a=s-u*(this.view.height/h)}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=M.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Er.prototype=Object.assign(Object.create(xr.prototype),{constructor:Er}),Ar.prototype=Object.assign(Object.create(_r.prototype),{constructor:Ar,isDirectionalLight:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Cr.prototype=Object.assign(Object.create(_r.prototype),{constructor:Cr,isAmbientLight:!0}),Pr.prototype=Object.assign(Object.create(_r.prototype),{constructor:Pr,isRectAreaLight:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=_r.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Dr.prototype,{load:function(t,e,i,n){var r=this,o=new zn(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t){function e(t){return void 0===r[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),r[t]}var r=this.textures,a=new Ru[t.type];if(void 0!==t.uuid&&(a.uuid=t.uuid),void 0!==t.name&&(a.name=t.name),void 0!==t.color&&a.color.setHex(t.color),void 0!==t.roughness&&(a.roughness=t.roughness),void 0!==t.metalness&&(a.metalness=t.metalness),void 0!==t.emissive&&a.emissive.setHex(t.emissive),void 0!==t.specular&&a.specular.setHex(t.specular),void 0!==t.shininess&&(a.shininess=t.shininess),void 0!==t.clearCoat&&(a.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(a.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(a.vertexColors=t.vertexColors),void 0!==t.fog&&(a.fog=t.fog),void 0!==t.flatShading&&(a.flatShading=t.flatShading),void 0!==t.blending&&(a.blending=t.blending),void 0!==t.combine&&(a.combine=t.combine),void 0!==t.side&&(a.side=t.side),void 0!==t.opacity&&(a.opacity=t.opacity),void 0!==t.transparent&&(a.transparent=t.transparent),void 0!==t.alphaTest&&(a.alphaTest=t.alphaTest),void 0!==t.depthTest&&(a.depthTest=t.depthTest),void 0!==t.depthWrite&&(a.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(a.colorWrite=t.colorWrite),void 0!==t.wireframe&&(a.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(a.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(a.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(a.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(a.rotation=t.rotation),1!==t.linewidth&&(a.linewidth=t.linewidth),void 0!==t.dashSize&&(a.dashSize=t.dashSize),void 0!==t.gapSize&&(a.gapSize=t.gapSize),void 0!==t.scale&&(a.scale=t.scale),void 0!==t.polygonOffset&&(a.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(a.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(a.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(a.skinning=t.skinning),void 0!==t.morphTargets&&(a.morphTargets=t.morphTargets),void 0!==t.dithering&&(a.dithering=t.dithering),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.uniforms)for(var h in t.uniforms){var c=t.uniforms[h];switch(a.uniforms[h]={},c.type){case"t":a.uniforms[h].value=e(c.value);break;case"c":a.uniforms[h].value=(new _).setHex(c.value);break;case"v2":a.uniforms[h].value=(new i).fromArray(c.value);break;case"v3":a.uniforms[h].value=(new o).fromArray(c.value);break;case"v4":a.uniforms[h].value=(new l).fromArray(c.value);break;case"m3":a.uniforms[h].value=(new s).fromArray(c.value);case"m4":a.uniforms[h].value=(new n).fromArray(c.value);break;default:a.uniforms[h].value=c.value}}if(void 0!==t.defines&&(a.defines=t.defines),void 0!==t.vertexShader&&(a.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(a.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var u in t.extensions)a.extensions[u]=t.extensions[u];if(void 0!==t.shading&&(a.flatShading=1===t.shading),void 0!==t.size&&(a.size=t.size),void 0!==t.sizeAttenuation&&(a.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(a.map=e(t.map)),void 0!==t.alphaMap&&(a.alphaMap=e(t.alphaMap),a.transparent=!0),void 0!==t.bumpMap&&(a.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(a.bumpScale=t.bumpScale),void 0!==t.normalMap&&(a.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(a.normalMapType=t.normalMapType),void 0!==t.normalScale){var d=t.normalScale;Array.isArray(d)===!1&&(d=[d,d]),a.normalScale=(new i).fromArray(d)}return void 0!==t.displacementMap&&(a.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(a.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(a.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(a.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(a.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(a.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(a.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(a.specularMap=e(t.specularMap)),void 0!==t.envMap&&(a.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(a.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(a.reflectivity=t.reflectivity),void 0!==t.lightMap&&(a.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(a.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(a.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(a.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(a.gradientMap=e(t.gradientMap)),a},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var Uu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.lastIndexOf("/");return e===-1?"./":t.substr(0,e+1)}};Object.assign(Lr.prototype,{load:function(t,e,i,n){var r=this,o=new zn(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t){var e=new G,i=t.data.index;if(void 0!==i){var n=new Vu[i.type](i.array);e.setIndex(new A(n,1))}var r=t.data.attributes;for(var s in r){var a=r[s],n=new Vu[a.type](a.array);e.addAttribute(s,new A(n,a.itemSize,a.normalized))}var l=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==l)for(var h=0,c=l.length;h!==c;++h){var u=l[h];e.addGroup(u.start,u.count,u.materialIndex)}var d=t.data.boundingSphere;if(void 0!==d){var p=new o;void 0!==d.center&&p.fromArray(d.center),e.boundingSphere=new f(p,d.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var Vu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Object.assign(Rr.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){var r=this,o=void 0===this.path?Uu.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;var s=new zn(r.manager);s.setPath(this.path),s.load(t,function(i){var o=null;try{o=JSON.parse(i)}catch(s){return void 0!==n&&n(s),void console.error("THREE:ObjectLoader: Can't parse "+t+".",s.message)}var a=o.metadata;return void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase()?void console.error("THREE.ObjectLoader: Can't load "+t):void r.parse(o,e)},i,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var i=this.parseShape(t.shapes),n=this.parseGeometries(t.geometries,i),r=this.parseImages(t.images,function(){void 0!==e&&e(a)}),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,n,s);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseShape:function(t){var e={};if(void 0!==t)for(var i=0,n=t.length;i<n;i++){var r=(new yr).fromJSON(t[i]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var i={};if(void 0!==t)for(var n=new Lr,r=0,o=t.length;r<o;r++){var s,a=t[r];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Lu[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Lu[a.type](a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Lu[a.type](a.radius,a.segments,a.thetaStart,a.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Lu[a.type](a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Lu[a.type](a.radius,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Lu[a.type](a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Lu[a.type](a.radius,a.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Lu[a.type](a.innerRadius,a.outerRadius,a.thetaSegments,a.phiSegments,a.thetaStart,a.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Lu[a.type](a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Lu[a.type](a.radius,a.tube,a.tubularSegments,a.radialSegments,a.p,a.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Lu[a.type](a.points,a.segments,a.phiStart,a.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Lu[a.type](a.vertices,a.indices,a.radius,a.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],h=0,c=a.shapes.length;h<c;h++){var u=e[a.shapes[h]];l.push(u)}s=new Lu[a.type](l,a.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(var l=[],h=0,c=a.shapes.length;h<c;h++){var u=e[a.shapes[h]];l.push(u)}var d=a.options.extrudePath;void 0!==d&&(a.options.extrudePath=(new zu[d.type]).fromJSON(d)),s=new Lu[a.type](l,a.options);break;case"BufferGeometry":s=n.parse(a);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE){var p=new THREE.LegacyJSONLoader;s=p.parse(a,this.resourcePath).geometry}else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+a.type+'"');continue}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),s.isBufferGeometry===!0&&void 0!==a.userData&&(s.userData=a.userData),i[a.uuid]=s}return i},parseMaterials:function(t,e){var i={},n={};if(void 0!==t){var r=new Dr;r.setTextures(e);for(var o=0,s=t.length;o<s;o++){var a=t[o];if("MultiMaterial"===a.type){for(var l=[],h=0;h<a.materials.length;h++){var c=a.materials[h];void 0===i[c.uuid]&&(i[c.uuid]=r.parse(c)),l.push(i[c.uuid])}n[a.uuid]=l}else void 0===i[a.uuid]&&(i[a.uuid]=r.parse(a)),n[a.uuid]=i[a.uuid]}}return n},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],r=Nn.parse(n);void 0!==n.uuid&&(r.uuid=n.uuid),e.push(r)}return e},parseImages:function(t,e){function i(t){return n.manager.itemStart(t),s.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}var n=this,r={};if(void 0!==t&&t.length>0){var o=new Fn(e),s=new Wn(o);s.setCrossOrigin(this.crossOrigin);for(var a=0,l=t.length;a<l;a++){var h=t[a],c=h.url;if(Array.isArray(c)){r[h.uuid]=[];for(var u=0,d=c.length;u<d;u++){var p=c[u],f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[h.uuid].push(i(f))}}else{var f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:n.resourcePath+h.url;r[h.uuid]=i(f)}}}return r},parseTextures:function(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var n={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var l;l=Array.isArray(e[s.image])?new at(e[s.image]):new a(e[s.image]),l.needsUpdate=!0,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=i(s.mapping,ju)),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=i(s.wrap[0],Wu),l.wrapT=i(s.wrap[1],Wu)),void 0!==s.format&&(l.format=s.format),void 0!==s.type&&(l.type=s.type),void 0!==s.encoding&&(l.encoding=s.encoding),void 0!==s.minFilter&&(l.minFilter=i(s.minFilter,Xu)),void 0!==s.magFilter&&(l.magFilter=i(s.magFilter,Xu)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),n[s.uuid]=l}return n},parseObject:function(t,e,i){function n(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function r(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];void 0===i[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(i[o])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}var o;switch(t.type){case"Scene":o=new Ie,void 0!==t.background&&Number.isInteger(t.background)&&(o.background=new _(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?o.fog=new Re(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(o.fog=new Le(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":o=new Me(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(o.focus=t.focus),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.filmGauge&&(o.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(o.filmOffset=t.filmOffset),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"OrthographicCamera":o=new Mr(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(o.zoom=t.zoom),void 0!==t.view&&(o.view=Object.assign({},t.view));break;case"AmbientLight":o=new Cr(t.color,t.intensity);break;case"DirectionalLight":o=new Ar(t.color,t.intensity);break;case"PointLight":o=new Sr(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":o=new Pr(t.color,t.intensity,t.width,t.height);break;case"SpotLight":o=new Tr(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":o=new br(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var s=n(t.geometry),a=r(t.material);o=s.bones&&s.bones.length>0?new Ge(s,a):new K(s,a),void 0!==t.drawMode&&o.setDrawMode(t.drawMode);break;case"LOD":o=new Be;break;case"Line":o=new Ve(n(t.geometry),r(t.material),t.mode);break;case"LineLoop":o=new We(n(t.geometry),r(t.material));break;case"LineSegments":o=new je(n(t.geometry),r(t.material));break;case"PointCloud":case"Points":o=new qe(n(t.geometry),r(t.material));break;case"Sprite":o=new Ne(r(t.material));break;case"Group":o=new Te;break;default:o=new M}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(o.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(o.matrixAutoUpdate=t.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.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.quaternion&&o.quaternion.fromArray(t.quaternion),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.castShadow&&(o.castShadow=t.castShadow),void 0!==t.receiveShadow&&(o.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(o.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(o.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&o.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(o.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.frustumCulled&&(o.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(o.renderOrder=t.renderOrder),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.layers&&(o.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,h=0;h<l.length;h++)o.add(this.parseObject(l[h],e,i));if("LOD"===t.type)for(var c=t.levels,u=0;u<c.length;u++){var d=c[u],p=o.getObjectByProperty("uuid",d.object);void 0!==p&&o.addLevel(p,d.distance)}return o}});var ju={UVMapping:pa,CubeReflectionMapping:fa,CubeRefractionMapping:ma,EquirectangularReflectionMapping:ga,EquirectangularRefractionMapping:va,SphericalReflectionMapping:ya,CubeUVReflectionMapping:_a,CubeUVRefractionMapping:ba},Wu={RepeatWrapping:xa,ClampToEdgeWrapping:wa,MirroredRepeatWrapping:Ta},Xu={NearestFilter:Sa,NearestMipMapNearestFilter:Ma,NearestMipMapLinearFilter:Ea,LinearFilter:Aa,LinearMipMapNearestFilter:Ca,LinearMipMapLinearFilter:Pa};Ir.prototype={constructor:Ir,setOptions:function(t){return this.options=t,this},load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=ku.get(t);return void 0!==o?(r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o):void fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,r.options)}).then(function(i){ku.add(t,i),e&&e(i),r.manager.itemEnd(t)})["catch"](function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(kr.prototype,{moveTo:function(t,e){this.currentPath=new vr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,n){this.currentPath.quadraticCurveTo(t,e,i,n)},bezierCurveTo:function(t,e,i,n,r,o){this.currentPath.bezierCurveTo(t,e,i,n,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],o=new yr;o.curves=r.curves,e.push(o)}return e}function n(t,e){for(var i=e.length,n=!1,r=i-1,o=0;o<i;r=o++){var s=e[r],a=e[o],l=a.x-s.x,h=a.y-s.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(s=e[o],l=-l,a=e[r],h=-h),t.y<s.y||t.y>a.y)continue;if(t.y===s.y){if(t.x===s.x)return!0}else{var c=h*(t.x-s.x)-l*(t.y-s.y);if(0===c)return!0;if(c<0)continue;n=!n}}else{if(t.y!==s.y)continue;if(a.x<=t.x&&t.x<=s.x||s.x<=t.x&&t.x<=a.x)return!0;
}}return n}var r=Pu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(e===!0)return i(o);var s,a,l,h=[];if(1===o.length)return a=o[0],l=new yr,l.curves=a.curves,h.push(l),h;var c=!r(o[0].getPoints());c=t?!c:c;var u,d=[],p=[],f=[],m=0;p[m]=void 0,f[m]=[];for(var g=0,v=o.length;g<v;g++)a=o[g],u=a.getPoints(),s=r(u),s=t?!s:s,s?(!c&&p[m]&&m++,p[m]={s:new yr,p:u},p[m].s.curves=a.curves,c&&m++,f[m]=[]):f[m].push({h:a,p:u[0]});if(!p[0])return i(o);if(p.length>1){for(var y=!1,_=[],b=0,x=p.length;b<x;b++)d[b]=[];for(var b=0,x=p.length;b<x;b++)for(var w=f[b],T=0;T<w.length;T++){for(var S=w[T],M=!0,E=0;E<p.length;E++)n(S.p,p[E].p)&&(b!==E&&_.push({froms:b,tos:E,hole:T}),M?(M=!1,d[E].push(S)):y=!0);M&&d[b].push(S)}_.length>0&&(y||(f=d))}for(var A,g=0,C=p.length;g<C;g++){l=p[g].s,h.push(l),A=f[g];for(var P=0,D=A.length;P<D;P++)l.holes.push(A[P].h)}return h}}),Object.assign(Or.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var i=[],n=Hr(t,e,this.data),r=0,o=n.length;r<o;r++)Array.prototype.push.apply(i,n[r].toShapes());return i}}),Object.assign(Br.prototype,{load:function(t,e,i,n){var r=this,o=new zn(this.manager);o.setPath(this.path),o.load(t,function(t){var i;try{i=JSON.parse(t)}catch(n){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}var o=r.parse(i);e&&e(o)},i,n)},parse:function(t){return new Or(t)},setPath:function(t){return this.path=t,this}}),Gr.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,i=0,n=e.length;i<n;i+=2){var r=e[i],o=e[i+1];if(r.test(t))return o}return null}},Object.assign(Gr.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,i){for(var n=[],r=0;r<t.length;++r)n[r]=this.createMaterial(t[r],e,i);return n},createMaterial:function(){var t={NoBlending:Cs,NormalBlending:Ps,AdditiveBlending:Ds,SubtractiveBlending:Ls,MultiplyBlending:Rs,CustomBlending:Is},e=new _,i=new qn,n=new Dr;return function(r,o,s){function a(t,e,n,r,a){var h,c=o+t,u=Gr.Handlers.get(c);null!==u?h=u.load(c):(i.setCrossOrigin(s),h=i.load(c)),void 0!==e&&(h.repeat.fromArray(e),1!==e[0]&&(h.wrapS=xa),1!==e[1]&&(h.wrapT=xa)),void 0!==n&&h.offset.fromArray(n),void 0!==r&&("repeat"===r[0]&&(h.wrapS=xa),"mirror"===r[0]&&(h.wrapS=Ta),"repeat"===r[1]&&(h.wrapT=xa),"mirror"===r[1]&&(h.wrapT=Ta)),void 0!==a&&(h.anisotropy=a);var d=jl.generateUUID();return l[d]=h,d}var l={},h={uuid:jl.generateUUID(),type:"MeshLambertMaterial"};for(var c in r){var u=r[c];switch(c){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":h.name=u;break;case"blending":h.blending=t[u];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",c,"is no longer supported.");break;case"colorDiffuse":h.color=e.fromArray(u).getHex();break;case"colorSpecular":h.specular=e.fromArray(u).getHex();break;case"colorEmissive":h.emissive=e.fromArray(u).getHex();break;case"specularCoef":h.shininess=u;break;case"shading":"basic"===u.toLowerCase()&&(h.type="MeshBasicMaterial"),"phong"===u.toLowerCase()&&(h.type="MeshPhongMaterial"),"standard"===u.toLowerCase()&&(h.type="MeshStandardMaterial");break;case"mapDiffuse":h.map=a(u,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":h.emissiveMap=a(u,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":h.lightMap=a(u,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":h.aoMap=a(u,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":h.bumpMap=a(u,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":h.bumpScale=u;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":h.normalMap=a(u,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":h.normalScale=u;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":h.specularMap=a(u,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":h.metalnessMap=a(u,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":h.roughnessMap=a(u,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":h.alphaMap=a(u,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":h.side=xs;break;case"doubleSided":h.side=ws;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),h.opacity=u;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":h[c]=u;break;case"vertexColors":u===!0&&(h.vertexColors=As),"face"===u&&(h.vertexColors=Es);break;default:console.error("THREE.Loader.createMaterial: Unsupported",c,u)}}return"MeshBasicMaterial"===h.type&&delete h.emissive,"MeshPhongMaterial"!==h.type&&delete h.specular,h.opacity<1&&(h.transparent=!0),n.setTextures(l),n.parse(h)}}()});var qu,Yu={getContext:function(){return void 0===qu&&(qu=new(window.AudioContext||window.webkitAudioContext)),qu},setContext:function(t){qu=t}};Object.assign(Fr.prototype,{load:function(t,e,i,n){var r=new zn(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,function(t){var i=t.slice(0),n=Yu.getContext();n.decodeAudioData(i,function(t){e(t)})},i,n)},setPath:function(t){return this.path=t,this}}),Object.assign(zr.prototype,{update:function(){var t,e,i,r,o,s,a,l,h=new n,c=new n;return function(n){var u=t!==this||e!==n.focus||i!==n.fov||r!==n.aspect*this.aspect||o!==n.near||s!==n.far||a!==n.zoom||l!==this.eyeSep;if(u){t=this,e=n.focus,i=n.fov,r=n.aspect*this.aspect,o=n.near,s=n.far,a=n.zoom;var d=n.projectionMatrix.clone();l=this.eyeSep/2;var p,f,m=l*o/e,g=o*Math.tan(jl.DEG2RAD*i*.5)/a;c.elements[12]=-l,h.elements[12]=l,p=-g*r+m,f=g*r+m,d.elements[0]=2*o/(f-p),d.elements[8]=(f+p)/(f-p),this.cameraL.projectionMatrix.copy(d),p=-g*r-m,f=g*r-m,d.elements[0]=2*o/(f-p),d.elements[8]=(f+p)/(f-p),this.cameraR.projectionMatrix.copy(d)}this.cameraL.matrixWorld.copy(n.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(n.matrixWorld).multiply(h)}}()}),Ur.prototype=Object.create(M.prototype),Ur.prototype.constructor=Ur,Object.assign(Vr.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),jr.prototype=Object.assign(Object.create(M.prototype),{constructor:jr,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(){var t=new o,e=new r,i=new o,n=new o,s=new Vr;return function(r){M.prototype.updateMatrixWorld.call(this,r);var o=this.context.listener,a=this.up;if(this.timeDelta=s.getDelta(),this.matrixWorld.decompose(t,e,i),n.set(0,0,-1).applyQuaternion(e),o.positionX){var l=this.context.currentTime+this.timeDelta;o.positionX.linearRampToValueAtTime(t.x,l),o.positionY.linearRampToValueAtTime(t.y,l),o.positionZ.linearRampToValueAtTime(t.z,l),o.forwardX.linearRampToValueAtTime(n.x,l),o.forwardY.linearRampToValueAtTime(n.y,l),o.forwardZ.linearRampToValueAtTime(n.z,l),o.upX.linearRampToValueAtTime(a.x,l),o.upY.linearRampToValueAtTime(a.y,l),o.upZ.linearRampToValueAtTime(a.z,l)}else o.setPosition(t.x,t.y,t.z),o.setOrientation(n.x,n.y,n.z,a.x,a.y,a.z)}}()}),Wr.prototype=Object.assign(Object.create(M.prototype),{constructor:Wr,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.isPlaying===!0&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this)},stop:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),this.isPlaying===!0?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,this.isPlaying===!0&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),Xr.prototype=Object.assign(Object.create(Wr.prototype),{constructor:Xr,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this},updateMatrixWorld:function(){var t=new o,e=new r,i=new o,n=new o;return function(r){if(M.prototype.updateMatrixWorld.call(this,r),this.isPlaying!==!1){this.matrixWorld.decompose(t,e,i),n.set(0,0,1).applyQuaternion(e);var o=this.panner;if(o.positionX){var s=this.context.currentTime+this.listener.timeDelta;o.positionX.linearRampToValueAtTime(t.x,s),o.positionY.linearRampToValueAtTime(t.y,s),o.positionZ.linearRampToValueAtTime(t.z,s),o.orientationX.linearRampToValueAtTime(n.x,s),o.orientationY.linearRampToValueAtTime(n.y,s),o.orientationZ.linearRampToValueAtTime(n.z,s)}else o.setPosition(t.x,t.y,t.z),o.setOrientation(n.x,n.y,n.z)}}}()}),Object.assign(qr.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Object.assign(Yr.prototype,{accumulate:function(t,e){var i=this.buffer,n=this.valueSize,r=t*n+n,o=this.cumulativeWeight;if(0===o){for(var s=0;s!==n;++s)i[r+s]=i[s];o=e}else{o+=e;var a=e/o;this._mixBufferRegion(i,r,0,a,n)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var s=3*e;this._mixBufferRegion(i,n,s,1-r,e)}for(var a=e,l=e+e;a!==l;++a)if(i[a]!==i[a+e]){o.setValue(i,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,i=this.valueSize,n=3*i;t.getValue(e,n);for(var r=i,o=n;r!==o;++r)e[r]=e[n+r%i];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,i,n,r){if(n>=.5)for(var o=0;o!==r;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,n){r.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var o=1-n,s=0;s!==r;++s){var a=e+s;t[a]=t[a]*o+t[i+s]*n}}});var Ku="\\[\\]\\.:\\/";Object.assign(Kr.prototype,{getValue:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(Zr,{Composite:Kr,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new Zr.Composite(t,e,i):new Zr(t,e,i)},sanitizeNodeName:function(){var t=new RegExp("["+Ku+"]","g");return function(e){return e.replace(/\s/g,"_").replace(t,"")}}(),parseTrackName:function(){var t="[^"+Ku+"]",e="[^"+Ku.replace("\\.","")+"]",i=/((?:WC+[\/:])*)/.source.replace("WC",t),n=/(WCOD+)?/.source.replace("WCOD",e),r=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",t),o=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",t),s=new RegExp("^"+i+n+r+o+"$"),a=["material","materials","bones"];return function(t){var e=s.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&n!==-1){var r=i.nodeName.substring(n+1);a.indexOf(r)!==-1&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=r)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}}(),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var r=t[i];if(r.name===e||r.uuid===e)return r;var o=n(r.children);if(o)return o}return null},r=n(t.children);if(r)return r}return null}}),Object.assign(Zr.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=Zr.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){var o=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var s=0;s<t.length;s++)if(t[s].name===o){o=s;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var a=t[n];if(void 0===a){var l=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+n+" but it wasn't found.",t)}var h=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?h=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(var s=0;s<this.node.geometry.morphAttributes.position.length;s++)if(t.geometry.morphAttributes.position[s].name===r){r=s;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(var s=0;s<this.node.geometry.morphTargets.length;s++)if(t.geometry.morphTargets[s].name===r){r=s;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(c=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Zr.prototype,{_getValue_unbound:Zr.prototype.getValue,_setValue_unbound:Zr.prototype.setValue}),Object.assign(Jr.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length,l=void 0,h=0,c=arguments.length;h!==c;++h){var u=arguments[h],d=u.uuid,p=n[d];if(void 0===p){p=e++,n[d]=p,t.push(u);for(var f=0,m=a;f!==m;++f)s[f].push(new Zr(u,r[f],o[f]))}else if(p<i){l=t[p];var g=--i,v=t[g];n[v.uuid]=p,t[p]=v,n[d]=g,t[g]=u;for(var f=0,m=a;f!==m;++f){var y=s[f],_=y[g],b=y[p];y[p]=_,void 0===b&&(b=new Zr(u,r[f],o[f])),y[g]=b}}else t[p]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=i},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,r=n.length,o=0,s=arguments.length;o!==s;++o){var a=arguments[o],l=a.uuid,h=i[l];if(void 0!==h&&h>=e){var c=e++,u=t[c];i[u.uuid]=h,t[h]=u,i[l]=c,t[c]=a;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[c],g=f[h];f[h]=m,f[c]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,o=r.length,s=0,a=arguments.length;s!==a;++s){var l=arguments[s],h=l.uuid,c=n[h];if(void 0!==c)if(delete n[h],c<i){var u=--i,d=t[u],p=--e,f=t[p];n[d.uuid]=c,t[c]=d,n[f.uuid]=u,t[u]=f,t.pop();for(var m=0,g=o;m!==g;++m){var v=r[m],y=v[u],_=v[p];v[c]=y,v[u]=_,v.pop()}}else{var p=--e,f=t[p];n[f.uuid]=c,t[c]=f,t.pop();for(var m=0,g=o;m!==g;++m){var v=r[m];v[c]=v[p],v.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){var i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];var o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,h=this.nCachedObjects_,c=new Array(l);n=r.length,i[t]=n,o.push(t),s.push(e),r.push(c);for(var u=h,d=a.length;u!==d;++u){var p=a[u];c[u]=new Zr(p,t,e)}return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){var n=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s],l=t[s];e[l]=i,o[i]=a,o.pop(),r[i]=r[s],r.pop(),n[i]=n[s],n.pop()}}}),Object.assign(Qr.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){var n=this._clip.duration,r=t._clip.duration,o=r/n,s=n/r;t.warp(1,o,e),this.warp(s,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){var n=this._mixer,r=n.time,o=this._timeScaleInterpolant,s=this.timeScale;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);var a=o.parameterPositions,l=o.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/s,l[1]=e/s,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);var r=this._startTime;if(null!==r){var o=(t-r)*i;if(o<0||0===i)return;this._startTime=null,e=i*o}e*=this._updateTimeScale(t);var s=this._updateTime(e),a=this._updateWeight(t);if(a>0)for(var l=this._interpolants,h=this._propertyBindings,c=0,u=l.length;c!==u;++c)l[c].evaluate(s),h[c].accumulate(n,a)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,i=this._clip.duration,n=this.loop,r=this._loopCount,o=n===wl;if(0===t)return r===-1?e:o&&1===(1&r)?i-e:e;if(n===bl){r===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(r===-1&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=i||e<0){var s=Math.floor(e/i);e-=i*s,r+=Math.abs(s);var a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){var l=t<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}}if(o&&1===(1&r))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=Al,n.endingEnd=Al):(t?n.endingStart=this.zeroSlopeAtStart?Al:El:n.endingStart=Cl,e?n.endingEnd=this.zeroSlopeAtEnd?Al:El:n.endingEnd=Cl)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=i,this}}),$r.prototype=Object.assign(Object.create(e.prototype),{constructor:$r,_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,s=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName,h=l[a];void 0===h&&(h={},l[a]=h);for(var c=0;c!==r;++c){var u=n[c],d=u.name,p=h[d];if(void 0!==p)o[c]=p;else{if(p=o[c],void 0!==p){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,a,d));continue}var f=e&&e._propertyBindings[c].binding.parsedPath;p=new Yr(Zr.create(i,d,f),u.ValueTypeName,u.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,a,d),o[c]=p}s[c].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(var r=t._propertyBindings,o=0,s=r.length;o!==s;++o){var a=r[o];0===a.useCount++&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0===--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){var n=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var s=o.knownActions;t._byClipCacheIndex=s.length,s.push(t)}t._cacheIndex=n.length,n.push(t),o.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],h=t._byClipCacheIndex;l._byClipCacheIndex=h,a[h]=l,a.pop(),t._byClipCacheIndex=null;var c=s.actionByRoot,u=(t._localRoot||this._root).uuid;delete c[u],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0===--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,
e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackAction:function(t){var e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_addInactiveBinding:function(t,e,i){var n=this._bindingsByRootAndName,r=n[e],o=this._bindings;void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,o=this._bindingsByRootAndName,s=o[n],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[r];t:{for(var h in s)break t;delete o[n]}},_lendBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(i=new An(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?Nn.findByName(i,t):t,o=null!==r?r.uuid:t,s=this._actionsByClip[o],a=null;if(void 0!==s){var l=s.actionByRoot[n];if(void 0!==l)return l;a=s.knownActions[0],null===r&&(r=a._clip)}if(null===r)return null;var h=new Qr(this,r,e);return this._bindAction(h,a),this._addInactiveAction(h,o,n),h},existingAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?Nn.findByName(i,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s?s.actionByRoot[n]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,i=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(var r=0;r!==n;++r)i[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,s=0;s!==i;++s){var a=e[s];a._update(n,t,r,o)}for(var l=this._bindings,h=this._nActiveBindings,s=0;s!==h;++s)l[s].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){for(var o=r.knownActions,s=0,a=o.length;s!==a;++s){var l=o[s];this._deactivateAction(l);var h=l._cacheIndex,c=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=h,e[h]=c,e.pop(),this._removeInactiveBindingsForAction(l)}delete n[i]}},uncacheRoot:function(t){var e=t.uuid,i=this._actionsByClip;for(var n in i){var r=i[n].actionByRoot,o=r[e];void 0!==o&&(this._deactivateAction(o),this._removeInactiveAction(o))}var s=this._bindingsByRootAndName,a=s[e];if(void 0!==a)for(var l in a){var h=a[l];h.restoreOriginalState(),this._removeInactiveBinding(h)}},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),to.prototype.clone=function(){return new to(void 0===this.value.clone?this.value:this.value.clone())},eo.prototype=Object.assign(Object.create(G.prototype),{constructor:eo,isInstancedBufferGeometry:!0,copy:function(t){return G.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),io.prototype=Object.assign(Object.create(ke.prototype),{constructor:io,isInstancedInterleavedBuffer:!0,copy:function(t){return ke.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),no.prototype=Object.assign(Object.create(A.prototype),{constructor:no,isInstancedBufferAttribute:!0,copy:function(t){return A.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(ro.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,i){var n=i||[];return so(t,this,n,e),n.sort(oo),n},intersectObjects:function(t,e,i){var n=i||[];if(Array.isArray(t)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var r=0,o=t.length;r<o;r++)so(t[r],this,n,e);return n.sort(oo),n}}),Object.assign(ao.prototype,{set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(jl.clamp(e/this.radius,-1,1))),this}}),Object.assign(lo.prototype,{set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}}),Object.assign(ho.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new i;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new i),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new i),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new i),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new i),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new i;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(co.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new o),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new o),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new o),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new o,e=new o;return function(i,n){t.subVectors(i,this.start),e.subVectors(this.end,this.start);var r=e.dot(e),o=e.dot(t),s=o/r;return n&&(s=jl.clamp(s,0,1)),s}}(),closestPointToPoint:function(t,e,i){var n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new o),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),uo.prototype=Object.create(M.prototype),uo.prototype.constructor=uo,uo.prototype.isImmediateRenderObject=!0,po.prototype=Object.create(je.prototype),po.prototype.constructor=po,po.prototype.update=function(){var t=new o,e=new o,i=new s;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var a=s.vertices,l=s.faces,h=0,c=0,u=l.length;c<u;c++)for(var d=l[c],p=0,f=d.vertexNormals.length;p<f;p++){var m=a[d[n[p]]],g=d.vertexNormals[p];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),o.setXYZ(h,t.x,t.y,t.z),h+=1,o.setXYZ(h,e.x,e.y,e.z),h+=1}else if(s&&s.isBufferGeometry)for(var v=s.attributes.position,y=s.attributes.normal,h=0,p=0,f=v.count;p<f;p++)t.set(v.getX(p),v.getY(p),v.getZ(p)).applyMatrix4(r),e.set(y.getX(p),y.getY(p),y.getZ(p)),e.applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),o.setXYZ(h,t.x,t.y,t.z),h+=1,o.setXYZ(h,e.x,e.y,e.z),h+=1;o.needsUpdate=!0}}(),fo.prototype=Object.create(M.prototype),fo.prototype.constructor=fo,fo.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},fo.prototype.update=function(){var t=new o;return function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,i=e*Math.tan(this.light.angle);this.cone.scale.set(i,i,e),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),go.prototype=Object.create(je.prototype),go.prototype.constructor=go,go.prototype.updateMatrixWorld=function(){var t=new o,e=new n,i=new n;return function(n){var r=this.bones,o=this.geometry,s=o.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var a=0,l=0;a<r.length;a++){var h=r[a];h.parent&&h.parent.isBone&&(e.multiplyMatrices(i,h.matrixWorld),t.setFromMatrixPosition(e),s.setXYZ(l,t.x,t.y,t.z),e.multiplyMatrices(i,h.parent.matrixWorld),t.setFromMatrixPosition(e),s.setXYZ(l+1,t.x,t.y,t.z),l+=2)}o.getAttribute("position").needsUpdate=!0,M.prototype.updateMatrixWorld.call(this,n)}}(),vo.prototype=Object.create(K.prototype),vo.prototype.constructor=vo,vo.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},vo.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},yo.prototype=Object.create(Ve.prototype),yo.prototype.constructor=yo,yo.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);e>1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},yo.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},_o.prototype=Object.create(M.prototype),_o.prototype.constructor=_o,_o.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},_o.prototype.update=function(){var t=new o,e=new _,i=new _;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=n.geometry.getAttribute("color");e.copy(this.light.color),i.copy(this.light.groundColor);for(var o=0,s=r.count;o<s;o++){var a=o<s/2?e:i;r.setXYZ(o,a.r,a.g,a.b)}r.needsUpdate=!0}n.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),bo.prototype=Object.create(je.prototype),bo.prototype.constructor=bo,xo.prototype=Object.create(je.prototype),xo.prototype.constructor=xo,wo.prototype=Object.create(je.prototype),wo.prototype.constructor=wo,wo.prototype.update=function(){var t=new o,e=new o,i=new s;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,s=o.vertices,a=o.faces,l=0,h=0,c=a.length;h<c;h++){var u=a[h],d=u.normal;t.copy(s[u.a]).add(s[u.b]).add(s[u.c]).divideScalar(3).applyMatrix4(n),e.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),r.setXYZ(l,t.x,t.y,t.z),l+=1,r.setXYZ(l,e.x,e.y,e.z),l+=1}r.needsUpdate=!0}}(),To.prototype=Object.create(M.prototype),To.prototype.constructor=To,To.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},To.prototype.update=function(){var t=new o,e=new o,i=new o;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(e,t),this.lightPlane.lookAt(e),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(e),this.targetLine.scale.z=i.length()}}(),So.prototype=Object.create(je.prototype),So.prototype.constructor=So,So.prototype.update=function(){function t(t,o,s,a){n.set(o,s,a).unproject(r);var l=i[t];if(void 0!==l)for(var h=e.getAttribute("position"),c=0,u=l.length;c<u;c++)h.setXYZ(l[c],n.x,n.y,n.z)}var e,i,n=new o,r=new Se;return function(){e=this.geometry,i=this.pointMap;var n=1,o=1;r.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-n,-o,-1),t("n2",n,-o,-1),t("n3",-n,o,-1),t("n4",n,o,-1),t("f1",-n,-o,1),t("f2",n,-o,1),t("f3",-n,o,1),t("f4",n,o,1),t("u1",.7*n,1.1*o,-1),t("u2",.7*-n,1.1*o,-1),t("u3",0,2*o,-1),t("cf1",-n,0,1),t("cf2",n,0,1),t("cf3",0,-o,1),t("cf4",0,o,1),t("cn1",-n,0,-1),t("cn2",n,0,-1),t("cn3",0,-o,-1),t("cn4",0,o,-1),e.getAttribute("position").needsUpdate=!0}}(),Mo.prototype=Object.create(je.prototype),Mo.prototype.constructor=Mo,Mo.prototype.update=function(){var t=new p;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var i=t.min,n=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=i.x,o[4]=n.y,o[5]=n.z,o[6]=i.x,o[7]=i.y,o[8]=n.z,o[9]=n.x,o[10]=i.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=i.z,o[15]=i.x,o[16]=n.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=n.x,o[22]=i.y,o[23]=i.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Mo.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Mo.prototype.copy=function(t){return je.prototype.copy.call(this,t),this.object=t.object,this},Mo.prototype.clone=function(){return(new this.constructor).copy(this)},Eo.prototype=Object.create(je.prototype),Eo.prototype.constructor=Eo,Eo.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),M.prototype.updateMatrixWorld.call(this,t))},Ao.prototype=Object.create(Ve.prototype),Ao.prototype.constructor=Ao,Ao.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?xs:bs,this.lookAt(this.plane.normal),M.prototype.updateMatrixWorld.call(this,t)};var Zu,Ju;Co.prototype=Object.create(M.prototype),Co.prototype.constructor=Co,Co.prototype.setDirection=function(){var t,e=new o;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(i.z,0,-i.x).normalize(),t=Math.acos(i.y),this.quaternion.setFromAxisAngle(e,t))}}(),Co.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Co.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Co.prototype.copy=function(t){return M.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Co.prototype.clone=function(){return(new this.constructor).copy(this)},Po.prototype=Object.create(je.prototype),Po.prototype.constructor=Po;var Qu=0,$u=1;Yn.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Yn.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(gr.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new E,i=0,n=t.length;i<n;i++){var r=t[i];e.vertices.push(new o(r.x,r.y,r.z||0))}return e}}),Object.assign(vr.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Zo.prototype=Object.create(Qn.prototype),Jo.prototype=Object.create(Qn.prototype),Qo.prototype=Object.create(Qn.prototype),Object.assign(Qo.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),bo.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},go.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Gr.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Uu.extractUrlBase(t)}}),Object.assign(Rr.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(ho.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(p.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),co.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(jl,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),jl.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),jl.ceilPowerOfTwo(t)}}),Object.assign(s.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(n.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new o),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,o)}}),m.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},r.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(X.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(q.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(q,{barycoordFromPoint:function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),q.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),q.getNormal(t,e,i,n)}}),Object.assign(yr.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new qi(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new on(this,t)}}),Object.assign(i.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(o.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(l.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(E.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(M.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(M.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Be.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Fe.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ge.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Yn.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),
this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Me.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(_r.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(A.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(G.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(G.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(Yi.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(to.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(j.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new _}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===Ts}}}),Object.defineProperties(_n.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(W.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(De.prototype,{clearTarget:function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}}),Object.defineProperties(De.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(_e.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(h.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Ce.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),Wr.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this,i=new Fr;return i.load(t,function(t){e.setBuffer(t)}),this},qr.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Ur.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var td={merge:function(t,e,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};Xl.crossOrigin=void 0,Xl.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new qn;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},Xl.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Xn;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},Xl.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Xl.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};var ed={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};t.WebGLMultisampleRenderTarget=c,t.WebGLRenderTargetCube=u,t.WebGLRenderTarget=h,t.WebGLRenderer=De,t.ShaderLib=hu,t.UniformsLib=lu,t.UniformsUtils=su,t.ShaderChunk=ou,t.FogExp2=Le,t.Fog=Re,t.Scene=Ie,t.Sprite=Ne,t.LOD=Be,t.SkinnedMesh=Ge,t.Skeleton=Fe,t.Bone=ze,t.Mesh=K,t.LineSegments=je,t.LineLoop=We,t.Line=Ve,t.Points=qe,t.Group=Te,t.VideoTexture=Ye,t.DataTexture=d,t.DataTexture3D=lt,t.CompressedTexture=Ke,t.CubeTexture=at,t.CanvasTexture=Ze,t.DepthTexture=Je,t.Texture=a,t.AnimationLoader=Un,t.CompressedTextureLoader=Vn,t.DataTextureLoader=jn,t.CubeTextureLoader=Xn,t.TextureLoader=qn,t.ObjectLoader=Rr,t.MaterialLoader=Dr,t.BufferGeometryLoader=Lr,t.DefaultLoadingManager=Ou,t.LoadingManager=Fn,t.ImageLoader=Wn,t.ImageBitmapLoader=Ir,t.FontLoader=Br,t.FileLoader=zn,t.Loader=Gr,t.LoaderUtils=Uu,t.Cache=ku,t.AudioLoader=Fr,t.SpotLightShadow=wr,t.SpotLight=Tr,t.PointLight=Sr,t.RectAreaLight=Pr,t.HemisphereLight=br,t.DirectionalLightShadow=Er,t.DirectionalLight=Ar,t.AmbientLight=Cr,t.LightShadow=xr,t.Light=_r,t.StereoCamera=zr,t.PerspectiveCamera=Me,t.OrthographicCamera=Mr,t.CubeCamera=Ur,t.ArrayCamera=Ee,t.Camera=Se,t.AudioListener=jr,t.PositionalAudio=Xr,t.AudioContext=Yu,t.AudioAnalyser=qr,t.Audio=Wr,t.VectorKeyframeTrack=Hn,t.StringKeyframeTrack=On,t.QuaternionKeyframeTrack=kn,t.NumberKeyframeTrack=Rn,t.ColorKeyframeTrack=Ln,t.BooleanKeyframeTrack=Dn,t.PropertyMixer=Yr,t.PropertyBinding=Zr,t.KeyframeTrack=Pn,t.AnimationUtils=Iu,t.AnimationObjectGroup=Jr,t.AnimationMixer=$r,t.AnimationClip=Nn,t.Uniform=to,t.InstancedBufferGeometry=eo,t.BufferGeometry=G,t.Geometry=E,t.InterleavedBufferAttribute=Oe,t.InstancedInterleavedBuffer=io,t.InterleavedBuffer=ke,t.InstancedBufferAttribute=no,t.Face3=w,t.Object3D=M,t.Raycaster=ro,t.Layers=S,t.EventDispatcher=e,t.Clock=Vr,t.QuaternionLinearInterpolant=In,t.LinearInterpolant=An,t.DiscreteInterpolant=Cn,t.CubicInterpolant=En,t.Interpolant=Mn,t.Triangle=q,t.Math=jl,t.Spherical=ao,t.Cylindrical=lo,t.Plane=m,t.Frustum=g,t.Sphere=f,t.Ray=X,t.Matrix4=n,t.Matrix3=s,t.Box3=p,t.Box2=ho,t.Line3=co,t.Euler=T,t.Vector4=l,t.Vector3=o,t.Vector2=i,t.Quaternion=r,t.Color=_,t.ImmediateRenderObject=uo,t.VertexNormalsHelper=po,t.SpotLightHelper=fo,t.SkeletonHelper=go,t.PointLightHelper=vo,t.RectAreaLightHelper=yo,t.HemisphereLightHelper=_o,t.GridHelper=bo,t.PolarGridHelper=xo,t.FaceNormalsHelper=wo,t.DirectionalLightHelper=To,t.CameraHelper=So,t.BoxHelper=Mo,t.Box3Helper=Eo,t.PlaneHelper=Ao,t.ArrowHelper=Co,t.AxesHelper=Po,t.Shape=yr,t.Path=vr,t.ShapePath=kr,t.Font=Or,t.CurvePath=gr,t.Curve=Yn,t.ImageUtils=Xl,t.ShapeUtils=Pu,t.WebGLUtils=we,t.WireframeGeometry=Qe,t.ParametricGeometry=$e,t.ParametricBufferGeometry=ti,t.TetrahedronGeometry=ni,t.TetrahedronBufferGeometry=ri,t.OctahedronGeometry=oi,t.OctahedronBufferGeometry=si,t.IcosahedronGeometry=ai,t.IcosahedronBufferGeometry=li,t.DodecahedronGeometry=hi,t.DodecahedronBufferGeometry=ci,t.PolyhedronGeometry=ei,t.PolyhedronBufferGeometry=ii,t.TubeGeometry=ui,t.TubeBufferGeometry=di,t.TorusKnotGeometry=pi,t.TorusKnotBufferGeometry=fi,t.TorusGeometry=mi,t.TorusBufferGeometry=gi,t.TextGeometry=Zi,t.TextBufferGeometry=Ji,t.SphereGeometry=Qi,t.SphereBufferGeometry=$i,t.RingGeometry=tn,t.RingBufferGeometry=en,t.PlaneGeometry=U,t.PlaneBufferGeometry=V,t.LatheGeometry=nn,t.LatheBufferGeometry=rn,t.ShapeGeometry=on,t.ShapeBufferGeometry=sn,t.ExtrudeGeometry=qi,t.ExtrudeBufferGeometry=Yi,t.EdgesGeometry=ln,t.ConeGeometry=un,t.ConeBufferGeometry=dn,t.CylinderGeometry=hn,t.CylinderBufferGeometry=cn,t.CircleGeometry=pn,t.CircleBufferGeometry=fn,t.BoxGeometry=F,t.CubeGeometry=F,t.BoxBufferGeometry=z,t.ShadowMaterial=mn,t.SpriteMaterial=He,t.RawShaderMaterial=gn,t.ShaderMaterial=W,t.PointsMaterial=Xe,t.MeshPhysicalMaterial=yn,t.MeshStandardMaterial=vn,t.MeshPhongMaterial=_n,t.MeshToonMaterial=bn,t.MeshNormalMaterial=xn,t.MeshLambertMaterial=wn,t.MeshDepthMaterial=ve,t.MeshDistanceMaterial=ye,t.MeshBasicMaterial=Y,t.MeshMatcapMaterial=Tn,t.LineDashedMaterial=Sn,t.LineBasicMaterial=Ue,t.Material=j,t.Float64BufferAttribute=H,t.Float32BufferAttribute=O,t.Uint32BufferAttribute=k,t.Int32BufferAttribute=I,t.Uint16BufferAttribute=R,t.Int16BufferAttribute=L,t.Uint8ClampedBufferAttribute=D,t.Uint8BufferAttribute=P,t.Int8BufferAttribute=C,t.BufferAttribute=A,t.ArcCurve=Zn,t.CatmullRomCurve3=Qn,t.CubicBezierCurve=hr,t.CubicBezierCurve3=cr,t.EllipseCurve=Kn,t.LineCurve=ur,t.LineCurve3=dr,t.QuadraticBezierCurve=pr,t.QuadraticBezierCurve3=fr,t.SplineCurve=mr,t.REVISION=hs,t.MOUSE=cs,t.CullFaceNone=us,t.CullFaceBack=ds,t.CullFaceFront=ps,t.CullFaceFrontBack=fs,t.FrontFaceDirectionCW=ms,t.FrontFaceDirectionCCW=gs,t.BasicShadowMap=vs,t.PCFShadowMap=ys,t.PCFSoftShadowMap=_s,t.FrontSide=bs,t.BackSide=xs,t.DoubleSide=ws,t.FlatShading=Ts,t.SmoothShading=Ss,t.NoColors=Ms,t.FaceColors=Es,t.VertexColors=As,t.NoBlending=Cs,t.NormalBlending=Ps,t.AdditiveBlending=Ds,t.SubtractiveBlending=Ls,t.MultiplyBlending=Rs,t.CustomBlending=Is,t.AddEquation=ks,t.SubtractEquation=Os,t.ReverseSubtractEquation=Hs,t.MinEquation=Ns,t.MaxEquation=Bs,t.ZeroFactor=Gs,t.OneFactor=Fs,t.SrcColorFactor=zs,t.OneMinusSrcColorFactor=Us,t.SrcAlphaFactor=Vs,t.OneMinusSrcAlphaFactor=js,t.DstAlphaFactor=Ws,t.OneMinusDstAlphaFactor=Xs,t.DstColorFactor=qs,t.OneMinusDstColorFactor=Ys,t.SrcAlphaSaturateFactor=Ks,t.NeverDepth=Zs,t.AlwaysDepth=Js,t.LessDepth=Qs,t.LessEqualDepth=$s,t.EqualDepth=ta,t.GreaterEqualDepth=ea,t.GreaterDepth=ia,t.NotEqualDepth=na,t.MultiplyOperation=ra,t.MixOperation=oa,t.AddOperation=sa,t.NoToneMapping=aa,t.LinearToneMapping=la,t.ReinhardToneMapping=ha,t.Uncharted2ToneMapping=ca,t.CineonToneMapping=ua,t.ACESFilmicToneMapping=da,t.UVMapping=pa,t.CubeReflectionMapping=fa,t.CubeRefractionMapping=ma,t.EquirectangularReflectionMapping=ga,t.EquirectangularRefractionMapping=va,t.SphericalReflectionMapping=ya,t.CubeUVReflectionMapping=_a,t.CubeUVRefractionMapping=ba,t.RepeatWrapping=xa,t.ClampToEdgeWrapping=wa,t.MirroredRepeatWrapping=Ta,t.NearestFilter=Sa,t.NearestMipMapNearestFilter=Ma,t.NearestMipMapLinearFilter=Ea,t.LinearFilter=Aa,t.LinearMipMapNearestFilter=Ca,t.LinearMipMapLinearFilter=Pa,t.UnsignedByteType=Da,t.ByteType=La,t.ShortType=Ra,t.UnsignedShortType=Ia,t.IntType=ka,t.UnsignedIntType=Oa,t.FloatType=Ha,t.HalfFloatType=Na,t.UnsignedShort4444Type=Ba,t.UnsignedShort5551Type=Ga,t.UnsignedShort565Type=Fa,t.UnsignedInt248Type=za,t.AlphaFormat=Ua,t.RGBFormat=Va,t.RGBAFormat=ja,t.LuminanceFormat=Wa,t.LuminanceAlphaFormat=Xa,t.RGBEFormat=qa,t.DepthFormat=Ya,t.DepthStencilFormat=Ka,t.RedFormat=Za,t.RGB_S3TC_DXT1_Format=Ja,t.RGBA_S3TC_DXT1_Format=Qa,t.RGBA_S3TC_DXT3_Format=$a,t.RGBA_S3TC_DXT5_Format=tl,t.RGB_PVRTC_4BPPV1_Format=el,t.RGB_PVRTC_2BPPV1_Format=il,t.RGBA_PVRTC_4BPPV1_Format=nl,t.RGBA_PVRTC_2BPPV1_Format=rl,t.RGB_ETC1_Format=ol,t.RGBA_ASTC_4x4_Format=sl,t.RGBA_ASTC_5x4_Format=al,t.RGBA_ASTC_5x5_Format=ll,t.RGBA_ASTC_6x5_Format=hl,t.RGBA_ASTC_6x6_Format=cl,t.RGBA_ASTC_8x5_Format=ul,t.RGBA_ASTC_8x6_Format=dl,t.RGBA_ASTC_8x8_Format=pl,t.RGBA_ASTC_10x5_Format=fl,t.RGBA_ASTC_10x6_Format=ml,t.RGBA_ASTC_10x8_Format=gl,t.RGBA_ASTC_10x10_Format=vl,t.RGBA_ASTC_12x10_Format=yl,t.RGBA_ASTC_12x12_Format=_l,t.LoopOnce=bl,t.LoopRepeat=xl,t.LoopPingPong=wl,t.InterpolateDiscrete=Tl,t.InterpolateLinear=Sl,t.InterpolateSmooth=Ml,t.ZeroCurvatureEnding=El,t.ZeroSlopeEnding=Al,t.WrapAroundEnding=Cl,t.TrianglesDrawMode=Pl,t.TriangleStripDrawMode=Dl,t.TriangleFanDrawMode=Ll,t.LinearEncoding=Rl,t.sRGBEncoding=Il,t.GammaEncoding=kl,t.RGBEEncoding=Ol,t.LogLuvEncoding=Hl,t.RGBM7Encoding=Nl,t.RGBM16Encoding=Bl,t.RGBDEncoding=Gl,t.BasicDepthPacking=Fl,t.RGBADepthPacking=zl,t.TangentSpaceNormalMap=Ul,t.ObjectSpaceNormalMap=Vl,t.Face4=Do,t.LineStrip=Qu,t.LinePieces=$u,t.MeshFaceMaterial=Lo,t.MultiMaterial=Ro,t.PointCloud=Io,t.Particle=ko,t.ParticleSystem=Oo,t.PointCloudMaterial=Ho,t.ParticleBasicMaterial=No,t.ParticleSystemMaterial=Bo,t.Vertex=Go,t.DynamicBufferAttribute=Fo,t.Int8Attribute=zo,t.Uint8Attribute=Uo,t.Uint8ClampedAttribute=Vo,t.Int16Attribute=jo,t.Uint16Attribute=Wo,t.Int32Attribute=Xo,t.Uint32Attribute=qo,t.Float32Attribute=Yo,t.Float64Attribute=Ko,t.ClosedSplineCurve3=Zo,t.SplineCurve3=Jo,t.Spline=Qo,t.AxisHelper=$o,t.BoundingBoxHelper=ts,t.EdgesHelper=es,t.WireframeHelper=is,t.XHRLoader=ns,t.BinaryTextureLoader=rs,t.GeometryUtils=td,t.Projector=os,t.CanvasRenderer=ss,t.JSONLoader=as,t.SceneUtils=ed,t.LensFlare=ls,Object.defineProperty(t,"__esModule",{value:!0})}),function(){"use strict";function t(t,e){var i=t.split("."),n=a;!(i[0]in n)&&n.execScript&&n.execScript("var "+i[0]);for(var r;i.length&&(r=i.shift());)i.length||e===s?n=n[r]?n[r]:n[r]={}:n[r]=e}function e(t){var e,i,n,r,o,s,a,h,c,u,d=t.length,p=0,f=Number.POSITIVE_INFINITY;for(h=0;h<d;++h)t[h]>p&&(p=t[h]),t[h]<f&&(f=t[h]);for(e=1<<p,i=new(l?Uint32Array:Array)(e),n=1,r=0,o=2;n<=p;){for(h=0;h<d;++h)if(t[h]===n){for(s=0,a=r,c=0;c<n;++c)s=s<<1|1&a,a>>=1;for(u=n<<16|h,c=s;c<e;c+=o)i[c]=u;++r}++n,r<<=1,o<<=1}return[i,p,f]}function i(t,e){switch(this.g=[],this.h=32768,this.d=this.f=this.a=this.l=0,this.input=l?new Uint8Array(t):t,this.m=!1,this.i=c,this.r=!1,!e&&(e={})||(e.index&&(this.a=e.index),e.bufferSize&&(this.h=e.bufferSize),e.bufferType&&(this.i=e.bufferType),e.resize&&(this.r=e.resize)),this.i){case h:this.b=32768,this.c=new(l?Uint8Array:Array)(32768+this.h+258);break;case c:this.b=0,this.c=new(l?Uint8Array:Array)(this.h),this.e=this.z,this.n=this.v,this.j=this.w;break;default:throw Error("invalid inflate mode")}}function n(t,e){for(var i,n=t.f,r=t.d,o=t.input,s=t.a,a=o.length;r<e;){if(s>=a)throw Error("input buffer is broken");n|=o[s++]<<r,r+=8}return i=n&(1<<e)-1,t.f=n>>>e,t.d=r-e,t.a=s,i}function r(t,e){for(var i,n,r=t.f,o=t.d,s=t.input,a=t.a,l=s.length,h=e[0],c=e[1];o<c&&!(a>=l);)r|=s[a++]<<o,o+=8;if(i=h[r&(1<<c)-1],n=i>>>16,n>o)throw Error("invalid code length: "+n);return t.f=r>>n,t.d=o-n,t.a=a,65535&i}function o(t,e){var n,r;switch(this.input=t,this.a=0,!e&&(e={})||(e.index&&(this.a=e.index),e.verify&&(this.A=e.verify)),n=t[this.a++],r=t[this.a++],15&n){case D:this.method=D;break;default:throw Error("unsupported compression method")}if(0!==((n<<8)+r)%31)throw Error("invalid fcheck flag:"+((n<<8)+r)%31);if(32&r)throw Error("fdict flag is not supported");this.q=new i(t,{index:this.a,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}var s=void 0,a=this,l="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,h=0,c=1,u={t:h,s:c};i.prototype.k=function(){for(;!this.m;){var t=n(this,3);switch(1&t&&(this.m=!0),t>>>=1){case 0:var i=this.input,o=this.a,a=this.c,u=this.b,d=i.length,p=s,f=s,g=a.length,v=s;if(this.d=this.f=0,o+1>=d)throw Error("invalid uncompressed block header: LEN");if(p=i[o++]|i[o++]<<8,o+1>=d)throw Error("invalid uncompressed block header: NLEN");if(f=i[o++]|i[o++]<<8,p===~f)throw Error("invalid uncompressed block header: length verify");if(o+p>i.length)throw Error("input buffer is broken");switch(this.i){case h:for(;u+p>a.length;){if(v=g-u,p-=v,l)a.set(i.subarray(o,o+v),u),u+=v,o+=v;else for(;v--;)a[u++]=i[o++];this.b=u,a=this.e(),u=this.b}break;case c:for(;u+p>a.length;)a=this.e({p:2});break;default:throw Error("invalid inflate mode")}if(l)a.set(i.subarray(o,o+p),u),u+=p,o+=p;else for(;p--;)a[u++]=i[o++];this.a=o,this.b=u,this.c=a;break;case 1:this.j(A,P);break;case 2:for(var y=n(this,5)+257,_=n(this,5)+1,b=n(this,4)+4,x=new(l?Uint8Array:Array)(m.length),w=s,T=s,S=s,M=s,E=s,C=s,D=s,L=s,R=s,L=0;L<b;++L)x[m[L]]=n(this,3);if(!l)for(L=b,b=x.length;L<b;++L)x[m[L]]=0;for(w=e(x),M=new(l?Uint8Array:Array)(y+_),L=0,R=y+_;L<R;)switch(E=r(this,w)){case 16:for(D=3+n(this,2);D--;)M[L++]=C;break;case 17:for(D=3+n(this,3);D--;)M[L++]=0;C=0;break;case 18:for(D=11+n(this,7);D--;)M[L++]=0;C=0;break;default:C=M[L++]=E}T=e(l?M.subarray(0,y):M.slice(0,y)),S=e(l?M.subarray(y):M.slice(y)),this.j(T,S);break;default:throw Error("unknown BTYPE: "+t)}}return this.n()};var d,p,f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],m=l?new Uint16Array(f):f,g=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],v=l?new Uint16Array(g):g,y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],_=l?new Uint8Array(y):y,b=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],x=l?new Uint16Array(b):b,w=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],T=l?new Uint8Array(w):w,S=new(l?Uint8Array:Array)(288);for(d=0,p=S.length;d<p;++d)S[d]=143>=d?8:255>=d?9:279>=d?7:8;var M,E,A=e(S),C=new(l?Uint8Array:Array)(30);for(M=0,E=C.length;M<E;++M)C[M]=5;var P=e(C);i.prototype.j=function(t,e){var i=this.c,o=this.b;this.o=t;for(var s,a,l,h,c=i.length-258;256!==(s=r(this,t));)if(256>s)o>=c&&(this.b=o,i=this.e(),o=this.b),i[o++]=s;else for(a=s-257,h=v[a],0<_[a]&&(h+=n(this,_[a])),s=r(this,e),l=x[s],0<T[s]&&(l+=n(this,T[s])),o>=c&&(this.b=o,i=this.e(),o=this.b);h--;)i[o]=i[o++-l];for(;8<=this.d;)this.d-=8,this.a--;this.b=o},i.prototype.w=function(t,e){var i=this.c,o=this.b;this.o=t;for(var s,a,l,h,c=i.length;256!==(s=r(this,t));)if(256>s)o>=c&&(i=this.e(),c=i.length),i[o++]=s;else for(a=s-257,h=v[a],0<_[a]&&(h+=n(this,_[a])),s=r(this,e),l=x[s],0<T[s]&&(l+=n(this,T[s])),o+h>c&&(i=this.e(),c=i.length);h--;)i[o]=i[o++-l];for(;8<=this.d;)this.d-=8,this.a--;this.b=o},i.prototype.e=function(){var t,e,i=new(l?Uint8Array:Array)(this.b-32768),n=this.b-32768,r=this.c;if(l)i.set(r.subarray(32768,i.length));else for(t=0,e=i.length;t<e;++t)i[t]=r[t+32768];if(this.g.push(i),this.l+=i.length,l)r.set(r.subarray(n,n+32768));else for(t=0;32768>t;++t)r[t]=r[n+t];return this.b=32768,r},i.prototype.z=function(t){var e,i,n,r,o=this.input.length/this.a+1|0,s=this.input,a=this.c;return t&&("number"==typeof t.p&&(o=t.p),"number"==typeof t.u&&(o+=t.u)),2>o?(i=(s.length-this.a)/this.o[2],r=258*(i/2)|0,n=r<a.length?a.length+r:a.length<<1):n=a.length*o,l?(e=new Uint8Array(n),e.set(a)):e=a,this.c=e},i.prototype.n=function(){var t,e,i,n,r,o=0,s=this.c,a=this.g,h=new(l?Uint8Array:Array)(this.l+(this.b-32768));if(0===a.length)return l?this.c.subarray(32768,this.b):this.c.slice(32768,this.b);for(e=0,i=a.length;e<i;++e)for(t=a[e],n=0,r=t.length;n<r;++n)h[o++]=t[n];for(e=32768,i=this.b;e<i;++e)h[o++]=s[e];return this.g=[],this.buffer=h},i.prototype.v=function(){var t,e=this.b;return l?this.r?(t=new Uint8Array(e),t.set(this.c.subarray(0,e))):t=this.c.subarray(0,e):(this.c.length>e&&(this.c.length=e),t=this.c),this.buffer=t},o.prototype.k=function(){var t,e,i=this.input;if(t=this.q.k(),this.a=this.q.a,this.A){e=(i[this.a++]<<24|i[this.a++]<<16|i[this.a++]<<8|i[this.a++])>>>0;var n=t;if("string"==typeof n){var r,o,s=n.split("");for(r=0,o=s.length;r<o;r++)s[r]=(255&s[r].charCodeAt(0))>>>0;n=s}for(var a,l=1,h=0,c=n.length,u=0;0<c;){a=1024<c?1024:c,c-=a;do l+=n[u++],h+=l;while(--a);l%=65521,h%=65521}if(e!==(h<<16|l)>>>0)throw Error("invalid adler-32 checksum")}return t};var D=8;t("Zlib.Inflate",o),t("Zlib.Inflate.prototype.decompress",o.prototype.k);var L,R,I,k,O={ADAPTIVE:u.s,BLOCK:u.t};if(Object.keys)L=Object.keys(O);else for(R in L=[],I=0,O)L[I++]=R;for(I=0,k=L.length;I<k;++I)R=L[I],t("Zlib.Inflate.BufferType."+R,O[R])}.call(this),THREE.FBXLoader=function(){function t(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager}function e(t){this.textureLoader=t}function i(){}function n(){}function r(){}function o(){}function s(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}function a(){}function l(t){var e="Kaydara FBX Binary  \0";return t.byteLength>=e.length&&e===g(t,0,e.length)}function h(t){function e(e){var i=t[e-1];return t=t.slice(n+e),n++,i}for(var i=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],n=0,r=0;r<i.length;++r){var o=e(1);if(o===i[r])return!1}return!0}function c(t){var e=/FBXVersion: (\d+)/,i=t.match(e);if(i){var n=parseInt(i[1]);return n}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function u(t){return t/46186158e3}function d(t,e,i,n){var r;switch(n.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=i;break;case"AllSame":r=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}"IndexToDirect"===n.referenceType&&(r=n.indices[r]);var o=r*n.dataSize,s=o+n.dataSize;return y(T,n.buffer,o,s)}function p(t){var e=new THREE.Matrix4,i=new THREE.Matrix4,n=new THREE.Matrix4,r=new THREE.Matrix4,o=new THREE.Matrix4,s=new THREE.Matrix4,a=new THREE.Matrix4,l=new THREE.Matrix4,h=new THREE.Matrix4,c=new THREE.Matrix4,u=new THREE.Matrix4,d=t.inheritType?t.inheritType:0;if(t.translation&&e.setPosition(M.fromArray(t.translation)),t.preRotation){var p=t.preRotation.map(THREE.Math.degToRad);p.push(t.eulerOrder),i.makeRotationFromEuler(S.fromArray(p))}if(t.rotation){var p=t.rotation.map(THREE.Math.degToRad);p.push(t.eulerOrder),n.makeRotationFromEuler(S.fromArray(p))}if(t.postRotation){var p=t.postRotation.map(THREE.Math.degToRad);p.push(t.eulerOrder),r.makeRotationFromEuler(S.fromArray(p));
}t.scale&&o.scale(M.fromArray(t.scale)),t.scalingOffset&&a.setPosition(M.fromArray(t.scalingOffset)),t.scalingPivot&&s.setPosition(M.fromArray(t.scalingPivot)),t.rotationOffset&&l.setPosition(M.fromArray(t.rotationOffset)),t.rotationPivot&&h.setPosition(M.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(c=t.parentMatrixWorld);var f=i.multiply(n).multiply(r),m=new THREE.Matrix4;c.extractRotation(m);var g,v,y,_=new THREE.Matrix4;_.copyPosition(c),y=_.getInverse(_).multiply(c),v=m.getInverse(m).multiply(y),g=o;var b;if(0===d)b=m.multiply(f).multiply(v).multiply(g);else if(1===d)b=m.multiply(v).multiply(f).multiply(g);else{var x=(new THREE.Matrix4).copy(o),w=v.multiply(x.getInverse(x));b=m.multiply(f).multiply(w).multiply(g)}var T=e.multiply(l).multiply(h).multiply(i).multiply(n).multiply(r).multiply(h.getInverse(h)).multiply(a).multiply(s).multiply(o).multiply(s.getInverse(s)),E=(new THREE.Matrix4).copyPosition(T),A=c.multiply(E);return u.copyPosition(A),T=u.multiply(b)}function f(t){t=t||0;var e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===t?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[t]}function m(t){var e=t.split(",").map(function(t){return parseFloat(t)});return e}function g(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),THREE.LoaderUtils.decodeText(new Uint8Array(t,e,i))}function v(t,e){for(var i=0,n=t.length,r=e.length;i<r;i++,n++)t[n]=e[i]}function y(t,e,i,n){for(var r=i,o=0;r<n;r++,o++)t[o]=e[r];return t}function _(t,e,i){return t.slice(0,e).concat(i).concat(t.slice(e))}var b,x,w;t.prototype={constructor:t,crossOrigin:"anonymous",load:function(t,e,i,n){var r=this,o=void 0===r.path?THREE.LoaderUtils.extractUrlBase(t):r.path,s=new THREE.FileLoader(this.manager);s.setResponseType("arraybuffer"),s.load(t,function(i){try{e(r.parse(i,o))}catch(s){setTimeout(function(){n&&n(s),r.manager.itemError(t)},0)}},i,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,i){if(l(t))b=(new o).parse(t);else{var n=g(t);if(!h(n))throw new Error("THREE.FBXLoader: Unknown format.");if(c(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+c(n));b=(new r).parse(n)}var s=new THREE.TextureLoader(this.manager).setPath(this.resourcePath||i).setCrossOrigin(this.crossOrigin);return new e(s).parse(b)}},e.prototype={constructor:e,parse:function(){x=this.parseConnections();var t=this.parseImages(),e=this.parseTextures(t),n=this.parseMaterials(e),r=this.parseDeformers(),o=(new i).parse(r);return this.parseScene(r,o,n),w},parseConnections:function(){var t=new Map;if("Connections"in b){var e=b.Connections.connections;e.forEach(function(e){var i=e[0],n=e[1],r=e[2];t.has(i)||t.set(i,{parents:[],children:[]});var o={ID:n,relationship:r};t.get(i).parents.push(o),t.has(n)||t.set(n,{parents:[],children:[]});var s={ID:i,relationship:r};t.get(n).children.push(s)})}return t},parseImages:function(){var t={},e={};if("Video"in b.Objects){var i=b.Objects.Video;for(var n in i){var r=i[n],o=parseInt(n);if(t[o]=r.RelativeFilename||r.Filename,"Content"in r){var s=r.Content instanceof ArrayBuffer&&r.Content.byteLength>0,a="string"==typeof r.Content&&""!==r.Content;if(s||a){var l=this.parseImage(i[n]);e[r.RelativeFilename||r.Filename]=l}}}}for(var o in t){var h=t[o];void 0!==e[h]?t[o]=e[h]:t[o]=t[o].split("\\").pop()}return t},parseImage:function(t){var e,i=t.Content,n=t.RelativeFilename||t.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();switch(r){case"bmp":e="image/bmp";break;case"jpg":case"jpeg":e="image/jpeg";break;case"png":e="image/png";break;case"tif":e="image/tiff";break;case"tga":if("function"!=typeof THREE.TGALoader)return void console.warn("FBXLoader: THREE.TGALoader is required to load TGA textures");if(null===THREE.Loader.Handlers.get(".tga")){var o=new THREE.TGALoader;o.setPath(this.textureLoader.path),THREE.Loader.Handlers.add(/\.tga$/i,o)}e="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof i)return"data:"+e+";base64,"+i;var s=new Uint8Array(i);return window.URL.createObjectURL(new Blob([s],{type:e}))},parseTextures:function(t){var e=new Map;if("Texture"in b.Objects){var i=b.Objects.Texture;for(var n in i){var r=this.parseTexture(i[n],t);e.set(parseInt(n),r)}}return e},parseTexture:function(t,e){var i=this.loadTexture(t,e);i.ID=t.id,i.name=t.attrName;var n=t.WrapModeU,r=t.WrapModeV,o=void 0!==n?n.value:0,s=void 0!==r?r.value:0;if(i.wrapS=0===o?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,i.wrapT=0===s?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,"Scaling"in t){var a=t.Scaling.value;i.repeat.x=a[0],i.repeat.y=a[1]}return i},loadTexture:function(t,e){var i,n=this.textureLoader.path,r=x.get(t.id).children;void 0!==r&&r.length>0&&void 0!==e[r[0].ID]&&(i=e[r[0].ID],0!==i.indexOf("blob:")&&0!==i.indexOf("data:")||this.textureLoader.setPath(void 0));var o,s=t.FileName.slice(-3).toLowerCase();if("tga"===s){var a=THREE.Loader.Handlers.get(".tga");null===a?(console.warn("FBXLoader: TGALoader not found, creating empty placeholder texture for",i),o=new THREE.Texture):o=a.load(i)}else"psd"===s?(console.warn("FBXLoader: PSD textures are not supported, creating empty placeholder texture for",i),o=new THREE.Texture):o=this.textureLoader.load(i);return this.textureLoader.setPath(n),o},parseMaterials:function(t){var e=new Map;if("Material"in b.Objects){var i=b.Objects.Material;for(var n in i){var r=this.parseMaterial(i[n],t);null!==r&&e.set(parseInt(n),r)}}return e},parseMaterial:function(t,e){var i=t.id,n=t.attrName,r=t.ShadingModel;if("object"==typeof r&&(r=r.value),!x.has(i))return null;var o,s=this.parseParameters(t,e,i);switch(r.toLowerCase()){case"phong":o=new THREE.MeshPhongMaterial;break;case"lambert":o=new THREE.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',r),o=new THREE.MeshPhongMaterial({color:3342591})}return o.setValues(s),o.name=n,o},parseParameters:function(t,e,i){var n={};t.BumpFactor&&(n.bumpScale=t.BumpFactor.value),t.Diffuse?n.color=(new THREE.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(n.color=(new THREE.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(n.displacementScale=t.DisplacementFactor.value),t.Emissive?n.emissive=(new THREE.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(n.emissive=(new THREE.Color).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(n.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(n.opacity=parseFloat(t.Opacity.value)),n.opacity<1&&(n.transparent=!0),t.ReflectionFactor&&(n.reflectivity=t.ReflectionFactor.value),t.Shininess&&(n.shininess=t.Shininess.value),t.Specular?n.specular=(new THREE.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(n.specular=(new THREE.Color).fromArray(t.SpecularColor.value));var r=this;return x.get(i).children.forEach(function(t){var i=t.relationship;switch(i){case"Bump":n.bumpMap=r.getTexture(e,t.ID);break;case"DiffuseColor":n.map=r.getTexture(e,t.ID);break;case"DisplacementColor":n.displacementMap=r.getTexture(e,t.ID);break;case"EmissiveColor":n.emissiveMap=r.getTexture(e,t.ID);break;case"NormalMap":n.normalMap=r.getTexture(e,t.ID);break;case"ReflectionColor":n.envMap=r.getTexture(e,t.ID),n.envMap.mapping=THREE.EquirectangularReflectionMapping;break;case"SpecularColor":n.specularMap=r.getTexture(e,t.ID);break;case"TransparentColor":n.alphaMap=r.getTexture(e,t.ID),n.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",i)}}),n},getTexture:function(t,e){return"LayeredTexture"in b.Objects&&e in b.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),e=x.get(e).children[0].ID),t.get(e)},parseDeformers:function(){var t={},e={};if("Deformer"in b.Objects){var i=b.Objects.Deformer;for(var n in i){var r=i[n],o=x.get(parseInt(n));if("Skin"===r.attrType){var s=this.parseSkeleton(o,i);s.ID=n,o.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),s.geometryID=o.parents[0].ID,t[n]=s}else if("BlendShape"===r.attrType){var a={id:n};a.rawTargets=this.parseMorphTargets(o,i),a.id=n,o.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),e[n]=a}}}return{skeletons:t,morphTargets:e}},parseSkeleton:function(t,e){var i=[];return t.children.forEach(function(t){var n=e[t.ID];if("Cluster"===n.attrType){var r={ID:t.ID,indices:[],weights:[],transformLink:(new THREE.Matrix4).fromArray(n.TransformLink.a)};"Indexes"in n&&(r.indices=n.Indexes.a,r.weights=n.Weights.a),i.push(r)}}),{rawBones:i,bones:[]}},parseMorphTargets:function(t,e){for(var i=[],n=0;n<t.children.length;n++){var r=t.children[n],o=e[r.ID],s={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if("BlendShapeChannel"!==o.attrType)return;s.geoID=x.get(parseInt(r.ID)).children.filter(function(t){return void 0===t.relationship})[0].ID,i.push(s)}return i},parseScene:function(t,e,i){w=new THREE.Group;var r=this.parseModels(t.skeletons,e,i),o=b.Objects.Model,s=this;r.forEach(function(t){var e=o[t.ID];s.setLookAtProperties(t,e);var i=x.get(t.ID).parents;i.forEach(function(e){var i=r.get(e.ID);void 0!==i&&i.add(t)}),null===t.parent&&w.add(t)}),this.bindSkeleton(t.skeletons,e,r),this.createAmbientLight(),this.setupMorphMaterials(),w.traverse(function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrixWorld=t.parent.matrix);var e=p(t.userData.transformData);t.applyMatrix(e)}});var a=(new n).parse();1===w.children.length&&w.children[0].isGroup&&(w.children[0].animations=a,w=w.children[0]),w.animations=a},parseModels:function(t,e,i){var n=new Map,r=b.Objects.Model;for(var o in r){var s=parseInt(o),a=r[o],l=x.get(s),h=this.buildSkeleton(l,t,s,a.attrName);if(!h){switch(a.attrType){case"Camera":h=this.createCamera(l);break;case"Light":h=this.createLight(l);break;case"Mesh":h=this.createMesh(l,e,i);break;case"NurbsCurve":h=this.createCurve(l,e);break;case"LimbNode":case"Root":h=new THREE.Bone;break;case"Null":default:h=new THREE.Group}h.name=THREE.PropertyBinding.sanitizeNodeName(a.attrName),h.ID=s}this.getTransformData(h,a),n.set(s,h)}return n},buildSkeleton:function(t,e,i,n){var r=null;return t.parents.forEach(function(t){for(var o in e){var s=e[o];s.rawBones.forEach(function(e,o){if(e.ID===t.ID){var a=r;r=new THREE.Bone,r.matrixWorld.copy(e.transformLink),r.name=THREE.PropertyBinding.sanitizeNodeName(n),r.ID=i,s.bones[o]=r,null!==a&&r.add(a)}})}}),r},createCamera:function(t){var e,i;if(t.children.forEach(function(t){var e=b.Objects.NodeAttribute[t.ID];void 0!==e&&(i=e)}),void 0===i)e=new THREE.Object3D;else{var n=0;void 0!==i.CameraProjectionType&&1===i.CameraProjectionType.value&&(n=1);var r=1;void 0!==i.NearPlane&&(r=i.NearPlane.value/1e3);var o=1e3;void 0!==i.FarPlane&&(o=i.FarPlane.value/1e3);var s=window.innerWidth,a=window.innerHeight;void 0!==i.AspectWidth&&void 0!==i.AspectHeight&&(s=i.AspectWidth.value,a=i.AspectHeight.value);var l=s/a,h=45;void 0!==i.FieldOfView&&(h=i.FieldOfView.value);var c=i.FocalLength?i.FocalLength.value:null;switch(n){case 0:e=new THREE.PerspectiveCamera(h,l,r,o),null!==c&&e.setFocalLength(c);break;case 1:e=new THREE.OrthographicCamera(-s/2,s/2,a/2,-a/2,r,o);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+n+"."),e=new THREE.Object3D}}return e},createLight:function(t){var e,i;if(t.children.forEach(function(t){var e=b.Objects.NodeAttribute[t.ID];void 0!==e&&(i=e)}),void 0===i)e=new THREE.Object3D;else{var n;n=void 0===i.LightType?0:i.LightType.value;var r=16777215;void 0!==i.Color&&(r=(new THREE.Color).fromArray(i.Color.value));var o=void 0===i.Intensity?1:i.Intensity.value/100;void 0!==i.CastLightOnObject&&0===i.CastLightOnObject.value&&(o=0);var s=0;void 0!==i.FarAttenuationEnd&&(s=void 0!==i.EnableFarAttenuation&&0===i.EnableFarAttenuation.value?0:i.FarAttenuationEnd.value);var a=1;switch(n){case 0:e=new THREE.PointLight(r,o,s,a);break;case 1:e=new THREE.DirectionalLight(r,o);break;case 2:var l=Math.PI/3;void 0!==i.InnerAngle&&(l=THREE.Math.degToRad(i.InnerAngle.value));var h=0;void 0!==i.OuterAngle&&(h=THREE.Math.degToRad(i.OuterAngle.value),h=Math.max(h,1)),e=new THREE.SpotLight(r,o,s,l,h,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+i.LightType.value+", defaulting to a THREE.PointLight."),e=new THREE.PointLight(r,o)}void 0!==i.CastShadows&&1===i.CastShadows.value&&(e.castShadow=!0)}return e},createMesh:function(t,e,i){var n,r=null,o=null,s=[];return t.children.forEach(function(t){e.has(t.ID)&&(r=e.get(t.ID)),i.has(t.ID)&&s.push(i.get(t.ID))}),s.length>1?o=s:s.length>0?o=s[0]:(o=new THREE.MeshPhongMaterial({color:13421772}),s.push(o)),"color"in r.attributes&&s.forEach(function(t){t.vertexColors=THREE.VertexColors}),r.FBX_Deformer?(s.forEach(function(t){t.skinning=!0}),n=new THREE.SkinnedMesh(r,o),n.normalizeSkinWeights()):n=new THREE.Mesh(r,o),n},createCurve:function(t,e){var i=t.children.reduce(function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t},null),n=new THREE.LineBasicMaterial({color:3342591,linewidth:1});return new THREE.Line(i,n)},getTransformData:function(t,e){var i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),"RotationOrder"in e?i.eulerOrder=f(e.RotationOrder.value):i.eulerOrder="ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i},setLookAtProperties:function(t,e){if("LookAtProperty"in e){var i=x.get(t.ID).children;i.forEach(function(e){if("LookAtProperty"===e.relationship){var i=b.Objects.Model[e.ID];if("Lcl_Translation"in i){var n=i.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(n),w.add(t.target)):t.lookAt((new THREE.Vector3).fromArray(n))}}})}},bindSkeleton:function(t,e,i){var n=this.parsePoseNodes();for(var r in t){var o=t[r],s=x.get(parseInt(o.ID)).parents;s.forEach(function(t){if(e.has(t.ID)){var r=t.ID,s=x.get(r);s.parents.forEach(function(t){if(i.has(t.ID)){var e=i.get(t.ID);e.bind(new THREE.Skeleton(o.bones),n[t.ID])}})}})}},parsePoseNodes:function(){var t={};if("Pose"in b.Objects){var e=b.Objects.Pose;for(var i in e)if("BindPose"===e[i].attrType){var n=e[i].PoseNode;Array.isArray(n)?n.forEach(function(e){t[e.Node]=(new THREE.Matrix4).fromArray(e.Matrix.a)}):t[n.Node]=(new THREE.Matrix4).fromArray(n.Matrix.a)}}return t},createAmbientLight:function(){if("GlobalSettings"in b&&"AmbientColor"in b.GlobalSettings){var t=b.GlobalSettings.AmbientColor.value,e=t[0],i=t[1],n=t[2];if(0!==e||0!==i||0!==n){var r=new THREE.Color(e,i,n);w.add(new THREE.AmbientLight(r,1))}}},setupMorphMaterials:function(){var t=this;w.traverse(function(e){e.isMesh&&e.geometry.morphAttributes.position&&e.geometry.morphAttributes.position.length&&(Array.isArray(e.material)?e.material.forEach(function(i,n){t.setupMorphMaterial(e,i,n)}):t.setupMorphMaterial(e,e.material))})},setupMorphMaterial:function(t,e,i){var n=t.uuid,r=e.uuid,o=!1;if(w.traverse(function(t){t.isMesh&&(Array.isArray(t.material)?t.material.forEach(function(e){e.uuid===r&&t.uuid!==n&&(o=!0)}):t.material.uuid===r&&t.uuid!==n&&(o=!0))}),o===!0){var s=e.clone();s.morphTargets=!0,void 0===i?t.material=s:t.material[i]=s}else e.morphTargets=!0}},i.prototype={constructor:i,parse:function(t){var e=new Map;if("Geometry"in b.Objects){var i=b.Objects.Geometry;for(var n in i){var r=x.get(parseInt(n)),o=this.parseGeometry(r,i[n],t);e.set(parseInt(n),o)}}return e},parseGeometry:function(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}},parseMeshGeometry:function(t,e,i){var n=i.skeletons,r=i.morphTargets,o=t.parents.map(function(t){return b.Objects.Model[t.ID]});if(0!==o.length){var s=t.children.reduce(function(t,e){return void 0!==n[e.ID]&&(t=n[e.ID]),t},null),a=t.children.reduce(function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t},null),l=o[0],h={};"RotationOrder"in l&&(h.eulerOrder=f(l.RotationOrder.value)),"InheritType"in l&&(h.inheritType=parseInt(l.InheritType.value)),"GeometricTranslation"in l&&(h.translation=l.GeometricTranslation.value),"GeometricRotation"in l&&(h.rotation=l.GeometricRotation.value),"GeometricScaling"in l&&(h.scale=l.GeometricScaling.value);var c=p(h);return this.genGeometry(e,s,a,c)}},genGeometry:function(t,e,i,n){var r=new THREE.BufferGeometry;t.attrName&&(r.name=t.attrName);var o=this.parseGeoNode(t,e),s=this.genBuffers(o),a=new THREE.Float32BufferAttribute(s.vertex,3);if(n.applyToBufferAttribute(a),r.addAttribute("position",a),s.colors.length>0&&r.addAttribute("color",new THREE.Float32BufferAttribute(s.colors,3)),e&&(r.addAttribute("skinIndex",new THREE.Uint16BufferAttribute(s.weightsIndices,4)),r.addAttribute("skinWeight",new THREE.Float32BufferAttribute(s.vertexWeights,4)),r.FBX_Deformer=e),s.normal.length>0){var l=new THREE.Float32BufferAttribute(s.normal,3),h=(new THREE.Matrix3).getNormalMatrix(n);h.applyToBufferAttribute(l),r.addAttribute("normal",l)}if(s.uvs.forEach(function(t,e){var i="uv"+(e+1).toString();0===e&&(i="uv"),r.addAttribute(i,new THREE.Float32BufferAttribute(s.uvs[e],2))}),o.material&&"AllSame"!==o.material.mappingType){var c=s.materialIndex[0],u=0;if(s.materialIndex.forEach(function(t,e){t!==c&&(r.addGroup(u,e-u,c),c=t,u=e)}),r.groups.length>0){var d=r.groups[r.groups.length-1],p=d.start+d.count;p!==s.materialIndex.length&&r.addGroup(p,s.materialIndex.length-p,c)}0===r.groups.length&&r.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(r,t,i,n),r},parseGeoNode:function(t,e){var i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];for(var n=0;t.LayerElementUV[n];)i.uv.push(this.parseUVs(t.LayerElementUV[n])),n++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach(function(t,e){t.indices.forEach(function(n,r){void 0===i.weightTable[n]&&(i.weightTable[n]=[]),i.weightTable[n].push({id:e,weight:t.weights[r]})})})),i},genBuffers:function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,r=!1,o=[],s=[],a=[],l=[],h=[],c=[],u=this;return t.vertexIndices.forEach(function(p,f){var m=!1;p<0&&(p^=-1,m=!0);var g=[],v=[];if(o.push(3*p,3*p+1,3*p+2),t.color){var y=d(f,i,p,t.color);a.push(y[0],y[1],y[2])}if(t.skeleton){if(void 0!==t.weightTable[p]&&t.weightTable[p].forEach(function(t){v.push(t.weight),g.push(t.id)}),v.length>4){r||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),r=!0);var _=[0,0,0,0],b=[0,0,0,0];v.forEach(function(t,e){var i=t,n=g[e];b.forEach(function(t,e,r){if(i>t){r[e]=i,i=t;var o=_[e];_[e]=n,n=o}})}),g=_,v=b}for(;v.length<4;)v.push(0),g.push(0);for(var x=0;x<4;++x)h.push(v[x]),c.push(g[x])}if(t.normal){var y=d(f,i,p,t.normal);s.push(y[0],y[1],y[2])}if(t.material&&"AllSame"!==t.material.mappingType)var w=d(f,i,p,t.material)[0];t.uv&&t.uv.forEach(function(t,e){var n=d(f,i,p,t);void 0===l[e]&&(l[e]=[]),l[e].push(n[0]),l[e].push(n[1])}),n++,m&&(u.genFace(e,t,o,w,s,a,l,h,c,n),i++,n=0,o=[],s=[],a=[],l=[],h=[],c=[])}),e},genFace:function(t,e,i,n,r,o,s,a,l,h){for(var c=2;c<h;c++)t.vertex.push(e.vertexPositions[i[0]]),t.vertex.push(e.vertexPositions[i[1]]),t.vertex.push(e.vertexPositions[i[2]]),t.vertex.push(e.vertexPositions[i[3*(c-1)]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+1]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+2]]),t.vertex.push(e.vertexPositions[i[3*c]]),t.vertex.push(e.vertexPositions[i[3*c+1]]),t.vertex.push(e.vertexPositions[i[3*c+2]]),e.skeleton&&(t.vertexWeights.push(a[0]),t.vertexWeights.push(a[1]),t.vertexWeights.push(a[2]),t.vertexWeights.push(a[3]),t.vertexWeights.push(a[4*(c-1)]),t.vertexWeights.push(a[4*(c-1)+1]),t.vertexWeights.push(a[4*(c-1)+2]),t.vertexWeights.push(a[4*(c-1)+3]),t.vertexWeights.push(a[4*c]),t.vertexWeights.push(a[4*c+1]),t.vertexWeights.push(a[4*c+2]),t.vertexWeights.push(a[4*c+3]),t.weightsIndices.push(l[0]),t.weightsIndices.push(l[1]),t.weightsIndices.push(l[2]),t.weightsIndices.push(l[3]),t.weightsIndices.push(l[4*(c-1)]),t.weightsIndices.push(l[4*(c-1)+1]),t.weightsIndices.push(l[4*(c-1)+2]),t.weightsIndices.push(l[4*(c-1)+3]),t.weightsIndices.push(l[4*c]),t.weightsIndices.push(l[4*c+1]),t.weightsIndices.push(l[4*c+2]),t.weightsIndices.push(l[4*c+3])),e.color&&(t.colors.push(o[0]),t.colors.push(o[1]),t.colors.push(o[2]),t.colors.push(o[3*(c-1)]),t.colors.push(o[3*(c-1)+1]),t.colors.push(o[3*(c-1)+2]),t.colors.push(o[3*c]),t.colors.push(o[3*c+1]),t.colors.push(o[3*c+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(n),t.materialIndex.push(n),t.materialIndex.push(n)),e.normal&&(t.normal.push(r[0]),t.normal.push(r[1]),t.normal.push(r[2]),t.normal.push(r[3*(c-1)]),t.normal.push(r[3*(c-1)+1]),t.normal.push(r[3*(c-1)+2]),t.normal.push(r[3*c]),t.normal.push(r[3*c+1]),t.normal.push(r[3*c+2])),e.uv&&e.uv.forEach(function(e,i){void 0===t.uvs[i]&&(t.uvs[i]=[]),t.uvs[i].push(s[i][0]),t.uvs[i].push(s[i][1]),t.uvs[i].push(s[i][2*(c-1)]),t.uvs[i].push(s[i][2*(c-1)+1]),t.uvs[i].push(s[i][2*c]),t.uvs[i].push(s[i][2*c+1])})},addMorphTargets:function(t,e,i,n){if(null!==i){t.morphAttributes.position=[];var r=this;i.rawTargets.forEach(function(i){var o=b.Objects.Geometry[i.geoID];void 0!==o&&r.genMorphGeometry(t,e,o,n,i.name)})}},genMorphGeometry:function(t,e,i,n,r){var o=new THREE.BufferGeometry;i.attrName&&(o.name=i.attrName);for(var s=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],a=void 0!==e.Vertices?e.Vertices.a.slice():[],l=void 0!==i.Vertices?i.Vertices.a:[],h=void 0!==i.Indexes?i.Indexes.a:[],c=0;c<h.length;c++){var u=3*h[c];a[u]+=l[3*c],a[u+1]+=l[3*c+1],a[u+2]+=l[3*c+2]}var d={vertexIndices:s,vertexPositions:a},p=this.genBuffers(d),f=new THREE.Float32BufferAttribute(p.vertex,3);f.name=r||i.attrName,n.applyToBufferAttribute(f),t.morphAttributes.position.push(f)},parseNormals:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Normals.a,r=[];return"IndexToDirect"===i&&("NormalIndex"in t?r=t.NormalIndex.a:"NormalsIndex"in t&&(r=t.NormalsIndex.a)),{dataSize:3,buffer:n,indices:r,mappingType:e,referenceType:i}},parseUVs:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.UV.a,r=[];return"IndexToDirect"===i&&(r=t.UVIndex.a),{dataSize:2,buffer:n,indices:r,mappingType:e,referenceType:i}},parseVertexColors:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Colors.a,r=[];return"IndexToDirect"===i&&(r=t.ColorIndex.a),{dataSize:4,buffer:n,indices:r,mappingType:e,referenceType:i}},parseMaterialIndices:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};for(var n=t.Materials.a,r=[],o=0;o<n.length;++o)r.push(o);return{dataSize:1,buffer:n,indices:r,mappingType:e,referenceType:i}},parseNurbsGeometry:function(t){if(void 0===THREE.NURBSCurve)return console.error("THREE.FBXLoader: The loader relies on THREE.NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new THREE.BufferGeometry;var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new THREE.BufferGeometry;for(var i=e-1,n=t.KnotVector.a,r=[],o=t.Points.a,s=0,a=o.length;s<a;s+=4)r.push((new THREE.Vector4).fromArray(o,s));var l,h;if("Closed"===t.Form)r.push(r[0]);else if("Periodic"===t.Form){l=i,h=n.length-1-l;for(var s=0;s<i;++s)r.push(r[s])}var c=new THREE.NURBSCurve(i,n,r,l,h),u=c.getPoints(7*r.length),d=new Float32Array(3*u.length);u.forEach(function(t,e){t.toArray(d,3*e)});var p=new THREE.BufferGeometry;return p.addAttribute("position",new THREE.BufferAttribute(d,3)),p}},n.prototype={constructor:n,parse:function(){var t=[],e=this.parseClips();if(void 0!==e){for(var i in e){var n=e[i],r=this.addClip(n);t.push(r)}return t}},parseClips:function(){if(void 0!==b.Objects.AnimationCurve){var t=this.parseAnimationCurveNodes();this.parseAnimationCurves(t);var e=this.parseAnimationLayers(t),i=this.parseAnimStacks(e);return i}},parseAnimationCurveNodes:function(){var t=b.Objects.AnimationCurveNode,e=new Map;for(var i in t){var n=t[i];if(null!==n.attrName.match(/S|R|T|DeformPercent/)){var r={id:n.id,attr:n.attrName,curves:{}};e.set(r.id,r)}}return e},parseAnimationCurves:function(t){var e=b.Objects.AnimationCurve;for(var i in e){var n={id:e[i].id,times:e[i].KeyTime.a.map(u),values:e[i].KeyValueFloat.a},r=x.get(n.id);if(void 0!==r){var o=r.parents[0].ID,s=r.parents[0].relationship;s.match(/X/)?t.get(o).curves.x=n:s.match(/Y/)?t.get(o).curves.y=n:s.match(/Z/)?t.get(o).curves.z=n:s.match(/d|DeformPercent/)&&t.has(o)&&(t.get(o).curves.morph=n)}}},parseAnimationLayers:function(t){var e=b.Objects.AnimationLayer,i=new Map;for(var n in e){var r=[],o=x.get(parseInt(n));if(void 0!==o){var s=o.children;s.forEach(function(e,i){if(t.has(e.ID)){var n=t.get(e.ID);if(void 0!==n.curves.x||void 0!==n.curves.y||void 0!==n.curves.z){if(void 0===r[i]){var o=x.get(e.ID).parents.filter(function(t){return void 0!==t.relationship})[0].ID;if(void 0!==o){var s=b.Objects.Model[o.toString()],a={modelName:THREE.PropertyBinding.sanitizeNodeName(s.attrName),ID:s.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};w.traverse(function(t){(t.ID=s.id)&&(a.transform=t.matrix,t.userData.transformData&&(a.eulerOrder=t.userData.transformData.eulerOrder))}),a.transform||(a.transform=new THREE.Matrix4),"PreRotation"in s&&(a.preRotation=s.PreRotation.value),"PostRotation"in s&&(a.postRotation=s.PostRotation.value),r[i]=a}}r[i]&&(r[i][n.attr]=n)}else if(void 0!==n.curves.morph){if(void 0===r[i]){var l=x.get(e.ID).parents.filter(function(t){return void 0!==t.relationship})[0].ID,h=x.get(l).parents[0].ID,c=x.get(h).parents[0].ID,o=x.get(c).parents[0].ID,s=b.Objects.Model[o],a={modelName:THREE.PropertyBinding.sanitizeNodeName(s.attrName),morphName:b.Objects.Deformer[l].attrName};r[i]=a}r[i][n.attr]=n}}}),i.set(parseInt(n),r)}}return i},parseAnimStacks:function(t){var e=b.Objects.AnimationStack,i={};for(var n in e){var r=x.get(parseInt(n)).children;r.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var o=t.get(r[0].ID);i[n]={name:e[n].attrName,layer:o}}return i},addClip:function(t){var e=[],i=this;return t.layer.forEach(function(t){e=e.concat(i.generateTracks(t))}),new THREE.AnimationClip(t.name,(-1),e)},generateTracks:function(t){var e=[],i=new THREE.Vector3,n=new THREE.Quaternion,r=new THREE.Vector3;if(t.transform&&t.transform.decompose(i,n,r),i=i.toArray(),n=(new THREE.Euler).setFromQuaternion(n,t.eulerOrder).toArray(),r=r.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){var o=this.generateVectorTrack(t.modelName,t.T.curves,i,"position");void 0!==o&&e.push(o)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){var s=this.generateRotationTrack(t.modelName,t.R.curves,n,t.preRotation,t.postRotation,t.eulerOrder);void 0!==s&&e.push(s)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){var a=this.generateVectorTrack(t.modelName,t.S.curves,r,"scale");void 0!==a&&e.push(a)}if(void 0!==t.DeformPercent){var l=this.generateMorphTrack(t);void 0!==l&&e.push(l)}return e},generateVectorTrack:function(t,e,i,n){var r=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(r,e,i);return new THREE.VectorKeyframeTrack(t+"."+n,r,o)},generateRotationTrack:function(t,e,i,n,r,o){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(THREE.Math.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(THREE.Math.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(THREE.Math.degToRad));var s=this.getTimesForAllAxes(e),a=this.getKeyframeTrackValues(s,e,i);void 0!==n&&(n=n.map(THREE.Math.degToRad),n.push(o),n=(new THREE.Euler).fromArray(n),n=(new THREE.Quaternion).setFromEuler(n)),void 0!==r&&(r=r.map(THREE.Math.degToRad),r.push(o),r=(new THREE.Euler).fromArray(r),r=(new THREE.Quaternion).setFromEuler(r).inverse());for(var l=new THREE.Quaternion,h=new THREE.Euler,c=[],u=0;u<a.length;u+=3)h.set(a[u],a[u+1],a[u+2],o),l.setFromEuler(h),void 0!==n&&l.premultiply(n),void 0!==r&&l.multiply(r),l.toArray(c,u/3*4);return new THREE.QuaternionKeyframeTrack(t+".quaternion",s,c)},generateMorphTrack:function(t){var e=t.DeformPercent.curves.morph,i=e.values.map(function(t){return t/100}),n=w.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new THREE.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+n+"]",e.times,i)},getTimesForAllAxes:function(t){var e=[];return void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),e=e.sort(function(t,e){return t-e}).filter(function(t,e,i){return i.indexOf(t)==e})},getKeyframeTrackValues:function(t,e,i){var n=i,r=[],o=-1,s=-1,a=-1;return t.forEach(function(t){if(e.x&&(o=e.x.times.indexOf(t)),e.y&&(s=e.y.times.indexOf(t)),e.z&&(a=e.z.times.indexOf(t)),o!==-1){var i=e.x.values[o];r.push(i),n[0]=i}else r.push(n[0]);if(s!==-1){var l=e.y.values[s];r.push(l),n[1]=l}else r.push(n[1]);if(a!==-1){var h=e.z.values[a];r.push(h),n[2]=h}else r.push(n[2])}),r},interpolateRotations:function(t){for(var e=1;e<t.values.length;e++){var i=t.values[e-1],n=t.values[e]-i,r=Math.abs(n);if(r>=180){for(var o=r/180,s=n/o,a=i+s,l=t.times[e-1],h=t.times[e]-l,c=h/o,u=l+c,d=[],p=[];u<t.times[e];)d.push(u),u+=c,p.push(a),a+=s;t.times=_(t.times,e,d),t.values=_(t.values,e,p)}}}},r.prototype={constructor:r,getPrevNode:function(){return this.nodeStack[this.currentIndent-2]},getCurrentNode:function(){return this.nodeStack[this.currentIndent-1]},getCurrentProp:function(){return this.currentProp},pushStack:function(t){this.nodeStack.push(t),this.currentIndent+=1},popStack:function(){this.nodeStack.pop(),this.currentIndent-=1},setCurrentProp:function(t,e){this.currentProp=t,this.currentPropName=e},parse:function(t){this.currentIndent=0,this.allNodes=new a,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,i=t.split(/[\r\n]+/);return i.forEach(function(t,n){var r=t.match(/^[\s\t]*;/),o=t.match(/^[\s\t]*$/);if(!r&&!o){var s=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),a=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=t.match("^\\t{"+(e.currentIndent-1)+"}}");s?e.parseNodeBegin(t,s):a?e.parseNodeProperty(t,a,i[++n]):l?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)}}),this.allNodes},parseNodeBegin:function(t,e){var i=e[1].trim().replace(/^"/,"").replace(/"$/,""),n=e[2].split(",").map(function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")}),r={name:i},o=this.parseNodeAttr(n),s=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,r):i in s?("PoseNode"===i?s.PoseNode.push(r):void 0!==s[i].id&&(s[i]={},
s[i][s[i].id]=s[i]),""!==o.id&&(s[i][o.id]=r)):"number"==typeof o.id?(s[i]={},s[i][o.id]=r):"Properties70"!==i&&("PoseNode"===i?s[i]=[r]:s[i]=r),"number"==typeof o.id&&(r.id=o.id),""!==o.name&&(r.attrName=o.name),""!==o.type&&(r.attrType=o.type),this.pushStack(r)},parseNodeAttr:function(t){var e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var i="",n="";return t.length>1&&(i=t[1].replace(/^(\w+)::/,""),n=t[2]),{id:e,name:i,type:n}},parseNodeProperty:function(t,e,i){var n=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===r&&(r=i.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode(),s=o.name;if("Properties70"===s)return void this.parseNodeSpecialProperty(t,n,r);if("C"===n){var a=r.split(",").slice(1),l=parseInt(a[0]),h=parseInt(a[1]),c=r.split(",").slice(3);c=c.map(function(t){return t.trim().replace(/^"/,"")}),n="connections",r=[l,h],v(r,c),void 0===o[n]&&(o[n]=[])}"Node"===n&&(o.id=r),n in o&&Array.isArray(o[n])?o[n].push(r):"a"!==n?o[n]=r:o.a=r,this.setCurrentProp(o,n),"a"===n&&","!==r.slice(-1)&&(o.a=m(r))},parseNodePropertyContinued:function(t){var e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=m(e.a))},parseNodeSpecialProperty:function(t,e,i){var n=i.split('",').map(function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")}),r=n[0],o=n[1],s=n[2],a=n[3],l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=m(l)}this.getPrevNode()[r]={type:o,type2:s,flag:a,value:l},this.setCurrentProp(this.getPrevNode(),r)}},o.prototype={constructor:o,parse:function(t){var e=new s(t);e.skip(23);var i=e.getUint32();console.log("THREE.FBXLoader: FBX binary version: "+i);for(var n=new a;!this.endOfContent(e);){var r=this.parseNode(e,i);null!==r&&n.add(r.name,r)}return n},endOfContent:function(t){return t.size()%16===0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},parseNode:function(t,e){var i={},n=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32(),o=(e>=7500?t.getUint64():t.getUint32(),t.getUint8()),s=t.getString(o);if(0===n)return null;for(var a=[],l=0;l<r;l++)a.push(this.parseProperty(t));var h=a.length>0?a[0]:"",c=a.length>1?a[1]:"",u=a.length>2?a[2]:"";for(i.singleProperty=1===r&&t.getOffset()===n;n>t.getOffset();){var d=this.parseNode(t,e);null!==d&&this.parseSubNode(s,i,d)}return i.propertyList=a,"number"==typeof h&&(i.id=h),""!==c&&(i.attrName=c),""!==u&&(i.attrType=u),""!==s&&(i.name=s),i},parseSubNode:function(t,e,i){if(i.singleProperty===!0){var n=i.propertyList[0];Array.isArray(n)?(e[i.name]=i,i.a=n):e[i.name]=n}else if("Connections"===t&&"C"===i.name){var r=[];i.propertyList.forEach(function(t,e){0!==e&&r.push(t)}),void 0===e.connections&&(e.connections=[]),e.connections.push(r)}else if("Properties70"===i.name){var o=Object.keys(i);o.forEach(function(t){e[t]=i[t]})}else if("Properties70"===t&&"P"===i.name){var s,a=i.propertyList[0],l=i.propertyList[1],h=i.propertyList[2],c=i.propertyList[3];0===a.indexOf("Lcl ")&&(a=a.replace("Lcl ","Lcl_")),0===l.indexOf("Lcl ")&&(l=l.replace("Lcl ","Lcl_")),s="Color"===l||"ColorRGB"===l||"Vector"===l||"Vector3D"===l||0===l.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[a]={type:l,type2:h,flag:c,value:s}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)},parseProperty:function(t){var e=t.getString(1);switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":var i=t.getUint32();return t.getArrayBuffer(i);case"S":var i=t.getUint32();return t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var n=t.getUint32(),r=t.getUint32(),o=t.getUint32();if(0===r)switch(e){case"b":case"c":return t.getBooleanArray(n);case"d":return t.getFloat64Array(n);case"f":return t.getFloat32Array(n);case"i":return t.getInt32Array(n);case"l":return t.getInt64Array(n)}"undefined"==typeof Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var a=new Zlib.Inflate(new Uint8Array(t.getArrayBuffer(o))),l=new s(a.decompress().buffer);switch(e){case"b":case"c":return l.getBooleanArray(n);case"d":return l.getFloat64Array(n);case"f":return l.getFloat32Array(n);case"i":return l.getInt32Array(n);case"l":return l.getInt64Array(n)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}},s.prototype={constructor:s,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(t){this.offset+=t},getBoolean:function(){return 1===(1&this.getUint8())},getBooleanArray:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getBoolean());return e},getUint8:function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},getInt16:function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},getInt32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt32());return e},getUint32:function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},getInt64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,t=4294967295&~t,4294967295===t&&(e=e+1&4294967295),t=t+1&4294967295,-(4294967296*e+t)):4294967296*e+t},getInt64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt64());return e},getUint64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t},getFloat32:function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat32());return e},getFloat64:function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},getFloat64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat64());return e},getArrayBuffer:function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},getString:function(t){for(var e=[],i=0;i<t;i++)e[i]=this.getUint8();var n=e.indexOf(0);return n>=0&&(e=e.slice(0,n)),THREE.LoaderUtils.decodeText(new Uint8Array(e))}},a.prototype={constructor:a,add:function(t,e){this[t]=e}};var T=[],S=new THREE.Euler,M=new THREE.Vector3;return t}(),THREE.OrbitControls=function(t,e){function i(){return 2*Math.PI/60/60*L.autoRotateSpeed}function n(){return Math.pow(.95,L.zoomSpeed)}function r(t){G.theta-=t}function o(t){G.phi-=t}function s(t){L.object.isPerspectiveCamera?F/=t:L.object.isOrthographicCamera?(L.object.zoom=Math.max(L.minZoom,Math.min(L.maxZoom,L.object.zoom*t)),L.object.updateProjectionMatrix(),U=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),L.enableZoom=!1)}function a(t){L.object.isPerspectiveCamera?F*=t:L.object.isOrthographicCamera?(L.object.zoom=Math.max(L.minZoom,Math.min(L.maxZoom,L.object.zoom/t)),L.object.updateProjectionMatrix(),U=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),L.enableZoom=!1)}function l(t){V.set(t.clientX,t.clientY)}function h(t){K.set(t.clientX,t.clientY)}function c(t){X.set(t.clientX,t.clientY)}function u(t){j.set(t.clientX,t.clientY),W.subVectors(j,V).multiplyScalar(L.rotateSpeed);var e=L.domElement===document?L.domElement.body:L.domElement;r(2*Math.PI*W.x/e.clientWidth),o(2*Math.PI*W.y/e.clientHeight),V.copy(j),L.update()}function d(t){Z.set(t.clientX,t.clientY),J.subVectors(Z,K),J.y>0?s(n()):J.y<0&&a(n()),K.copy(Z),L.update()}function p(t){q.set(t.clientX,t.clientY),Y.subVectors(q,X).multiplyScalar(L.panSpeed),tt(Y.x,Y.y),X.copy(q),L.update()}function f(t){}function m(t){t.deltaY<0?a(n()):t.deltaY>0&&s(n()),L.update()}function g(t){switch(t.keyCode){case L.keys.UP:tt(0,L.keyPanSpeed),L.update();break;case L.keys.BOTTOM:tt(0,-L.keyPanSpeed),L.update();break;case L.keys.LEFT:tt(L.keyPanSpeed,0),L.update();break;case L.keys.RIGHT:tt(-L.keyPanSpeed,0),L.update()}}function v(t){V.set(t.touches[0].pageX,t.touches[0].pageY)}function y(t){if(L.enableZoom){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);K.set(0,n)}if(L.enablePan){var r=.5*(t.touches[0].pageX+t.touches[1].pageX),o=.5*(t.touches[0].pageY+t.touches[1].pageY);X.set(r,o)}}function _(t){j.set(t.touches[0].pageX,t.touches[0].pageY),W.subVectors(j,V).multiplyScalar(L.rotateSpeed);var e=L.domElement===document?L.domElement.body:L.domElement;r(2*Math.PI*W.x/e.clientWidth),o(2*Math.PI*W.y/e.clientHeight),V.copy(j),L.update()}function b(t){if(L.enableZoom){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);Z.set(0,n),J.set(0,Math.pow(Z.y/K.y,L.zoomSpeed)),s(J.y),K.copy(Z)}if(L.enablePan){var r=.5*(t.touches[0].pageX+t.touches[1].pageX),o=.5*(t.touches[0].pageY+t.touches[1].pageY);q.set(r,o),Y.subVectors(q,X).multiplyScalar(L.panSpeed),tt(Y.x,Y.y),X.copy(q)}L.update()}function x(t){}function w(t){if(L.enabled!==!1){switch(t.preventDefault(),t.button){case L.mouseButtons.ORBIT:if(L.enableRotate===!1)return;l(t),H=O.ROTATE;break;case L.mouseButtons.ZOOM:if(L.enableZoom===!1)return;h(t),H=O.DOLLY;break;case L.mouseButtons.PAN:if(L.enablePan===!1)return;c(t),H=O.PAN}H!==O.NONE&&(document.addEventListener("mousemove",T,!1),document.addEventListener("mouseup",S,!1),L.dispatchEvent(I))}}function T(t){if(L.enabled!==!1)switch(t.preventDefault(),H){case O.ROTATE:if(L.enableRotate===!1)return;u(t);break;case O.DOLLY:if(L.enableZoom===!1)return;d(t);break;case O.PAN:if(L.enablePan===!1)return;p(t)}}function S(t){L.enabled!==!1&&(f(t),document.removeEventListener("mousemove",T,!1),document.removeEventListener("mouseup",S,!1),L.dispatchEvent(k),H=O.NONE)}function M(t){L.enabled===!1||L.enableZoom===!1||H!==O.NONE&&H!==O.ROTATE||(t.preventDefault(),t.stopPropagation(),L.dispatchEvent(I),m(t),L.dispatchEvent(k))}function E(t){L.enabled!==!1&&L.enableKeys!==!1&&L.enablePan!==!1&&g(t)}function A(t){if(L.enabled!==!1){switch(t.preventDefault(),t.touches.length){case 1:if(L.enableRotate===!1)return;v(t),H=O.TOUCH_ROTATE;break;case 2:if(L.enableZoom===!1&&L.enablePan===!1)return;y(t),H=O.TOUCH_DOLLY_PAN;break;default:H=O.NONE}H!==O.NONE&&L.dispatchEvent(I)}}function C(t){if(L.enabled!==!1)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(L.enableRotate===!1)return;if(H!==O.TOUCH_ROTATE)return;_(t);break;case 2:if(L.enableZoom===!1&&L.enablePan===!1)return;if(H!==O.TOUCH_DOLLY_PAN)return;b(t);break;default:H=O.NONE}}function P(t){L.enabled!==!1&&(x(t),L.dispatchEvent(k),H=O.NONE)}function D(t){L.enabled!==!1&&t.preventDefault()}this.object=t,this.domElement=void 0!==e?e:document,this.enabled=!0,this.target=new THREE.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-(1/0),this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:THREE.MOUSE.LEFT,ZOOM:THREE.MOUSE.MIDDLE,PAN:THREE.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return B.phi},this.getAzimuthalAngle=function(){return B.theta},this.saveState=function(){L.target0.copy(L.target),L.position0.copy(L.object.position),L.zoom0=L.object.zoom},this.reset=function(){L.target.copy(L.target0),L.object.position.copy(L.position0),L.object.zoom=L.zoom0,L.object.updateProjectionMatrix(),L.dispatchEvent(R),L.update(),H=O.NONE},this.update=function(){var e=new THREE.Vector3,n=(new THREE.Quaternion).setFromUnitVectors(t.up,new THREE.Vector3(0,1,0)),o=n.clone().inverse(),s=new THREE.Vector3,a=new THREE.Quaternion;return function(){var t=L.object.position;return e.copy(t).sub(L.target),e.applyQuaternion(n),B.setFromVector3(e),L.autoRotate&&H===O.NONE&&r(i()),B.theta+=G.theta,B.phi+=G.phi,B.theta=Math.max(L.minAzimuthAngle,Math.min(L.maxAzimuthAngle,B.theta)),B.phi=Math.max(L.minPolarAngle,Math.min(L.maxPolarAngle,B.phi)),B.makeSafe(),B.radius*=F,B.radius=Math.max(L.minDistance,Math.min(L.maxDistance,B.radius)),L.target.add(z),e.setFromSpherical(B),e.applyQuaternion(o),t.copy(L.target).add(e),L.object.lookAt(L.target),L.enableDamping===!0?(G.theta*=1-L.dampingFactor,G.phi*=1-L.dampingFactor,z.multiplyScalar(1-L.dampingFactor)):(G.set(0,0,0),z.set(0,0,0)),F=1,!!(U||s.distanceToSquared(L.object.position)>N||8*(1-a.dot(L.object.quaternion))>N)&&(L.dispatchEvent(R),s.copy(L.object.position),a.copy(L.object.quaternion),U=!1,!0)}}(),this.dispose=function(){L.domElement.removeEventListener("contextmenu",D,!1),L.domElement.removeEventListener("mousedown",w,!1),L.domElement.removeEventListener("wheel",M,!1),L.domElement.removeEventListener("touchstart",A,!1),L.domElement.removeEventListener("touchend",P,!1),L.domElement.removeEventListener("touchmove",C,!1),document.removeEventListener("mousemove",T,!1),document.removeEventListener("mouseup",S,!1),window.removeEventListener("keydown",E,!1)};var L=this,R={type:"change"},I={type:"start"},k={type:"end"},O={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},H=O.NONE,N=1e-6,B=new THREE.Spherical,G=new THREE.Spherical,F=1,z=new THREE.Vector3,U=!1,V=new THREE.Vector2,j=new THREE.Vector2,W=new THREE.Vector2,X=new THREE.Vector2,q=new THREE.Vector2,Y=new THREE.Vector2,K=new THREE.Vector2,Z=new THREE.Vector2,J=new THREE.Vector2,Q=function(){var t=new THREE.Vector3;return function(e,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-e),z.add(t)}}(),$=function(){var t=new THREE.Vector3;return function(e,i){L.screenSpacePanning===!0?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(L.object.up,t)),t.multiplyScalar(e),z.add(t)}}(),tt=function(){var t=new THREE.Vector3;return function(e,i){var n=L.domElement===document?L.domElement.body:L.domElement;if(L.object.isPerspectiveCamera){var r=L.object.position;t.copy(r).sub(L.target);var o=t.length();o*=Math.tan(L.object.fov/2*Math.PI/180),Q(2*e*o/n.clientHeight,L.object.matrix),$(2*i*o/n.clientHeight,L.object.matrix)}else L.object.isOrthographicCamera?(Q(e*(L.object.right-L.object.left)/L.object.zoom/n.clientWidth,L.object.matrix),$(i*(L.object.top-L.object.bottom)/L.object.zoom/n.clientHeight,L.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),L.enablePan=!1)}}();L.domElement.addEventListener("contextmenu",D,!1),L.domElement.addEventListener("mousedown",w,!1),L.domElement.addEventListener("wheel",M,!1),L.domElement.addEventListener("touchstart",A,!1),L.domElement.addEventListener("touchend",P,!1),L.domElement.addEventListener("touchmove",C,!1),window.addEventListener("keydown",E,!1),this.update()},THREE.OrbitControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.OrbitControls.prototype.constructor=THREE.OrbitControls,Object.defineProperties(THREE.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}}),THREE.DeviceOrientationControls=function(t){var e=this;this.object=t,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var i=function(t){e.deviceOrientation=t},n=function(){e.screenOrientation=window.orientation||0},r=function(){var t=new THREE.Vector3(0,0,1),e=new THREE.Euler,i=new THREE.Quaternion,n=new THREE.Quaternion((-Math.sqrt(.5)),0,0,Math.sqrt(.5));return function(r,o,s,a,l){e.set(s,o,-a,"YXZ"),r.setFromEuler(e),r.multiply(n),r.multiply(i.setFromAxisAngle(t,-l))}}();this.connect=function(){n(),window.addEventListener("orientationchange",n,!1),window.addEventListener("deviceorientation",i,!1),e.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",n,!1),window.removeEventListener("deviceorientation",i,!1),e.enabled=!1},this.update=function(){if(e.enabled!==!1){var t=e.deviceOrientation;if(t){var i=t.alpha?THREE.Math.degToRad(t.alpha)+e.alphaOffset:0,n=t.beta?THREE.Math.degToRad(t.beta):0,o=t.gamma?THREE.Math.degToRad(t.gamma):0,s=e.screenOrientation?THREE.Math.degToRad(e.screenOrientation):0;r(e.object.quaternion,i,n,o,s)}}},this.dispose=function(){e.disconnect()},this.connect()},function(t,e){t(function(){"use strict";function t(t,e){return null!=t&&null!=e&&t.toLowerCase()===e.toLowerCase()}function i(t,e){var i,n,r=t.length;if(!r||!e)return!1;for(i=e.toLowerCase(),n=0;n<r;++n)if(i===t[n].toLowerCase())return!0;return!1}function n(t){for(var e in t)l.call(t,e)&&(t[e]=new RegExp(t[e],"i"))}function r(t){return(t||"").substr(0,500)}function o(t,e){this.ua=r(t),this._cache={},this.maxPhoneWidth=e||600}var s={};s.mobileDetectRules={phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+",HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6",Dell:"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",Samsung:"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F",LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)",Sony:"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533",Asus:"Asus.*Galaxy|PadFone.*Mobile",NokiaLumia:"Lumia [0-9]{3,4}",Micromax:"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b",Palm:"PalmSource|Palm",Vertu:"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature",Pantech:"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790",Fly:"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250",Wiko:"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM",iMobile:"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)",SimValley:"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b",Wolfgang:"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q",Alcatel:"Alcatel",Nintendo:"Nintendo (3DS|Switch)",Amoi:"Amoi",INQ:"INQ",GenericPhone:"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},tablets:{iPad:"iPad|iPad.*Mobile",NexusTablet:"Android.*Nexus[\\s]+(7|9|10)",GoogleTablet:"Android.*Pixel C",SamsungTablet:"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835",Kindle:"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)",SurfaceTablet:"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)",HPTablet:"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10",AsusTablet:"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b",BlackBerryTablet:"PlayBook|RIM Tablet",HTCtablet:"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410",MotorolaTablet:"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617",NookTablet:"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2",AcerTablet:"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30",ToshibaTablet:"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO",LGTablet:"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b",FujitsuTablet:"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b",PrestigioTablet:"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002",
LenovoTablet:"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304F|TB-X304L|TB-8703F|Tab2A7-10F|TB2-X30L",DellTablet:"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7",YarvikTablet:"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b",MedionTablet:"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB",ArnovaTablet:"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2",IntensoTablet:"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004",IRUTablet:"M702pro",MegafonTablet:"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b",EbodaTablet:"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)",AllViewTablet:"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)",ArchosTablet:"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b",AinolTablet:"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark",NokiaLumiaTablet:"Lumia 2520",SonyTablet:"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712",PhilipsTablet:"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b",CubeTablet:"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT",CobyTablet:"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010",MIDTablet:"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10",MSITablet:"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b",SMiTTablet:"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)",RockChipTablet:"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A",FlyTablet:"IQ310|Fly Vision",bqTablet:"Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))|Maxwell.*Lite|Maxwell.*Plus",HuaweiTablet:"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09",NecTablet:"\\bN-06D|\\bN-08D",PantechTablet:"Pantech.*P4100",BronchoTablet:"Broncho.*(N701|N708|N802|a710)",VersusTablet:"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b",ZyncTablet:"z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900",PositivoTablet:"TB07STA|TB10STA|TB07FTA|TB10FTA",NabiTablet:"Android.*\\bNabi",KoboTablet:"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build",DanewTablet:"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b",TexetTablet:"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE",PlaystationTablet:"Playstation.*(Portable|Vita)",TrekstorTablet:"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab",PyleAudioTablet:"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b",AdvanTablet:"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ",DanyTechTablet:"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1",GalapadTablet:"Android.*\\bG1\\b(?!\\))",MicromaxTablet:"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b",KarbonnTablet:"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b",AllFineTablet:"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide",PROSCANTablet:"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b",YONESTablet:"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026",ChangJiaTablet:"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503",GUTablet:"TX-A1301|TX-M9002|Q702|kf026",PointOfViewTablet:"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10",OvermaxTablet:"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027",HCLTablet:"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync",DPSTablet:"DPS Dream 9|DPS Dual 7",VistureTablet:"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10",CrestaTablet:"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989",MediatekTablet:"\\bMT8125|MT8389|MT8135|MT8377\\b",ConcordeTablet:"Concorde([ ]+)?Tab|ConCorde ReadMan",GoCleverTablet:"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042",ModecomTablet:"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003",VoninoTablet:"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b",ECSTablet:"V07OT2|TM105A|S10OT1|TR10CS1",StorexTablet:"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab",VodafoneTablet:"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497",EssentielBTablet:"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2",RossMoorTablet:"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711",iMobileTablet:"i-mobile i-note",TolinoTablet:"tolino tab [0-9.]+|tolino shine",AudioSonicTablet:"\\bC-22Q|T7-QC|T-17B|T-17P\\b",AMPETablet:"Android.* A78 ",SkkTablet:"Android.* (SKYPAD|PHOENIX|CYCLOPS)",TecnoTablet:"TECNO P9|TECNO DP8D",JXDTablet:"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b",iJoyTablet:"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)",FX2Tablet:"FX2 PAD7|FX2 PAD10",XoroTablet:"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151",ViewsonicTablet:"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a",VerizonTablet:"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1",OdysTablet:"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10",CaptivaTablet:"CAPTIVA PAD",IconbitTablet:"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S",TeclastTablet:"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi",OndaTablet:"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b",JaytechTablet:"TPC-PA762",BlaupunktTablet:"Endeavour 800NG|Endeavour 1010",DigmaTablet:"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b",EvolioTablet:"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b",LavaTablet:"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b",AocTablet:"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712",MpmanTablet:"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010",CelkonTablet:"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b",WolderTablet:"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b",MediacomTablet:"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA",MiTablet:"\\bMI PAD\\b|\\bHM NOTE 1W\\b",NibiruTablet:"Nibiru M1|Nibiru Jupiter One",NexoTablet:"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI",LeaderTablet:"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100",UbislateTablet:"UbiSlate[\\s]?7C",PocketBookTablet:"Pocketbook",KocasoTablet:"\\b(TB-1207)\\b",HisenseTablet:"\\b(F5281|E2371)\\b",Hudl:"Hudl HT7S3|Hudl 2",TelstraTablet:"T-Hub2",GenericTablet:"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"},oss:{AndroidOS:"Android",BlackBerryOS:"blackberry|\\bBB10\\b|rim tablet os",PalmOS:"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino",SymbianOS:"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b",WindowsMobileOS:"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;",WindowsPhoneOS:"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;",iOS:"\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia",MeeGoOS:"MeeGo",MaemoOS:"Maemo",JavaOS:"J2ME/|\\bMIDP\\b|\\bCLDC\\b",webOS:"webOS|hpwOS",badaOS:"\\bBada\\b",BREWOS:"BREW"},uas:{Chrome:"\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?",Dolfin:"\\bDolfin\\b",Opera:"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+$|Coast/[0-9.]+",Skyfire:"Skyfire",Edge:"Mobile Safari/[.0-9]* Edge",IE:"IEMobile|MSIEMobile",Firefox:"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS",Bolt:"bolt",TeaShark:"teashark",Blazer:"Blazer",Safari:"Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari",WeChat:"\\bMicroMessenger\\b",UCBrowser:"UC.*Browser|UCWEB",baiduboxapp:"baiduboxapp",baidubrowser:"baidubrowser",DiigoBrowser:"DiigoBrowser",Puffin:"Puffin",Mercury:"\\bMercury\\b",ObigoBrowser:"Obigo",NetFront:"NF-Browser",GenericBrowser:"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger",PaleMoon:"Android.*PaleMoon|Mobile.*PaleMoon"},props:{Mobile:"Mobile/[VER]",Build:"Build/[VER]",Version:"Version/[VER]",VendorID:"VendorID/[VER]",iPad:"iPad.*CPU[a-z ]+[VER]",iPhone:"iPhone.*CPU[a-z ]+[VER]",iPod:"iPod.*CPU[a-z ]+[VER]",Kindle:"Kindle/[VER]",Chrome:["Chrome/[VER]","CriOS/[VER]","CrMo/[VER]"],Coast:["Coast/[VER]"],Dolfin:"Dolfin/[VER]",Firefox:["Firefox/[VER]","FxiOS/[VER]"],Fennec:"Fennec/[VER]",Edge:"Edge/[VER]",IE:["IEMobile/[VER];","IEMobile [VER]","MSIE [VER];","Trident/[0-9.]+;.*rv:[VER]"],NetFront:"NetFront/[VER]",NokiaBrowser:"NokiaBrowser/[VER]",Opera:[" OPR/[VER]","Opera Mini/[VER]","Version/[VER]"],"Opera Mini":"Opera Mini/[VER]","Opera Mobi":"Version/[VER]",UCBrowser:["UCWEB[VER]","UC.*Browser/[VER]"],MQQBrowser:"MQQBrowser/[VER]",MicroMessenger:"MicroMessenger/[VER]",baiduboxapp:"baiduboxapp/[VER]",baidubrowser:"baidubrowser/[VER]",SamsungBrowser:"SamsungBrowser/[VER]",Iron:"Iron/[VER]",Safari:["Version/[VER]","Safari/[VER]"],Skyfire:"Skyfire/[VER]",Tizen:"Tizen/[VER]",Webkit:"webkit[ /][VER]",PaleMoon:"PaleMoon/[VER]",Gecko:"Gecko/[VER]",Trident:"Trident/[VER]",Presto:"Presto/[VER]",Goanna:"Goanna/[VER]",iOS:" \\bi?OS\\b [VER][ ;]{1}",Android:"Android [VER]",BlackBerry:["BlackBerry[\\w]+/[VER]","BlackBerry.*Version/[VER]","Version/[VER]"],BREW:"BREW [VER]",Java:"Java/[VER]","Windows Phone OS":["Windows Phone OS [VER]","Windows Phone [VER]"],"Windows Phone":"Windows Phone [VER]","Windows CE":"Windows CE/[VER]","Windows NT":"Windows NT [VER]",Symbian:["SymbianOS/[VER]","Symbian/[VER]"],webOS:["webOS/[VER]","hpwOS/[VER];"]},utils:{Bot:"Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom",MobileBot:"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2",DesktopMode:"WPDesktop",TV:"SonyDTV|HbbTV",WebKit:"(webkit)[ /]([\\w.]+)",Console:"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\b",Watch:"SM-V700"}},s.detectMobileBrowsers={fullPattern:/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,shortPattern:/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,tabletPattern:/android|ipad|playbook|silk/i};var a,l=Object.prototype.hasOwnProperty;return s.FALLBACK_PHONE="UnknownPhone",s.FALLBACK_TABLET="UnknownTablet",s.FALLBACK_MOBILE="UnknownMobile",a="isArray"in Array?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},function(){var t,e,i,r,o,h,c=s.mobileDetectRules;for(t in c.props)if(l.call(c.props,t)){for(e=c.props[t],a(e)||(e=[e]),o=e.length,r=0;r<o;++r)i=e[r],h=i.indexOf("[VER]"),h>=0&&(i=i.substring(0,h)+"([\\w._\\+]+)"+i.substring(h+5)),e[r]=new RegExp(i,"i");c.props[t]=e}n(c.oss),n(c.phones),n(c.tablets),n(c.uas),n(c.utils),c.oss0={WindowsPhoneOS:c.oss.WindowsPhoneOS,WindowsMobileOS:c.oss.WindowsMobileOS}}(),s.findMatch=function(t,e){for(var i in t)if(l.call(t,i)&&t[i].test(e))return i;return null},s.findMatches=function(t,e){var i=[];for(var n in t)l.call(t,n)&&t[n].test(e)&&i.push(n);return i},s.getVersionStr=function(t,e){var i,n,r,o,a=s.mobileDetectRules.props;if(l.call(a,t))for(i=a[t],r=i.length,n=0;n<r;++n)if(o=i[n].exec(e),null!==o)return o[1];return null},s.getVersion=function(t,e){var i=s.getVersionStr(t,e);return i?s.prepareVersionNo(i):NaN},s.prepareVersionNo=function(t){var e;return e=t.split(/[a-z._ \/\-]/i),1===e.length&&(t=e[0]),e.length>1&&(t=e[0]+".",e.shift(),t+=e.join("")),Number(t)},s.isMobileFallback=function(t){return s.detectMobileBrowsers.fullPattern.test(t)||s.detectMobileBrowsers.shortPattern.test(t.substr(0,4))},s.isTabletFallback=function(t){return s.detectMobileBrowsers.tabletPattern.test(t)},s.prepareDetectionCache=function(t,i,n){if(t.mobile===e){var r,a,l;return(a=s.findMatch(s.mobileDetectRules.tablets,i))?(t.mobile=t.tablet=a,void(t.phone=null)):(r=s.findMatch(s.mobileDetectRules.phones,i))?(t.mobile=t.phone=r,void(t.tablet=null)):void(s.isMobileFallback(i)?(l=o.isPhoneSized(n),l===e?(t.mobile=s.FALLBACK_MOBILE,t.tablet=t.phone=null):l?(t.mobile=t.phone=s.FALLBACK_PHONE,t.tablet=null):(t.mobile=t.tablet=s.FALLBACK_TABLET,t.phone=null)):s.isTabletFallback(i)?(t.mobile=t.tablet=s.FALLBACK_TABLET,t.phone=null):t.mobile=t.tablet=t.phone=null)}},s.mobileGrade=function(t){var e=null!==t.mobile();return t.os("iOS")&&t.version("iPad")>=4.3||t.os("iOS")&&t.version("iPhone")>=3.1||t.os("iOS")&&t.version("iPod")>=3.1||t.version("Android")>2.1&&t.is("Webkit")||t.version("Windows Phone OS")>=7||t.is("BlackBerry")&&t.version("BlackBerry")>=6||t.match("Playbook.*Tablet")||t.version("webOS")>=1.4&&t.match("Palm|Pre|Pixi")||t.match("hp.*TouchPad")||t.is("Firefox")&&t.version("Firefox")>=12||t.is("Chrome")&&t.is("AndroidOS")&&t.version("Android")>=4||t.is("Skyfire")&&t.version("Skyfire")>=4.1&&t.is("AndroidOS")&&t.version("Android")>=2.3||t.is("Opera")&&t.version("Opera Mobi")>11&&t.is("AndroidOS")||t.is("MeeGoOS")||t.is("Tizen")||t.is("Dolfin")&&t.version("Bada")>=2||(t.is("UC Browser")||t.is("Dolfin"))&&t.version("Android")>=2.3||t.match("Kindle Fire")||t.is("Kindle")&&t.version("Kindle")>=3||t.is("AndroidOS")&&t.is("NookTablet")||t.version("Chrome")>=11&&!e||t.version("Safari")>=5&&!e||t.version("Firefox")>=4&&!e||t.version("MSIE")>=7&&!e||t.version("Opera")>=10&&!e?"A":t.os("iOS")&&t.version("iPad")<4.3||t.os("iOS")&&t.version("iPhone")<3.1||t.os("iOS")&&t.version("iPod")<3.1||t.is("Blackberry")&&t.version("BlackBerry")>=5&&t.version("BlackBerry")<6||t.version("Opera Mini")>=5&&t.version("Opera Mini")<=6.5&&(t.version("Android")>=2.3||t.is("iOS"))||t.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||t.version("Opera Mobi")>=11&&t.is("SymbianOS")?"B":(t.version("BlackBerry")<5||t.match("MSIEMobile|Windows CE.*Mobile")||t.version("Windows Mobile")<=5.2,"C")},s.detectOS=function(t){return s.findMatch(s.mobileDetectRules.oss0,t)||s.findMatch(s.mobileDetectRules.oss,t)},s.getDeviceSmallerSide=function(){return window.screen.width<window.screen.height?window.screen.width:window.screen.height},o.prototype={constructor:o,mobile:function(){return s.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.mobile},phone:function(){return s.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.phone},tablet:function(){return s.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.tablet},userAgent:function(){return this._cache.userAgent===e&&(this._cache.userAgent=s.findMatch(s.mobileDetectRules.uas,this.ua)),this._cache.userAgent},userAgents:function(){return this._cache.userAgents===e&&(this._cache.userAgents=s.findMatches(s.mobileDetectRules.uas,this.ua)),this._cache.userAgents},os:function(){return this._cache.os===e&&(this._cache.os=s.detectOS(this.ua)),this._cache.os},version:function(t){return s.getVersion(t,this.ua)},versionStr:function(t){return s.getVersionStr(t,this.ua)},is:function(e){return i(this.userAgents(),e)||t(e,this.os())||t(e,this.phone())||t(e,this.tablet())||i(s.findMatches(s.mobileDetectRules.utils,this.ua),e)},match:function(t){return t instanceof RegExp||(t=new RegExp(t,"i")),t.test(this.ua)},isPhoneSized:function(t){return o.isPhoneSized(t||this.maxPhoneWidth)},mobileGrade:function(){return this._cache.grade===e&&(this._cache.grade=s.mobileGrade(this)),this._cache.grade}},"undefined"!=typeof window&&window.screen?o.isPhoneSized=function(t){return t<0?e:s.getDeviceSmallerSide()<=t}:o.isPhoneSized=function(){},o._impl=s,o.version="1.4.3 2018-09-08",o})}(function(t){if("undefined"!=typeof module&&module.exports)return function(t){module.exports=t()};if("function"==typeof define&&define.amd)return define;if("undefined"!=typeof window)return function(t){window.MobileDetect=t()};throw new Error("unknown environment")}());var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var n=function(t){var e,i=[],n=t.length;for(e=0;e!==n;i.push(t[e++]));return i},r=function(t,e,i){var n,r,o=t.cycle;for(n in o)r=o[n],t[n]="function"==typeof r?r(i,e[i]):r[i%r.length];delete t.cycle},o=function(t,e,n){i.call(this,t,e,n),this._cycle=0,this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._repeat&&this._uncache(!0),this.render=o.prototype.render},s=1e-10,a=i._internals,l=a.isSelector,h=a.isArray,c=o.prototype=i.to({},.1,{}),u=[];o.version="1.20.4",c.constructor=o,c.kill()._gc=!1,o.killTweensOf=o.killDelayedCallsTo=i.killTweensOf,o.getTweensOf=i.getTweensOf,o.lagSmoothing=i.lagSmoothing,o.ticker=i.ticker,o.render=i.render,c.invalidate=function(){return this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._yoyoEase=null,this._uncache(!0),i.prototype.invalidate.call(this)},c.updateTo=function(t,e){var n,r=this.ratio,o=this.vars.immediateRender||t.immediateRender;e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay));for(n in t)this.vars[n]=t[n];if(this._initted||o)if(e)this._initted=!1,o&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&i._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var s=this._totalTime;this.render(0,!0,!1),this._initted=!1,this.render(s,!0,!1)}else if(this._initted=!1,this._init(),this._time>0||o)for(var a,l=1/(1-r),h=this._firstPT;h;)a=h.s+h.c,h.c*=l,h.s=a-h.c,h=h._next;return this},c.render=function(t,e,n){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var r,o,l,h,c,u,d,p,f,m=this._dirty?this.totalDuration():this._totalDuration,g=this._time,v=this._totalTime,y=this._cycle,_=this._duration,b=this._rawPrevTime;if(t>=m-1e-7&&t>=0?(this._totalTime=m,this._cycle=this._repeat,this._yoyo&&0!==(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=_,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(r=!0,o="onComplete",n=n||this._timeline.autoRemoveChildren),0===_&&(this._initted||!this.vars.lazy||n)&&(this._startTime===this._timeline._duration&&(t=0),(0>b||0>=t&&t>=-1e-7||b===s&&"isPause"!==this.data)&&b!==t&&(n=!0,b>s&&(o="onReverseComplete")),this._rawPrevTime=p=!e||t||b===t?t:s)):1e-7>t?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==v||0===_&&b>0)&&(o="onReverseComplete",r=this._reversed),0>t&&(this._active=!1,0===_&&(this._initted||!this.vars.lazy||n)&&(b>=0&&(n=!0),this._rawPrevTime=p=!e||t||b===t?t:s)),this._initted||(n=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(h=_+this._repeatDelay,this._cycle=this._totalTime/h>>0,0!==this._cycle&&this._cycle===this._totalTime/h&&t>=v&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!==(1&this._cycle)&&(this._time=_-this._time,f=this._yoyoEase||this.vars.yoyoEase,f&&(this._yoyoEase||(f!==!0||this._initted?this._yoyoEase=f=f===!0?this._ease:f instanceof Ease?f:Ease.map[f]:(f=this.vars.ease,this._yoyoEase=f=f?f instanceof Ease?f:"function"==typeof f?new Ease(f,this.vars.easeParams):Ease.map[f]||i.defaultEase:i.defaultEase)),this.ratio=f?1-f.getRatio((_-this._time)/_):0)),this._time>_?this._time=_:this._time<0&&(this._time=0)),this._easeType&&!f?(c=this._time/_,u=this._easeType,d=this._easePower,(1===u||3===u&&c>=.5)&&(c=1-c),3===u&&(c*=2),1===d?c*=c:2===d?c*=c*c:3===d?c*=c*c*c:4===d&&(c*=c*c*c*c),1===u?this.ratio=1-c:2===u?this.ratio=c:this._time/_<.5?this.ratio=c/2:this.ratio=1-c/2):f||(this.ratio=this._ease.getRatio(this._time/_))),g===this._time&&!n&&y===this._cycle)return void(v!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate")));if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!n&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=g,this._totalTime=v,this._rawPrevTime=b,this._cycle=y,a.lazyTweens.push(this),void(this._lazy=[t,e]);!this._time||r||f?r&&this._ease._calcEnd&&!f&&(this.ratio=this._ease.getRatio(0===this._time?0:1)):this.ratio=this._ease.getRatio(this._time/_)}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==g&&t>=0&&(this._active=!0),0===v&&(2===this._initted&&t>0&&this._init(),this._startAt&&(t>=0?this._startAt.render(t,!0,n):o||(o="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===_)&&(e||this._callback("onStart"))),l=this._firstPT;l;)l.f?l.t[l.p](l.c*this.ratio+l.s):l.t[l.p]=l.c*this.ratio+l.s,l=l._next;this._onUpdate&&(0>t&&this._startAt&&this._startTime&&this._startAt.render(t,!0,n),e||(this._totalTime!==v||o)&&this._callback("onUpdate")),this._cycle!==y&&(e||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),o&&(!this._gc||n)&&(0>t&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,!0,n),r&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this._callback(o),0===_&&this._rawPrevTime===s&&p!==s&&(this._rawPrevTime=0))},o.to=function(t,e,i){return new o(t,e,i)},o.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new o(t,e,i)},o.fromTo=function(t,e,i,n){return n.startAt=i,n.immediateRender=0!=n.immediateRender&&0!=i.immediateRender,new o(t,e,n)},o.staggerTo=o.allTo=function(t,e,s,a,c,d,p){a=a||0;var f,m,g,v,y=0,_=[],b=function(){s.onComplete&&s.onComplete.apply(s.onCompleteScope||this,arguments),c.apply(p||s.callbackScope||this,d||u)},x=s.cycle,w=s.startAt&&s.startAt.cycle;for(h(t)||("string"==typeof t&&(t=i.selector(t)||t),l(t)&&(t=n(t))),t=t||[],0>a&&(t=n(t),t.reverse(),a*=-1),f=t.length-1,g=0;f>=g;g++){m={};for(v in s)m[v]=s[v];if(x&&(r(m,t,g),null!=m.duration&&(e=m.duration,delete m.duration)),w){w=m.startAt={};for(v in s.startAt)w[v]=s.startAt[v];r(m.startAt,t,g)}m.delay=y+(m.delay||0),g===f&&c&&(m.onComplete=b),_[g]=new o(t[g],e,m),y+=a}return _},o.staggerFrom=o.allFrom=function(t,e,i,n,r,s,a){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,o.staggerTo(t,e,i,n,r,s,a)},o.staggerFromTo=o.allFromTo=function(t,e,i,n,r,s,a,l){return n.startAt=i,n.immediateRender=0!=n.immediateRender&&0!=i.immediateRender,o.staggerTo(t,e,n,r,s,a,l)},o.delayedCall=function(t,e,i,n,r){return new o(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:n,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,useFrames:r,overwrite:0})},o.set=function(t,e){return new o(t,0,e)},o.isTweening=function(t){return i.getTweensOf(t,!0).length>0};var d=function(t,e){for(var n=[],r=0,o=t._first;o;)o instanceof i?n[r++]=o:(e&&(n[r++]=o),n=n.concat(d(o,e)),r=n.length),o=o._next;return n},p=o.getAllTweens=function(e){return d(t._rootTimeline,e).concat(d(t._rootFramesTimeline,e));
};o.killAll=function(t,i,n,r){null==i&&(i=!0),null==n&&(n=!0);var o,s,a,l=p(0!=r),h=l.length,c=i&&n&&r;for(a=0;h>a;a++)s=l[a],(c||s instanceof e||(o=s.target===s.vars.onComplete)&&n||i&&!o)&&(t?s.totalTime(s._reversed?0:s.totalDuration()):s._enabled(!1,!1))},o.killChildTweensOf=function(t,e){if(null!=t){var r,s,c,u,d,p=a.tweenLookup;if("string"==typeof t&&(t=i.selector(t)||t),l(t)&&(t=n(t)),h(t))for(u=t.length;--u>-1;)o.killChildTweensOf(t[u],e);else{r=[];for(c in p)for(s=p[c].target.parentNode;s;)s===t&&(r=r.concat(p[c].tweens)),s=s.parentNode;for(d=r.length,u=0;d>u;u++)e&&r[u].totalTime(r[u].totalDuration()),r[u]._enabled(!1,!1)}}};var f=function(t,i,n,r){i=i!==!1,n=n!==!1,r=r!==!1;for(var o,s,a=p(r),l=i&&n&&r,h=a.length;--h>-1;)s=a[h],(l||s instanceof e||(o=s.target===s.vars.onComplete)&&n||i&&!o)&&s.paused(t)};return o.pauseAll=function(t,e,i){f(!0,t,e,i)},o.resumeAll=function(t,e,i){f(!1,t,e,i)},o.globalTimeScale=function(e){var n=t._rootTimeline,r=i.ticker.time;return arguments.length?(e=e||s,n._startTime=r-(r-n._startTime)*n._timeScale/e,n=t._rootFramesTimeline,r=i.ticker.frame,n._startTime=r-(r-n._startTime)*n._timeScale/e,n._timeScale=t._rootTimeline._timeScale=e,e):n._timeScale},c.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()},c.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()},c.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},c.duration=function(e){return arguments.length?t.prototype.duration.call(this,e):this._duration},c.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},c.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},c.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},c.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},o},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(t,e,i){var n=function(t){e.call(this,t),this._labels={},this.autoRemoveChildren=this.vars.autoRemoveChildren===!0,this.smoothChildTiming=this.vars.smoothChildTiming===!0,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var i,n,r=this.vars;for(n in r)i=r[n],l(i)&&-1!==i.join("").indexOf("{self}")&&(r[n]=this._swapSelfInParams(i));l(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},r=1e-10,o=i._internals,s=n._internals={},a=o.isSelector,l=o.isArray,h=o.lazyTweens,c=o.lazyRender,u=_gsScope._gsDefine.globals,d=function(t){var e,i={};for(e in t)i[e]=t[e];return i},p=function(t,e,i){var n,r,o=t.cycle;for(n in o)r=o[n],t[n]="function"==typeof r?r(i,e[i]):r[i%r.length];delete t.cycle},f=s.pauseCallback=function(){},m=function(t){var e,i=[],n=t.length;for(e=0;e!==n;i.push(t[e++]));return i},g=n.prototype=new e;return n.version="1.20.4",g.constructor=n,g.kill()._gc=g._forcingPlayhead=g._hasPause=!1,g.to=function(t,e,n,r){var o=n.repeat&&u.TweenMax||i;return e?this.add(new o(t,e,n),r):this.set(t,n,r)},g.from=function(t,e,n,r){return this.add((n.repeat&&u.TweenMax||i).from(t,e,n),r)},g.fromTo=function(t,e,n,r,o){var s=r.repeat&&u.TweenMax||i;return e?this.add(s.fromTo(t,e,n,r),o):this.set(t,r,o)},g.staggerTo=function(t,e,r,o,s,l,h,c){var u,f,g=new n({onComplete:l,onCompleteParams:h,callbackScope:c,smoothChildTiming:this.smoothChildTiming}),v=r.cycle;for("string"==typeof t&&(t=i.selector(t)||t),t=t||[],a(t)&&(t=m(t)),o=o||0,0>o&&(t=m(t),t.reverse(),o*=-1),f=0;f<t.length;f++)u=d(r),u.startAt&&(u.startAt=d(u.startAt),u.startAt.cycle&&p(u.startAt,t,f)),v&&(p(u,t,f),null!=u.duration&&(e=u.duration,delete u.duration)),g.to(t[f],e,u,f*o);return this.add(g,s)},g.staggerFrom=function(t,e,i,n,r,o,s,a){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,n,r,o,s,a)},g.staggerFromTo=function(t,e,i,n,r,o,s,a,l){return n.startAt=i,n.immediateRender=0!=n.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,n,r,o,s,a,l)},g.call=function(t,e,n,r){return this.add(i.delayedCall(0,t,e,n),r)},g.set=function(t,e,n){return n=this._parseTimeOrLabel(n,0,!0),null==e.immediateRender&&(e.immediateRender=n===this._time&&!this._paused),this.add(new i(t,0,e),n)},n.exportRoot=function(t,e){t=t||{},null==t.smoothChildTiming&&(t.smoothChildTiming=!0);var r,o,s,a,l=new n(t),h=l._timeline;for(null==e&&(e=!0),h._remove(l,!0),l._startTime=0,l._rawPrevTime=l._time=l._totalTime=h._time,s=h._first;s;)a=s._next,e&&s instanceof i&&s.target===s.vars.onComplete||(o=s._startTime-s._delay,0>o&&(r=1),l.add(s,o)),s=a;return h.add(l,0),r&&l.totalDuration(),l},g.add=function(r,o,s,a){var h,c,u,d,p,f;if("number"!=typeof o&&(o=this._parseTimeOrLabel(o,0,!0,r)),!(r instanceof t)){if(r instanceof Array||r&&r.push&&l(r)){for(s=s||"normal",a=a||0,h=o,c=r.length,u=0;c>u;u++)l(d=r[u])&&(d=new n({tweens:d})),this.add(d,h),"string"!=typeof d&&"function"!=typeof d&&("sequence"===s?h=d._startTime+d.totalDuration()/d._timeScale:"start"===s&&(d._startTime-=d.delay())),h+=a;return this._uncache(!0)}if("string"==typeof r)return this.addLabel(r,o);if("function"!=typeof r)throw"Cannot add "+r+" into the timeline; it is not a tween, timeline, function, or string.";r=i.delayedCall(0,r)}if(e.prototype.add.call(this,r,o),r._time&&r.render((this.rawTime()-r._startTime)*r._timeScale,!1,!1),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(p=this,f=p.rawTime()>r._startTime;p._timeline;)f&&p._timeline.smoothChildTiming?p.totalTime(p._totalTime,!0):p._gc&&p._enabled(!0,!1),p=p._timeline;return this},g.remove=function(e){if(e instanceof t){this._remove(e,!1);var i=e._timeline=e.vars.useFrames?t._rootFramesTimeline:t._rootTimeline;return e._startTime=(e._paused?e._pauseTime:i._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&l(e)){for(var n=e.length;--n>-1;)this.remove(e[n]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},g._remove=function(t,i){e.prototype._remove.call(this,t,i);var n=this._last;return n?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},g.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},g.insert=g.insertMultiple=function(t,e,i,n){return this.add(t,e||0,i,n)},g.appendMultiple=function(t,e,i,n){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,n)},g.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},g.addPause=function(t,e,n,r){var o=i.delayedCall(0,f,n,r||this);return o.vars.onComplete=o.vars.onReverseComplete=e,o.data="isPause",this._hasPause=!0,this.add(o,t)},g.removeLabel=function(t){return delete this._labels[t],this},g.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},g._parseTimeOrLabel=function(e,i,n,r){var o,s;if(r instanceof t&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&l(r)))for(s=r.length;--s>-1;)r[s]instanceof t&&r[s].timeline===this&&this.remove(r[s]);if(o="number"!=typeof e||i?this.duration()>99999999999?this.recent().endTime(!1):this._duration:0,"string"==typeof i)return this._parseTimeOrLabel(i,n&&"number"==typeof e&&null==this._labels[i]?e-o:0,n);if(i=i||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=o);else{if(s=e.indexOf("="),-1===s)return null==this._labels[e]?n?this._labels[e]=o+i:i:this._labels[e]+i;i=parseInt(e.charAt(s-1)+"1",10)*Number(e.substr(s+1)),e=s>1?this._parseTimeOrLabel(e.substr(0,s-1),0,n):o}return Number(e)+i},g.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),e!==!1)},g.stop=function(){return this.paused(!0)},g.gotoAndPlay=function(t,e){return this.play(t,e)},g.gotoAndStop=function(t,e){return this.pause(t,e)},g.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var n,o,s,a,l,u,d,p=this._time,f=this._dirty?this.totalDuration():this._totalDuration,m=this._startTime,g=this._timeScale,v=this._paused;if(p!==this._time&&(t+=this._time-p),t>=f-1e-7&&t>=0)this._totalTime=this._time=f,this._reversed||this._hasPausedChild()||(o=!0,a="onComplete",l=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=t&&t>=-1e-7||this._rawPrevTime<0||this._rawPrevTime===r)&&this._rawPrevTime!==t&&this._first&&(l=!0,this._rawPrevTime>r&&(a="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,t=f+1e-4;else if(1e-7>t)if(this._totalTime=this._time=0,(0!==p||0===this._duration&&this._rawPrevTime!==r&&(this._rawPrevTime>0||0>t&&this._rawPrevTime>=0))&&(a="onReverseComplete",o=this._reversed),0>t)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(l=o=!0,a="onReverseComplete"):this._rawPrevTime>=0&&this._first&&(l=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,0===t&&o)for(n=this._first;n&&0===n._startTime;)n._duration||(o=!1),n=n._next;t=0,this._initted||(l=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!e){if(t>=p)for(n=this._first;n&&n._startTime<=t&&!u;)n._duration||"isPause"!==n.data||n.ratio||0===n._startTime&&0===this._rawPrevTime||(u=n),n=n._next;else for(n=this._last;n&&n._startTime>=t&&!u;)n._duration||"isPause"===n.data&&n._rawPrevTime>0&&(u=n),n=n._prev;u&&(this._time=t=u._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=t}if(this._time!==p&&this._first||i||l||u){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==p&&t>0&&(this._active=!0),0===p&&this.vars.onStart&&(0===this._time&&this._duration||e||this._callback("onStart")),d=this._time,d>=p)for(n=this._first;n&&(s=n._next,d===this._time&&(!this._paused||v));)(n._active||n._startTime<=d&&!n._paused&&!n._gc)&&(u===n&&this.pause(),n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=s;else for(n=this._last;n&&(s=n._prev,d===this._time&&(!this._paused||v));){if(n._active||n._startTime<=p&&!n._paused&&!n._gc){if(u===n){for(u=n._prev;u&&u.endTime()>this._time;)u.render(u._reversed?u.totalDuration()-(t-u._startTime)*u._timeScale:(t-u._startTime)*u._timeScale,e,i),u=u._prev;u=null,this.pause()}n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)}n=s}this._onUpdate&&(e||(h.length&&c(),this._callback("onUpdate"))),a&&(this._gc||(m===this._startTime||g!==this._timeScale)&&(0===this._time||f>=this.totalDuration())&&(o&&(h.length&&c(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[a]&&this._callback(a)))}},g._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof n&&t._hasPausedChild())return!0;t=t._next}return!1},g.getChildren=function(t,e,n,r){r=r||-9999999999;for(var o=[],s=this._first,a=0;s;)s._startTime<r||(s instanceof i?e!==!1&&(o[a++]=s):(n!==!1&&(o[a++]=s),t!==!1&&(o=o.concat(s.getChildren(!0,e,n)),a=o.length))),s=s._next;return o},g.getTweensOf=function(t,e){var n,r,o=this._gc,s=[],a=0;for(o&&this._enabled(!0,!0),n=i.getTweensOf(t),r=n.length;--r>-1;)(n[r].timeline===this||e&&this._contains(n[r]))&&(s[a++]=n[r]);return o&&this._enabled(!1,!0),s},g.recent=function(){return this._recent},g._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},g.shiftChildren=function(t,e,i){i=i||0;for(var n,r=this._first,o=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(n in o)o[n]>=i&&(o[n]+=t);return this._uncache(!0)},g._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),n=i.length,r=!1;--n>-1;)i[n]._kill(t,e)&&(r=!0);return r},g.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;--i>-1;)e[i]._enabled(!1,!1);return t!==!1&&(this._labels={}),this._uncache(!0)},g.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},g._enabled=function(t,i){if(t===this._gc)for(var n=this._first;n;)n._enabled(t,!0),n=n._next;return e.prototype._enabled.call(this,t,i)},g.totalTime=function(e,i,n){this._forcingPlayhead=!0;var r=t.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},g.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},g.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,n=0,r=this._last,o=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>o&&this._sortChildren&&!r._paused&&!this._calculatingDuration?(this._calculatingDuration=1,this.add(r,r._startTime-r._delay),this._calculatingDuration=0):o=r._startTime,r._startTime<0&&!r._paused&&(n-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale,this._time-=r._startTime,this._totalTime-=r._startTime,this._rawPrevTime-=r._startTime),this.shiftChildren(-r._startTime,!1,-9999999999),o=0),i=r._startTime+r._totalDuration/r._timeScale,i>n&&(n=i),r=e;this._duration=this._totalDuration=n,this._dirty=!1}return this._totalDuration}return t&&this.totalDuration()?this.timeScale(this._totalDuration/t):this},g.paused=function(e){if(!e)for(var i=this._first,n=this._time;i;)i._startTime===n&&"isPause"===i.data&&(i._rawPrevTime=0),i=i._next;return t.prototype.paused.apply(this,arguments)},g.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===t._rootFramesTimeline},g.rawTime=function(t){return t&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(t)-this._startTime)*this._timeScale},n},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(t,e,i){var n=function(e){t.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=this.vars.yoyo===!0,this._dirty=!0},r=1e-10,o=e._internals,s=o.lazyTweens,a=o.lazyRender,l=_gsScope._gsDefine.globals,h=new i(null,null,1,0),c=n.prototype=new t;return c.constructor=n,c.kill()._gc=!1,n.version="1.20.4",c.invalidate=function(){return this._yoyo=this.vars.yoyo===!0,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),t.prototype.invalidate.call(this)},c.addCallback=function(t,i,n,r){return this.add(e.delayedCall(0,t,n,r),i)},c.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),n=i.length,r=this._parseTimeOrLabel(e);--n>-1;)i[n]._startTime===r&&i[n]._enabled(!1,!1);return this},c.removePause=function(e){return this.removeCallback(t._internals.pauseCallback,e)},c.tweenTo=function(t,i){i=i||{};var n,r,o,s={ease:h,useFrames:this.usesFrames(),immediateRender:!1,lazy:!1},a=i.repeat&&l.TweenMax||e;for(r in i)s[r]=i[r];return s.time=this._parseTimeOrLabel(t),n=Math.abs(Number(s.time)-this._time)/this._timeScale||.001,o=new a(this,n,s),s.onStart=function(){o.target.paused(!0),o.vars.time===o.target.time()||n!==o.duration()||o.isFromTo||o.duration(Math.abs(o.vars.time-o.target.time())/o.target._timeScale).render(o.time(),!0,!0),i.onStart&&i.onStart.apply(i.onStartScope||i.callbackScope||o,i.onStartParams||[])},o},c.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],callbackScope:this},i.immediateRender=i.immediateRender!==!1;var n=this.tweenTo(e,i);return n.isFromTo=1,n.duration(Math.abs(n.vars.time-t)/this._timeScale||.001)},c.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var n,o,l,h,c,u,d,p,f=this._time,m=this._dirty?this.totalDuration():this._totalDuration,g=this._duration,v=this._totalTime,y=this._startTime,_=this._timeScale,b=this._rawPrevTime,x=this._paused,w=this._cycle;if(f!==this._time&&(t+=this._time-f),t>=m-1e-7&&t>=0)this._locked||(this._totalTime=m,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(o=!0,h="onComplete",c=!!this._timeline.autoRemoveChildren,0===this._duration&&(0>=t&&t>=-1e-7||0>b||b===r)&&b!==t&&this._first&&(c=!0,b>r&&(h="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:r,this._yoyo&&0!==(1&this._cycle)?this._time=t=0:(this._time=g,t=g+1e-4);else if(1e-7>t)if(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==f||0===g&&b!==r&&(b>0||0>t&&b>=0)&&!this._locked)&&(h="onReverseComplete",o=this._reversed),0>t)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(c=o=!0,h="onReverseComplete"):b>=0&&this._first&&(c=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=g||!e||t||this._rawPrevTime===t?t:r,0===t&&o)for(n=this._first;n&&0===n._startTime;)n._duration||(o=!1),n=n._next;t=0,this._initted||(c=!0)}else if(0===g&&0>b&&(c=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(u=g+this._repeatDelay,this._cycle=this._totalTime/u>>0,0!==this._cycle&&this._cycle===this._totalTime/u&&t>=v&&this._cycle--,this._time=this._totalTime-this._cycle*u,this._yoyo&&0!==(1&this._cycle)&&(this._time=g-this._time),this._time>g?(this._time=g,t=g+1e-4):this._time<0?this._time=t=0:t=this._time)),this._hasPause&&!this._forcingPlayhead&&!e){if(t=this._time,t>=f||this._repeat&&w!==this._cycle)for(n=this._first;n&&n._startTime<=t&&!d;)n._duration||"isPause"!==n.data||n.ratio||0===n._startTime&&0===this._rawPrevTime||(d=n),n=n._next;else for(n=this._last;n&&n._startTime>=t&&!d;)n._duration||"isPause"===n.data&&n._rawPrevTime>0&&(d=n),n=n._prev;d&&d._startTime<g&&(this._time=t=d._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==w&&!this._locked){var T=this._yoyo&&0!==(1&w),S=T===(this._yoyo&&0!==(1&this._cycle)),M=this._totalTime,E=this._cycle,A=this._rawPrevTime,C=this._time;if(this._totalTime=w*g,this._cycle<w?T=!T:this._totalTime+=g,this._time=f,this._rawPrevTime=0===g?b-1e-4:b,this._cycle=w,this._locked=!0,f=T?0:g,this.render(f,e,0===g),e||this._gc||this.vars.onRepeat&&(this._cycle=E,this._locked=!1,this._callback("onRepeat")),f!==this._time)return;if(S&&(this._cycle=w,this._locked=!0,f=T?g+1e-4:-1e-4,this.render(f,!0,!1)),this._locked=!1,this._paused&&!x)return;this._time=C,this._totalTime=M,this._cycle=E,this._rawPrevTime=A}if(!(this._time!==f&&this._first||i||c||d))return void(v!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate")));if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==v&&t>0&&(this._active=!0),0===v&&this.vars.onStart&&(0===this._totalTime&&this._totalDuration||e||this._callback("onStart")),p=this._time,p>=f)for(n=this._first;n&&(l=n._next,p===this._time&&(!this._paused||x));)(n._active||n._startTime<=this._time&&!n._paused&&!n._gc)&&(d===n&&this.pause(),n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=l;else for(n=this._last;n&&(l=n._prev,p===this._time&&(!this._paused||x));){if(n._active||n._startTime<=f&&!n._paused&&!n._gc){if(d===n){for(d=n._prev;d&&d.endTime()>this._time;)d.render(d._reversed?d.totalDuration()-(t-d._startTime)*d._timeScale:(t-d._startTime)*d._timeScale,e,i),d=d._prev;d=null,this.pause()}n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)}n=l}this._onUpdate&&(e||(s.length&&a(),this._callback("onUpdate"))),h&&(this._locked||this._gc||(y===this._startTime||_!==this._timeScale)&&(0===this._time||m>=this.totalDuration())&&(o&&(s.length&&a(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[h]&&this._callback(h)))},c.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var n,r,o=[],s=this.getChildren(t,e,i),a=0,l=s.length;for(n=0;l>n;n++)r=s[n],r.isActive()&&(o[a++]=r);return o},c.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),n=i.length;for(e=0;n>e;e++)if(i[e].time>t)return i[e].name;return null},c.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;--i>-1;)if(e[i].time<t)return e[i].name;return null},c.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},c.invalidate=function(){return this._locked=!1,t.prototype.invalidate.call(this)},c.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()||0},c.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()||0},c.totalDuration=function(e){return arguments.length?-1!==this._repeat&&e?this.timeScale(this.totalDuration()/e):this:(this._dirty&&(t.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},c.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!==(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},c.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},c.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},c.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},c.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},n},!0),function(){var t=180/Math.PI,e=[],i=[],n=[],r={},o=_gsScope._gsDefine.globals,s=function(t,e,i,n){i===n&&(i=n-(n-e)/1e6),t===e&&(e=t+(i-t)/1e6),this.a=t,this.b=e,this.c=i,this.d=n,this.da=n-t,this.ca=i-t,this.ba=e-t},a=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",l=function(t,e,i,n){var r={a:t},o={},s={},a={c:n},l=(t+e)/2,h=(e+i)/2,c=(i+n)/2,u=(l+h)/2,d=(h+c)/2,p=(d-u)/8;return r.b=l+(t-l)/4,o.b=u+p,r.c=o.a=(r.b+o.b)/2,o.c=s.a=(u+d)/2,s.b=d-p,a.b=c+(n-c)/4,s.c=a.a=(s.b+a.b)/2,[r,o,s,a]},h=function(t,r,o,s,a){var h,c,u,d,p,f,m,g,v,y,_,b,x,w=t.length-1,T=0,S=t[0].a;for(h=0;w>h;h++)p=t[T],c=p.a,u=p.d,d=t[T+1].d,a?(_=e[h],b=i[h],x=(b+_)*r*.25/(s?.5:n[h]||.5),f=u-(u-c)*(s?.5*r:0!==_?x/_:0),m=u+(d-u)*(s?.5*r:0!==b?x/b:0),g=u-(f+((m-f)*(3*_/(_+b)+.5)/4||0))):(f=u-(u-c)*r*.5,m=u+(d-u)*r*.5,g=u-(f+m)/2),f+=g,m+=g,p.c=v=f,0!==h?p.b=S:p.b=S=p.a+.6*(p.c-p.a),p.da=u-c,p.ca=v-c,p.ba=S-c,o?(y=l(c,S,v,u),t.splice(T,1,y[0],y[1],y[2],y[3]),T+=4):T++,S=m;p=t[T],p.b=S,p.c=S+.4*(p.d-S),p.da=p.d-p.a,p.ca=p.c-p.a,p.ba=S-p.a,o&&(y=l(p.a,S,p.c,p.d),t.splice(T,1,y[0],y[1],y[2],y[3]))},c=function(t,n,r,o){var a,l,h,c,u,d,p=[];if(o)for(t=[o].concat(t),l=t.length;--l>-1;)"string"==typeof(d=t[l][n])&&"="===d.charAt(1)&&(t[l][n]=o[n]+Number(d.charAt(0)+d.substr(2)));if(a=t.length-2,0>a)return p[0]=new s(t[0][n],0,0,t[0][n]),p;for(l=0;a>l;l++)h=t[l][n],c=t[l+1][n],p[l]=new s(h,0,0,c),r&&(u=t[l+2][n],e[l]=(e[l]||0)+(c-h)*(c-h),i[l]=(i[l]||0)+(u-c)*(u-c));return p[l]=new s(t[l][n],0,0,t[l+1][n]),p},u=function(t,o,s,l,u,d){var p,f,m,g,v,y,_,b,x={},w=[],T=d||t[0];u="string"==typeof u?","+u+",":a,null==o&&(o=1);for(f in t[0])w.push(f);if(t.length>1){for(b=t[t.length-1],_=!0,p=w.length;--p>-1;)if(f=w[p],Math.abs(T[f]-b[f])>.05){_=!1;break}_&&(t=t.concat(),d&&t.unshift(d),t.push(t[1]),d=t[t.length-3])}for(e.length=i.length=n.length=0,p=w.length;--p>-1;)f=w[p],r[f]=-1!==u.indexOf(","+f+","),x[f]=c(t,f,r[f],d);for(p=e.length;--p>-1;)e[p]=Math.sqrt(e[p]),i[p]=Math.sqrt(i[p]);if(!l){for(p=w.length;--p>-1;)if(r[f])for(m=x[w[p]],y=m.length-1,g=0;y>g;g++)v=m[g+1].da/i[g]+m[g].da/e[g]||0,n[g]=(n[g]||0)+v*v;for(p=n.length;--p>-1;)n[p]=Math.sqrt(n[p])}for(p=w.length,g=s?4:1;--p>-1;)f=w[p],m=x[f],h(m,o,s,l,r[f]),_&&(m.splice(0,g),m.splice(m.length-g,g));return x},d=function(t,e,i){e=e||"soft";var n,r,o,a,l,h,c,u,d,p,f,m={},g="cubic"===e?3:2,v="soft"===e,y=[];if(v&&i&&(t=[i].concat(t)),null==t||t.length<g+1)throw"invalid Bezier data";for(d in t[0])y.push(d);for(h=y.length;--h>-1;){for(d=y[h],m[d]=l=[],p=0,u=t.length,c=0;u>c;c++)n=null==i?t[c][d]:"string"==typeof(f=t[c][d])&&"="===f.charAt(1)?i[d]+Number(f.charAt(0)+f.substr(2)):Number(f),v&&c>1&&u-1>c&&(l[p++]=(n+l[p-2])/2),l[p++]=n;for(u=p-g+1,p=0,c=0;u>c;c+=g)n=l[c],r=l[c+1],o=l[c+2],a=2===g?0:l[c+3],l[p++]=f=3===g?new s(n,r,o,a):new s(n,(2*r+n)/3,(2*r+o)/3,o);l.length=p}return m},p=function(t,e,i){for(var n,r,o,s,a,l,h,c,u,d,p,f=1/i,m=t.length;--m>-1;)for(d=t[m],o=d.a,s=d.d-o,a=d.c-o,l=d.b-o,n=r=0,c=1;i>=c;c++)h=f*c,u=1-h,n=r-(r=(h*h*s+3*u*(h*a+u*l))*h),p=m*i+c-1,e[p]=(e[p]||0)+n*n},f=function(t,e){e=e>>0||6;var i,n,r,o,s=[],a=[],l=0,h=0,c=e-1,u=[],d=[];for(i in t)p(t[i],s,e);for(r=s.length,n=0;r>n;n++)l+=Math.sqrt(s[n]),o=n%e,d[o]=l,o===c&&(h+=l,o=n/e>>0,u[o]=d,a[o]=h,l=0,d=[]);return{length:h,lengths:a,segments:u}},m=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.8",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._mod={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var n,r,o,s,a,l=e.values||[],h={},c=l[0],p=e.autoRotate||i.vars.orientToBezier;this._autoRotate=p?p instanceof Array?p:[["x","y","rotation",p===!0?0:Number(p)||0]]:null;for(n in c)this._props.push(n);for(o=this._props.length;--o>-1;)n=this._props[o],this._overwriteProps.push(n),r=this._func[n]="function"==typeof t[n],h[n]=r?t[n.indexOf("set")||"function"!=typeof t["get"+n.substr(3)]?n:"get"+n.substr(3)]():parseFloat(t[n]),a||h[n]!==l[0][n]&&(a=h);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?u(l,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,a):d(l,e.type,h),this._segCount=this._beziers[n].length,this._timeRes){var m=f(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(p=this._autoRotate)for(this._initialRotations=[],p[0]instanceof Array||(this._autoRotate=p=[p]),o=p.length;--o>-1;){for(s=0;3>s;s++)n=p[o][s],this._func[n]="function"==typeof t[n]&&t[n.indexOf("set")||"function"!=typeof t["get"+n.substr(3)]?n:"get"+n.substr(3)];n=p[o][2],this._initialRotations[o]=(this._func[n]?this._func[n].call(this._target):this._target[n])||0,this._overwriteProps.push(n)}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(e){var i,n,r,o,s,a,l,h,c,u,d=this._segCount,p=this._func,f=this._target,m=e!==this._startRatio;if(this._timeRes){if(c=this._lengths,u=this._curSeg,e*=this._length,r=this._li,e>this._l2&&d-1>r){for(h=d-1;h>r&&(this._l2=c[++r])<=e;);this._l1=c[r-1],this._li=r,this._curSeg=u=this._segments[r],this._s2=u[this._s1=this._si=0]}else if(e<this._l1&&r>0){for(;r>0&&(this._l1=c[--r])>=e;);0===r&&e<this._l1?this._l1=0:r++,this._l2=c[r],this._li=r,this._curSeg=u=this._segments[r],this._s1=u[(this._si=u.length-1)-1]||0,this._s2=u[this._si]}if(i=r,e-=this._l1,r=this._si,e>this._s2&&r<u.length-1){for(h=u.length-1;h>r&&(this._s2=u[++r])<=e;);this._s1=u[r-1],this._si=r}else if(e<this._s1&&r>0){for(;r>0&&(this._s1=u[--r])>=e;);0===r&&e<this._s1?this._s1=0:r++,this._s2=u[r],this._si=r}a=(r+(e-this._s1)/(this._s2-this._s1))*this._prec||0}else i=0>e?0:e>=1?d-1:d*e>>0,a=(e-i*(1/d))*d;for(n=1-a,r=this._props.length;--r>-1;)o=this._props[r],s=this._beziers[o][i],l=(a*a*s.da+3*n*(a*s.ca+n*s.ba))*a+s.a,this._mod[o]&&(l=this._mod[o](l,f)),p[o]?f[o](l):f[o]=l;if(this._autoRotate){var g,v,y,_,b,x,w,T=this._autoRotate;for(r=T.length;--r>-1;)o=T[r][2],x=T[r][3]||0,w=T[r][4]===!0?1:t,s=this._beziers[T[r][0]],g=this._beziers[T[r][1]],s&&g&&(s=s[i],g=g[i],v=s.a+(s.b-s.a)*a,_=s.b+(s.c-s.b)*a,v+=(_-v)*a,_+=(s.c+(s.d-s.c)*a-_)*a,y=g.a+(g.b-g.a)*a,b=g.b+(g.c-g.b)*a,y+=(b-y)*a,b+=(g.c+(g.d-g.c)*a-b)*a,l=m?Math.atan2(b-y,_-v)*w+x:this._initialRotations[r],this._mod[o]&&(l=this._mod[o](l,f)),p[o]?f[o](l):f[o]=l)}}}),g=m.prototype;m.bezierThrough=u,m.cubicToQuadratic=l,m._autoCSS=!0,m.quadraticToCubic=function(t,e,i){return new s(t,(2*e+t)/3,(2*e+i)/3,i)},m._cssRegister=function(){var t=o.CSSPlugin;if(t){var e=t._internals,i=e._parseToProxy,n=e._setPluginRatio,r=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,o,s,a,l){e instanceof Array&&(e={values:e}),l=new m;var h,c,u,d=e.values,p=d.length-1,f=[],g={};if(0>p)return a;for(h=0;p>=h;h++)u=i(t,d[h],s,a,l,p!==h),f[h]=u.end;for(c in e)g[c]=e[c];return g.values=f,a=new r(t,"bezier",0,0,u.pt,2),a.data=u,a.plugin=l,a.setRatio=n,0===g.autoRotate&&(g.autoRotate=!0),!g.autoRotate||g.autoRotate instanceof Array||(h=g.autoRotate===!0?0:Number(g.autoRotate),g.autoRotate=null!=u.end.left?[["left","top","rotation",h,!1]]:null!=u.end.x&&[["x","y","rotation",h,!1]]),g.autoRotate&&(s._transform||s._enableTransforms(!1),u.autoRotate=s._target._gsTransform,u.proxy.rotation=u.autoRotate.rotation||0,s._overwriteProps.push("rotation")),l._onInitTween(u.proxy,g,s._tween),a}})}},g._mod=function(t){for(var e,i=this._overwriteProps,n=i.length;--n>-1;)e=t[i[n]],e&&"function"==typeof e&&(this._mod[i[n]]=e)},g._kill=function(t){var e,i,n=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=n.length;--i>-1;)n[i]===e&&n.splice(i,1);if(n=this._autoRotate)for(i=n.length;--i>-1;)t[n[i][2]]&&n.splice(i,1);return this._super._kill.call(this,t)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(t,e){var i,n,r,o,s=function(){t.call(this,"css"),this._overwriteProps.length=0,this.setRatio=s.prototype.setRatio},a=_gsScope._gsDefine.globals,l={},h=s.prototype=new t("css");h.constructor=s,s.version="1.20.4",s.API=2,s.defaultTransformPerspective=0,s.defaultSkewType="compensated",s.defaultSmoothOrigin=!0,h="px",s.suffixMap={top:h,right:h,bottom:h,left:h,width:h,height:h,fontSize:h,padding:h,margin:h,perspective:h,lineHeight:""};var c,u,d,p,f,m,g,v,y=/(?:\-|\.|\b)(\d|\.|e\-)+/g,_=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,b=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,x=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,w=/(?:\d|\-|\+|=|#|\.)*/g,T=/opacity *= *([^)]*)/i,S=/opacity:([^;]*)/i,M=/alpha\(opacity *=.+?\)/i,E=/^(rgb|hsl)/,A=/([A-Z])/g,C=/-([a-z])/gi,P=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,D=function(t,e){return e.toUpperCase()},L=/(?:Left|Right|Width)/i,R=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,I=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,k=/,(?=[^\)]*(?:\(|$))/gi,O=/[\s,\(]/i,H=Math.PI/180,N=180/Math.PI,B={},G={style:{}},F=_gsScope.document||{createElement:function(){return G}},z=function(t,e){return F.createElementNS?F.createElementNS(e||"http://www.w3.org/1999/xhtml",t):F.createElement(t)},U=z("div"),V=z("img"),j=s._internals={
_specialProps:l},W=(_gsScope.navigator||{}).userAgent||"",X=function(){var t=W.indexOf("Android"),e=z("a");return d=-1!==W.indexOf("Safari")&&-1===W.indexOf("Chrome")&&(-1===t||parseFloat(W.substr(t+8,2))>3),f=d&&parseFloat(W.substr(W.indexOf("Version/")+8,2))<6,p=-1!==W.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(W)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(W))&&(m=parseFloat(RegExp.$1)),!!e&&(e.style.cssText="top:1px;opacity:.55;",/^0.55/.test(e.style.opacity))}(),q=function(t){return T.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},Y=function(t){_gsScope.console&&console.log(t)},K="",Z="",J=function(t,e){e=e||U;var i,n,r=e.style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],n=5;--n>-1&&void 0===r[i[n]+t];);return n>=0?(Z=3===n?"ms":i[n],K="-"+Z.toLowerCase()+"-",Z+t):null},Q=F.defaultView?F.defaultView.getComputedStyle:function(){},$=s.getStyle=function(t,e,i,n,r){var o;return X||"opacity"!==e?(!n&&t.style[e]?o=t.style[e]:(i=i||Q(t))?o=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(A,"-$1").toLowerCase()):t.currentStyle&&(o=t.currentStyle[e]),null==r||o&&"none"!==o&&"auto"!==o&&"auto auto"!==o?o:r):q(t)},tt=j.convertToPixels=function(t,i,n,r,o){if("px"===r||!r&&"lineHeight"!==i)return n;if("auto"===r||!n)return 0;var a,l,h,c=L.test(i),u=t,d=U.style,p=0>n,f=1===n;if(p&&(n=-n),f&&(n*=100),"lineHeight"!==i||r)if("%"===r&&-1!==i.indexOf("border"))a=n/100*(c?t.clientWidth:t.clientHeight);else{if(d.cssText="border:0 solid red;position:"+$(t,"position")+";line-height:0;","%"!==r&&u.appendChild&&"v"!==r.charAt(0)&&"rem"!==r)d[c?"borderLeftWidth":"borderTopWidth"]=n+r;else{if(u=t.parentNode||F.body,-1!==$(u,"display").indexOf("flex")&&(d.position="absolute"),l=u._gsCache,h=e.ticker.frame,l&&c&&l.time===h)return l.width*n/100;d[c?"width":"height"]=n+r}u.appendChild(U),a=parseFloat(U[c?"offsetWidth":"offsetHeight"]),u.removeChild(U),c&&"%"===r&&s.cacheWidths!==!1&&(l=u._gsCache=u._gsCache||{},l.time=h,l.width=a/n*100),0!==a||o||(a=tt(t,i,n,r,!0))}else l=Q(t).lineHeight,t.style.lineHeight=n,a=parseFloat(Q(t).lineHeight),t.style.lineHeight=l;return f&&(a/=100),p?-a:a},et=j.calculateOffset=function(t,e,i){if("absolute"!==$(t,"position",i))return 0;var n="left"===e?"Left":"Top",r=$(t,"margin"+n,i);return t["offset"+n]-(tt(t,e,parseFloat(r),r.replace(w,""))||0)},it=function(t,e){var i,n,r,o={};if(e=e||Q(t,null))if(i=e.length)for(;--i>-1;)r=e[i],(-1===r.indexOf("-transform")||Pt===r)&&(o[r.replace(C,D)]=e.getPropertyValue(r));else for(i in e)(-1===i.indexOf("Transform")||Ct===i)&&(o[i]=e[i]);else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===o[i]&&(o[i.replace(C,D)]=e[i]);return X||(o.opacity=q(t)),n=Vt(t,e,!1),o.rotation=n.rotation,o.skewX=n.skewX,o.scaleX=n.scaleX,o.scaleY=n.scaleY,o.x=n.x,o.y=n.y,Lt&&(o.z=n.z,o.rotationX=n.rotationX,o.rotationY=n.rotationY,o.scaleZ=n.scaleZ),o.filters&&delete o.filters,o},nt=function(t,e,i,n,r){var o,s,a,l={},h=t.style;for(s in i)"cssText"!==s&&"length"!==s&&isNaN(s)&&(e[s]!==(o=i[s])||r&&r[s])&&-1===s.indexOf("Origin")&&("number"==typeof o||"string"==typeof o)&&(l[s]="auto"!==o||"left"!==s&&"top"!==s?""!==o&&"auto"!==o&&"none"!==o||"string"!=typeof e[s]||""===e[s].replace(x,"")?o:0:et(t,s),void 0!==h[s]&&(a=new yt(h,s,h[s],a)));if(n)for(s in n)"className"!==s&&(l[s]=n[s]);return{difs:l,firstMPT:a}},rt={width:["Left","Right"],height:["Top","Bottom"]},ot=["marginLeft","marginRight","marginTop","marginBottom"],st=function(t,e,i){if("svg"===(t.nodeName+"").toLowerCase())return(i||Q(t))[e]||0;if(t.getCTM&&Ft(t))return t.getBBox()[e]||0;var n=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=rt[e],o=r.length;for(i=i||Q(t,null);--o>-1;)n-=parseFloat($(t,"padding"+r[o],i,!0))||0,n-=parseFloat($(t,"border"+r[o]+"Width",i,!0))||0;return n},at=function(t,e){if("contain"===t||"auto"===t||"auto auto"===t)return t+" ";(null==t||""===t)&&(t="0 0");var i,n=t.split(" "),r=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":n[0],o=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":n[1];if(n.length>3&&!e){for(n=t.split(", ").join(",").split(","),t=[],i=0;i<n.length;i++)t.push(at(n[i]));return t.join(",")}return null==o?o="center"===r?"50%":"0":"center"===o&&(o="50%"),("center"===r||isNaN(parseFloat(r))&&-1===(r+"").indexOf("="))&&(r="50%"),t=r+" "+o+(n.length>2?" "+n[2]:""),e&&(e.oxp=-1!==r.indexOf("%"),e.oyp=-1!==o.indexOf("%"),e.oxr="="===r.charAt(1),e.oyr="="===o.charAt(1),e.ox=parseFloat(r.replace(x,"")),e.oy=parseFloat(o.replace(x,"")),e.v=t),e||t},lt=function(t,e){return"function"==typeof t&&(t=t(v,g)),"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)||0},ht=function(t,e){return"function"==typeof t&&(t=t(v,g)),null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)||0},ct=function(t,e,i,n){var r,o,s,a,l,h=1e-6;return"function"==typeof t&&(t=t(v,g)),null==t?a=e:"number"==typeof t?a=t:(r=360,o=t.split("_"),l="="===t.charAt(1),s=(l?parseInt(t.charAt(0)+"1",10)*parseFloat(o[0].substr(2)):parseFloat(o[0]))*(-1===t.indexOf("rad")?1:N)-(l?0:e),o.length&&(n&&(n[i]=e+s),-1!==t.indexOf("short")&&(s%=r,s!==s%(r/2)&&(s=0>s?s+r:s-r)),-1!==t.indexOf("_cw")&&0>s?s=(s+9999999999*r)%r-(s/r|0)*r:-1!==t.indexOf("ccw")&&s>0&&(s=(s-9999999999*r)%r-(s/r|0)*r)),a=e+s),h>a&&a>-h&&(a=0),a},ut={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},dt=function(t,e,i){return t=0>t?t+1:t>1?t-1:t,255*(1>6*t?e+(i-e)*t*6:.5>t?i:2>3*t?e+(i-e)*(2/3-t)*6:e)+.5|0},pt=s.parseColor=function(t,e){var i,n,r,o,s,a,l,h,c,u,d;if(t)if("number"==typeof t)i=[t>>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ut[t])i=ut[t];else if("#"===t.charAt(0))4===t.length&&(n=t.charAt(1),r=t.charAt(2),o=t.charAt(3),t="#"+n+n+r+r+o+o),t=parseInt(t.substr(1),16),i=[t>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(i=d=t.match(y),e){if(-1!==t.indexOf("="))return t.match(_)}else s=Number(i[0])%360/360,a=Number(i[1])/100,l=Number(i[2])/100,r=.5>=l?l*(a+1):l+a-l*a,n=2*l-r,i.length>3&&(i[3]=Number(i[3])),i[0]=dt(s+1/3,n,r),i[1]=dt(s,n,r),i[2]=dt(s-1/3,n,r);else i=t.match(y)||ut.transparent;i[0]=Number(i[0]),i[1]=Number(i[1]),i[2]=Number(i[2]),i.length>3&&(i[3]=Number(i[3]))}else i=ut.black;return e&&!d&&(n=i[0]/255,r=i[1]/255,o=i[2]/255,h=Math.max(n,r,o),c=Math.min(n,r,o),l=(h+c)/2,h===c?s=a=0:(u=h-c,a=l>.5?u/(2-h-c):u/(h+c),s=h===n?(r-o)/u+(o>r?6:0):h===r?(o-n)/u+2:(n-r)/u+4,s*=60),i[0]=s+.5|0,i[1]=100*a+.5|0,i[2]=100*l+.5|0),i},ft=function(t,e){var i,n,r,o=t.match(mt)||[],s=0,a="";if(!o.length)return t;for(i=0;i<o.length;i++)n=o[i],r=t.substr(s,t.indexOf(n,s)-s),s+=r.length+n.length,n=pt(n,e),3===n.length&&n.push(1),a+=r+(e?"hsla("+n[0]+","+n[1]+"%,"+n[2]+"%,"+n[3]:"rgba("+n.join(","))+")";return a+t.substr(s)},mt="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(h in ut)mt+="|"+h+"\\b";mt=new RegExp(mt+")","gi"),s.colorStringFilter=function(t){var e,i=t[0]+" "+t[1];mt.test(i)&&(e=-1!==i.indexOf("hsl(")||-1!==i.indexOf("hsla("),t[0]=ft(t[0],e),t[1]=ft(t[1],e)),mt.lastIndex=0},e.defaultStringFilter||(e.defaultStringFilter=s.colorStringFilter);var gt=function(t,e,i,n){if(null==t)return function(t){return t};var r,o=e?(t.match(mt)||[""])[0]:"",s=t.split(o).join("").match(b)||[],a=t.substr(0,t.indexOf(s[0])),l=")"===t.charAt(t.length-1)?")":"",h=-1!==t.indexOf(" ")?" ":",",c=s.length,u=c>0?s[0].replace(y,""):"";return c?r=e?function(t){var e,d,p,f;if("number"==typeof t)t+=u;else if(n&&k.test(t)){for(f=t.replace(k,"|").split("|"),p=0;p<f.length;p++)f[p]=r(f[p]);return f.join(",")}if(e=(t.match(mt)||[o])[0],d=t.split(e).join("").match(b)||[],p=d.length,c>p--)for(;++p<c;)d[p]=i?d[(p-1)/2|0]:s[p];return a+d.join(h)+h+e+l+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,o,d;if("number"==typeof t)t+=u;else if(n&&k.test(t)){for(o=t.replace(k,"|").split("|"),d=0;d<o.length;d++)o[d]=r(o[d]);return o.join(",")}if(e=t.match(b)||[],d=e.length,c>d--)for(;++d<c;)e[d]=i?e[(d-1)/2|0]:s[d];return a+e.join(h)+l}:function(t){return t}},vt=function(t){return t=t.split(","),function(e,i,n,r,o,s,a){var l,h=(i+"").split(" ");for(a={},l=0;4>l;l++)a[t[l]]=h[l]=h[l]||h[(l-1)/2>>0];return r.parse(e,a,o,s)}},yt=(j._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,n,r,o,s=this.data,a=s.proxy,l=s.firstMPT,h=1e-6;l;)e=a[l.v],l.r?e=Math.round(e):h>e&&e>-h&&(e=0),l.t[l.p]=e,l=l._next;if(s.autoRotate&&(s.autoRotate.rotation=s.mod?s.mod(a.rotation,this.t):a.rotation),1===t||0===t)for(l=s.firstMPT,o=1===t?"e":"b";l;){if(i=l.t,i.type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,n=1;n<i.l;n++)r+=i["xn"+n]+i["xs"+(n+1)];i[o]=r}}else i[o]=i.s+i.xs0;l=l._next}},function(t,e,i,n,r){this.t=t,this.p=e,this.v=i,this.r=r,n&&(n._prev=this,this._next=n)}),_t=(j._parseToProxy=function(t,e,i,n,r,o){var s,a,l,h,c,u=n,d={},p={},f=i._transform,m=B;for(i._transform=null,B=e,n=c=i.parse(t,e,n,r),B=m,o&&(i._transform=f,u&&(u._prev=null,u._prev&&(u._prev._next=null)));n&&n!==u;){if(n.type<=1&&(a=n.p,p[a]=n.s+n.c,d[a]=n.s,o||(h=new yt(n,"s",a,h,n.r),n.c=0),1===n.type))for(s=n.l;--s>0;)l="xn"+s,a=n.p+"_"+l,p[a]=n.data[l],d[a]=n[l],o||(h=new yt(n,l,a,h,n.rxp[l]));n=n._next}return{proxy:d,end:p,firstMPT:h,pt:c}},j.CSSPropTween=function(t,e,n,r,s,a,l,h,c,u,d){this.t=t,this.p=e,this.s=n,this.c=r,this.n=l||e,t instanceof _t||o.push(this.n),this.r=h,this.type=a||0,c&&(this.pr=c,i=!0),this.b=void 0===u?n:u,this.e=void 0===d?n+r:d,s&&(this._next=s,s._prev=this)}),bt=function(t,e,i,n,r,o){var s=new _t(t,e,i,n-i,r,(-1),o);return s.b=i,s.e=s.xs0=n,s},xt=s.parseComplex=function(t,e,i,n,r,o,a,l,h,u){i=i||o||"","function"==typeof n&&(n=n(v,g)),a=new _t(t,e,0,0,a,u?2:1,null,(!1),l,i,n),n+="",r&&mt.test(n+i)&&(n=[i,n],s.colorStringFilter(n),i=n[0],n=n[1]);var d,p,f,m,b,x,w,T,S,M,E,A,C,P=i.split(", ").join(",").split(" "),D=n.split(", ").join(",").split(" "),L=P.length,R=c!==!1;for((-1!==n.indexOf(",")||-1!==i.indexOf(","))&&(-1!==(n+i).indexOf("rgb")||-1!==(n+i).indexOf("hsl")?(P=P.join(" ").replace(k,", ").split(" "),D=D.join(" ").replace(k,", ").split(" ")):(P=P.join(" ").split(",").join(", ").split(" "),D=D.join(" ").split(",").join(", ").split(" ")),L=P.length),L!==D.length&&(P=(o||"").split(" "),L=P.length),a.plugin=h,a.setRatio=u,mt.lastIndex=0,d=0;L>d;d++)if(m=P[d],b=D[d],T=parseFloat(m),T||0===T)a.appendXtra("",T,lt(b,T),b.replace(_,""),R&&-1!==b.indexOf("px"),!0);else if(r&&mt.test(m))A=b.indexOf(")")+1,A=")"+(A?b.substr(A):""),C=-1!==b.indexOf("hsl")&&X,M=b,m=pt(m,C),b=pt(b,C),S=m.length+b.length>6,S&&!X&&0===b[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(D[d]).join("transparent")):(X||(S=!1),C?a.appendXtra(M.substr(0,M.indexOf("hsl"))+(S?"hsla(":"hsl("),m[0],lt(b[0],m[0]),",",!1,!0).appendXtra("",m[1],lt(b[1],m[1]),"%,",!1).appendXtra("",m[2],lt(b[2],m[2]),S?"%,":"%"+A,!1):a.appendXtra(M.substr(0,M.indexOf("rgb"))+(S?"rgba(":"rgb("),m[0],b[0]-m[0],",",!0,!0).appendXtra("",m[1],b[1]-m[1],",",!0).appendXtra("",m[2],b[2]-m[2],S?",":A,!0),S&&(m=m.length<4?1:m[3],a.appendXtra("",m,(b.length<4?1:b[3])-m,A,!1))),mt.lastIndex=0;else if(x=m.match(y)){if(w=b.match(_),!w||w.length!==x.length)return a;for(f=0,p=0;p<x.length;p++)E=x[p],M=m.indexOf(E,f),a.appendXtra(m.substr(f,M-f),Number(E),lt(w[p],E),"",R&&"px"===m.substr(M+E.length,2),0===p),f=M+E.length;a["xs"+a.l]+=m.substr(f)}else a["xs"+a.l]+=a.l||a["xs"+a.l]?" "+b:b;if(-1!==n.indexOf("=")&&a.data){for(A=a.xs0+a.data.s,d=1;d<a.l;d++)A+=a["xs"+d]+a.data["xn"+d];a.e=A+a["xs"+d]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},wt=9;for(h=_t.prototype,h.l=h.pr=0;--wt>0;)h["xn"+wt]=0,h["xs"+wt]="";h.xs0="",h._next=h._prev=h.xfirst=h.data=h.plugin=h.setRatio=h.rxp=null,h.appendXtra=function(t,e,i,n,r,o){var s=this,a=s.l;return s["xs"+a]+=o&&(a||s["xs"+a])?" "+t:t||"",i||0===a||s.plugin?(s.l++,s.type=s.setRatio?2:1,s["xs"+s.l]=n||"",a>0?(s.data["xn"+a]=e+i,s.rxp["xn"+a]=r,s["xn"+a]=e,s.plugin||(s.xfirst=new _t(s,"xn"+a,e,i,s.xfirst||s,0,s.n,r,s.pr),s.xfirst.xs0=0),s):(s.data={s:e+i},s.rxp={},s.s=e,s.c=i,s.r=r,s)):(s["xs"+a]+=e+(n||""),s)};var Tt=function(t,e){e=e||{},this.p=e.prefix?J(t)||t:t,l[t]=l[this.p]=this,this.format=e.formatter||gt(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},St=j._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var n,r,o=t.split(","),s=e.defaultValue;for(i=i||[s],n=0;n<o.length;n++)e.prefix=0===n&&e.prefix,e.defaultValue=i[n]||s,r=new Tt(o[n],e)},Mt=j._registerPluginProp=function(t){if(!l[t]){var e=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";St(t,{parser:function(t,i,n,r,o,s,h){var c=a.com.greensock.plugins[e];return c?(c._cssRegister(),l[n].parse(t,i,n,r,o,s,h)):(Y("Error: "+e+" js file not loaded."),o)}})}};h=Tt.prototype,h.parseComplex=function(t,e,i,n,r,o){var s,a,l,h,c,u,d=this.keyword;if(this.multi&&(k.test(i)||k.test(e)?(a=e.replace(k,"|").split("|"),l=i.replace(k,"|").split("|")):d&&(a=[e],l=[i])),l){for(h=l.length>a.length?l.length:a.length,s=0;h>s;s++)e=a[s]=a[s]||this.dflt,i=l[s]=l[s]||this.dflt,d&&(c=e.indexOf(d),u=i.indexOf(d),c!==u&&(-1===u?a[s]=a[s].split(d).join(""):-1===c&&(a[s]+=" "+d)));e=a.join(", "),i=l.join(", ")}return xt(t,this.p,e,i,this.clrs,this.dflt,n,this.pr,r,o)},h.parse=function(t,e,i,n,o,s,a){return this.parseComplex(t.style,this.format($(t,this.p,r,!1,this.dflt)),this.format(e),o,s)},s.registerSpecialProp=function(t,e,i){St(t,{parser:function(t,n,r,o,s,a,l){var h=new _t(t,r,0,0,s,2,r,(!1),i);return h.plugin=a,h.setRatio=e(t,n,o._tween,r),h},priority:i})},s.useSVGTransformAttr=!0;var Et,At="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Ct=J("transform"),Pt=K+"transform",Dt=J("transformOrigin"),Lt=null!==J("perspective"),Rt=j.Transform=function(){this.perspective=parseFloat(s.defaultTransformPerspective)||0,this.force3D=!(s.defaultForce3D===!1||!Lt)&&(s.defaultForce3D||"auto")},It=_gsScope.SVGElement,kt=function(t,e,i){var n,r=F.createElementNS("http://www.w3.org/2000/svg",t),o=/([a-z])([A-Z])/g;for(n in i)r.setAttributeNS(null,n.replace(o,"$1-$2").toLowerCase(),i[n]);return e.appendChild(r),r},Ot=F.documentElement||{},Ht=function(){var t,e,i,n=m||/Android/i.test(W)&&!_gsScope.chrome;return F.createElementNS&&!n&&(t=kt("svg",Ot),e=kt("rect",t,{width:100,height:50,x:100}),i=e.getBoundingClientRect().width,e.style[Dt]="50% 50%",e.style[Ct]="scaleX(0.5)",n=i===e.getBoundingClientRect().width&&!(p&&Lt),Ot.removeChild(t)),n}(),Nt=function(t,e,i,n,r,o){var a,l,h,c,u,d,p,f,m,g,v,y,_,b,x=t._gsTransform,w=Ut(t,!0);x&&(_=x.xOrigin,b=x.yOrigin),(!n||(a=n.split(" ")).length<2)&&(p=t.getBBox(),0===p.x&&0===p.y&&p.width+p.height===0&&(p={x:parseFloat(t.hasAttribute("x")?t.getAttribute("x"):t.hasAttribute("cx")?t.getAttribute("cx"):0)||0,y:parseFloat(t.hasAttribute("y")?t.getAttribute("y"):t.hasAttribute("cy")?t.getAttribute("cy"):0)||0,width:0,height:0}),e=at(e).split(" "),a=[(-1!==e[0].indexOf("%")?parseFloat(e[0])/100*p.width:parseFloat(e[0]))+p.x,(-1!==e[1].indexOf("%")?parseFloat(e[1])/100*p.height:parseFloat(e[1]))+p.y]),i.xOrigin=c=parseFloat(a[0]),i.yOrigin=u=parseFloat(a[1]),n&&w!==zt&&(d=w[0],p=w[1],f=w[2],m=w[3],g=w[4],v=w[5],y=d*m-p*f,y&&(l=c*(m/y)+u*(-f/y)+(f*v-m*g)/y,h=c*(-p/y)+u*(d/y)-(d*v-p*g)/y,c=i.xOrigin=a[0]=l,u=i.yOrigin=a[1]=h)),x&&(o&&(i.xOffset=x.xOffset,i.yOffset=x.yOffset,x=i),r||r!==!1&&s.defaultSmoothOrigin!==!1?(l=c-_,h=u-b,x.xOffset+=l*w[0]+h*w[2]-l,x.yOffset+=l*w[1]+h*w[3]-h):x.xOffset=x.yOffset=0),o||t.setAttribute("data-svg-origin",a.join(" "))},Bt=function(t){var e,i=z("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,r=this.nextSibling,o=this.style.cssText;if(Ot.appendChild(i),i.appendChild(this),this.style.display="block",t)try{e=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=Bt}catch(s){}else this._originalGetBBox&&(e=this._originalGetBBox());return r?n.insertBefore(this,r):n.appendChild(this),Ot.removeChild(i),this.style.cssText=o,e},Gt=function(t){try{return t.getBBox()}catch(e){return Bt.call(t,!0)}},Ft=function(t){return!(!It||!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Gt(t))},zt=[1,0,0,1,0,0],Ut=function(t,e){var i,n,r,o,s,a,l=t._gsTransform||new Rt,h=1e5,c=t.style;if(Ct?n=$(t,Pt,null,!0):t.currentStyle&&(n=t.currentStyle.filter.match(R),n=n&&4===n.length?[n[0].substr(4),Number(n[2].substr(4)),Number(n[1].substr(4)),n[3].substr(4),l.x||0,l.y||0].join(","):""),i=!n||"none"===n||"matrix(1, 0, 0, 1, 0, 0)"===n,!Ct||!(a=!Q(t)||"none"===Q(t).display)&&t.parentNode||(a&&(o=c.display,c.display="block"),t.parentNode||(s=1,Ot.appendChild(t)),n=$(t,Pt,null,!0),i=!n||"none"===n||"matrix(1, 0, 0, 1, 0, 0)"===n,o?c.display=o:a&&qt(c,"display"),s&&Ot.removeChild(t)),(l.svg||t.getCTM&&Ft(t))&&(i&&-1!==(c[Ct]+"").indexOf("matrix")&&(n=c[Ct],i=0),r=t.getAttribute("transform"),i&&r&&(r=t.transform.baseVal.consolidate().matrix,n="matrix("+r.a+","+r.b+","+r.c+","+r.d+","+r.e+","+r.f+")",i=0)),i)return zt;for(r=(n||"").match(y)||[],wt=r.length;--wt>-1;)o=Number(r[wt]),r[wt]=(s=o-(o|=0))?(s*h+(0>s?-.5:.5)|0)/h+o:o;return e&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r},Vt=j.getTransform=function(t,i,n,r){if(t._gsTransform&&n&&!r)return t._gsTransform;var o,a,l,h,c,u,d=n?t._gsTransform||new Rt:new Rt,p=d.scaleX<0,f=2e-5,m=1e5,g=Lt?parseFloat($(t,Dt,i,!1,"0 0 0").split(" ")[2])||d.zOrigin||0:0,v=parseFloat(s.defaultTransformPerspective)||0;if(d.svg=!(!t.getCTM||!Ft(t)),d.svg&&(Nt(t,$(t,Dt,i,!1,"50% 50%")+"",d,t.getAttribute("data-svg-origin")),Et=s.useSVGTransformAttr||Ht),o=Ut(t),o!==zt){if(16===o.length){var y,_,b,x,w,T=o[0],S=o[1],M=o[2],E=o[3],A=o[4],C=o[5],P=o[6],D=o[7],L=o[8],R=o[9],I=o[10],k=o[12],O=o[13],H=o[14],B=o[11],G=Math.atan2(P,I);d.zOrigin&&(H=-d.zOrigin,k=L*H-o[12],O=R*H-o[13],H=I*H+d.zOrigin-o[14]),d.rotationX=G*N,G&&(x=Math.cos(-G),w=Math.sin(-G),y=A*x+L*w,_=C*x+R*w,b=P*x+I*w,L=A*-w+L*x,R=C*-w+R*x,I=P*-w+I*x,B=D*-w+B*x,A=y,C=_,P=b),G=Math.atan2(-M,I),d.rotationY=G*N,G&&(x=Math.cos(-G),w=Math.sin(-G),y=T*x-L*w,_=S*x-R*w,b=M*x-I*w,R=S*w+R*x,I=M*w+I*x,B=E*w+B*x,T=y,S=_,M=b),G=Math.atan2(S,T),d.rotation=G*N,G&&(x=Math.cos(G),w=Math.sin(G),y=T*x+S*w,_=A*x+C*w,b=L*x+R*w,S=S*x-T*w,C=C*x-A*w,R=R*x-L*w,T=y,A=_,L=b),d.rotationX&&Math.abs(d.rotationX)+Math.abs(d.rotation)>359.9&&(d.rotationX=d.rotation=0,d.rotationY=180-d.rotationY),G=Math.atan2(A,C),d.scaleX=(Math.sqrt(T*T+S*S+M*M)*m+.5|0)/m,d.scaleY=(Math.sqrt(C*C+P*P)*m+.5|0)/m,d.scaleZ=(Math.sqrt(L*L+R*R+I*I)*m+.5|0)/m,T/=d.scaleX,A/=d.scaleY,S/=d.scaleX,C/=d.scaleY,Math.abs(G)>f?(d.skewX=G*N,A=0,"simple"!==d.skewType&&(d.scaleY*=1/Math.cos(G))):d.skewX=0,d.perspective=B?1/(0>B?-B:B):0,d.x=k,d.y=O,d.z=H,d.svg&&(d.x-=d.xOrigin-(d.xOrigin*T-d.yOrigin*A),d.y-=d.yOrigin-(d.yOrigin*S-d.xOrigin*C))}else if(!Lt||r||!o.length||d.x!==o[4]||d.y!==o[5]||!d.rotationX&&!d.rotationY){var F=o.length>=6,z=F?o[0]:1,U=o[1]||0,V=o[2]||0,j=F?o[3]:1;d.x=o[4]||0,d.y=o[5]||0,l=Math.sqrt(z*z+U*U),h=Math.sqrt(j*j+V*V),c=z||U?Math.atan2(U,z)*N:d.rotation||0,u=V||j?Math.atan2(V,j)*N+c:d.skewX||0,d.scaleX=l,d.scaleY=h,d.rotation=c,d.skewX=u,Lt&&(d.rotationX=d.rotationY=d.z=0,d.perspective=v,d.scaleZ=1),d.svg&&(d.x-=d.xOrigin-(d.xOrigin*z+d.yOrigin*V),d.y-=d.yOrigin-(d.xOrigin*U+d.yOrigin*j))}Math.abs(d.skewX)>90&&Math.abs(d.skewX)<270&&(p?(d.scaleX*=-1,d.skewX+=d.rotation<=0?180:-180,d.rotation+=d.rotation<=0?180:-180):(d.scaleY*=-1,d.skewX+=d.skewX<=0?180:-180)),d.zOrigin=g;for(a in d)d[a]<f&&d[a]>-f&&(d[a]=0)}return n&&(t._gsTransform=d,d.svg&&(Et&&t.style[Ct]?e.delayedCall(.001,function(){qt(t.style,Ct)}):!Et&&t.getAttribute("transform")&&e.delayedCall(.001,function(){t.removeAttribute("transform")}))),d},jt=function(t){var e,i,n=this.data,r=-n.rotation*H,o=r+n.skewX*H,s=1e5,a=(Math.cos(r)*n.scaleX*s|0)/s,l=(Math.sin(r)*n.scaleX*s|0)/s,h=(Math.sin(o)*-n.scaleY*s|0)/s,c=(Math.cos(o)*n.scaleY*s|0)/s,u=this.t.style,d=this.t.currentStyle;if(d){i=l,l=-h,h=-i,e=d.filter,u.filter="";var p,f,g=this.t.offsetWidth,v=this.t.offsetHeight,y="absolute"!==d.position,_="progid:DXImageTransform.Microsoft.Matrix(M11="+a+", M12="+l+", M21="+h+", M22="+c,b=n.x+g*n.xPercent/100,x=n.y+v*n.yPercent/100;if(null!=n.ox&&(p=(n.oxp?g*n.ox*.01:n.ox)-g/2,f=(n.oyp?v*n.oy*.01:n.oy)-v/2,b+=p-(p*a+f*l),x+=f-(p*h+f*c)),y?(p=g/2,f=v/2,_+=", Dx="+(p-(p*a+f*l)+b)+", Dy="+(f-(p*h+f*c)+x)+")"):_+=", sizingMethod='auto expand')",-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?u.filter=e.replace(I,_):u.filter=_+" "+e,(0===t||1===t)&&1===a&&0===l&&0===h&&1===c&&(y&&-1===_.indexOf("Dx=0, Dy=0")||T.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf(e.indexOf("Alpha"))&&u.removeAttribute("filter")),!y){var S,M,E,A=8>m?1:-1;for(p=n.ieOffsetX||0,f=n.ieOffsetY||0,n.ieOffsetX=Math.round((g-((0>a?-a:a)*g+(0>l?-l:l)*v))/2+b),n.ieOffsetY=Math.round((v-((0>c?-c:c)*v+(0>h?-h:h)*g))/2+x),wt=0;4>wt;wt++)M=ot[wt],S=d[M],i=-1!==S.indexOf("px")?parseFloat(S):tt(this.t,M,parseFloat(S),S.replace(w,""))||0,E=i!==n[M]?2>wt?-n.ieOffsetX:-n.ieOffsetY:2>wt?p-n.ieOffsetX:f-n.ieOffsetY,u[M]=(n[M]=Math.round(i-E*(0===wt||2===wt?1:A)))+"px"}}},Wt=j.set3DTransformRatio=j.setTransformRatio=function(t){var e,i,n,r,o,s,a,l,h,c,u,d,f,m,g,v,y,_,b,x,w,T,S,M=this.data,E=this.t.style,A=M.rotation,C=M.rotationX,P=M.rotationY,D=M.scaleX,L=M.scaleY,R=M.scaleZ,I=M.x,k=M.y,O=M.z,N=M.svg,B=M.perspective,G=M.force3D,F=M.skewY,z=M.skewX;if(F&&(z+=F,A+=F),((1===t||0===t)&&"auto"===G&&(this.tween._totalTime===this.tween._totalDuration||!this.tween._totalTime)||!G)&&!O&&!B&&!P&&!C&&1===R||Et&&N||!Lt)return void(A||z||N?(A*=H,T=z*H,S=1e5,i=Math.cos(A)*D,o=Math.sin(A)*D,n=Math.sin(A-T)*-L,s=Math.cos(A-T)*L,T&&"simple"===M.skewType&&(e=Math.tan(T-F*H),e=Math.sqrt(1+e*e),n*=e,s*=e,F&&(e=Math.tan(F*H),e=Math.sqrt(1+e*e),i*=e,o*=e)),N&&(I+=M.xOrigin-(M.xOrigin*i+M.yOrigin*n)+M.xOffset,k+=M.yOrigin-(M.xOrigin*o+M.yOrigin*s)+M.yOffset,Et&&(M.xPercent||M.yPercent)&&(g=this.t.getBBox(),I+=.01*M.xPercent*g.width,k+=.01*M.yPercent*g.height),g=1e-6,g>I&&I>-g&&(I=0),g>k&&k>-g&&(k=0)),b=(i*S|0)/S+","+(o*S|0)/S+","+(n*S|0)/S+","+(s*S|0)/S+","+I+","+k+")",N&&Et?this.t.setAttribute("transform","matrix("+b):E[Ct]=(M.xPercent||M.yPercent?"translate("+M.xPercent+"%,"+M.yPercent+"%) matrix(":"matrix(")+b):E[Ct]=(M.xPercent||M.yPercent?"translate("+M.xPercent+"%,"+M.yPercent+"%) matrix(":"matrix(")+D+",0,0,"+L+","+I+","+k+")");if(p&&(g=1e-4,g>D&&D>-g&&(D=R=2e-5),g>L&&L>-g&&(L=R=2e-5),!B||M.z||M.rotationX||M.rotationY||(B=0)),A||z)A*=H,v=i=Math.cos(A),y=o=Math.sin(A),z&&(A-=z*H,v=Math.cos(A),y=Math.sin(A),"simple"===M.skewType&&(e=Math.tan((z-F)*H),e=Math.sqrt(1+e*e),v*=e,y*=e,M.skewY&&(e=Math.tan(F*H),e=Math.sqrt(1+e*e),i*=e,o*=e))),n=-y,s=v;else{if(!(P||C||1!==R||B||N))return void(E[Ct]=(M.xPercent||M.yPercent?"translate("+M.xPercent+"%,"+M.yPercent+"%) translate3d(":"translate3d(")+I+"px,"+k+"px,"+O+"px)"+(1!==D||1!==L?" scale("+D+","+L+")":""));i=s=1,n=o=0}c=1,r=a=l=h=u=d=0,f=B?-1/B:0,m=M.zOrigin,g=1e-6,x=",",w="0",A=P*H,A&&(v=Math.cos(A),y=Math.sin(A),l=-y,u=f*-y,r=i*y,a=o*y,c=v,f*=v,i*=v,o*=v),A=C*H,A&&(v=Math.cos(A),y=Math.sin(A),e=n*v+r*y,_=s*v+a*y,h=c*y,d=f*y,r=n*-y+r*v,a=s*-y+a*v,c*=v,f*=v,n=e,s=_),1!==R&&(r*=R,a*=R,c*=R,f*=R),1!==L&&(n*=L,s*=L,h*=L,d*=L),1!==D&&(i*=D,o*=D,l*=D,u*=D),(m||N)&&(m&&(I+=r*-m,k+=a*-m,O+=c*-m+m),N&&(I+=M.xOrigin-(M.xOrigin*i+M.yOrigin*n)+M.xOffset,k+=M.yOrigin-(M.xOrigin*o+M.yOrigin*s)+M.yOffset),g>I&&I>-g&&(I=w),g>k&&k>-g&&(k=w),g>O&&O>-g&&(O=0)),b=M.xPercent||M.yPercent?"translate("+M.xPercent+"%,"+M.yPercent+"%) matrix3d(":"matrix3d(",b+=(g>i&&i>-g?w:i)+x+(g>o&&o>-g?w:o)+x+(g>l&&l>-g?w:l),b+=x+(g>u&&u>-g?w:u)+x+(g>n&&n>-g?w:n)+x+(g>s&&s>-g?w:s),C||P||1!==R?(b+=x+(g>h&&h>-g?w:h)+x+(g>d&&d>-g?w:d)+x+(g>r&&r>-g?w:r),b+=x+(g>a&&a>-g?w:a)+x+(g>c&&c>-g?w:c)+x+(g>f&&f>-g?w:f)+x):b+=",0,0,0,0,1,0,",b+=I+x+k+x+O+x+(B?1+-O/B:1)+")",E[Ct]=b};h=Rt.prototype,h.x=h.y=h.z=h.skewX=h.skewY=h.rotation=h.rotationX=h.rotationY=h.zOrigin=h.xPercent=h.yPercent=h.xOffset=h.yOffset=0,h.scaleX=h.scaleY=h.scaleZ=1,St("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(t,e,i,n,o,a,l){if(n._lastParsedTransform===l)return o;n._lastParsedTransform=l;var h,c=l.scale&&"function"==typeof l.scale?l.scale:0;"function"==typeof l[i]&&(h=l[i],l[i]=e),c&&(l.scale=c(v,t));var u,d,p,f,m,y,_,b,x,w=t._gsTransform,T=t.style,S=1e-6,M=At.length,E=l,A={},C="transformOrigin",P=Vt(t,r,!0,E.parseTransform),D=E.transform&&("function"==typeof E.transform?E.transform(v,g):E.transform);if(P.skewType=E.skewType||P.skewType||s.defaultSkewType,n._transform=P,D&&"string"==typeof D&&Ct)d=U.style,d[Ct]=D,d.display="block",d.position="absolute",F.body.appendChild(U),u=Vt(U,null,!1),"simple"===P.skewType&&(u.scaleY*=Math.cos(u.skewX*H)),P.svg&&(y=P.xOrigin,_=P.yOrigin,u.x-=P.xOffset,u.y-=P.yOffset,(E.transformOrigin||E.svgOrigin)&&(D={},Nt(t,at(E.transformOrigin),D,E.svgOrigin,E.smoothOrigin,!0),y=D.xOrigin,_=D.yOrigin,u.x-=D.xOffset-P.xOffset,u.y-=D.yOffset-P.yOffset),(y||_)&&(b=Ut(U,!0),u.x-=y-(y*b[0]+_*b[2]),u.y-=_-(y*b[1]+_*b[3]))),F.body.removeChild(U),u.perspective||(u.perspective=P.perspective),null!=E.xPercent&&(u.xPercent=ht(E.xPercent,P.xPercent)),null!=E.yPercent&&(u.yPercent=ht(E.yPercent,P.yPercent));else if("object"==typeof E){if(u={scaleX:ht(null!=E.scaleX?E.scaleX:E.scale,P.scaleX),scaleY:ht(null!=E.scaleY?E.scaleY:E.scale,P.scaleY),scaleZ:ht(E.scaleZ,P.scaleZ),x:ht(E.x,P.x),y:ht(E.y,P.y),z:ht(E.z,P.z),xPercent:ht(E.xPercent,P.xPercent),yPercent:ht(E.yPercent,P.yPercent),perspective:ht(E.transformPerspective,P.perspective)},m=E.directionalRotation,null!=m)if("object"==typeof m)for(d in m)E[d]=m[d];else E.rotation=m;"string"==typeof E.x&&-1!==E.x.indexOf("%")&&(u.x=0,u.xPercent=ht(E.x,P.xPercent)),"string"==typeof E.y&&-1!==E.y.indexOf("%")&&(u.y=0,u.yPercent=ht(E.y,P.yPercent)),u.rotation=ct("rotation"in E?E.rotation:"shortRotation"in E?E.shortRotation+"_short":"rotationZ"in E?E.rotationZ:P.rotation,P.rotation,"rotation",A),Lt&&(u.rotationX=ct("rotationX"in E?E.rotationX:"shortRotationX"in E?E.shortRotationX+"_short":P.rotationX||0,P.rotationX,"rotationX",A),u.rotationY=ct("rotationY"in E?E.rotationY:"shortRotationY"in E?E.shortRotationY+"_short":P.rotationY||0,P.rotationY,"rotationY",A)),u.skewX=ct(E.skewX,P.skewX),u.skewY=ct(E.skewY,P.skewY)}for(Lt&&null!=E.force3D&&(P.force3D=E.force3D,f=!0),p=P.force3D||P.z||P.rotationX||P.rotationY||u.z||u.rotationX||u.rotationY||u.perspective,p||null==E.scale||(u.scaleZ=1);--M>-1;)x=At[M],D=u[x]-P[x],(D>S||-S>D||null!=E[x]||null!=B[x])&&(f=!0,o=new _t(P,x,P[x],D,o),x in A&&(o.e=A[x]),o.xs0=0,o.plugin=a,n._overwriteProps.push(o.n));return D=E.transformOrigin,P.svg&&(D||E.svgOrigin)&&(y=P.xOffset,_=P.yOffset,Nt(t,at(D),u,E.svgOrigin,E.smoothOrigin),o=bt(P,"xOrigin",(w?P:u).xOrigin,u.xOrigin,o,C),o=bt(P,"yOrigin",(w?P:u).yOrigin,u.yOrigin,o,C),(y!==P.xOffset||_!==P.yOffset)&&(o=bt(P,"xOffset",w?y:P.xOffset,P.xOffset,o,C),o=bt(P,"yOffset",w?_:P.yOffset,P.yOffset,o,C)),D="0px 0px"),(D||Lt&&p&&P.zOrigin)&&(Ct?(f=!0,x=Dt,D=(D||$(t,x,r,!1,"50% 50%"))+"",o=new _t(T,x,0,0,o,(-1),C),o.b=T[x],o.plugin=a,Lt?(d=P.zOrigin,D=D.split(" "),P.zOrigin=(D.length>2&&(0===d||"0px"!==D[2])?parseFloat(D[2]):d)||0,o.xs0=o.e=D[0]+" "+(D[1]||"50%")+" 0px",o=new _t(P,"zOrigin",0,0,o,(-1),o.n),o.b=d,o.xs0=o.e=P.zOrigin):o.xs0=o.e=D):at(D+"",P)),f&&(n._transformType=P.svg&&Et||!p&&3!==this._transformType?2:3),h&&(l[i]=h),c&&(l.scale=c),o},prefix:!0}),St("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),St("borderRadius",{defaultValue:"0px",parser:function(t,e,i,o,s,a){e=this.format(e);var l,h,c,u,d,p,f,m,g,v,y,_,b,x,w,T,S=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],M=t.style;for(g=parseFloat(t.offsetWidth),v=parseFloat(t.offsetHeight),l=e.split(" "),h=0;h<S.length;h++)this.p.indexOf("border")&&(S[h]=J(S[h])),d=u=$(t,S[h],r,!1,"0px"),-1!==d.indexOf(" ")&&(u=d.split(" "),d=u[0],u=u[1]),p=c=l[h],f=parseFloat(d),_=d.substr((f+"").length),b="="===p.charAt(1),b?(m=parseInt(p.charAt(0)+"1",10),p=p.substr(2),m*=parseFloat(p),y=p.substr((m+"").length-(0>m?1:0))||""):(m=parseFloat(p),y=p.substr((m+"").length)),""===y&&(y=n[i]||_),y!==_&&(x=tt(t,"borderLeft",f,_),w=tt(t,"borderTop",f,_),"%"===y?(d=x/g*100+"%",u=w/v*100+"%"):"em"===y?(T=tt(t,"borderLeft",1,"em"),d=x/T+"em",u=w/T+"em"):(d=x+"px",u=w+"px"),b&&(p=parseFloat(d)+m+y,c=parseFloat(u)+m+y)),s=xt(M,S[h],d+" "+u,p+" "+c,!1,"0px",s);return s},prefix:!0,formatter:gt("0px 0px 0px 0px",!1,!0)}),St("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(t,e,i,n,o,s){return xt(t.style,i,this.format($(t,i,r,!1,"0px 0px")),this.format(e),!1,"0px",o)},prefix:!0,formatter:gt("0px 0px",!1,!0)}),St("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,n,o,s){var a,l,h,c,u,d,p="background-position",f=r||Q(t,null),g=this.format((f?m?f.getPropertyValue(p+"-x")+" "+f.getPropertyValue(p+"-y"):f.getPropertyValue(p):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),v=this.format(e);if(-1!==g.indexOf("%")!=(-1!==v.indexOf("%"))&&v.split(",").length<2&&(d=$(t,"backgroundImage").replace(P,""),d&&"none"!==d)){for(a=g.split(" "),l=v.split(" "),V.setAttribute("src",d),h=2;--h>-1;)g=a[h],c=-1!==g.indexOf("%"),c!==(-1!==l[h].indexOf("%"))&&(u=0===h?t.offsetWidth-V.width:t.offsetHeight-V.height,a[h]=c?parseFloat(g)/100*u+"px":parseFloat(g)/u*100+"%");g=a.join(" ")}return this.parseComplex(t.style,g,v,o,s)},formatter:at}),St("backgroundSize",{defaultValue:"0 0",formatter:function(t){return t+="",at(-1===t.indexOf(" ")?t+" "+t:t)}}),St("perspective",{defaultValue:"0px",prefix:!0}),St("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),St("transformStyle",{prefix:!0}),St("backfaceVisibility",{prefix:!0}),St("userSelect",{prefix:!0}),St("margin",{parser:vt("marginTop,marginRight,marginBottom,marginLeft")}),St("padding",{parser:vt("paddingTop,paddingRight,paddingBottom,paddingLeft")}),St("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,n,o,s){var a,l,h;return 9>m?(l=t.currentStyle,h=8>m?" ":",",a="rect("+l.clipTop+h+l.clipRight+h+l.clipBottom+h+l.clipLeft+")",e=this.format(e).split(",").join(h)):(a=this.format($(t,this.p,r,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,a,e,o,s)}}),St("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),St("autoRound,strictUnits",{parser:function(t,e,i,n,r){return r}}),St("border",{defaultValue:"0px solid #000",parser:function(t,e,i,n,o,s){var a=$(t,"borderTopWidth",r,!1,"0px"),l=this.format(e).split(" "),h=l[0].replace(w,"");return"px"!==h&&(a=parseFloat(a)/tt(t,"borderTopWidth",1,h)+h),this.parseComplex(t.style,this.format(a+" "+$(t,"borderTopStyle",r,!1,"solid")+" "+$(t,"borderTopColor",r,!1,"#000")),l.join(" "),o,s)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(mt)||["#000"])[0]}}),St("borderWidth",{parser:vt("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),St("float,cssFloat,styleFloat",{parser:function(t,e,i,n,r,o){var s=t.style,a="cssFloat"in s?"cssFloat":"styleFloat";return new _t(s,a,0,0,r,(-1),i,(!1),0,s[a],e);
}});var Xt=function(t){var e,i=this.t,n=i.filter||$(this.data,"filter")||"",r=this.s+this.c*t|0;100===r&&(-1===n.indexOf("atrix(")&&-1===n.indexOf("radient(")&&-1===n.indexOf("oader(")?(i.removeAttribute("filter"),e=!$(this.data,"filter")):(i.filter=n.replace(M,""),e=!0)),e||(this.xn1&&(i.filter=n=n||"alpha(opacity="+r+")"),-1===n.indexOf("pacity")?0===r&&this.xn1||(i.filter=n+" alpha(opacity="+r+")"):i.filter=n.replace(T,"opacity="+r))};St("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,n,o,s){var a=parseFloat($(t,"opacity",r,!1,"1")),l=t.style,h="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+a),h&&1===a&&"hidden"===$(t,"visibility",r)&&0!==e&&(a=0),X?o=new _t(l,"opacity",a,e-a,o):(o=new _t(l,"opacity",100*a,100*(e-a),o),o.xn1=h?1:0,l.zoom=1,o.type=2,o.b="alpha(opacity="+o.s+")",o.e="alpha(opacity="+(o.s+o.c)+")",o.data=t,o.plugin=s,o.setRatio=Xt),h&&(o=new _t(l,"visibility",0,0,o,(-1),null,(!1),0,0!==a?"inherit":"hidden",0===e?"hidden":"inherit"),o.xs0="inherit",n._overwriteProps.push(o.n),n._overwriteProps.push(i)),o}});var qt=function(t,e){e&&(t.removeProperty?(("ms"===e.substr(0,2)||"webkit"===e.substr(0,6))&&(e="-"+e),t.removeProperty(e.replace(A,"-$1").toLowerCase())):t.removeAttribute(e))},Yt=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:qt(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};St("className",{parser:function(t,e,n,o,s,a,l){var h,c,u,d,p,f=t.getAttribute("class")||"",m=t.style.cssText;if(s=o._classNamePT=new _t(t,n,0,0,s,2),s.setRatio=Yt,s.pr=-11,i=!0,s.b=f,c=it(t,r),u=t._gsClassPT){for(d={},p=u.data;p;)d[p.p]=1,p=p._next;u.setRatio(1)}return t._gsClassPT=s,s.e="="!==e.charAt(1)?e:f.replace(new RegExp("(?:\\s|^)"+e.substr(2)+"(?![\\w-])"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),t.setAttribute("class",s.e),h=nt(t,c,it(t),l,d),t.setAttribute("class",f),s.data=h.firstMPT,t.style.cssText=m,s=s.xfirst=o.parse(t,h.difs,s,a)}});var Kt=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,n,r,o,s=this.t.style,a=l.transform.parse;if("all"===this.e)s.cssText="",r=!0;else for(e=this.e.split(" ").join("").split(","),n=e.length;--n>-1;)i=e[n],l[i]&&(l[i].parse===a?r=!0:i="transformOrigin"===i?Dt:l[i].p),qt(s,i);r&&(qt(s,Ct),o=this.t._gsTransform,o&&(o.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}};for(St("clearProps",{parser:function(t,e,n,r,o){return o=new _t(t,n,0,0,o,2),o.setRatio=Kt,o.e=e,o.pr=-10,o.data=r._tween,i=!0,o}}),h="bezier,throwProps,physicsProps,physics2D".split(","),wt=h.length;wt--;)Mt(h[wt]);h=s.prototype,h._firstPT=h._lastParsedTransform=h._transform=null,h._onInitTween=function(t,e,a,h){if(!t.nodeType)return!1;this._target=g=t,this._tween=a,this._vars=e,v=h,c=e.autoRound,i=!1,n=e.suffixMap||s.suffixMap,r=Q(t,""),o=this._overwriteProps;var p,m,y,_,b,x,w,T,M,E=t.style;if(u&&""===E.zIndex&&(p=$(t,"zIndex",r),("auto"===p||""===p)&&this._addLazySet(E,"zIndex",0)),"string"==typeof e&&(_=E.cssText,p=it(t,r),E.cssText=_+";"+e,p=nt(t,p,it(t)).difs,!X&&S.test(e)&&(p.opacity=parseFloat(RegExp.$1)),e=p,E.cssText=_),e.className?this._firstPT=m=l.className.parse(t,e.className,"className",this,null,null,e):this._firstPT=m=this.parse(t,e,null),this._transformType){for(M=3===this._transformType,Ct?d&&(u=!0,""===E.zIndex&&(w=$(t,"zIndex",r),("auto"===w||""===w)&&this._addLazySet(E,"zIndex",0)),f&&this._addLazySet(E,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(M?"visible":"hidden"))):E.zoom=1,y=m;y&&y._next;)y=y._next;T=new _t(t,"transform",0,0,null,2),this._linkCSSP(T,null,y),T.setRatio=Ct?Wt:jt,T.data=this._transform||Vt(t,r,!0),T.tween=a,T.pr=-1,o.pop()}if(i){for(;m;){for(x=m._next,y=_;y&&y.pr>m.pr;)y=y._next;(m._prev=y?y._prev:b)?m._prev._next=m:_=m,(m._next=y)?y._prev=m:b=m,m=x}this._firstPT=_}return!0},h.parse=function(t,e,i,o){var s,a,h,u,d,p,f,m,y,_,b=t.style;for(s in e){if(p=e[s],"function"==typeof p&&(p=p(v,g)),a=l[s])i=a.parse(t,p,s,this,i,o,e);else{if("--"===s.substr(0,2)){this._tween._propLookup[s]=this._addTween.call(this._tween,t.style,"setProperty",Q(t).getPropertyValue(s)+"",p+"",s,!1,s);continue}d=$(t,s,r)+"",y="string"==typeof p,"color"===s||"fill"===s||"stroke"===s||-1!==s.indexOf("Color")||y&&E.test(p)?(y||(p=pt(p),p=(p.length>3?"rgba(":"rgb(")+p.join(",")+")"),i=xt(b,s,d,p,!0,"transparent",i,0,o)):y&&O.test(p)?i=xt(b,s,d,p,!0,null,i,0,o):(h=parseFloat(d),f=h||0===h?d.substr((h+"").length):"",(""===d||"auto"===d)&&("width"===s||"height"===s?(h=st(t,s,r),f="px"):"left"===s||"top"===s?(h=et(t,s,r),f="px"):(h="opacity"!==s?0:1,f="")),_=y&&"="===p.charAt(1),_?(u=parseInt(p.charAt(0)+"1",10),p=p.substr(2),u*=parseFloat(p),m=p.replace(w,"")):(u=parseFloat(p),m=y?p.replace(w,""):""),""===m&&(m=s in n?n[s]:f),p=u||0===u?(_?u+h:u)+m:e[s],f!==m&&(""!==m||"lineHeight"===s)&&(u||0===u)&&h&&(h=tt(t,s,h,f),"%"===m?(h/=tt(t,s,100,"%")/100,e.strictUnits!==!0&&(d=h+"%")):"em"===m||"rem"===m||"vw"===m||"vh"===m?h/=tt(t,s,1,m):"px"!==m&&(u=tt(t,s,u,m),m="px"),_&&(u||0===u)&&(p=u+h+m)),_&&(u+=h),!h&&0!==h||!u&&0!==u?void 0!==b[s]&&(p||p+""!="NaN"&&null!=p)?(i=new _t(b,s,u||h||0,0,i,(-1),s,(!1),0,d,p),i.xs0="none"!==p||"display"!==s&&-1===s.indexOf("Style")?p:d):Y("invalid "+s+" tween value: "+e[s]):(i=new _t(b,s,h,u-h,i,0,s,c!==!1&&("px"===m||"zIndex"===s),0,d,p),i.xs0=m))}o&&i&&!i.plugin&&(i.plugin=o)}return i},h.setRatio=function(t){var e,i,n,r=this._firstPT,o=1e-6;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;r;){if(e=r.c*t+r.s,r.r?e=Math.round(e):o>e&&e>-o&&(e=0),r.type)if(1===r.type)if(n=r.l,2===n)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===n)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===n)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===n)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,n=1;n<r.l;n++)i+=r["xn"+n]+r["xs"+(n+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;){if(2!==r.type)if(r.r&&-1!==r.type)if(e=Math.round(r.s+r.c),r.type){if(1===r.type){for(n=r.l,i=r.xs0+e+r.xs1,n=1;n<r.l;n++)i+=r["xn"+n]+r["xs"+(n+1)];r.t[r.p]=i}}else r.t[r.p]=e+r.xs0;else r.t[r.p]=r.e;else r.setRatio(t);r=r._next}},h._enableTransforms=function(t){this._transform=this._transform||Vt(this._target,r,!0),this._transformType=this._transform.svg&&Et||!t&&3!==this._transformType?2:3};var Zt=function(t){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};h._addLazySet=function(t,e,i){var n=this._firstPT=new _t(t,e,0,0,this._firstPT,2);n.e=i,n.setRatio=Zt,n.data=this},h._linkCSSP=function(t,e,i,n){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,n=!0),i?i._next=t:n||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},h._mod=function(t){for(var e=this._firstPT;e;)"function"==typeof t[e.p]&&t[e.p]===Math.round&&(e.r=1),e=e._next},h._kill=function(e){var i,n,r,o=e;if(e.autoAlpha||e.alpha){o={};for(n in e)o[n]=e[n];o.opacity=1,o.autoAlpha&&(o.visibility=1)}for(e.className&&(i=this._classNamePT)&&(r=i.xfirst,r&&r._prev?this._linkCSSP(r._prev,i._next,r._prev._prev):r===this._firstPT&&(this._firstPT=i._next),i._next&&this._linkCSSP(i._next,i._next._next,r._prev),this._classNamePT=null),i=this._firstPT;i;)i.plugin&&i.plugin!==n&&i.plugin._kill&&(i.plugin._kill(e),n=i.plugin),i=i._next;return t.prototype._kill.call(this,o)};var Jt=function(t,e,i){var n,r,o,s;if(t.slice)for(r=t.length;--r>-1;)Jt(t[r],e,i);else for(n=t.childNodes,r=n.length;--r>-1;)o=n[r],s=o.type,o.style&&(e.push(it(o)),i&&i.push(o)),1!==s&&9!==s&&11!==s||!o.childNodes.length||Jt(o,e,i)};return s.cascadeTo=function(t,i,n){var r,o,s,a,l=e.to(t,i,n),h=[l],c=[],u=[],d=[],p=e._internals.reservedProps;for(t=l._targets||l.target,Jt(t,c,d),l.render(i,!0,!0),Jt(t,u),l.render(0,!0,!0),l._enabled(!0),r=d.length;--r>-1;)if(o=nt(d[r],c[r],u[r]),o.firstMPT){o=o.difs;for(s in n)p[s]&&(o[s]=n[s]);a={};for(s in o)a[s]=c[r][s];h.push(e.fromTo(d[r],i,a,o))}return h},t.activate([s]),s},!0),function(){var t=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.6.0",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),e=function(t){for(;t;)t.f||t.blob||(t.m=Math.round),t=t._next},i=t.prototype;i._onInitAllProps=function(){for(var t,i,n,r=this._tween,o=r.vars.roundProps.join?r.vars.roundProps:r.vars.roundProps.split(","),s=o.length,a={},l=r._propLookup.roundProps;--s>-1;)a[o[s]]=Math.round;for(s=o.length;--s>-1;)for(t=o[s],i=r._firstPT;i;)n=i._next,i.pg?i.t._mod(a):i.n===t&&(2===i.f&&i.t?e(i.t._firstPT):(this._add(i.t,t,i.s,i.c),n&&(n._prev=i._prev),i._prev?i._prev._next=n:r._firstPT===i&&(r._firstPT=n),i._next=i._prev=null,r._propLookup[t]=l)),i=n;return!1},i._add=function(t,e,i,n){this._addTween(t,e,i,i+n,e,Math.round),this._overwriteProps.push(e)}}(),function(){_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.6.1",init:function(t,e,i,n){var r,o;if("function"!=typeof t.setAttribute)return!1;for(r in e)o=e[r],"function"==typeof o&&(o=o(n,t)),this._addTween(t,"setAttribute",t.getAttribute(r)+"",o+"",r,!1,r),this._overwriteProps.push(r);return!0}})}(),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.3.1",API:2,init:function(t,e,i,n){"object"!=typeof e&&(e={rotation:e}),this.finals={};var r,o,s,a,l,h,c=e.useRadians===!0?2*Math.PI:360,u=1e-6;for(r in e)"useRadians"!==r&&(a=e[r],"function"==typeof a&&(a=a(n,t)),h=(a+"").split("_"),o=h[0],s=parseFloat("function"!=typeof t[r]?t[r]:t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)]()),a=this.finals[r]="string"==typeof o&&"="===o.charAt(1)?s+parseInt(o.charAt(0)+"1",10)*Number(o.substr(2)):Number(o)||0,l=a-s,h.length&&(o=h.join("_"),-1!==o.indexOf("short")&&(l%=c,l!==l%(c/2)&&(l=0>l?l+c:l-c)),-1!==o.indexOf("_cw")&&0>l?l=(l+9999999999*c)%c-(l/c|0)*c:-1!==o.indexOf("ccw")&&l>0&&(l=(l-9999999999*c)%c-(l/c|0)*c)),(l>u||-u>l)&&(this._addTween(t,r,s,s+l,r),this._overwriteProps.push(r)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(t){var e,i,n,r,o=_gsScope.GreenSockGlobals||_gsScope,s=o.com.greensock,a=2*Math.PI,l=Math.PI/2,h=s._class,c=function(e,i){var n=h("easing."+e,function(){},!0),r=n.prototype=new t;return r.constructor=n,r.getRatio=i,n},u=t.register||function(){},d=function(t,e,i,n,r){var o=h("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new n},!0);return u(o,t),o},p=function(t,e,i){this.t=t,this.v=e,i&&(this.next=i,i.prev=this,this.c=i.v-e,this.gap=i.t-t)},f=function(e,i){var n=h("easing."+e,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=n.prototype=new t;return r.constructor=n,r.getRatio=i,r.config=function(t){return new n(t)},n},m=d("Back",f("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),f("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),f("BackInOut",function(t){return(t*=2)<1?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),g=h("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:t>1&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=i===!0},!0),v=g.prototype=new t;return v.constructor=g,v.getRatio=function(t){var e=t+(.5-t)*this._p;return t<this._p1?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1===t?0:1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},g.ease=new g(.7,.7),v.config=g.config=function(t,e,i){return new g(t,e,i)},e=h("easing.SteppedEase",function(t,e){t=t||1,this._p1=1/t,this._p2=t+(e?0:1),this._p3=e?1:0},!0),v=e.prototype=new t,v.constructor=e,v.getRatio=function(t){return 0>t?t=0:t>=1&&(t=.999999999),((this._p2*t|0)+this._p3)*this._p1},v.config=e.config=function(t,i){return new e(t,i)},i=h("easing.ExpoScaleEase",function(t,e,i){this._p1=Math.log(e/t),this._p2=e-t,this._p3=t,this._ease=i},!0),v=i.prototype=new t,v.constructor=i,v.getRatio=function(t){return this._ease&&(t=this._ease.getRatio(t)),(this._p3*Math.exp(this._p1*t)-this._p3)/this._p2},v.config=i.config=function(t,e,n){return new i(t,e,n)},n=h("easing.RoughEase",function(e){e=e||{};for(var i,n,r,o,s,a,l=e.taper||"none",h=[],c=0,u=0|(e.points||20),d=u,f=e.randomize!==!1,m=e.clamp===!0,g=e.template instanceof t?e.template:null,v="number"==typeof e.strength?.4*e.strength:.4;--d>-1;)i=f?Math.random():1/u*d,n=g?g.getRatio(i):i,"none"===l?r=v:"out"===l?(o=1-i,r=o*o*v):"in"===l?r=i*i*v:.5>i?(o=2*i,r=o*o*.5*v):(o=2*(1-i),r=o*o*.5*v),f?n+=Math.random()*r-.5*r:d%2?n+=.5*r:n-=.5*r,m&&(n>1?n=1:0>n&&(n=0)),h[c++]={x:i,y:n};for(h.sort(function(t,e){return t.x-e.x}),a=new p(1,1,null),d=u;--d>-1;)s=h[d],a=new p(s.x,s.y,a);this._prev=new p(0,0,0!==a.t?a:a.next)},!0),v=n.prototype=new t,v.constructor=n,v.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return this._prev=e,e.v+(t-e.t)/e.gap*e.c},v.config=function(t){return new n(t)},n.ease=new n,d("Bounce",c("BounceOut",function(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),c("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:2/2.75>t?1-(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),c("BounceInOut",function(t){var e=.5>t;return t=e?1-2*t:2*t-1,t=1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),d("Circ",c("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),c("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),c("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),r=function(e,i,n){var r=h("easing."+e,function(t,e){this._p1=t>=1?t:1,this._p2=(e||n)/(1>t?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),o=r.prototype=new t;return o.constructor=r,o.getRatio=i,o.config=function(t,e){return new r(t,e)},r},d("Elastic",r("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),r("ElasticIn",function(t){return-(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2))},.3),r("ElasticInOut",function(t){return(t*=2)<1?-.5*(this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)):this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),d("Expo",c("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),c("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),c("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),d("Sine",c("SineOut",function(t){return Math.sin(t*l)}),c("SineIn",function(t){return-Math.cos(t*l)+1}),c("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),h("easing.EaseLookup",{find:function(e){return t.map[e]}},!0),u(o.SlowMo,"SlowMo","ease,"),u(n,"RoughEase","ease,"),u(e,"SteppedEase","ease,"),m},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(t,e){"use strict";var i={},n=t.document,r=t.GreenSockGlobals=t.GreenSockGlobals||t;if(!r.TweenLite){var o,s,a,l,h,c=function(t){var e,i=t.split("."),n=r;for(e=0;e<i.length;e++)n[i[e]]=n=n[i[e]]||{};return n},u=c("com.greensock"),d=1e-10,p=function(t){var e,i=[],n=t.length;for(e=0;e!==n;i.push(t[e++]));return i},f=function(){},m=function(){var t=Object.prototype.toString,e=t.call([]);return function(i){return null!=i&&(i instanceof Array||"object"==typeof i&&!!i.push&&t.call(i)===e)}}(),g={},v=function(n,o,s,a){this.sc=g[n]?g[n].sc:[],g[n]=this,this.gsClass=null,this.func=s;var l=[];this.check=function(h){for(var u,d,p,f,m=o.length,y=m;--m>-1;)(u=g[o[m]]||new v(o[m],[])).gsClass?(l[m]=u.gsClass,y--):h&&u.sc.push(this);if(0===y&&s){if(d=("com.greensock."+n).split("."),p=d.pop(),f=c(d.join("."))[p]=this.gsClass=s.apply(s,l),a)if(r[p]=i[p]=f,"undefined"!=typeof module&&module.exports)if(n===e){module.exports=i[e]=f;for(m in i)f[m]=i[m]}else i[e]&&(i[e][p]=f);else"function"==typeof define&&define.amd&&define((t.GreenSockAMDPath?t.GreenSockAMDPath+"/":"")+n.split(".").pop(),[],function(){return f});for(m=0;m<this.sc.length;m++)this.sc[m].check()}},this.check(!0)},y=t._gsDefine=function(t,e,i,n){return new v(t,e,i,n)},_=u._class=function(t,e,i){return e=e||function(){},y(t,[],function(){return e},i),e};y.globals=r;var b=[0,0,1,1],x=_("easing.Ease",function(t,e,i,n){this._func=t,this._type=i||0,this._power=n||0,this._params=e?b.concat(e):b},!0),w=x.map={},T=x.register=function(t,e,i,n){for(var r,o,s,a,l=e.split(","),h=l.length,c=(i||"easeIn,easeOut,easeInOut").split(",");--h>-1;)for(o=l[h],r=n?_("easing."+o,null,!0):u.easing[o]||{},s=c.length;--s>-1;)a=c[s],w[o+"."+a]=w[a+o]=r[a]=t.getRatio?t:t[a]||new t};for(a=x.prototype,a._calcEnd=!1,a.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,n=1===e?1-t:2===e?t:.5>t?2*t:2*(1-t);return 1===i?n*=n:2===i?n*=n*n:3===i?n*=n*n*n:4===i&&(n*=n*n*n*n),1===e?1-n:2===e?n:.5>t?n/2:1-n/2},o=["Linear","Quad","Cubic","Quart","Quint,Strong"],s=o.length;--s>-1;)a=o[s]+",Power"+s,T(new x(null,null,1,s),a,"easeOut",!0),T(new x(null,null,2,s),a,"easeIn"+(0===s?",easeNone":"")),T(new x(null,null,3,s),a,"easeInOut");w.linear=u.easing.Linear.easeIn,w.swing=u.easing.Quad.easeInOut;var S=_("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});a=S.prototype,a.addEventListener=function(t,e,i,n,r){r=r||0;var o,s,a=this._listeners[t],c=0;for(this!==l||h||l.wake(),null==a&&(this._listeners[t]=a=[]),s=a.length;--s>-1;)o=a[s],o.c===e&&o.s===i?a.splice(s,1):0===c&&o.pr<r&&(c=s+1);a.splice(c,0,{c:e,s:i,up:n,pr:r})},a.removeEventListener=function(t,e){var i,n=this._listeners[t];if(n)for(i=n.length;--i>-1;)if(n[i].c===e)return void n.splice(i,1)},a.dispatchEvent=function(t){var e,i,n,r=this._listeners[t];if(r)for(e=r.length,e>1&&(r=r.slice(0)),i=this._eventTarget;--e>-1;)n=r[e],n&&(n.up?n.c.call(n.s||i,{type:t,target:i}):n.c.call(n.s||i))};var M=t.requestAnimationFrame,E=t.cancelAnimationFrame,A=Date.now||function(){return(new Date).getTime()},C=A();for(o=["ms","moz","webkit","o"],s=o.length;--s>-1&&!M;)M=t[o[s]+"RequestAnimationFrame"],E=t[o[s]+"CancelAnimationFrame"]||t[o[s]+"CancelRequestAnimationFrame"];_("Ticker",function(t,e){var i,r,o,s,a,c=this,u=A(),p=!(e===!1||!M)&&"auto",m=500,g=33,v="tick",y=function(t){var e,n,l=A()-C;l>m&&(u+=l-g),C+=l,c.time=(C-u)/1e3,e=c.time-a,(!i||e>0||t===!0)&&(c.frame++,a+=e+(e>=s?.004:s-e),n=!0),t!==!0&&(o=r(y)),n&&c.dispatchEvent(v)};S.call(c),c.time=c.frame=0,c.tick=function(){y(!0)},c.lagSmoothing=function(t,e){return arguments.length?(m=t||1/d,void(g=Math.min(e,m,0))):1/d>m},c.sleep=function(){null!=o&&(p&&E?E(o):clearTimeout(o),r=f,o=null,c===l&&(h=!1))},c.wake=function(t){null!==o?c.sleep():t?u+=-C+(C=A()):c.frame>10&&(C=A()-m+5),r=0===i?f:p&&M?M:function(t){return setTimeout(t,1e3*(a-c.time)+1|0)},c===l&&(h=!0),y(2)},c.fps=function(t){return arguments.length?(i=t,s=1/(i||60),a=this.time+s,void c.wake()):i},c.useRAF=function(t){return arguments.length?(c.sleep(),p=t,void c.fps(i)):p},c.fps(t),setTimeout(function(){"auto"===p&&c.frame<5&&"hidden"!==(n||{}).visibilityState&&c.useRAF(!1)},1500)}),a=u.Ticker.prototype=new u.events.EventDispatcher,a.constructor=u.Ticker;var P=_("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=e.immediateRender===!0,this.data=e.data,this._reversed=e.reversed===!0,K){h||l.wake();var i=this.vars.useFrames?Y:K;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});l=P.ticker=new u.Ticker,a=P.prototype,a._dirty=a._gc=a._initted=a._paused=!1,a._totalTime=a._time=0,a._rawPrevTime=-1,a._next=a._last=a._onUpdate=a._timeline=a.timeline=null,a._paused=!1;var D=function(){h&&A()-C>2e3&&("hidden"!==(n||{}).visibilityState||!l.lagSmoothing())&&l.wake();var t=setTimeout(D,2e3);t.unref&&t.unref()};D(),a.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},a.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},a.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},a.seek=function(t,e){return this.totalTime(Number(t),e!==!1)},a.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,e!==!1,!0)},a.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},a.render=function(t,e,i){},a.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},a.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<i+this.totalDuration()/this._timeScale-1e-7},a._enabled=function(t,e){return h||l.wake(),this._gc=!t,this._active=this.isActive(),e!==!0&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},a._kill=function(t,e){return this._enabled(!1,!1)},a.kill=function(t,e){return this._kill(t,e),this},a._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},a._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();--e>-1;)"{self}"===t[e]&&(i[e]=this);return i},a._callback=function(t){var e=this.vars,i=e[t],n=e[t+"Params"],r=e[t+"Scope"]||e.callbackScope||this,o=n?n.length:0;switch(o){case 0:i.call(r);break;case 1:i.call(r,n[0]);break;case 2:i.call(r,n[0],n[1]);break;default:i.apply(r,n)}},a.eventCallback=function(t,e,i,n){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=m(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=n),"onUpdate"===t&&(this._onUpdate=e)}return this},a.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},a.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},a.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},a.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},a.totalTime=function(t,e,i){if(h||l.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>t&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var n=this._totalDuration,r=this._timeline;if(t>n&&!i&&(t=n),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?n-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(O.length&&J(),this.render(t,e,!1),O.length&&J())}return this},a.progress=a.totalProgress=function(t,e){var i=this.duration();return arguments.length?this.totalTime(i*t,e):i?this._time/i:this.ratio},a.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},a.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},a.timeScale=function(t){if(!arguments.length)return this._timeScale;var e,i;for(t=t||d,this._timeline&&this._timeline.smoothChildTiming&&(e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime(),this._startTime=i-(i-this._startTime)*this._timeScale/t),this._timeScale=t,i=this.timeline;i&&i.timeline;)i._dirty=!0,i.totalDuration(),i=i.timeline;return this},a.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},a.paused=function(t){if(!arguments.length)return this._paused;var e,i,n=this._timeline;return t!=this._paused&&n&&(h||t||l.wake(),e=n.rawTime(),i=e-this._pauseTime,!t&&n.smoothChildTiming&&(this._startTime+=i,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!==i&&this._initted&&this.duration()&&(e=n.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,this.render(e,e===this._totalTime,!0))),this._gc&&!t&&this._enabled(!0,!1),this};var L=_("core.SimpleTimeline",function(t){P.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});a=L.prototype=new P,a.constructor=L,a.kill()._gc=!1,a._first=a._last=a._recent=null,a._sortChildren=!1,a.add=a.insert=function(t,e,i,n){var r,o;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),r=this._last,this._sortChildren)for(o=t._startTime;r&&r._startTime>o;)r=r._prev;return r?(t._next=r._next,r._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=r,this._recent=t,this._timeline&&this._uncache(!0),this},a._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},a.render=function(t,e,i){var n,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)n=r._next,(r._active||t>=r._startTime&&!r._paused&&!r._gc)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=n},a.rawTime=function(){return h||l.wake(),this._totalTime};var R=_("TweenLite",function(e,i,n){if(P.call(this,i,n),this.render=R.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:R.selector(e)||e;var r,o,s,a=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),l=this.vars.overwrite;if(this._overwrite=l=null==l?q[R.defaultOverwrite]:"number"==typeof l?l>>0:q[l],(a||e instanceof Array||e.push&&m(e))&&"number"!=typeof e[0])for(this._targets=s=p(e),this._propLookup=[],this._siblings=[],r=0;r<s.length;r++)o=s[r],o?"string"!=typeof o?o.length&&o!==t&&o[0]&&(o[0]===t||o[0].nodeType&&o[0].style&&!o.nodeType)?(s.splice(r--,1),this._targets=s=s.concat(p(o))):(this._siblings[r]=Q(o,this,!1),1===l&&this._siblings[r].length>1&&tt(o,this,null,1,this._siblings[r])):(o=s[r--]=R.selector(o),"string"==typeof o&&s.splice(r+1,1)):s.splice(r--,1);else this._propLookup={},this._siblings=Q(e,this,!1),1===l&&this._siblings.length>1&&tt(e,this,null,1,this._siblings);(this.vars.immediateRender||0===i&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-d,this.render(Math.min(0,-this._delay)))},!0),I=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)},k=function(t,e){var i,n={};for(i in t)X[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!V[i]||V[i]&&V[i]._autoCSS)||(n[i]=t[i],delete t[i]);t.css=n};a=R.prototype=new P,a.constructor=R,a.kill()._gc=!1,a.ratio=0,a._firstPT=a._targets=a._overwrittenProps=a._startAt=null,a._notifyPluginsOfEnabled=a._lazy=!1,R.version="1.20.4",R.defaultEase=a._ease=new x(null,null,1,1),R.defaultOverwrite="auto",R.ticker=l,R.autoSleep=120,R.lagSmoothing=function(t,e){l.lagSmoothing(t,e)},R.selector=t.$||t.jQuery||function(e){var i=t.$||t.jQuery;return i?(R.selector=i,i(e)):"undefined"==typeof n?e:n.querySelectorAll?n.querySelectorAll(e):n.getElementById("#"===e.charAt(0)?e.substr(1):e)};var O=[],H={},N=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,B=/[\+-]=-?[\.\d]/,G=function(t){for(var e,i=this._firstPT,n=1e-6;i;)e=i.blob?1===t&&null!=this.end?this.end:t?this.join(""):this.start:i.c*t+i.s,i.m?e=i.m(e,this._target||i.t):n>e&&e>-n&&!i.blob&&(e=0),i.f?i.fp?i.t[i.p](i.fp,e):i.t[i.p](e):i.t[i.p]=e,i=i._next},F=function(t,e,i,n){var r,o,s,a,l,h,c,u=[],d=0,p="",f=0;for(u.start=t,u.end=e,t=u[0]=t+"",e=u[1]=e+"",i&&(i(u),t=u[0],e=u[1]),u.length=0,r=t.match(N)||[],o=e.match(N)||[],n&&(n._next=null,n.blob=1,u._firstPT=u._applyPT=n),l=o.length,a=0;l>a;a++)c=o[a],h=e.substr(d,e.indexOf(c,d)-d),p+=h||!a?h:",",d+=h.length,f?f=(f+1)%5:"rgba("===h.substr(-5)&&(f=1),c===r[a]||r.length<=a?p+=c:(p&&(u.push(p),p=""),s=parseFloat(r[a]),u.push(s),u._firstPT={_next:u._firstPT,t:u,p:u.length-1,s:s,c:("="===c.charAt(1)?parseInt(c.charAt(0)+"1",10)*parseFloat(c.substr(2)):parseFloat(c)-s)||0,f:0,m:f&&4>f?Math.round:0}),d+=c.length;return p+=e.substr(d),p&&u.push(p),u.setRatio=G,B.test(e)&&(u.end=null),u},z=function(t,e,i,n,r,o,s,a,l){"function"==typeof n&&(n=n(l||0,t));var h,c=typeof t[e],u="function"!==c?"":e.indexOf("set")||"function"!=typeof t["get"+e.substr(3)]?e:"get"+e.substr(3),d="get"!==i?i:u?s?t[u](s):t[u]():t[e],p="string"==typeof n&&"="===n.charAt(1),f={t:t,p:e,s:d,f:"function"===c,pg:0,n:r||e,m:o?"function"==typeof o?o:Math.round:0,pr:0,c:p?parseInt(n.charAt(0)+"1",10)*parseFloat(n.substr(2)):parseFloat(n)-d||0};return("number"!=typeof d||"number"!=typeof n&&!p)&&(s||isNaN(d)||!p&&isNaN(n)||"boolean"==typeof d||"boolean"==typeof n?(f.fp=s,h=F(d,p?parseFloat(f.s)+f.c+(f.s+"").replace(/[0-9\-\.]/g,""):n,a||R.defaultStringFilter,f),f={t:h,p:"setRatio",s:0,c:1,f:2,pg:0,n:r||e,pr:0,m:0}):(f.s=parseFloat(d),p||(f.c=parseFloat(n)-f.s||0))),f.c?((f._next=this._firstPT)&&(f._next._prev=f),this._firstPT=f,f):void 0},U=R._internals={isArray:m,isSelector:I,lazyTweens:O,blobDif:F},V=R._plugins={},j=U.tweenLookup={},W=0,X=U.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1},q={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},Y=P._rootFramesTimeline=new L,K=P._rootTimeline=new L,Z=30,J=U.lazyRender=function(){var t,e=O.length;for(H={};--e>-1;)t=O[e],t&&t._lazy!==!1&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);O.length=0};K._startTime=l.time,Y._startTime=l.frame,K._active=Y._active=!0,setTimeout(J,1),P._updateRoot=R.render=function(){var t,e,i;if(O.length&&J(),K.render((l.time-K._startTime)*K._timeScale,!1,!1),Y.render((l.frame-Y._startTime)*Y._timeScale,!1,!1),O.length&&J(),l.frame>=Z){Z=l.frame+(parseInt(R.autoSleep,10)||120);for(i in j){for(e=j[i].tweens,t=e.length;--t>-1;)e[t]._gc&&e.splice(t,1);
0===e.length&&delete j[i]}if(i=K._first,(!i||i._paused)&&R.autoSleep&&!Y._first&&1===l._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||l.sleep()}}},l.addEventListener("tick",P._updateRoot);var Q=function(t,e,i){var n,r,o=t._gsTweenID;if(j[o||(t._gsTweenID=o="t"+W++)]||(j[o]={target:t,tweens:[]}),e&&(n=j[o].tweens,n[r=n.length]=e,i))for(;--r>-1;)n[r]===e&&n.splice(r,1);return j[o].tweens},$=function(t,e,i,n){var r,o,s=t.vars.onOverwrite;return s&&(r=s(t,e,i,n)),s=R.onOverwrite,s&&(o=s(t,e,i,n)),r!==!1&&o!==!1},tt=function(t,e,i,n,r){var o,s,a,l;if(1===n||n>=4){for(l=r.length,o=0;l>o;o++)if((a=r[o])!==e)a._gc||a._kill(null,t,e)&&(s=!0);else if(5===n)break;return s}var h,c=e._startTime+d,u=[],p=0,f=0===e._duration;for(o=r.length;--o>-1;)(a=r[o])===e||a._gc||a._paused||(a._timeline!==e._timeline?(h=h||et(e,0,f),0===et(a,h,f)&&(u[p++]=a)):a._startTime<=c&&a._startTime+a.totalDuration()/a._timeScale>c&&((f||!a._initted)&&c-a._startTime<=2e-10||(u[p++]=a)));for(o=p;--o>-1;)if(a=u[o],2===n&&a._kill(i,t,e)&&(s=!0),2!==n||!a._firstPT&&a._initted){if(2!==n&&!$(a,e))continue;a._enabled(!1,!1)&&(s=!0)}return s},et=function(t,e,i){for(var n=t._timeline,r=n._timeScale,o=t._startTime;n._timeline;){if(o+=n._startTime,r*=n._timeScale,n._paused)return-100;n=n._timeline}return o/=r,o>e?o-e:i&&o===e||!t._initted&&2*d>o-e?d:(o+=t.totalDuration()/t._timeScale/r)>e+d?0:o-e-d};a._init=function(){var t,e,i,n,r,o,s=this.vars,a=this._overwrittenProps,l=this._duration,h=!!s.immediateRender,c=s.ease;if(s.startAt){this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={};for(n in s.startAt)r[n]=s.startAt[n];if(r.data="isStart",r.overwrite=!1,r.immediateRender=!0,r.lazy=h&&s.lazy!==!1,r.startAt=r.delay=null,r.onUpdate=s.onUpdate,r.onUpdateParams=s.onUpdateParams,r.onUpdateScope=s.onUpdateScope||s.callbackScope||this,this._startAt=R.to(this.target,0,r),h)if(this._time>0)this._startAt=null;else if(0!==l)return}else if(s.runBackwards&&0!==l)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{0!==this._time&&(h=!1),i={};for(n in s)X[n]&&"autoCSS"!==n||(i[n]=s[n]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&s.lazy!==!1,i.immediateRender=h,this._startAt=R.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=c=c?c instanceof x?c:"function"==typeof c?new x(c,s.easeParams):w[c]||R.defaultEase:R.defaultEase,s.easeParams instanceof Array&&c.config&&(this._ease=c.config.apply(c,s.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(o=this._targets.length,t=0;o>t;t++)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null,t)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a,0);if(e&&R._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),s.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=s.onUpdate,this._initted=!0},a._initProps=function(e,i,n,r,o){var s,a,l,h,c,u;if(null==e)return!1;H[e._gsTweenID]&&J(),this.vars.css||e.style&&e!==t&&e.nodeType&&V.css&&this.vars.autoCSS!==!1&&k(this.vars,e);for(s in this.vars)if(u=this.vars[s],X[s])u&&(u instanceof Array||u.push&&m(u))&&-1!==u.join("").indexOf("{self}")&&(this.vars[s]=u=this._swapSelfInParams(u,this));else if(V[s]&&(h=new V[s])._onInitTween(e,this.vars[s],this,o)){for(this._firstPT=c={_next:this._firstPT,t:h,p:"setRatio",s:0,c:1,f:1,n:s,pg:1,pr:h._priority,m:0},a=h._overwriteProps.length;--a>-1;)i[h._overwriteProps[a]]=this._firstPT;(h._priority||h._onInitAllProps)&&(l=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0),c._next&&(c._next._prev=c)}else i[s]=z.call(this,e,s,"get",u,s,0,null,this.vars.stringFilter,o);return r&&this._kill(r,e)?this._initProps(e,i,n,r,o):this._overwrite>1&&this._firstPT&&n.length>1&&tt(e,this,i,this._overwrite,n)?(this._kill(i,e),this._initProps(e,i,n,r,o)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(H[e._gsTweenID]=!0),l)},a.render=function(t,e,i){var n,r,o,s,a=this._time,l=this._duration,h=this._rawPrevTime;if(t>=l-1e-7&&t>=0)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(n=!0,r="onComplete",i=i||this._timeline.autoRemoveChildren),0===l&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0>h||0>=t&&t>=-1e-7||h===d&&"isPause"!==this.data)&&h!==t&&(i=!0,h>d&&(r="onReverseComplete")),this._rawPrevTime=s=!e||t||h===t?t:d);else if(1e-7>t)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==a||0===l&&h>0)&&(r="onReverseComplete",n=this._reversed),0>t&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||i)&&(h>=0&&(h!==d||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=s=!e||t||h===t?t:d)),(!this._initted||this._startAt&&this._startAt.progress())&&(i=!0);else if(this._totalTime=this._time=t,this._easeType){var c=t/l,u=this._easeType,p=this._easePower;(1===u||3===u&&c>=.5)&&(c=1-c),3===u&&(c*=2),1===p?c*=c:2===p?c*=c*c:3===p?c*=c*c*c:4===p&&(c*=c*c*c*c),1===u?this.ratio=1-c:2===u?this.ratio=c:.5>t/l?this.ratio=c/2:this.ratio=1-c/2}else this.ratio=this._ease.getRatio(t/l);if(this._time!==a||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=a,this._rawPrevTime=h,O.push(this),void(this._lazy=[t,e]);this._time&&!n?this.ratio=this._ease.getRatio(this._time/l):n&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(this._lazy!==!1&&(this._lazy=!1),this._active||!this._paused&&this._time!==a&&t>=0&&(this._active=!0),0===a&&(this._startAt&&(t>=0?this._startAt.render(t,!0,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===l)&&(e||this._callback("onStart"))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(0>t&&this._startAt&&t!==-1e-4&&this._startAt.render(t,!0,i),e||(this._time!==a||n||i)&&this._callback("onUpdate")),r&&(!this._gc||i)&&(0>t&&this._startAt&&!this._onUpdate&&t!==-1e-4&&this._startAt.render(t,!0,i),n&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this._callback(r),0===l&&this._rawPrevTime===d&&s!==d&&(this._rawPrevTime=0))}},a._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:R.selector(e)||e;var n,r,o,s,a,l,h,c,u,d=i&&this._time&&i._startTime===this._startTime&&this._timeline===i._timeline;if((m(e)||I(e))&&"number"!=typeof e[0])for(n=e.length;--n>-1;)this._kill(t,e[n],i)&&(l=!0);else{if(this._targets){for(n=this._targets.length;--n>-1;)if(e===this._targets[n]){a=this._propLookup[n]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[n]=t?this._overwrittenProps[n]||{}:"all";break}}else{if(e!==this.target)return!1;a=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(a){if(h=t||a,c=t!==r&&"all"!==r&&t!==a&&("object"!=typeof t||!t._tempKill),i&&(R.onOverwrite||this.vars.onOverwrite)){for(o in h)a[o]&&(u||(u=[]),u.push(o));if((u||!t)&&!$(this,i,e,u))return!1}for(o in h)(s=a[o])&&(d&&(s.f?s.t[s.p](s.s):s.t[s.p]=s.s,l=!0),s.pg&&s.t._kill(h)&&(l=!0),s.pg&&0!==s.t._overwriteProps.length||(s._prev?s._prev._next=s._next:s===this._firstPT&&(this._firstPT=s._next),s._next&&(s._next._prev=s._prev),s._next=s._prev=null),delete a[o]),c&&(r[o]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},a.invalidate=function(){return this._notifyPluginsOfEnabled&&R._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],P.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-d,this.render(Math.min(0,-this._delay))),this},a._enabled=function(t,e){if(h||l.wake(),t&&this._gc){var i,n=this._targets;if(n)for(i=n.length;--i>-1;)this._siblings[i]=Q(n[i],this,!0);else this._siblings=Q(this.target,this,!0)}return P.prototype._enabled.call(this,t,e),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&R._onPluginEvent(t?"_onEnable":"_onDisable",this)},R.to=function(t,e,i){return new R(t,e,i)},R.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new R(t,e,i)},R.fromTo=function(t,e,i,n){return n.startAt=i,n.immediateRender=0!=n.immediateRender&&0!=i.immediateRender,new R(t,e,n)},R.delayedCall=function(t,e,i,n,r){return new R(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:n,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,lazy:!1,useFrames:r,overwrite:0})},R.set=function(t,e){return new R(t,0,e)},R.getTweensOf=function(t,e){if(null==t)return[];t="string"!=typeof t?t:R.selector(t)||t;var i,n,r,o;if((m(t)||I(t))&&"number"!=typeof t[0]){for(i=t.length,n=[];--i>-1;)n=n.concat(R.getTweensOf(t[i],e));for(i=n.length;--i>-1;)for(o=n[i],r=i;--r>-1;)o===n[r]&&n.splice(i,1)}else if(t._gsTweenID)for(n=Q(t).concat(),i=n.length;--i>-1;)(n[i]._gc||e&&!n[i].isActive())&&n.splice(i,1);return n||[]},R.killTweensOf=R.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var n=R.getTweensOf(t,e),r=n.length;--r>-1;)n[r]._kill(i,t)};var it=_("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=it.prototype},!0);if(a=it.prototype,it.version="1.19.0",it.API=2,a._firstPT=null,a._addTween=z,a.setRatio=G,a._kill=function(t){var e,i=this._overwriteProps,n=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;--e>-1;)null!=t[i[e]]&&i.splice(e,1);for(;n;)null!=t[n.n]&&(n._next&&(n._next._prev=n._prev),n._prev?(n._prev._next=n._next,n._prev=null):this._firstPT===n&&(this._firstPT=n._next)),n=n._next;return!1},a._mod=a._roundProps=function(t){for(var e,i=this._firstPT;i;)e=t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")],e&&"function"==typeof e&&(2===i.f?i.t._applyPT.m=e:i.m=e),i=i._next},R._onPluginEvent=function(t,e){var i,n,r,o,s,a=e._firstPT;if("_onInitAllProps"===t){for(;a;){for(s=a._next,n=r;n&&n.pr>a.pr;)n=n._next;(a._prev=n?n._prev:o)?a._prev._next=a:r=a,(a._next=n)?n._prev=a:o=a,a=s}a=e._firstPT=r}for(;a;)a.pg&&"function"==typeof a.t[t]&&a.t[t]()&&(i=!0),a=a._next;return i},it.activate=function(t){for(var e=t.length;--e>-1;)t[e].API===it.API&&(V[(new t[e])._propName]=t[e]);return!0},y.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,n=t.priority||0,r=t.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},s=_("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){it.call(this,i,n),this._overwriteProps=r||[]},t.global===!0),a=s.prototype=new it(i);a.constructor=s,s.API=t.API;for(e in o)"function"==typeof t[e]&&(a[o[e]]=t[e]);return s.version=t.version,it.activate([s]),s},o=t._gsQueue){for(s=0;s<o.length;s++)o[s]();for(a in g)g[a].func||t.console.log("GSAP encountered missing dependency: "+a)}h=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window,"TweenMax"),!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.dat=e()}(this,function(){"use strict";function t(t,e){var i=t.__state.conversionName.toString(),n=Math.round(t.r),r=Math.round(t.g),o=Math.round(t.b),s=t.a,a=Math.round(t.h),l=t.s.toFixed(1),h=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===i||"SIX_CHAR_HEX"===i){for(var c=t.hex.toString(16);c.length<6;)c="0"+c;return"#"+c}return"CSS_RGB"===i?"rgb("+n+","+r+","+o+")":"CSS_RGBA"===i?"rgba("+n+","+r+","+o+","+s+")":"HEX"===i?"0x"+t.hex.toString(16):"RGB_ARRAY"===i?"["+n+","+r+","+o+"]":"RGBA_ARRAY"===i?"["+n+","+r+","+o+","+s+"]":"RGB_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+"}":"RGBA_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+",a:"+s+"}":"HSV_OBJ"===i?"{h:"+a+",s:"+l+",v:"+h+"}":"HSVA_OBJ"===i?"{h:"+a+",s:"+l+",v:"+h+",a:"+s+"}":"unknown format"}function e(t,e,i){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space?this.__state[e]:(G.recalculateRGB(this,e,i),this.__state[e])},set:function(t){"RGB"!==this.__state.space&&(G.recalculateRGB(this,e,i),this.__state.space="RGB"),this.__state[e]=t}})}function i(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space?this.__state[e]:(G.recalculateHSV(this),this.__state[e])},set:function(t){"HSV"!==this.__state.space&&(G.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}function n(t){if("0"===t||E.isUndefined(t))return 0;var e=t.match(V);return E.isNull(e)?0:parseFloat(e[1])}function r(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}function o(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}function s(t,e,i,n,r){return n+(t-e)/(i-e)*(r-n)}function a(t,e,i,n){t.style.background="",E.each($,function(r){t.style.cssText+="background: "+r+"linear-gradient("+e+", "+i+" 0%, "+n+" 100%); "})}function l(t){t.style.background="",t.style.cssText+="background: -moz-linear-gradient(top,  #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",t.style.cssText+="background: -webkit-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: -o-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: -ms-linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: linear-gradient(top,  #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}function h(t,e,i){var n=document.createElement("li");return e&&n.appendChild(e),i?t.__ul.insertBefore(n,i):t.__ul.appendChild(n),t.onResize(),n}function c(t){j.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&j.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function u(t,e){var i=t.__preset_select[t.__preset_select.selectedIndex];i.innerHTML=e?i.value+"*":i.value}function d(t,e,i){if(i.__li=e,i.__gui=t,E.extend(i,{options:function(e){if(arguments.length>1){var n=i.__li.nextElementSibling;return i.remove(),f(t,i.object,i.property,{before:n,factoryArgs:[E.toArray(arguments)]})}if(E.isArray(e)||E.isObject(e)){var r=i.__li.nextElementSibling;return i.remove(),f(t,i.object,i.property,{before:r,factoryArgs:[e]})}},name:function(t){return i.__li.firstElementChild.firstElementChild.innerHTML=t,i},listen:function(){return i.__gui.listen(i),i},remove:function(){return i.__gui.remove(i),i}}),i instanceof Z){var n=new K(i.object,i.property,{min:i.__min,max:i.__max,step:i.__step});E.each(["updateDisplay","onChange","onFinishChange","step"],function(t){var e=i[t],r=n[t];i[t]=n[t]=function(){var t=Array.prototype.slice.call(arguments);return r.apply(n,t),e.apply(i,t)}}),j.addClass(e,"has-slider"),i.domElement.insertBefore(n.domElement,i.domElement.firstElementChild)}else if(i instanceof K){var r=function(e){if(E.isNumber(i.__min)&&E.isNumber(i.__max)){var n=i.__li.firstElementChild.firstElementChild.innerHTML,r=i.__gui.__listening.indexOf(i)>-1;i.remove();var o=f(t,i.object,i.property,{before:i.__li.nextElementSibling,factoryArgs:[i.__min,i.__max,i.__step]});return o.name(n),r&&o.listen(),o}return e};i.min=E.compose(r,i.min),i.max=E.compose(r,i.max)}else i instanceof W?(j.bind(e,"click",function(){j.fakeEvent(i.__checkbox,"click")}),j.bind(i.__checkbox,"click",function(t){t.stopPropagation()})):i instanceof J?(j.bind(e,"click",function(){j.fakeEvent(i.__button,"click")}),j.bind(e,"mouseover",function(){j.addClass(i.__button,"hover")}),j.bind(e,"mouseout",function(){j.removeClass(i.__button,"hover")})):i instanceof Q&&(j.addClass(e,"color"),i.updateDisplay=E.compose(function(t){return e.style.borderLeftColor=i.__color.toString(),t},i.updateDisplay),i.updateDisplay());i.setValue=E.compose(function(e){return t.getRoot().__preset_select&&i.isModified()&&u(t.getRoot(),!0),e},i.setValue)}function p(t,e){var i=t.getRoot(),n=i.__rememberedObjects.indexOf(e.object);if(-1!==n){var r=i.__rememberedObjectIndecesToControllers[n];if(void 0===r&&(r={},i.__rememberedObjectIndecesToControllers[n]=r),r[e.property]=e,i.load&&i.load.remembered){var o=i.load.remembered,s=void 0;if(o[t.preset])s=o[t.preset];else{if(!o[ot])return;s=o[ot]}if(s[n]&&void 0!==s[n][e.property]){var a=s[n][e.property];e.initialValue=a,e.setValue(a)}}}}function f(t,e,i,n){if(void 0===e[i])throw new Error('Object "'+e+'" has no property "'+i+'"');var r=void 0;if(n.color)r=new Q(e,i);else{var o=[e,i].concat(n.factoryArgs);r=et.apply(t,o)}n.before instanceof F&&(n.before=n.before.__li),p(t,r),j.addClass(r.domElement,"c");var s=document.createElement("span");j.addClass(s,"property-name"),s.innerHTML=r.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(r.domElement);var l=h(t,a,n.before);return j.addClass(l,dt.CLASS_CONTROLLER_ROW),r instanceof Q?j.addClass(l,"color"):j.addClass(l,I(r.getValue())),d(t,l,r),t.__controllers.push(r),r}function m(t,e){return document.location.href+"."+e}function g(t,e,i){var n=document.createElement("option");n.innerHTML=e,n.value=e,t.__preset_select.appendChild(n),i&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function v(t,e){e.style.display=t.useLocalStorage?"block":"none"}function y(t){var e=t.__save_row=document.createElement("li");j.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),j.addClass(e,"save-row");var i=document.createElement("span");i.innerHTML="&nbsp;",j.addClass(i,"button gears");var n=document.createElement("span");n.innerHTML="Save",j.addClass(n,"button"),j.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",j.addClass(r,"button"),j.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",j.addClass(o,"button"),j.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?E.each(t.load.remembered,function(e,i){g(t,i,i===t.preset)}):g(t,ot,!1),j.bind(s,"change",function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value}),e.appendChild(s),e.appendChild(i),e.appendChild(n),e.appendChild(r),e.appendChild(o),st){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(m(t,"isLocal"))&&l.setAttribute("checked","checked"),v(t,a),j.bind(l,"change",function(){t.useLocalStorage=!t.useLocalStorage,v(t,a)})}var h=document.getElementById("dg-new-constructor");j.bind(h,"keydown",function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||at.hide()}),j.bind(i,"click",function(){h.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),at.show(),h.focus(),h.select()}),j.bind(n,"click",function(){t.save()}),j.bind(r,"click",function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)}),j.bind(o,"click",function(){t.revert()})}function _(t){function e(e){return e.preventDefault(),t.width+=r-e.clientX,t.onResize(),r=e.clientX,!1}function i(){j.removeClass(t.__closeButton,dt.CLASS_DRAG),j.unbind(window,"mousemove",e),j.unbind(window,"mouseup",i)}function n(n){return n.preventDefault(),r=n.clientX,j.addClass(t.__closeButton,dt.CLASS_DRAG),j.bind(window,"mousemove",e),j.bind(window,"mouseup",i),!1}var r=void 0;t.__resize_handle=document.createElement("div"),E.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),j.bind(t.__resize_handle,"mousedown",n),j.bind(t.__closeButton,"mousedown",n),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function b(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function x(t,e){var i={};return E.each(t.__rememberedObjects,function(n,r){var o={},s=t.__rememberedObjectIndecesToControllers[r];E.each(s,function(t,i){o[i]=e?t.initialValue:t.getValue()}),i[r]=o}),i}function w(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}function T(t){0!==t.length&&it.call(window,function(){T(t)}),E.each(t,function(t){t.updateDisplay()})}var S=Array.prototype.forEach,M=Array.prototype.slice,E={BREAK:{},extend:function(t){return this.each(M.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(e[i])||(t[i]=e[i])}.bind(this))},this),t},defaults:function(t){return this.each(M.call(arguments,1),function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(t[i])&&(t[i]=e[i])}.bind(this))},this),t},compose:function(){var t=M.call(arguments);return function(){for(var e=M.call(arguments),i=t.length-1;i>=0;i--)e=[t[i].apply(this,e)];return e[0]}},each:function(t,e,i){if(t)if(S&&t.forEach&&t.forEach===S)t.forEach(e,i);else if(t.length===t.length+0){var n=void 0,r=void 0;for(n=0,r=t.length;n<r;n++)if(n in t&&e.call(i,t[n],n)===this.BREAK)return}else for(var o in t)if(e.call(i,t[o],o)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,i){var n=void 0;return function(){var r=this,o=arguments,s=i||!n;clearTimeout(n),n=setTimeout(function(){n=null,i||t.apply(r,o)},e),s&&t.apply(r,o)}},toArray:function(t){return t.toArray?t.toArray():M.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t){return isNaN(t)}),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)}},A=[{litmus:E.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:t},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:t},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:t},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:t}}},{litmus:E.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:E.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:E.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(E.isNumber(t.r)&&E.isNumber(t.g)&&E.isNumber(t.b)&&E.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(E.isNumber(t.r)&&E.isNumber(t.g)&&E.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(E.isNumber(t.h)&&E.isNumber(t.s)&&E.isNumber(t.v)&&E.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(E.isNumber(t.h)&&E.isNumber(t.s)&&E.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],C=void 0,P=void 0,D=function(){P=!1;var t=arguments.length>1?E.toArray(arguments):arguments[0];return E.each(A,function(e){if(e.litmus(t))return E.each(e.conversions,function(e,i){if(C=e.read(t),!1===P&&!1!==C)return P=C,C.conversionName=i,C.conversion=e,E.BREAK}),E.BREAK}),P},L=void 0,R={hsv_to_rgb:function(t,e,i){var n=Math.floor(t/60)%6,r=t/60-Math.floor(t/60),o=i*(1-e),s=i*(1-r*e),a=i*(1-(1-r)*e),l=[[i,a,o],[s,i,o],[o,i,a],[o,s,i],[a,o,i],[i,o,s]][n];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(t,e,i){var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,s=void 0,a=void 0;return 0===r?{h:NaN,s:0,v:0}:(a=o/r,s=t===r?(e-i)/o:e===r?2+(i-t)/o:4+(t-e)/o,(s/=6)<0&&(s+=1),{h:360*s,s:a,v:r/255})},rgb_to_hex:function(t,e,i){var n=this.hex_with_component(0,2,t);return n=this.hex_with_component(n,1,e),n=this.hex_with_component(n,0,i)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,i){return i<<(L=8*e)|t&~(255<<L)}},I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},O=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),H=function pt(t,e,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var r=Object.getPrototypeOf(t);return null===r?void 0:pt(r,e,i)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(i):void 0},N=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},B=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},G=function(){function e(){if(k(this,e),this.__state=D.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return O(e,[{key:"toString",value:function(){return t(this)}},{key:"toHexString",value:function(){return t(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),e}();G.recalculateRGB=function(t,e,i){if("HEX"===t.__state.space)t.__state[e]=R.component_from_hex(t.__state.hex,i);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");E.extend(t.__state,R.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},G.recalculateHSV=function(t){var e=R.rgb_to_hsv(t.r,t.g,t.b);E.extend(t.__state,{s:e.s,v:e.v}),E.isNaN(e.h)?E.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},G.COMPONENTS=["r","g","b","h","s","v","hex","a"],e(G.prototype,"r",2),e(G.prototype,"g",1),e(G.prototype,"b",0),i(G.prototype,"h"),i(G.prototype,"s"),i(G.prototype,"v"),Object.defineProperty(G.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(G.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=R.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var F=function(){function t(e,i){k(this,t),this.initialValue=e[i],this.domElement=document.createElement("div"),this.object=e,this.property=i,this.__onChange=void 0,this.__onFinishChange=void 0}return O(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),z={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},U={};E.each(z,function(t,e){E.each(t,function(t){U[t]=e})});var V=/(\d+(\.\d+)?)px/,j={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,i){var n=i,r=e;E.isUndefined(r)&&(r=!0),E.isUndefined(n)&&(n=!0),t.style.position="absolute",r&&(t.style.left=0,t.style.right=0),n&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,i,n){var r=i||{},o=U[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var a=r.x||r.clientX||0,l=r.y||r.clientY||0;s.initMouseEvent(e,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,a,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var h=s.initKeyboardEvent||s.initKeyEvent;E.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(e,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(e,r.bubbles||!1,r.cancelable||!0)}E.defaults(s,n),t.dispatchEvent(s)},bind:function(t,e,i,n){var r=n||!1;return t.addEventListener?t.addEventListener(e,i,r):t.attachEvent&&t.attachEvent("on"+e,i),j},unbind:function(t,e,i,n){var r=n||!1;return t.removeEventListener?t.removeEventListener(e,i,r):t.detachEvent&&t.detachEvent("on"+e,i),j},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var i=t.className.split(/ +/);-1===i.indexOf(e)&&(i.push(e),t.className=i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return j},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var i=t.className.split(/ +/),n=i.indexOf(e);-1!==n&&(i.splice(n,1),t.className=i.join(" "))}else t.className=void 0;return j},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return n(e["border-left-width"])+n(e["border-right-width"])+n(e["padding-left"])+n(e["padding-right"])+n(e.width)},getHeight:function(t){var e=getComputedStyle(t);return n(e["border-top-width"])+n(e["border-bottom-width"])+n(e["padding-top"])+n(e["padding-bottom"])+n(e.height)},getOffset:function(t){var e=t,i={left:0,top:0};if(e.offsetParent)do i.left+=e.offsetLeft,i.top+=e.offsetTop,e=e.offsetParent;while(e);return i},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},W=function(t){function e(t,i){k(this,e);var n=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),r=n;return n.__prev=n.getValue(),n.__checkbox=document.createElement("input"),n.__checkbox.setAttribute("type","checkbox"),j.bind(n.__checkbox,"change",function(){r.setValue(!r.__prev)},!1),n.domElement.appendChild(n.__checkbox),n.updateDisplay(),n}return N(e,F),O(e,[{key:"setValue",value:function(t){var i=H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),
i}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(),X=function(t){function e(t,i,n){k(this,e);var r=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=n,s=r;if(r.__select=document.createElement("select"),E.isArray(o)){var a={};E.each(o,function(t){a[t]=t}),o=a}return E.each(o,function(t,e){var i=document.createElement("option");i.innerHTML=e,i.setAttribute("value",t),s.__select.appendChild(i)}),r.updateDisplay(),j.bind(r.__select,"change",function(){var t=this.options[this.selectedIndex].value;s.setValue(t)}),r.domElement.appendChild(r.__select),r}return N(e,F),O(e,[{key:"setValue",value:function(t){var i=H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i}},{key:"updateDisplay",value:function(){return j.isActive(this.__select)?this:(this.__select.value=this.getValue(),H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(),q=function(t){function e(t,i){function n(){o.setValue(o.__input.value)}k(this,e);var r=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=r;return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),j.bind(r.__input,"keyup",n),j.bind(r.__input,"change",n),j.bind(r.__input,"blur",function(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}),j.bind(r.__input,"keydown",function(t){13===t.keyCode&&this.blur()}),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return N(e,F),O(e,[{key:"updateDisplay",value:function(){return j.isActive(this.__input)||(this.__input.value=this.getValue()),H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(),Y=function(t){function e(t,i,n){k(this,e);var o=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),s=n||{};return o.__min=s.min,o.__max=s.max,o.__step=s.step,E.isUndefined(o.__step)?0===o.initialValue?o.__impliedStep=1:o.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(o.initialValue))/Math.LN10))/10:o.__impliedStep=o.__step,o.__precision=r(o.__impliedStep),o}return N(e,F),O(e,[{key:"setValue",value:function(t){var i=t;return void 0!==this.__min&&i<this.__min?i=this.__min:void 0!==this.__max&&i>this.__max&&(i=this.__max),void 0!==this.__step&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,i)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=r(t),this}}]),e}(),K=function(t){function e(t,i,n){function r(){l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())}function o(t){var e=h-t.clientY;l.setValue(l.getValue()+e*l.__impliedStep),h=t.clientY}function s(){j.unbind(window,"mousemove",o),j.unbind(window,"mouseup",s),r()}k(this,e);var a=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,n));a.__truncationSuspended=!1;var l=a,h=void 0;return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),j.bind(a.__input,"change",function(){var t=parseFloat(l.__input.value);E.isNaN(t)||l.setValue(t)}),j.bind(a.__input,"blur",function(){r()}),j.bind(a.__input,"mousedown",function(t){j.bind(window,"mousemove",o),j.bind(window,"mouseup",s),h=t.clientY}),j.bind(a.__input,"keydown",function(t){13===t.keyCode&&(l.__truncationSuspended=!0,this.blur(),l.__truncationSuspended=!1,r())}),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return N(e,Y),O(e,[{key:"updateDisplay",value:function(){return this.__input.value=this.__truncationSuspended?this.getValue():o(this.getValue(),this.__precision),H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(),Z=function(t){function e(t,i,n,r,o){function a(t){t.preventDefault();var e=d.__background.getBoundingClientRect();return d.setValue(s(t.clientX,e.left,e.right,d.__min,d.__max)),!1}function l(){j.unbind(window,"mousemove",a),j.unbind(window,"mouseup",l),d.__onFinishChange&&d.__onFinishChange.call(d,d.getValue())}function h(t){var e=t.touches[0].clientX,i=d.__background.getBoundingClientRect();d.setValue(s(e,i.left,i.right,d.__min,d.__max))}function c(){j.unbind(window,"touchmove",h),j.unbind(window,"touchend",c),d.__onFinishChange&&d.__onFinishChange.call(d,d.getValue())}k(this,e);var u=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,{min:n,max:r,step:o})),d=u;return u.__background=document.createElement("div"),u.__foreground=document.createElement("div"),j.bind(u.__background,"mousedown",function(t){document.activeElement.blur(),j.bind(window,"mousemove",a),j.bind(window,"mouseup",l),a(t)}),j.bind(u.__background,"touchstart",function(t){1===t.touches.length&&(j.bind(window,"touchmove",h),j.bind(window,"touchend",c),h(t))}),j.addClass(u.__background,"slider"),j.addClass(u.__foreground,"slider-fg"),u.updateDisplay(),u.__background.appendChild(u.__foreground),u.domElement.appendChild(u.__background),u}return N(e,Y),O(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",H(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(),J=function(t){function e(t,i,n){k(this,e);var r=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=r;return r.__button=document.createElement("div"),r.__button.innerHTML=void 0===n?"Fire":n,j.bind(r.__button,"click",function(t){return t.preventDefault(),o.fire(),!1}),j.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return N(e,F),O(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(),Q=function(t){function e(t,i){function n(t){u(t),j.bind(window,"mousemove",u),j.bind(window,"touchmove",u),j.bind(window,"mouseup",o),j.bind(window,"touchend",o)}function r(t){d(t),j.bind(window,"mousemove",d),j.bind(window,"touchmove",d),j.bind(window,"mouseup",s),j.bind(window,"touchend",s)}function o(){j.unbind(window,"mousemove",u),j.unbind(window,"touchmove",u),j.unbind(window,"mouseup",o),j.unbind(window,"touchend",o),c()}function s(){j.unbind(window,"mousemove",d),j.unbind(window,"touchmove",d),j.unbind(window,"mouseup",s),j.unbind(window,"touchend",s),c()}function h(){var t=D(this.value);!1!==t?(f.__color.__state=t,f.setValue(f.__color.toOriginal())):this.value=f.__color.toString()}function c(){f.__onFinishChange&&f.__onFinishChange.call(f,f.__color.toOriginal())}function u(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=f.__saturation_field.getBoundingClientRect(),i=t.touches&&t.touches[0]||t,n=i.clientX,r=i.clientY,o=(n-e.left)/(e.right-e.left),s=1-(r-e.top)/(e.bottom-e.top);return s>1?s=1:s<0&&(s=0),o>1?o=1:o<0&&(o=0),f.__color.v=s,f.__color.s=o,f.setValue(f.__color.toOriginal()),!1}function d(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=f.__hue_field.getBoundingClientRect(),i=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return i>1?i=1:i<0&&(i=0),f.__color.h=360*i,f.setValue(f.__color.toOriginal()),!1}k(this,e);var p=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));p.__color=new G(p.getValue()),p.__temp=new G(0);var f=p;p.domElement=document.createElement("div"),j.makeSelectable(p.domElement,!1),p.__selector=document.createElement("div"),p.__selector.className="selector",p.__saturation_field=document.createElement("div"),p.__saturation_field.className="saturation-field",p.__field_knob=document.createElement("div"),p.__field_knob.className="field-knob",p.__field_knob_border="2px solid ",p.__hue_knob=document.createElement("div"),p.__hue_knob.className="hue-knob",p.__hue_field=document.createElement("div"),p.__hue_field.className="hue-field",p.__input=document.createElement("input"),p.__input.type="text",p.__input_textShadow="0 1px 1px ",j.bind(p.__input,"keydown",function(t){13===t.keyCode&&h.call(this)}),j.bind(p.__input,"blur",h),j.bind(p.__selector,"mousedown",function(){j.addClass(this,"drag").bind(window,"mouseup",function(){j.removeClass(f.__selector,"drag")})}),j.bind(p.__selector,"touchstart",function(){j.addClass(this,"drag").bind(window,"touchend",function(){j.removeClass(f.__selector,"drag")})});var m=document.createElement("div");return E.extend(p.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),E.extend(p.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:p.__field_knob_border+(p.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),E.extend(p.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),E.extend(p.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),E.extend(m.style,{width:"100%",height:"100%",background:"none"}),a(m,"top","rgba(0,0,0,0)","#000"),E.extend(p.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),l(p.__hue_field),E.extend(p.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:p.__input_textShadow+"rgba(0,0,0,0.7)"}),j.bind(p.__saturation_field,"mousedown",n),j.bind(p.__saturation_field,"touchstart",n),j.bind(p.__field_knob,"mousedown",n),j.bind(p.__field_knob,"touchstart",n),j.bind(p.__hue_field,"mousedown",r),j.bind(p.__hue_field,"touchstart",r),p.__saturation_field.appendChild(m),p.__selector.appendChild(p.__field_knob),p.__selector.appendChild(p.__saturation_field),p.__selector.appendChild(p.__hue_field),p.__hue_field.appendChild(p.__hue_knob),p.domElement.appendChild(p.__input),p.domElement.appendChild(p.__selector),p.updateDisplay(),p}return N(e,F),O(e,[{key:"updateDisplay",value:function(){var t=D(this.getValue());if(!1!==t){var e=!1;E.each(G.COMPONENTS,function(i){if(!E.isUndefined(t[i])&&!E.isUndefined(this.__color.__state[i])&&t[i]!==this.__color.__state[i])return e=!0,{}},this),e&&E.extend(this.__color.__state,t)}E.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,n=255-i;E.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,a(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),E.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),e}(),$=["-moz-","-o-","-webkit-","-ms-",""],tt={load:function(t,e){var i=e||document,n=i.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=t,i.getElementsByTagName("head")[0].appendChild(n)},inject:function(t,e){var i=e||document,n=document.createElement("style");n.type="text/css",n.innerHTML=t;var r=i.getElementsByTagName("head")[0];try{r.appendChild(n)}catch(t){}}},et=function(t,e){var i=t[e];return E.isArray(arguments[2])||E.isObject(arguments[2])?new X(t,e,arguments[2]):E.isNumber(i)?E.isNumber(arguments[2])&&E.isNumber(arguments[3])?E.isNumber(arguments[4])?new Z(t,e,arguments[2],arguments[3],arguments[4]):new Z(t,e,arguments[2],arguments[3]):E.isNumber(arguments[4])?new K(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new K(t,e,{min:arguments[2],max:arguments[3]}):E.isString(i)?new q(t,e):E.isFunction(i)?new J(t,e,""):E.isBoolean(i)?new W(t,e):null},it=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},nt=function(){function t(){k(this,t),this.backgroundElement=document.createElement("div"),E.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),j.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),E.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;j.bind(this.backgroundElement,"click",function(){e.hide()})}return O(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),E.defer(function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var t=this,e=function i(){t.domElement.style.display="none",t.backgroundElement.style.display="none",j.unbind(t.domElement,"webkitTransitionEnd",i),j.unbind(t.domElement,"transitionend",i),j.unbind(t.domElement,"oTransitionEnd",i)};j.bind(this.domElement,"webkitTransitionEnd",e),j.bind(this.domElement,"transitionend",e),j.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-j.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-j.getHeight(this.domElement)/2+"px"}}]),t}(),rt=function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n");tt.inject(rt);var ot="Default",st=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}(),at=void 0,lt=!0,ht=void 0,ct=!1,ut=[],dt=function ft(t){var e=this,i=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),j.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],i=E.defaults(i,{closeOnTop:!1,autoPlace:!0,width:ft.DEFAULT_WIDTH}),i=E.defaults(i,{resizable:i.autoPlace,hideable:i.autoPlace}),E.isUndefined(i.load)?i.load={preset:ot}:i.preset&&(i.load.preset=i.preset),E.isUndefined(i.parent)&&i.hideable&&ut.push(this),i.resizable=E.isUndefined(i.parent)&&i.resizable,i.autoPlace&&E.isUndefined(i.scrollable)&&(i.scrollable=!0);var n=st&&"true"===localStorage.getItem(m(this,"isLocal")),r=void 0;if(Object.defineProperties(this,{parent:{get:function(){return i.parent}},scrollable:{get:function(){return i.scrollable}},autoPlace:{get:function(){return i.autoPlace}},closeOnTop:{get:function(){return i.closeOnTop}},preset:{get:function(){return e.parent?e.getRoot().preset:i.load.preset},set:function(t){e.parent?e.getRoot().preset=t:i.load.preset=t,w(this),e.revert()}},width:{get:function(){return i.width},set:function(t){i.width=t,b(e,t)}},name:{get:function(){return i.name},set:function(t){i.name=t,titleRowName&&(titleRowName.innerHTML=i.name)}},closed:{get:function(){return i.closed},set:function(t){i.closed=t,i.closed?j.addClass(e.__ul,ft.CLASS_CLOSED):j.removeClass(e.__ul,ft.CLASS_CLOSED),this.onResize(),e.__closeButton&&(e.__closeButton.innerHTML=t?ft.TEXT_OPEN:ft.TEXT_CLOSED)}},load:{get:function(){return i.load}},useLocalStorage:{get:function(){return n},set:function(t){st&&(n=t,t?j.bind(window,"unload",r):j.unbind(window,"unload",r),localStorage.setItem(m(e,"isLocal"),t))}}}),E.isUndefined(i.parent)){if(i.closed=!1,j.addClass(this.domElement,ft.CLASS_MAIN),j.makeSelectable(this.domElement,!1),st&&n){e.useLocalStorage=!0;var o=localStorage.getItem(m(this,"gui"));o&&(i.load=JSON.parse(o))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=ft.TEXT_CLOSED,j.addClass(this.__closeButton,ft.CLASS_CLOSE_BUTTON),i.closeOnTop?(j.addClass(this.__closeButton,ft.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(j.addClass(this.__closeButton,ft.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),j.bind(this.__closeButton,"click",function(){e.closed=!e.closed})}else{void 0===i.closed&&(i.closed=!0);var s=document.createTextNode(i.name);j.addClass(s,"controller-name");var a=h(e,s);j.addClass(this.__ul,ft.CLASS_CLOSED),j.addClass(a,"title"),j.bind(a,"click",function(t){return t.preventDefault(),e.closed=!e.closed,!1}),i.closed||(this.closed=!1)}i.autoPlace&&(E.isUndefined(i.parent)&&(lt&&(ht=document.createElement("div"),j.addClass(ht,"dg"),j.addClass(ht,ft.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ht),lt=!1),ht.appendChild(this.domElement),j.addClass(this.domElement,ft.CLASS_AUTO_PLACE)),this.parent||b(e,i.width)),this.__resizeHandler=function(){e.onResizeDebounced()},j.bind(window,"resize",this.__resizeHandler),j.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),j.bind(this.__ul,"transitionend",this.__resizeHandler),j.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),i.resizable&&_(this),r=function(){st&&"true"===localStorage.getItem(m(e,"isLocal"))&&localStorage.setItem(m(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=r,i.parent||function(){var t=e.getRoot();t.width+=1,E.defer(function(){t.width-=1})}()};return dt.toggleHide=function(){ct=!ct,E.each(ut,function(t){t.domElement.style.display=ct?"none":""})},dt.CLASS_AUTO_PLACE="a",dt.CLASS_AUTO_PLACE_CONTAINER="ac",dt.CLASS_MAIN="main",dt.CLASS_CONTROLLER_ROW="cr",dt.CLASS_TOO_TALL="taller-than-window",dt.CLASS_CLOSED="closed",dt.CLASS_CLOSE_BUTTON="close-button",dt.CLASS_CLOSE_TOP="close-top",dt.CLASS_CLOSE_BOTTOM="close-bottom",dt.CLASS_DRAG="drag",dt.DEFAULT_WIDTH=245,dt.TEXT_CLOSED="Close Controls",dt.TEXT_OPEN="Open Controls",dt._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||dt.toggleHide()},j.bind(window,"keydown",dt._keydownHandler,!1),E.extend(dt.prototype,{add:function(t,e){return f(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return f(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;E.defer(function(){e.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ht.removeChild(this.domElement);var t=this;E.each(this.__folders,function(e){t.removeFolder(e)}),j.unbind(window,"keydown",dt._keydownHandler,!1),c(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var i=new dt(e);this.__folders[t]=i;var n=h(this,i.domElement);return j.addClass(n,"folder"),i},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],c(t);var e=this;E.each(t.__folders,function(e){t.removeFolder(e)}),E.defer(function(){e.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=j.getOffset(t.__ul).top,i=0;E.each(t.__ul.childNodes,function(e){t.autoPlace&&e===t.__save_row||(i+=j.getHeight(e))}),window.innerHeight-e-20<i?(j.addClass(t.domElement,dt.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(j.removeClass(t.domElement,dt.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&E.defer(function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"}),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:E.debounce(function(){this.onResize()},50),remember:function(){if(E.isUndefined(at)&&((at=new nt).domElement.innerHTML='<div id="dg-save" class="dg dialogue">\n\n  Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n  <textarea id="dg-new-constructor"></textarea>\n\n  <div id="dg-save-locally">\n\n    <input id="dg-local-storage" type="checkbox"/> Automatically save\n    values to <code>localStorage</code> on exit.\n\n    <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n      override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n      easier to work incrementally, but <code>localStorage</code> is fragile,\n      and your friends may not see the same values you do.\n\n    </div>\n\n  </div>\n\n</div>'),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;E.each(Array.prototype.slice.call(arguments),function(e){0===t.__rememberedObjects.length&&y(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)}),this.autoPlace&&b(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=x(this)),t.folders={},E.each(this.__folders,function(e,i){t.folders[i]=e.getSaveObject()}),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=x(this),u(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered[ot]=x(this,!0)),this.load.remembered[t]=x(this),this.preset=t,g(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){E.each(this.__controllers,function(e){this.getRoot().load.remembered?p(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())},this),E.each(this.__folders,function(t){t.revert(t)}),t||u(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&T(this.__listening)},updateDisplay:function(){E.each(this.__controllers,function(t){t.updateDisplay()}),E.each(this.__folders,function(t){t.updateDisplay()})}}),{color:{Color:G,math:R,interpret:D},controllers:{Controller:F,BooleanController:W,OptionController:X,StringController:q,NumberController:Y,NumberControllerBox:K,NumberControllerSlider:Z,FunctionController:J,ColorController:Q},dom:{dom:j},gui:{GUI:dt},GUI:dt}});var Stats=function(){function t(t){return n.appendChild(t.dom),t}function e(t){for(var e=0;e<n.children.length;e++)n.children[e].style.display=e===t?"block":"none";i=t}var i=0,n=document.createElement("div");n.style.cssText="cursor:pointer;opacity:0.9",n.addEventListener("click",function(t){t.preventDefault(),e(++i%n.children.length)},!1);var r=(performance||Date).now(),o=r,s=0,a=t(new Stats.Panel("FPS","#0ff","#002")),l=t(new Stats.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=t(new Stats.Panel("MB","#f08","#201"));return e(0),{REVISION:16,domElement:n,addPanel:t,showPanel:e,setMode:e,begin:function(){r=(performance||Date).now()},end:function(){s++;var t=(performance||Date).now();if(l.update(t-r,200),t>o+1e3&&(a.update(1e3*s/(t-o),100),o=t,s=0,h)){var e=performance.memory;h.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){r=this.end()}}};Stats.Panel=function(t,e,i){var n=1/0,r=0,o=Math.round,s=o(window.devicePixelRatio||1),a=80*s,l=48*s,h=3*s,c=2*s,u=3*s,d=15*s,p=74*s,f=30*s,m=document.createElement("canvas");m.width=a,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*s+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,a,l),g.fillStyle=e,g.fillText(t,h,c),g.fillRect(u,d,p,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(u,d,p,f),{dom:m,update:function(l,v){n=Math.min(n,l),r=Math.max(r,l),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,a,d),g.fillStyle=e,g.fillText(o(l)+" "+t+" ("+o(n)+"-"+o(r)+")",h,c),g.drawImage(m,u+s,d,p-s,f,u,d,p-s,f),g.fillRect(u+p-s,d,s,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(u+p-s,d,s,o((1-l/v)*f))}}},"object"==typeof module&&(module.exports=Stats);var WpTracking=function(){function t(t){Gtm.sendStats(t)}return{sendTracking:t}}();
var Project;!function(t){function e(){var t=window.getComputedStyle(document.querySelector("body"),":before"),e=t.getPropertyValue("content").replace(/[\"\']/g,"");return{desktop:"desktop"===e,phone:"phone"===e,tablet:"tablet"===e,value:e}}t.getBreakpoint=e}(Project||(Project={}));var Project;!function(t){var e=function(){function e(){this.buttonPlay=$("#button-play"),this.buttonBack=$("#button-back"),this.audioTab=new Array,this.audioTab.push($("#audio1")[0]),this.audioTab.push($("#audio2")[0]),this.audioTab.push($("#audio3")[0]),this.playstopProgress=this.buttonPlay.find(".playstop-progress"),this.setButtonStart(),this.bind()}return e.prototype.bind=function(){var e=this;this.buttonPlay.off(".buttonPlay").on("click.buttonPlay",function(i){return e.clickButtonPlay(t.Main.stage)}),$.each(this.audioTab,function(t,i){i.onended=function(){e.mp3StopAll()},i.ontimeupdate=function(t){e.timeupdate(t)}})},e.prototype.setButtonStart=function(){this.buttonPlay.find("svg .g-stop").css({opacity:0}),this.buttonPlay.find("svg .g-play").css({opacity:1})},e.prototype.clickButtonPlay=function(t){this.mp3Toggle(this.audioTab[t-1])},e.prototype.mp3Toggle=function(t){t.paused?(t.play(),this.buttonPlay.find("svg .g-stop").css({opacity:1}),this.buttonPlay.find("svg .g-play").css({opacity:0})):(t.pause(),this.buttonPlay.find("svg .g-stop").css({opacity:0}),this.buttonPlay.find("svg .g-play").css({opacity:1}))},e.prototype.mp3StopAll=function(){$.each(this.audioTab,function(t,e){e.pause(),e.currentTime=0}),this.setButtonStart()},e.prototype.timeupdate=function(e){var i=e.currentTarget,o=100*i.currentTime/i.duration,n=114-114*o/100;TweenMax.to(this.playstopProgress,.1,{strokeDashoffset:n,ease:Power2.easeOut}),3==t.Main.stage&&o>95&&(this.buttonPlay.removeClass("active"),this.buttonBack.addClass("active"),t.Main.isBlossomTime=!0,$(document).trigger("end3VO"))},e}();t.Audio=e}(Project||(Project={}));var Project;!function(t){var e=function(){function t(t,e){this.obj=new THREE.Object3D,this.obj=t.clone();var i=1e3*Math.random()-500,o=0,n=1e3*Math.random()-500;this.positionStart=new THREE.Vector3(i,o,n),this.rotationStart=new THREE.Vector3(0,0,0),this.obj.position.x=this.positionStart.x,this.obj.position.z=this.positionStart.z,this.obj.position.y=this.positionStart.y,this.speed=2*Math.random()+1,e.add(this.obj)}return t}();t.Petal=e}(Project||(Project={}));var Project;!function(t){var e=function(){function e(t,e){var i=this;this.petals=new Array,this.petalCount=2e3,this.yStart=500,this.status="hidden",this.opacity=0,this.curtainBlossom=$("#curtain-blossom"),this.initPetalPrototype("petal",t).then(function(){i.addPetals(e)})}return e.prototype.addPetals=function(e){for(var i=0;i<this.petalCount;i++){var o=new t.Petal(this.petalPrototype,e);this.petals.push(o)}},e.prototype.initPetalPrototype=function(t,e){var i=this;return new Promise(function(o,n){var a=new THREE.FBXLoader;a.load(e+t+".fbx",function(t){t.traverse(function(t){t.isMesh&&(t.castShadow=!1,t.receiveShadow=!1,t.material.alphaTest=.5,t.material.side=THREE.DoubleSide,t.material.transparent=!0,t.material.opacity=i.opacity)}),i.petalPrototype=t,o()})})},e.prototype.show=function(t){for(var e=0;e<this.petals.length;e++)this.petals[e].obj.position.y=this.yStart;this.status="showing",TweenMax.to(this.curtainBlossom,t?0:1,{opacity:1,ease:Power4.easeOut,onComplete:function(){}})},e.prototype.hide=function(t){if(this.status="hiding",TweenMax.to(this.curtainBlossom,t?0:1,{opacity:0,ease:Power4.easeOut,onComplete:function(){}}),t){this.status="hidden";for(var e=0;e<this.petals.length;e++)this.petals[e].obj.traverse(function(t){t.material&&(t.material.opacity=0)})}},e.prototype.render=function(){for(var t=this,e=.001*Date.now(),i=0;i<this.petals.length;i++){var o=this.petals[i].obj.position.y-this.petals[i].speed;o<-200&&(o=this.yStart),this.petals[i].obj.position.y=o,this.petals[i].obj.position.x=this.petals[i].positionStart.x+2*Math.cos(e),this.petals[i].obj.position.z=this.petals[i].positionStart.z+2*Math.sin(e),this.petals[i].obj.rotation.x+=.01*this.petals[i].speed,this.petals[i].obj.rotation.y+=.01*this.petals[i].speed,this.petals[i].obj.rotation.z+=.01*this.petals[i].speed,"hiding"==this.status&&(this.opacity-=.01,this.opacity<=0&&(this.opacity=0,this.status="hidden"),this.petals[i].obj.traverse(function(e){e.material&&(e.material.opacity=t.opacity)})),"showing"==this.status&&(this.opacity+=.01,this.opacity>=1&&(this.opacity=1,this.status="showed"),this.petals[i].obj.traverse(function(e){e.material&&(e.material.opacity=t.opacity)}))}},e}();t.Blossom=e}(Project||(Project={}));var Project;!function(t){function e(){var t=(new MobileDetect(window.navigator.userAgent),window.navigator.userAgent),e={mobile:!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))),android:/Android/i.test(t),ios:/iPad|iPhone|iPod/.test(t),mac:navigator.platform.toUpperCase().indexOf("MAC")>=0,ie:t.indexOf("MSIE ")>0||!!t.match(/Trident.*rv\:11\./),edge:t.indexOf("Edge")>-1,opera:!!window.opr&&!!opr.addons||!!window.opera||t.indexOf(" OPR/")>=0,firefox:t.toLowerCase().indexOf("firefox")>-1,safari:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),chrome:t.toLowerCase().indexOf("chrome")>-1&&navigator.vendor.toLowerCase().indexOf("google")>-1,chromeMobile:t.toLowerCase().indexOf("version")>-1};return $("html").toggleClass("mac",e.ios||e.mac).toggleClass("mobile",e.mobile).toggleClass("firefox",e.firefox).toggleClass("safari",e.safari).toggleClass("ie",e.ie).toggleClass("chrome",e.chrome).toggleClass("chromeMobile",e.chromeMobile),e}t.getBrowser=e}(Project||(Project={}));var InstallTrigger=function(){function t(){}return t}(),Project;!function(t){var e=function(){function t(t){this.text=t}return t.prototype.copy=function(t){this.createElForm(t),this.selectText(),this.copyToClipboard()},t.prototype.createElForm=function(t){this.button=$(t.currentTarget),this.text=this.button.attr("data-link"),this.textNormal=this.button.attr("data-text-normal"),this.textCopied=this.button.attr("data-text-copied"),this.elForm=document.createElement("textarea"),document.body.appendChild(this.elForm),this.elForm.value=this.text},t.prototype.selectText=function(){var t,e;navigator.userAgent.match(/ipad|iphone/i)?(t=document.createRange(),t.selectNodeContents(this.elForm),e=window.getSelection(),e.removeAllRanges(),e.addRange(t),this.elForm.setSelectionRange(0,999999)):this.elForm.select()},t.prototype.copyToClipboard=function(){document.execCommand("copy",!1),document.body.removeChild(this.elForm),this.button.text(this.textCopied),this.button.addClass("copied")},t}();t.Clipboard=e}(Project||(Project={}));var Project;!function(t){var e=function(){function t(t,e,i,o,n,a,s){this.obj=new THREE.Object3D,this.obj=t.clone(),this.name=e,this.positionStart=i,this.rotationStart=o,this.obj.animations=t.animations,this.obj.position.x=this.positionStart.x,this.obj.position.z=this.positionStart.z,this.obj.position.y=this.positionStart.y,this.obj.setRotationFromMatrix(s),this.obj.rotation.z+=Math.PI,n.add(this.obj),this.mixer=new THREE.AnimationMixer(this.obj),this.action=this.mixer.clipAction(a[1]),this.action.loop=1,this.action.play()}return t}();t.Flower=e}(Project||(Project={}));var Project;!function(t){var e=function(){function t(){var t=this;this.lastWidthScreen=0,this.lastBreakpoint="",this.resize=function(){t.lastBreakpoint!=breakpoint.value&&(t.lastBreakpoint=breakpoint.value,t.setSrc()),breakpoint.desktop?t.setProportion(t.view,t.videoEL):t.lastWidthScreen!=$(window).width()&&(t.lastWidthScreen=$(window).width(),t.setProportion(t.view,t.videoEL))},this.view=$(".home"),this.videoELContainer=this.view.find(".home-video__container"),this.videoEL=this.view.find("video"),this.video=this.videoEL[0],this.srcDesktop=this.videoEL.attr("data-src-desktop"),this.srcMobile=this.videoEL.attr("data-src-mobile"),this.posterDesktop=this.videoEL.attr("data-poster-desktop"),this.posterMobile=this.videoEL.attr("data-poster-mobile"),this.$poster=this.view.find(".home-video__poster"),this.setSrc(),this.videoEL.on("playing",function(){t.videoELContainer.addClass("is-playing")}),this.setProportion(this.view,this.videoEL)}return t.prototype.setProportion=function(t,e){if(e.length>0){var i=0,o=0;e.removeAttr("style");var n=1280,a=720;breakpoint.desktop||(n=768,a=720);var s=t.width()/t.height(),r=n/a;if(s>=r){var h=t.width()*a/n,l=(t.height()-h)/2;i=t.width(),e.css({width:i,height:h,"margin-left":0,"margin-top":l})}else if(s<r){var c=t.height()*n/a,p=(t.width()-c)/2;o=t.height(),e.css({width:c,height:o,"margin-left":p,"margin-top":0})}}TweenMax.to(this.videoELContainer,.25,{opacity:1,ease:Sine.easeOut})},t.prototype.setSrc=function(){var t=this;breakpoint.desktop?(this.video.poster=this.posterDesktop,this.video.src=this.srcDesktop,this.video.oncanplay=function(){t.video.play()}):(this.video.poster=this.posterMobile,this.$poster.css("backgroundImage","url("+this.posterMobile+")"),this.video.src=this.srcMobile,this.video.oncanplay=function(){t.video.play()})},t}();t.Hero=e}(Project||(Project={}));var Project;!function(t){var e=function(){function t(e){e&&(e=e.replace(/^[\/]+|[\/]+$/g,""),t.path="/"+e+"/","undefined"!=typeof s&&s.sendDataToOmniture("project-template-omniture",{eVar1:t.path}),this.bind())}return t.sendDataToOmniture=function(e){"undefined"!=typeof s&&s.sendDataToOmniture("project-template-omniture","event80",{eVar1:t.path,eVar26:t.path+e})},t.prototype.bind=function(){$("[data-omni]").on("click",function(e){t.sendDataToOmniture($(e.currentTarget).data("omni"))})},t}();t.Tracking=e}(Project||(Project={}));var Project;!function(t){var e=function(){function e(t,e,i,o,n,a,s,r,h){var l=this;this.loadedPercent=0,this.loadedFlowerPercent=0,this.isLoaded=!1,this.initFlowerPrototype("flower",e).then(function(){l.addFBX(t,e,i,o,n,a,s,r,h)})}return e.prototype.addFBX=function(e,i,o,n,a,s,r,h,l){var c=this;this.flowers=new Array;var p=(new THREE.AnimationObjectGroup,new THREE.FBXLoader);p.load(i+e+".fbx",function(e){e.traverse(function(e){if(e.isMesh&&(e.castShadow=!1,e.receiveShadow=!1,e.material.alphaTest=.5,e.material.shading=THREE.SmoothShading,e.material.side=THREE.DoubleSide),"Group"==e.type&&e.name.includes("flower")){var i=new t.Flower(c.flowerPrototype,e.name,e.position,e.rotation,n,c.animations,e.matrix);c.flowers.push(i)}}),c.object=e,c.object.scale.set(a,a,a),c.object.position.x=s,c.object.position.y=r,c.object.position.z=h,c.object.rotation.y=THREE.Math.degToRad(l),c.object.visible=o,n.add(c.object),c.isLoaded=!0},function(t){return c.onProgress(t)},function(){return c.onError()})},e.prototype.initFlowerPrototype=function(t,e){var i=this;return new Promise(function(o,n){var a=new THREE.FBXLoader;a.load(e+t+".fbx",function(t){t.traverse(function(t){t.isMesh&&(t.castShadow=!1,t.receiveShadow=!1,t.material.alphaTest=.5,t.material.side=THREE.DoubleSide)}),i.flowerPrototype=t,i.animations=t.animations,o()},function(t){return i.onProgressFlower(t)},function(){return i.onError()})})},e.prototype.loadModel=function(){},e.prototype.onProgress=function(t){t.lengthComputable&&(this.loadedPercent=Math.round(t.loaded/t.total*100))},e.prototype.onProgressFlower=function(t){t.lengthComputable&&(this.loadedFlowerPercent=Math.round(t.loaded/t.total*100))},e.prototype.onError=function(){},e.prototype.spin=function(e,i){var o=this,n=this.object.rotation.y;this.object.position.y;TweenMax.to(this.object.rotation,e,{y:i,ease:Power4.easeInOut,onComplete:function(){o.object.rotation.y=n,t.Main.isAnimating=!1}})},e.prototype.show=function(t){TweenMax.set(this.object,{visible:!0,delay:t})},e.prototype.hide=function(t){TweenMax.set(this.object,{visible:!1,delay:t})},e}();t.Tree=e}(Project||(Project={}));var Project;!function(t){var e=function(){function e(){var t=this;this.cache={},this.ignoreCache=!!browser.safari,$(window).on("scroll",function(){return t.onScroll()})}return e.scrollToElement=function(e,i,o){return new Promise(function(n,a){var s=e.offset().top-t.Scroll.headerHeight+(i||0),r={y:Math.max(document.body.scrollTop,window.pageYOffset)};TweenMax.killTweensOf(r),TweenMax.to(r,"undefined"==typeof o?1.2:o,{y:s,ease:Power2.easeOut,onUpdate:function(){window.scrollTo(0,r.y)},onComplete:function(){n()}})})},e.prototype.resize=function(){e.windowHeight=window.innerHeight,e.headerHeight=$("#wpbs").offset().top,this.saveCache()},e.prototype.saveCache=function(){var t=[];$("[data-animation]").each(function(e,i){var o=$(i);t.push({$el:o,start:o.data("start")||.1,y:o.offset().top,height:o.height(),done:o.hasClass("animated"),type:o.data("animation"),delay:o.data("delay")||null})});var e=[];$("[data-parallax]").each(function(t,i){var o=$(i),n=o.data("parallax");e.push({$el:o,y:o.offset().top,height:o.height(),type:"string"==typeof n?n:null,shift:"number"==typeof n?1280*n/window.innerWidth:null,done:!1,noTablet:o.data("parallax-no-tablet")})}),this.cache.animations=t,this.cache.parallaxes=e,this.onScroll()},e.prototype.onScroll=function(){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=e.windowHeight,o=e.headerHeight;if(this.cache.animations&&this.cache.animations.length>0)for(var n=0;n<this.cache.animations.length;n++){var a=this.cache.animations[n],s=t+(1-a.start)*i,r=t,h=this.ignoreCache?a.$el.offset().top:a.y,l=this.ignoreCache?a.$el.height():a.height;if(!a.done&&h<=s&&h+l>=t){a.$el.addClass("animated"),a.done=!0;var c=r>=h+l;this.animate(a.$el,a.type,a.delay,c)}else a.done&&"petals"===a.type&&(h>s||h+l<t)&&(TweenMax.killChildTweensOf(a.$el,!1),a.$el.removeClass("animated"),a.done=!1)}if(this.cache.parallaxes&&this.cache.parallaxes.length>0)for(var n=0;n<this.cache.parallaxes.length;n++)breakpoint.tablet&&this.cache.parallaxes[n].noTablet||this.parallax(this.cache.parallaxes[n],t,i,o)},e.prototype.animate=function(t,e,i,o){void 0===i&&(i=.1);var n=o?0:1;switch(e){case"fade":TweenMax.killTweensOf(t,{opacity:!0}),TweenMax.fromTo(t,n,{opacity:0},{opacity:1,ease:Sine.easeOut,delay:i});break;case"fadeUp":TweenMax.killTweensOf(t,{opacity:!0,x:!0}),TweenMax.fromTo(t,n,{opacity:0,y:40},{opacity:1,y:0,ease:Sine.easeOut,delay:i});break;case"quote":TweenMax.killTweensOf(t,{opacity:!0,x:!0}),TweenMax.set(t,{opacity:1}),TweenMax.staggerTo(t.find(".quote-line-top").find("span"),.5,{x:0,delay:.2},0),TweenMax.staggerTo(t.find(".quote-line-bottom").find("span"),.5,{x:0,delay:.4},0),TweenMax.staggerFromTo(t.find(".quote-line").find("p"),1,{opacity:0,y:20},{opacity:1,y:0,delay:.6},.5),TweenMax.staggerFromTo(t.find(".js-quote-text"),1,{opacity:0,y:20},{opacity:1,y:0,delay:.8},.5);break;case"petals":TweenMax.killTweensOf(t,{opacity:!0,x:!0}),TweenMax.set(t,{opacity:1}),t.find(".petal").each(function(t,e){var i=2*Math.random()>1?1:-1,o=3*Math.random()+5,n=$(e).data("delay");TweenMax.set($(e),{opacity:0,yPercent:0}),TweenMax.set($(e).find(".petal-wrapper"),{rotation:0,x:0});var a=new TimelineMax({delay:n,repeat:-1}),s=new TimelineMax({delay:n,repeat:-1}),r=new TimelineMax({delay:n,repeat:-1});a.to($(e),o,{yPercent:80}),s.fromTo($(e),o/2,{opacity:0},{opacity:1}).to($(e),o/2,{opacity:0}),r.fromTo($(e).find(".petal-wrapper"),o/3,{rotation:-25*i,x:-40*i,ease:Sine.easeInOut},{rotation:25*i,x:40*i,ease:Sine.easeInOut}).to($(e).find(".petal-wrapper"),o/3,{rotation:-25*i,x:-40*i,ease:Sine.easeInOut})});break;case"cherry":TweenMax.killTweensOf(t,{opacity:!0,x:!0}),TweenMax.set(t,{opacity:1}),TweenMax.fromTo(t.find("img"),1.2,{scale:.4,opacity:0,rotation:45},{scale:1,opacity:1,rotation:0});break;case"cherry2":TweenMax.killTweensOf(t,{opacity:!0,x:!0}),TweenMax.set(t,{opacity:1}),TweenMax.fromTo(t.find("img"),1.2,{scale:.4,opacity:1,rotation:45},{scale:1,opacity:1,rotation:0});break;case"toggle":t.css("opacity",1)}},e.prototype.parallax=function(t,e,i,o){var n=t.$el,a=t.y,s=e+i,r=e-t.height;if(a>=r+o&&a<=s){var h=a+.5*t.height-e-o,l=-1+h/i*2,c=l*t.shift;breakpoint.tablet&&(c=l*t.shift*.3);var p=t.done?.5:0;if(t.done=!0,t.shift)breakpoint.desktop&&(TweenMax.killTweensOf(n),TweenMax.to(n,p,{y:c,roundProps:["y"],ease:Sine.easeOut}));else if(t.type){var d=t.$el;t.y,e-t.height;switch(t.type){case"css-animation":d.hasClass("animation-play")||d.addClass("animation-play")}}}else"css-animation"===t.type&&n.hasClass("animation-play")&&n.removeClass("animation-play")},e}();t.Scroll=e}(Project||(Project={}));var main,tracking,breakpoint,browser,$doc,$window,$body,Project;!function(t){var e=function(){function e(){var e=this;this.isGui=!1,this.isStats=!1,this.cameraType="DeviceOrientationControls",this.isSetVideo=!1,this.videoShowed=!1,this.videoReady=!1,this.videoType="environment",this.navigatorObj=navigator,this.requestId=0,this.isShowAr=!1,this.isAr=!1,this.panelLoaderIsHidden=!1,this.timeAnimatePause=0,this.isGyro=!1,this.options={angle:{angle:0},lightAmbient:{color:"#cccccc",intensity:.8},lightPointTop:{x:50,y:120,z:0,color:"#ffffff",intensity:.8,distance:1e3,decay:2,visible:!0},lightPointFlash:{radius:600,x:0,y:100,z:0,color:"#b7258e",intensity:.2,distance:0,decay:1,visible:!0},tree:{scale:1,x:0,y:0,z:0,rotate:0}},this.orientation={alpha:0,beta:40,gamma:0},this.onResize=function(){breakpoint=t.getBreakpoint(),e.hero.resize(),e.repositionArButtons(),e.isShowAr&&(e.camera.aspect=e.containerAr.width()/e.containerAr.height(),e.camera.updateProjectionMatrix(),e.renderer.setSize(e.containerAr.width(),e.containerAr.height())),e.checkRotatePhone()},$doc=$(document),$window=$(window),$body=$("body"),browser=t.getBrowser(),breakpoint=t.getBreakpoint(),this.scroll=new t.Scroll,this.scroll.resize(),this.hero=new t.Hero,this.audio=new t.Audio,this.containerAr=$("#container-ar"),this.panelLoader=$("#panel-loader"),this.panelContinue=$("#panel-continue"),this.panelVersion=$("#panel-version"),this.panelGyro=$("#panel-gyro"),this.panelPhoto=$("#panel-photo"),this.panelStart=$("#panel-start"),this.panelBlossom=$("#panel-blossom"),this.panelRotate=$("#panel-rotate"),this.panelStartHashAr=$("#panel-start-hash-ar"),this.apiUrl=this.containerAr.attr("data-api-url"),this.pathModel=this.containerAr.attr("data-path-model"),this.panelVersion.html(),this.webgl=$("#webgl"),this.videoCurtain=$("#video__curtain"),this.curtainStep=$("#curtain-step"),this.buttonEnterAr=$("#button-enter-ar"),this.buttonClose=$("#container-ar-close"),this.buttonContinue=$("#button-continue"),this.buttonCopyLink=$("#button-copy-link"),this.buttonRefresh=$("#button-refresh"),this.buttonStartHashAr=$("#button-start-hash-ar"),this.buttonPrev=$("#button-prev"),this.buttonNext=$("#button-next"),this.buttonBack=$("#button-back"),this.buttonPhoto=$("#button-photo"),this.buttonBlossom=$("#button-blossom"),this.share=$("#share"),this.buttonPhotoClose=$("#button-photo-close"),this.buttonStart=$("#button-start"),this.text1=$("#text-1"),this.text2=$("#text-2"),this.text3=$("#text-3"),this.photo=$("#photo"),this.photoCanvas=$("#photo-canvas")[0],this.clock=new THREE.Clock,this.bind(),this.checkGyro(),window.addEventListener("resize",this.onResize,!1),this.onResize(),this.isStats&&this.setStats(),this.render(),this.clipboard=new t.Clipboard(this.buttonCopyLink.attr("data-link")),TweenMax.to($(".loader"),.2,{opacity:0,ease:Sine.easeOut});var i=(new URL(window.location.href),window.location.hash);if("#ar"==i)if(breakpoint.desktop){var o=$(".link--box").offset().top-200;TweenMax.to($("html, body"),1,{scrollTop:o,ease:Sine.easeOut})}else this.showPanel(this.containerAr),this.showPanel(this.panelStartHashAr,!0)}return e.prototype.showPanel=function(t,e){t.css({display:"block"}),t.css({opacity:1}),this.repositionArButtons()},e.prototype.hidePanel=function(t,e){TweenMax.to(t,e?0:.5,{opacity:0,ease:Sine.easeOut,onComplete:function(){t.css({display:"none"})}})},e.prototype.enterAr=function(){this.checkGyro(),breakpoint.desktop||(browser.ie?this.showPanel(this.panelVersion,!0):browser.ios&&!this.isGyro?this.showPanel(this.panelGyro,!0):this.panelContinueCheck(),this.showPanel(this.containerAr))},e.prototype.panelContinueCheck=function(){var t=this;this.isAr?($.each(this.tree.flowers,function(t,e){e.action.play()}),this.isShowAr=!0,this.goTo(1)):(this.showPanel(this.panelContinue,!0),this.buildSceneVideo(),this.videoShowed=!0,$(this.video).show(),TweenMax.set(this.videoCurtain,{opacity:0}),DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission&&DeviceOrientationEvent.requestPermission().then(function(){})["catch"](function(){t.isGyro=!1}),this.videoOn(!0))},e.prototype.clickContinue=function(){this.hidePanel(this.panelContinue),this.isShowAr=!0,this.isAr||(this.isAr=!0,this.buildScene(),this.blossom=new t.Blossom(this.pathModel,this.scene),this.isGui&&this.setGui())},e.prototype.bind=function(){var t=this;window.addEventListener("deviceorientation",function(e){return t.handleOrientation(e)},!0),this.buttonEnterAr.off(".enterAr").on("click.enterAr",function(e){return t.enterAr()}),this.buttonClose.off(".buttonClose").on("click.buttonClose",function(e){return t.closeAr()}),this.buttonContinue.off(".buttonContinue").on("click.buttonContinue",function(e){clearTimeout(t.timeoutContinue),t.clickContinue()}),this.buttonCopyLink.off(".buttonCopyLink").on("click.buttonCopyLink",function(e){return t.clipboard.copy(e)}),this.buttonRefresh.off(".buttonRefresh").on("click.Refresh",function(t){location.reload()}),this.buttonStartHashAr.off(".buttonStartHashAr").on("click.buttonStartHashAr",function(e){t.hidePanel(t.panelStartHashAr),t.enterAr()}),this.buttonPrev.off(".buttonPrev").on("click.buttonPrev",function(e){return t.goPrev()}),this.buttonNext.off(".buttonNext").on("click.buttonNext",function(e){return t.goNext()}),this.buttonBack.off(".buttonBack").on("click.buttonBack",function(e){t.hideBlossom(),t.goTo(1)}),this.buttonPhoto.off(".buttonPhoto").on("click.buttonPhoto",function(e){return t.showPhoto()}),this.buttonPhotoClose.off(".buttonPhoto").on("click.buttonPhoto",function(e){return t.hidePhoto()}),this.buttonBlossom.off(".buttonBlossom").on("click.buttonBlossom",function(e){"hidden"==t.blossom.status&&t.showBlossom()}),this.buttonStart.off(".buttonStart").on("click.buttonStart",function(e){t.hidePanel(t.panelStart),t.goTo(1)}),$("[data-share]").off().on("click.share",function(e){return t.onShareClick(e)}),$(document).off(".end3VO").on("end3VO.end3VO",function(e){return t.showPanelBlossom()}),document.addEventListener("visibilitychange",function(){t.isAr&&"hidden"==document.visibilityState&&(t.audio.mp3StopAll(),t.videoOff()),t.isAr&&"visible"==document.visibilityState&&t.videoOn()})},e.prototype.checkGyro=function(){var t=this;DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?this.isGyro=!0:window.DeviceOrientationEvent||window.DeviceMotionEvent?window.addEventListener("deviceorientation",function(e){return t.handleDeviceOrientation(e)},!1):window.DeviceMotionEvent&&window.addEventListener("devicemotion",function(e){return t.handleDeviceOrientation(e)},!1)},e.prototype.handleDeviceOrientation=function(t){this.isGyro=!0},e.prototype.onShareClick=function(t){t.preventDefault();var e=parseInt($(t.currentTarget).attr("data-winwidth"),10)||520,i=parseInt($(t.currentTarget).attr("data-winheight"),10)||350,o=screen.height/2-i/2,n=screen.width/2-e/2,a=t.currentTarget.href,s=$(t.currentTarget).data("share");return"facebook"!==s&&"twitter"!==s||(a+=encodeURIComponent(window.location.href)),window.open(a,"sharer"+s,"top="+o+",left="+n+",toolbar=0,status=0,width="+e+",height="+i),!1},e.prototype.showPanelBlossom=function(){e.isBlossomTime=!0,this.showPanel(this.panelBlossom),this.buttonPrev.removeClass("active"),this.text3.removeClass("active"),this.buttonBlossom.addClass("active")},e.prototype.showBlossom=function(){var t=this;this.blossom.show(),clearTimeout(this.timeoutBloomEnd),this.timeoutBloomEnd=setTimeout(function(){t.finishBlossom()},2e4),this.panelBlossom.addClass("clicked"),this.buttonBlossom.removeClass("active")},e.prototype.hideBlossom=function(){clearTimeout(this.timeoutBloomEnd),this.blossom.hide(),this.buttonPrev.addClass("active"),this.text3.addClass("active"),this.buttonBlossom.removeClass("active")},e.prototype.finishBlossom=function(){clearTimeout(this.timeoutBloomEnd),this.blossom.hide(),this.showPanel(this.panelBlossom),this.buttonBlossom.addClass("active")},e.prototype.closeAr=function(){this.isAr?(this.audio.mp3StopAll(),this.hidePanel(this.containerAr,!0),this.hidePhoto(),this.hidePanel(this.panelStart,!0),clearTimeout(this.timeoutBloomEnd),this.blossom?(this.blossom.hide(!0),this.isShowAr=!1,$.each(this.tree.flowers,function(t,e){e.action.stop(),e.action.play(),e.action.timeScale=1e-5})):(this.isShowAr=!1,$.each(this.tree.flowers,function(t,e){e.action.stop(),e.action.play(),e.action.timeScale=1e-5}))):(this.hidePanel(this.containerAr,!0),this.isShowAr=!1)},e.prototype.showPhoto=function(){this.showPanel(this.panelPhoto),this.snap(),this.audio.mp3StopAll(),$(".button").removeClass("active"),$(".text-step").removeClass("active"),this.share.addClass("active")},e.prototype.hidePhoto=function(){switch(this.hidePanel(this.panelPhoto),this.share.removeClass("active"),this.buttonPhoto.addClass("active"),e.stage){case 1:this.buttonNext.addClass("active"),this.text1.addClass("active"),this.audio.buttonPlay.addClass("active");break;case 2:this.buttonPrev.addClass("active"),this.buttonNext.addClass("active"),this.text2.addClass("active"),this.audio.buttonPlay.addClass("active");break;case 3:e.isBlossomTime?this.buttonBack.addClass("active"):(this.audio.buttonPlay.addClass("active"),this.buttonPrev.addClass("active"),this.text3.addClass("active"))}},e.prototype.snap=function(){var t=this.photoCanvas.getContext("2d");if(this.videoReady){var e=this.video.videoWidth,i=this.video.videoHeight,o=e/i,n=this.panelPhoto.width()/this.panelPhoto.height(),a=0,s=0,r=0,h=0;this.photoCanvas.width=this.containerAr.width(),this.photoCanvas.height=this.containerAr.height(),n>=o?(s=this.photoCanvas.width*i/e,h=(this.photoCanvas.height-s)/2,a=this.photoCanvas.width):n<o&&(a=this.photoCanvas.height*e/i,r=(this.photoCanvas.width-a)/2,s=this.photoCanvas.height),t.drawImage(this.video,r,h,a,s)}if(t.drawImage(this.renderer.domElement,0,0,this.photoCanvas.width,this.photoCanvas.height),"showed"==this.blossom.status){var l=this.photoCanvas.width>this.photoCanvas.height?this.photoCanvas.width/2:this.photoCanvas.height/2,c=t.createRadialGradient(this.photoCanvas.width/2,this.photoCanvas.height/2,0,this.photoCanvas.width/2,this.photoCanvas.height/2,l);c.addColorStop(0,"rgba(217,135,141,0.31)"),c.addColorStop(.3,"rgba(217,135,141,0.31)"),c.addColorStop(1,"rgba(217,135,141,0.9)"),t.fillStyle=c,t.fillRect(0,0,this.photoCanvas.width,this.photoCanvas.height)}var p="image/jpeg",d=this.photoCanvas.toDataURL(p),u=this.b64ToUint8Array(d),m=new FormData;m.append("action","add"),m.append("image",new Blob([u],{type:"image/jpeg"})),this.sendFoto(m)},e.prototype.b64ToUint8Array=function(t){for(var e=atob(t.split(",")[1]),i=[],o=0;o<e.length;)i.push(e.charCodeAt(o)),o++;return new Uint8Array(i)},e.prototype.sendFoto=function(t){$.ajax({url:this.apiUrl,global:!1,type:"POST",dataType:"json",data:t,processData:!1,contentType:!1}).done(function(t){if(t){var e=window.location.origin+window.location.pathname+"?uid="+t.uid,i=t.download;window.history.replaceState({},"title",e),$("#share-download").attr("href",i)}}).fail(function(t){})},e.prototype.goPrev=function(){2==e.stage?(WpTracking.sendTracking("ar-step-two-previous-step"),t.Tracking.sendDataToOmniture("ar-step-two-previous-step")):3==e.stage&&(WpTracking.sendTracking("ar-step-three-previous-step"),t.Tracking.sendDataToOmniture("ar-step-three-previous-step")),this.goTo(e.stage-1)},e.prototype.goNext=function(){1==e.stage?(WpTracking.sendTracking("ar-step-one-next-step"),t.Tracking.sendDataToOmniture("ar-step-one-next-step")):2==e.stage&&(WpTracking.sendTracking("ar-step-two-next-step"),t.Tracking.sendDataToOmniture("ar-step-two-next-step")),this.goTo(e.stage+1)},e.prototype.repositionArButtons=function(){var t=breakpoint.tablet?window.innerHeight-180:window.innerHeight-60;this.buttonPhoto.css("top",t+"px"),this.audio.buttonPlay.css("top",t+"px"),this.buttonBack.css("top",t+"px"),this.share.css("top",t+"px"),this.panelPhoto.css("top",.2*t+"px"),$(".panel__center").each(function(e,i){var o=(t+22-$(i).height())/2;$(i).css("top",o+"px")})},e.prototype.setTimeScale=function(t,e,i){this.timeAnimatePause=i;var o=(Math.floor(20*Math.random())+1)/60;return t<e?.6-o:-.6+o},e.prototype.goTo=function(t){var i=this;if(t>=1&&t<=3){switch(this.checkRotatePhone(),e.isBlossomTime=!1,this.hidePanel(this.panelBlossom),$(".button").removeClass("active"),$(".text-step").removeClass("active"),this.buttonPrev.removeClass("active"),this.buttonPhoto.addClass("active"),this.audio.buttonPlay.addClass("active"),this.audio.mp3StopAll(),this.repositionArButtons(),clearTimeout(this.timeoutBloomEnd),this.hidePanel(this.panelBlossom),this.audio.clickButtonPlay(t),t){case 1:$.each(this.tree.flowers,function(o,n){n.action.timeScale=i.setTimeScale(e.stage,t,0)}),this.buttonNext.addClass("active"),this.text1.addClass("active");break;case 2:$.each(this.tree.flowers,function(o,n){n.action.timeScale=i.setTimeScale(e.stage,t,2)}),this.buttonPrev.addClass("active"),this.buttonNext.addClass("active"),this.text2.addClass("active");break;case 3:$.each(this.tree.flowers,function(o,n){n.action.timeScale=i.setTimeScale(e.stage,t,4)}),this.buttonPrev.addClass("active"),this.text3.addClass("active")}e.stage=t}},e.prototype.handleOrientation=function(t){return!breakpoint.desktop&&(this.orientation.alpha=t.alpha,this.orientation.beta=t.beta,void(this.orientation.gamma=t.gamma))},e.prototype.buildScene=function(){var e=this.containerAr.width(),i=this.containerAr.height();this.renderer=new THREE.WebGLRenderer({alpha:!0,preserveDrawingBuffer:!0}),this.renderer.shadowMap.enabled=!0,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(e,i),this.renderer.setClearColor(0,0),this.webgl[0].appendChild(this.renderer.domElement),this.camera=new THREE.PerspectiveCamera(75,e/i,.1,1e3),this.setCamera(),this.scene=new THREE.Scene,this.scene.fog=new THREE.FogExp2(16777215,0),this.lightAmbient=new THREE.AmbientLight(this.options.lightAmbient.color.replace("#","0x"),this.options.lightAmbient.intensity),
this.scene.add(this.lightAmbient),this.lightPointTop=new THREE.PointLight(this.options.lightPointTop.color.replace("#","0x"),this.options.lightPointTop.intensity),this.lightPointTop.position.x=this.options.lightPointTop.x,this.lightPointTop.position.y=this.options.lightPointTop.y,this.lightPointTop.position.z=this.options.lightPointTop.z,this.lightPointTop.color.setHex(parseInt(this.options.lightPointTop.color.replace("#","0x"))),this.scene.add(this.lightPointTop),this.lightPointFlash=new THREE.PointLight(this.options.lightPointFlash.color.replace("#","0x"),this.options.lightPointFlash.intensity),this.lightPointFlash.position.x=this.options.lightPointFlash.x,this.lightPointFlash.position.y=this.options.lightPointFlash.y,this.lightPointFlash.position.z=this.options.lightPointFlash.z,this.lightPointFlash.color.setHex(parseInt(this.options.lightPointFlash.color.replace("#","0x"))),this.scene.add(this.lightPointFlash),this.tree=new t.Tree("tree_empty",this.pathModel,(!0),this.scene,this.options.tree.scale,this.options.tree.x,this.options.tree.y,this.options.tree.z,this.options.tree.rotate)},e.prototype.setCamera=function(){this.containerAr.width(),this.containerAr.height();breakpoint.desktop?(this.cameraType="DeviceOrientationControls",this.camera.position.set(0,40,0),this.controls=new THREE.DeviceOrientationControls(this.camera)):(this.camera.position.set(0,40,0),this.cameraType="DeviceOrientationControls",this.controls=new THREE.DeviceOrientationControls(this.camera))},e.prototype.buildSceneVideo=function(){var t={effects:!1};t.effects=window.location.search.indexOf("fx")>-1,this.video=document.getElementById("video")},e.prototype.videoOn=function(t){var e=this;this.isSetVideo=!0,this.videoType="environment",this.navigatorObj=navigator;var i={audio:!1,video:{facingMode:this.videoType}};return this.navigatorObj.mediaDevices&&this.navigatorObj.mediaDevices.getUserMedia?void this.navigatorObj.mediaDevices.getUserMedia(i).then(function(i){e.video.srcObject=i,e.video.play(),e.videoReady=!0,t&&(e.buttonContinue.addClass("active"),e.timeoutContinue=setTimeout(function(){e.clickContinue()},3e3))},function(t){}):void this.showPanel(this.panelVersion,!0)},e.prototype.videoOff=function(){this.video.pause(),this.videoReady=!1,this.video.srcObject.getTracks()[0].stop(),this.video.srcObject=null},e.prototype.checkRotatePhone=function(){!breakpoint.desktop&&this.isShowAr&&$window.width()>$window.height()?this.showPanel(this.panelRotate,!0):this.hidePanel(this.panelRotate,!0)},e.prototype.setProgressBar=function(t){var e=t-100;TweenMax.to($(".panel-loader__progress"),.5,{x:e+"%",ease:Sine.easeOut,onComplete:function(){}}),$(".panel-loader__text").text(t+"%")},e.prototype.render=function(){var t=this;if(this.isStats&&this.stats.begin(),this.requestId=requestAnimationFrame(function(){return t.render()}),this.isShowAr){var e=this.clock.getDelta();if(!this.panelLoaderIsHidden){var i=0,o=!1;i=Math.round((this.tree.loadedPercent+this.tree.loadedFlowerPercent)/2),o=this.tree.isLoaded,this.setProgressBar(i),o&&(this.panelLoaderIsHidden=!0,setTimeout(function(){t.hidePanel(t.panelLoader),t.showPanel(t.panelStart)},1e3))}$.each(this.tree.flowers,function(e,i){i.action&&(0==t.timeAnimatePause&&i.action.time<.1&&(i.action.timeScale=1e-5),2==t.timeAnimatePause&&i.action.time>1.95&&i.action.time<2.05&&(i.action.timeScale=1e-5),4==t.timeAnimatePause&&i.action.time>3.9&&i.action.time<4&&(i.action.timeScale=1e-5))}),$.each(this.tree.flowers,function(t,i){i.mixer&&i.mixer.update(e)}),"hidden"!=this.blossom.status&&this.blossom.render(),breakpoint.desktop||this.controls.update(),this.renderer.render(this.scene,this.camera)}this.isStats&&this.stats.end()},e.prototype.setGui=function(){var t=this;this.gui=new dat.GUI;var e=this.gui.addFolder("Camera");e.add(this.camera.position,"x",-500,500).step(1),e.add(this.camera.position,"y",-500,500).step(1),e.add(this.camera.position,"z",-500,500).step(1);var i=this.gui.addFolder("Light Ambient");i.add(this.lightAmbient,"visible").listen(),i.addColor(this.options.lightAmbient,"color").onChange(function(e){t.lightAmbient.color.setHex(e.replace("#","0x"))}),i.add(this.lightAmbient,"intensity",0,2).listen();var o=this.gui.addFolder("Light Point Top");o.add(this.lightPointTop,"visible").listen(),o.add(this.lightPointTop.position,"x",0,300).listen(),o.add(this.lightPointTop.position,"y",0,300).listen(),o.add(this.lightPointTop.position,"z",-300,300).listen(),o.addColor(this.options.lightPointTop,"color").onChange(function(e){t.lightPointTop.color.setHex(e.replace("#","0x"))}),o.add(this.lightPointTop,"intensity",0,2).listen(),o.add(this.lightPointTop,"distance",.1,1e3).listen(),o.add(this.lightPointTop,"decay",0,2).listen();var n=this.gui.addFolder("Light Point Flash");n.add(this.options.lightPointFlash,"radius",0,1e3).listen(),n.add(this.lightPointFlash,"visible").listen(),n.add(this.lightPointFlash.position,"x",0,300).listen(),n.add(this.lightPointFlash.position,"y",0,300).listen(),n.add(this.lightPointFlash.position,"z",-300,300).listen(),n.addColor(this.options.lightPointFlash,"color").onChange(function(e){t.lightPointFlash.color.setHex(e.replace("#","0x"))}),n.add(this.lightPointFlash,"intensity",0,2).listen(),n.add(this.lightPointFlash,"distance",.1,1e3).listen(),n.add(this.lightPointFlash,"decay",0,2).listen()},e.prototype.setStats=function(){this.stats=new Stats,this.stats.setMode(0),this.stats.domElement.style.position="fixed",this.stats.domElement.style.left="60px",this.stats.domElement.style.top="100px",document.body.appendChild(this.stats.domElement)},e.isAnimating=!1,e.stage=0,e.isBlossomTime=!1,e}();t.Main=e}(Project||(Project={})),function(t){main=new Project.Main,tracking=new Project.Tracking("brand-connect/mgm/hanami/")}(jQuery);