diff --git a/.gitignore b/.gitignore index 1522ee7..f5e11dd 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ url_exct_frontend/node_modules ./frontend/url_exct_frontend/coverage # production -./frontend/url_exct_frontend/build +#./frontend/url_exct_frontend/build # misc ./frontend/url_exct_frontend/.DS_Store diff --git a/url_exct_frontend/build/asset-manifest.json b/url_exct_frontend/build/asset-manifest.json new file mode 100644 index 0000000..117190b --- /dev/null +++ b/url_exct_frontend/build/asset-manifest.json @@ -0,0 +1,12 @@ +{ + "files": { + "main.css": "/static/css/main.31d6cfe0.css", + "main.js": "/static/js/main.a7e45ac4.js", + "index.html": "/index.html", + "main.a7e45ac4.js.map": "/static/js/main.a7e45ac4.js.map" + }, + "entrypoints": [ + "static/css/main.31d6cfe0.css", + "static/js/main.a7e45ac4.js" + ] +} \ No newline at end of file diff --git a/url_exct_frontend/build/favicon.ico b/url_exct_frontend/build/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/url_exct_frontend/build/favicon.ico differ diff --git a/url_exct_frontend/build/index.html b/url_exct_frontend/build/index.html new file mode 100644 index 0000000..ef42ca7 --- /dev/null +++ b/url_exct_frontend/build/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/url_exct_frontend/build/logo192.png b/url_exct_frontend/build/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/url_exct_frontend/build/logo192.png differ diff --git a/url_exct_frontend/build/logo512.png b/url_exct_frontend/build/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/url_exct_frontend/build/logo512.png differ diff --git a/url_exct_frontend/build/manifest.json b/url_exct_frontend/build/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/url_exct_frontend/build/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/url_exct_frontend/build/robots.txt b/url_exct_frontend/build/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/url_exct_frontend/build/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/url_exct_frontend/build/static/css/main.31d6cfe0.css b/url_exct_frontend/build/static/css/main.31d6cfe0.css new file mode 100644 index 0000000..e69de29 diff --git a/url_exct_frontend/build/static/js/main.a7e45ac4.js b/url_exct_frontend/build/static/js/main.a7e45ac4.js new file mode 100644 index 0000000..215eb33 --- /dev/null +++ b/url_exct_frontend/build/static/js/main.a7e45ac4.js @@ -0,0 +1,3 @@ +/*! For license information please see main.a7e45ac4.js.LICENSE.txt */ +(()=>{var e={784:(e,t,n)=>{"use strict";var r=n(184),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var s=l(t),m=l(n),g=0;g{e=n.nmd(e);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object AsyncFunction]",s="[object Function]",l="[object GeneratorFunction]",c="[object Null]",u="[object Object]",d="[object Proxy]",h="[object Undefined]",f=/^\[object .+?Constructor\]$/,p=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[o]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[s]=m["[object Map]"]=m["[object Number]"]=m[u]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var g="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,v="object"==typeof self&&self&&self.Object===Object&&self,y=g||v||Function("return this")(),b=t&&!t.nodeType&&t,x=b&&e&&!e.nodeType&&e,w=x&&x.exports===b,_=w&&g.process,S=function(){try{var e=x&&x.require&&x.require("util").types;return e||_&&_.binding&&_.binding("util")}catch(t){}}(),M=S&&S.isTypedArray;var E,T,C=Array.prototype,A=Function.prototype,k=Object.prototype,P=y["__core-js_shared__"],R=A.toString,L=k.hasOwnProperty,O=function(){var e=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),z=k.toString,D=R.call(Object),N=RegExp("^"+R.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=w?y.Buffer:void 0,F=y.Symbol,B=y.Uint8Array,j=I?I.allocUnsafe:void 0,U=(E=Object.getPrototypeOf,T=Object,function(e){return E(T(e))}),H=Object.create,G=k.propertyIsEnumerable,V=C.splice,W=F?F.toStringTag:void 0,q=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),X=I?I.isBuffer:void 0,Y=Math.max,$=Date.now,Z=ye(y,"Map"),J=ye(Object,"create"),Q=function(){function e(){}return function(t){if(!Pe(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},ee.prototype.set=function(e,t){var n=this.__data__,r=ae(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},te.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(Z||ee),string:new K}},te.prototype.delete=function(e){var t=ve(this,e).delete(e);return this.size-=t?1:0,t},te.prototype.get=function(e){return ve(this,e).get(e)},te.prototype.has=function(e){return ve(this,e).has(e)},te.prototype.set=function(e,t){var n=ve(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ne.prototype.clear=function(){this.__data__=new ee,this.size=0},ne.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ne.prototype.get=function(e){return this.__data__.get(e)},ne.prototype.has=function(e){return this.__data__.has(e)},ne.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ee){var r=n.__data__;if(!Z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new te(r)}return n.set(e,t),this.size=n.size,this};var le,ce=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var s=o[le?a:++r];if(!1===t(i[s],s,i))break}return e};function ue(e){return null==e?void 0===e?h:c:W&&W in Object(e)?function(e){var t=L.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(o){}var i=z.call(e);r&&(t?e[W]=n:delete e[W]);return i}(e):function(e){return z.call(e)}(e)}function de(e){return Re(e)&&ue(e)==o}function he(e){return!(!Pe(e)||function(e){return!!O&&O in e}(e))&&(Ae(e)?N:f).test(function(e){if(null!=e){try{return R.call(e)}catch(t){}try{return e+""}catch(t){}}return""}(e))}function fe(e){if(!Pe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=xe(e),n=[];for(var r in e)("constructor"!=r||!t&&L.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,i){e!==t&&ce(t,(function(o,a){if(i||(i=new ne),Pe(o))!function(e,t,n,r,i,o,a){var s=we(e,n),l=we(t,n),c=a.get(l);if(c)return void ie(e,n,c);var d=o?o(s,l,n+"",e,t,a):void 0,h=void 0===d;if(h){var f=Ee(l),p=!f&&Ce(l),m=!f&&!p&&Le(l);d=l,f||p||m?Ee(s)?d=s:Re(g=s)&&Te(g)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ge);function Se(e,t){return e===t||e!==e&&t!==t}var Me=de(function(){return arguments}())?de:function(e){return Re(e)&&L.call(e,"callee")&&!G.call(e,"callee")},Ee=Array.isArray;function Te(e){return null!=e&&ke(e.length)&&!Ae(e)}var Ce=X||function(){return!1};function Ae(e){if(!Pe(e))return!1;var t=ue(e);return t==s||t==l||t==a||t==d}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Pe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Re(e){return null!=e&&"object"==typeof e}var Le=M?function(e){return function(t){return e(t)}}(M):function(e){return Re(e)&&ke(e.length)&&!!m[ue(e)]};function Oe(e){return Te(e)?re(e,!0):fe(e)}var ze,De=(ze=function(e,t,n,r){pe(e,t,n,r)},me((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=ze.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!Pe(n))return!1;var r=typeof t;return!!("number"==r?Te(n)&&be(t,n.length):"string"==r&&t in n)&&Se(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=24)}([function(e,t){e.exports=n(60)},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ServerStyleSheet",(function(){return Be})),n.d(t,"StyleSheetConsumer",(function(){return ie})),n.d(t,"StyleSheetContext",(function(){return re})),n.d(t,"StyleSheetManager",(function(){return ue})),n.d(t,"ThemeConsumer",(function(){return Re})),n.d(t,"ThemeContext",(function(){return Pe})),n.d(t,"ThemeProvider",(function(){return Le})),n.d(t,"__PRIVATE__",(function(){return He})),n.d(t,"createGlobalStyle",(function(){return Ie})),n.d(t,"css",(function(){return be})),n.d(t,"isStyledComponent",(function(){return x})),n.d(t,"keyframes",(function(){return Fe})),n.d(t,"useTheme",(function(){return Ue})),n.d(t,"version",(function(){return _})),n.d(t,"withTheme",(function(){return je}));var r=n(11),i=n(0),o=n.n(i),a=n(21),s=n.n(a),l=n(22),c=n(23),u=n(13),d=n(12),h=n.n(d);function f(){return(f=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var C=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&T(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(w))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(w,"active"),r.setAttribute("data-styled-version","5.2.1");var a=F();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},j=function(){function e(e){var t=this.element=B(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")})),r+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),q=/(a)(d)/gi,X=function(e){return String.fromCharCode(e+(e>25?39:97))};function Y(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=X(t%52)+n;return(X(t%52)+n).replace(q,"$1-$2")}var $=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Z=function(e){return $(5381,e)};function J(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=$(this.baseHash,n.hash),u="",d=0;d>>0);if(!t.hasNameForId(r,m)){var g=n(u,"."+m,void 0,r);t.insertRules(r,m,g)}i.push(m)}}return i.join(" ")},e}(),ee=/^\s*\/\/.*$/gm,te=[":","[",".","#"];function ne(e){var t,n,r,i,o=void 0===e?v:e,a=o.options,s=void 0===a?v:a,c=o.plugins,u=void 0===c?g:c,d=new l.a(s),h=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,l,c,u,d){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(i[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){h.push(e)})),p=function(e,r,o){return 0===r&&te.includes(o[n.length])||o.match(i)?e:"."+t};function m(e,o,a,s){void 0===s&&(s="&");var l=e.replace(ee,""),c=o&&a?a+" "+o+" { "+l+" }":l;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),d(a||!o?"":o,c)}return d.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,p))},f,function(e){if(-2===e){var t=h;return h=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||T(15),$(e,t.name)}),5381).toString():"",m}var re=o.a.createContext(),ie=re.Consumer,oe=o.a.createContext(),ae=(oe.Consumer,new W),se=ne();function le(){return Object(i.useContext)(re)||ae}function ce(){return Object(i.useContext)(oe)||se}function ue(e){var t=Object(i.useState)(e.stylisPlugins),n=t[0],r=t[1],a=le(),l=Object(i.useMemo)((function(){var t=a;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),c=Object(i.useMemo)((function(){return ne({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(i.useEffect)((function(){s()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),o.a.createElement(re.Provider,{value:l},o.a.createElement(oe.Provider,{value:c},e.children))}var de=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=se);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return T(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=se),this.name+e.hash},e}(),he=/([A-Z])/,fe=/([A-Z])/g,pe=/^ms-/,me=function(e){return"-"+e.toLowerCase()};function ge(e){return he.test(e)?e.replace(fe,me).replace(pe,"-ms-"):e}var ve=function(e){return null==e||!1===e||""===e};function ye(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,_e=/(^-|-$)/g;function Se(e){return e.replace(we,"-").replace(_e,"")}var Me=function(e){return Y(Z(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var Te=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ce=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Ae(e,t,n){var r=e[n];Te(t)&&Te(r)?ke(r,t):e[n]=t}function ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(Ee(e)?e:Se(b(e)));return ze(e,f({},i,{attrs:_,componentId:o}),n)},Object.defineProperty(M,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?ke({},e.defaultProps,t):t}}),M.toString=function(){return"."+M.styledComponentId},a&&h()(M,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),M}var De=function(e){return function e(t,n,i){if(void 0===i&&(i=v),!Object(r.isValidElementType)(n))return T(1,String(n));var o=function(){return t(n,i,be.apply(void 0,arguments))};return o.withConfig=function(r){return e(t,n,f({},i,{},r))},o.attrs=function(r){return e(t,n,f({},i,{attrs:Array.prototype.concat(i.attrs,r).filter(Boolean)}))},o}(ze,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){De[e]=De(e)}));var Ne=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=J(e),W.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var i=r(ye(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&W.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Ie(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r"+t+""},this.getStyleTags=function(){return e.sealed?T(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return T(2);var n=((t={})[w]="",t["data-styled-version"]="5.2.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=F();return r&&(n.nonce=r),[o.a.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}var t=e.prototype;return t.collectStyles=function(e){return this.sealed?T(2):o.a.createElement(ue,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return T(3)},e}(),je=function(e){var t=o.a.forwardRef((function(t,n){var r=Object(i.useContext)(Pe),a=e.defaultProps,s=xe(t,r,a);return o.a.createElement(e,f({},t,{theme:s,ref:n}))}));return h()(t,e),t.displayName="WithTheme("+b(e)+")",t},Ue=function(){return Object(i.useContext)(Pe)},He={StyleSheet:W,masterSheet:ae};t.default=De}.call(this,n(26))},function(e,t,n){var r;"undefined"!=typeof self&&self,e.exports=(r=n(0),function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=7)}([function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=s;case"max":return l<=s;default:return l===s}}));return s&&!n||!s&&n}))},t.parse=r;var s=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,l=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,c=/^(?:(min|max)-)?(.+)/,u=/(em|rem|px|cm|mm|in|pt|pc)?$/,d=/(dpi|dpcm|dppx)?$/},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var o=0;o1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),r)},oneOfType:function(e){if(!Array.isArray(e))return i("Invalid argument supplied to oneOfType, expected an instance of array."),r;for(var t=0;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["children","device","onChange"]),a=Object(r.a)(o,n,i);return"function"==typeof t?t(a):a?t:null};var r=n(0)}]))},function(e,t,n){var r;r=function(){var e={};e.TAU=2*Math.PI,e.extend=function(e,t){for(var n in t)e[n]=t[n];return e},e.lerp=function(e,t,n){return(t-e)*n+e},e.modulo=function(e,t){return(e%t+t)%t};var t={2:function(e){return e*e},3:function(e){return e*e*e},4:function(e){return e*e*e*e},5:function(e){return e*e*e*e*e}};return e.easeInOut=function(e,n){if(1==n)return e;var r=(e=Math.max(0,Math.min(1,e)))<.5,i=r?e:1-e,o=(t[n]||t[2])(i/=.5);return o/=2,r?o:1-o},e},e.exports?e.exports=r():this.Zdog=r()},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3),n(6),n(15),n(16));else{var i=t.Zdog;i.Anchor=r(i,i.Vector,i.CanvasRenderer,i.SvgRenderer)}}(this,(function(e,t,n,r){var i=e.TAU,o={x:1,y:1,z:1};function a(e){this.create(e||{})}return a.prototype.create=function(n){this.children=[],e.extend(this,this.constructor.defaults),this.setOptions(n),this.translate=new t(n.translate),this.rotate=new t(n.rotate),this.scale=new t(o).multiply(this.scale),this.origin=new t,this.renderOrigin=new t,this.addTo&&this.addTo.addChild(this)},a.defaults={},a.optionKeys=Object.keys(a.defaults).concat(["rotate","translate","scale","addTo"]),a.prototype.setOptions=function(e){var t=this.constructor.optionKeys;for(var n in e)-1!=t.indexOf(n)&&(this[n]=e[n])},a.prototype.addChild=function(e){-1==this.children.indexOf(e)&&(e.remove(),e.addTo=this,this.children.push(e))},a.prototype.removeChild=function(e){var t=this.children.indexOf(e);-1!=t&&this.children.splice(t,1)},a.prototype.remove=function(){this.addTo&&this.addTo.removeChild(this)},a.prototype.update=function(){this.reset(),this.children.forEach((function(e){e.update()})),this.transform(this.translate,this.rotate,this.scale)},a.prototype.reset=function(){this.renderOrigin.set(this.origin)},a.prototype.transform=function(e,t,n){this.renderOrigin.transform(e,t,n),this.children.forEach((function(r){r.transform(e,t,n)}))},a.prototype.updateGraph=function(){this.update(),this.updateFlatGraph(),this.flatGraph.forEach((function(e){e.updateSortValue()})),this.flatGraph.sort(a.shapeSorter)},a.shapeSorter=function(e,t){return e.sortValue-t.sortValue},Object.defineProperty(a.prototype,"flatGraph",{get:function(){return this._flatGraph||this.updateFlatGraph(),this._flatGraph},set:function(e){this._flatGraph=e}}),a.prototype.updateFlatGraph=function(){this.flatGraph=this.getFlatGraph()},a.prototype.getFlatGraph=function(){var e=[this];return this.addChildFlatGraph(e)},a.prototype.addChildFlatGraph=function(e){return this.children.forEach((function(t){var n=t.getFlatGraph();Array.prototype.push.apply(e,n)})),e},a.prototype.updateSortValue=function(){this.sortValue=this.renderOrigin.z},a.prototype.render=function(){},a.prototype.renderGraphCanvas=function(e){if(!e)throw new Error("ctx is "+e+". Canvas context required for render. Check .renderGraphCanvas( ctx ).");this.flatGraph.forEach((function(t){t.render(e,n)}))},a.prototype.renderGraphSvg=function(e){if(!e)throw new Error("svg is "+e+". SVG required for render. Check .renderGraphSvg( svg ).");this.flatGraph.forEach((function(t){t.render(e,r)}))},a.prototype.copy=function(t){var n={};return this.constructor.optionKeys.forEach((function(e){n[e]=this[e]}),this),e.extend(n,t),new(0,this.constructor)(n)},a.prototype.copyGraph=function(e){var t=this.copy(e);return this.children.forEach((function(e){e.copyGraph({addTo:t})})),t},a.prototype.normalizeRotate=function(){this.rotate.x=e.modulo(this.rotate.x,i),this.rotate.y=e.modulo(this.rotate.y,i),this.rotate.z=e.modulo(this.rotate.z,i)},a.subclass=function t(n){return function(r){function i(e){this.create(e||{})}return i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.defaults=e.extend({},n.defaults),e.extend(i.defaults,r),i.optionKeys=n.optionKeys.slice(0),Object.keys(i.defaults).forEach((function(e){1!=!i.optionKeys.indexOf(e)&&i.optionKeys.push(e)})),i.subclass=t(i),i}}(a),a}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3),n(6),n(8),n(4));else{var i=t.Zdog;i.Shape=r(i,i.Vector,i.PathCommand,i.Anchor)}}(this,(function(e,t,n,r){var i=r.subclass({stroke:1,fill:!1,color:"#333",closed:!0,visible:!0,path:[{}],front:{z:1},backface:!0});i.prototype.create=function(e){r.prototype.create.call(this,e),this.updatePath(),this.front=new t(e.front||this.front),this.renderFront=new t(this.front),this.renderNormal=new t};var o=["move","line","bezier","arc"];i.prototype.updatePath=function(){this.setPath(),this.updatePathCommands()},i.prototype.setPath=function(){},i.prototype.updatePathCommands=function(){var e;this.pathCommands=this.path.map((function(t,r){var i=Object.keys(t),a=i[0],s=t[a];1==i.length&&-1!=o.indexOf(a)||(a="line",s=t);var l="line"==a||"move"==a,c=Array.isArray(s);l&&!c&&(s=[s]);var u=new n(a=0===r?"move":a,s,e);return e=u.endRenderPoint,u}))},i.prototype.reset=function(){this.renderOrigin.set(this.origin),this.renderFront.set(this.front),this.pathCommands.forEach((function(e){e.reset()}))},i.prototype.transform=function(e,t,n){this.renderOrigin.transform(e,t,n),this.renderFront.transform(e,t,n),this.renderNormal.set(this.renderOrigin).subtract(this.renderFront),this.pathCommands.forEach((function(r){r.transform(e,t,n)})),this.children.forEach((function(r){r.transform(e,t,n)}))},i.prototype.updateSortValue=function(){var e=this.pathCommands.length,t=this.pathCommands[0].endRenderPoint,n=this.pathCommands[e-1].endRenderPoint;e>2&&t.isSame(n)&&(e-=1);for(var r=0,i=0;i0,this.backface||!this.isFacingBack)){if(!t)throw new Error("Zdog renderer required. Set to "+t);var r=1==n;t.isCanvas&&r?this.renderCanvasDot(e,t):this.renderPath(e,t)}};var a=e.TAU;return i.prototype.renderCanvasDot=function(e){var t=this.getLineWidth();if(t){e.fillStyle=this.getRenderColor();var n=this.pathCommands[0].endRenderPoint;e.beginPath();var r=t/2;e.arc(n.x,n.y,r,0,a),e.fill()}},i.prototype.getLineWidth=function(){return this.stroke?1==this.stroke?1:this.stroke:0},i.prototype.getRenderColor=function(){return"string"==typeof this.backface&&this.isFacingBack?this.backface:this.color},i.prototype.renderPath=function(e,t){var n=this.getRenderElement(e,t),r=!(2==this.pathCommands.length&&"line"==this.pathCommands[1].method)&&this.closed,i=this.getRenderColor();t.renderPath(e,n,this.pathCommands,r),t.stroke(e,n,this.stroke,i,this.getLineWidth()),t.fill(e,n,this.fill,i),t.end(e,n)},i.prototype.getRenderElement=function(e,t){if(t.isSvg)return this.svgElement||(this.svgElement=document.createElementNS("http://www.w3.org/2000/svg","path"),this.svgElement.setAttribute("stroke-linecap","round"),this.svgElement.setAttribute("stroke-linejoin","round")),this.svgElement},i}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(3));else{var i=t.Zdog;i.Vector=r(i)}}(this,(function(e){function t(e){this.set(e)}var n=e.TAU;function r(e,t,r,i){if(t&&t%n!=0){var o=Math.cos(t),a=Math.sin(t),s=e[r],l=e[i];e[r]=s*o-l*a,e[i]=l*o+s*a}}function i(e){return Math.abs(e-1)<1e-8?1:Math.sqrt(e)}return t.prototype.set=function(e){return this.x=e&&e.x||0,this.y=e&&e.y||0,this.z=e&&e.z||0,this},t.prototype.write=function(e){return e?(this.x=null!=e.x?e.x:this.x,this.y=null!=e.y?e.y:this.y,this.z=null!=e.z?e.z:this.z,this):this},t.prototype.rotate=function(e){if(e)return this.rotateZ(e.z),this.rotateY(e.y),this.rotateX(e.x),this},t.prototype.rotateZ=function(e){r(this,e,"x","y")},t.prototype.rotateX=function(e){r(this,e,"y","z")},t.prototype.rotateY=function(e){r(this,e,"x","z")},t.prototype.isSame=function(e){return!!e&&this.x===e.x&&this.y===e.y&&this.z===e.z},t.prototype.add=function(e){return e?(this.x+=e.x||0,this.y+=e.y||0,this.z+=e.z||0,this):this},t.prototype.subtract=function(e){return e?(this.x-=e.x||0,this.y-=e.y||0,this.z-=e.z||0,this):this},t.prototype.multiply=function(e){return null==e||("number"==typeof e?(this.x*=e,this.y*=e,this.z*=e):(this.x*=null!=e.x?e.x:1,this.y*=null!=e.y?e.y:1,this.z*=null!=e.z?e.z:1)),this},t.prototype.transform=function(e,t,n){return this.multiply(n),this.rotate(t),this.add(e),this},t.prototype.lerp=function(t,n){return this.x=e.lerp(this.x,t.x||0,n),this.y=e.lerp(this.y,t.y||0,n),this.z=e.lerp(this.z,t.z||0,n),this},t.prototype.magnitude=function(){return i(this.x*this.x+this.y*this.y+this.z*this.z)},t.prototype.magnitude2d=function(){return i(this.x*this.x+this.y*this.y)},t.prototype.copy=function(){return new t(this)},t}))},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}n.r(t),n.d(t,"gsap",(function(){return Gr})),n.d(t,"default",(function(){return Gr})),n.d(t,"CSSPlugin",(function(){return Hr})),n.d(t,"TweenMax",(function(){return Vr})),n.d(t,"TweenLite",(function(){return Yt})),n.d(t,"TimelineMax",(function(){return Bt})),n.d(t,"TimelineLite",(function(){return Bt})),n.d(t,"Power0",(function(){return _n})),n.d(t,"Power1",(function(){return Sn})),n.d(t,"Power2",(function(){return Mn})),n.d(t,"Power3",(function(){return En})),n.d(t,"Power4",(function(){return Tn})),n.d(t,"Linear",(function(){return Cn})),n.d(t,"Quad",(function(){return An})),n.d(t,"Cubic",(function(){return kn})),n.d(t,"Quart",(function(){return Pn})),n.d(t,"Quint",(function(){return Rn})),n.d(t,"Strong",(function(){return Ln})),n.d(t,"Elastic",(function(){return On})),n.d(t,"Back",(function(){return zn})),n.d(t,"SteppedEase",(function(){return Dn})),n.d(t,"Bounce",(function(){return Nn})),n.d(t,"Sine",(function(){return In})),n.d(t,"Expo",(function(){return Fn})),n.d(t,"Circ",(function(){return Bn}));var o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M,E,T,C,A,k,P,R,L,O={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},z={duration:.5,overwrite:!1,delay:0},D=1e8,N=2*Math.PI,I=N/4,F=0,B=Math.sqrt,j=Math.cos,U=Math.sin,H=function(e){return"string"==typeof e},G=function(e){return"function"==typeof e},V=function(e){return"number"==typeof e},W=function(e){return void 0===e},q=function(e){return"object"==typeof e},X=function(e){return!1!==e},Y=function(){return"undefined"!=typeof window},$=function(e){return G(e)||H(e)},Z="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},J=Array.isArray,Q=/(?:-?\.?\d|\.)+/gi,K=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ee=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,te=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ne=/[+-]=-?[.\d]+/,re=/[#\-+.]*\b[a-z\d-=+%.]+/gi,ie=/[\d.+\-=]+(?:e[-+]\d*)*/i,oe={},ae={},se=function(e){return(ae=Oe(e,oe))&&fn},le=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},ce=function(e,t){return!t&&console.warn(e)},ue=function(e,t){return e&&(oe[e]=t)&&ae&&(ae[e]=t)||oe},de=function(){return 0},he={},fe=[],pe={},me={},ge={},ve=30,ye=[],be="",xe=function(e){var t,n,r=e[0];if(q(r)||G(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=ye.length;n--&&!ye[n].targetTest(r););t=ye[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new It(e[n],t)))||e.splice(n,1);return e},we=function(e){return e._gsap||xe(it(e))[0]._gsap},_e=function(e,t,n){return(n=e[t])&&G(n)?e[t]():W(n)&&e.getAttribute&&e.getAttribute(t)||n},Se=function(e,t){return(e=e.split(",")).forEach(t)||e},Me=function(e){return Math.round(1e5*e)/1e5||0},Ee=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++re._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},je=function(e){return e._repeat?Ue(e._tTime,e=e.duration()+e._rDelay)*e:0},Ue=function(e,t){var n=Math.floor(e/=t);return e&&n===e?n-1:n},He=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Ge=function(e){return e._end=Me(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},Ve=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Me(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Ge(e),n._dirty||Be(n,e)),e},We=function(e,t){var n;if((t._time||t._initted&&!t._dur)&&(n=He(e.rawTime(),t),(!t._dur||et(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),Be(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},qe=function(e,t,n,r){return t.parent&&Fe(t),t._start=Me(n+t._delay),t._end=Me(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),function(e,t,n,r,i){void 0===n&&(n="_first"),void 0===r&&(r="_last");var o,a=e[r];if(i)for(o=t[i];a&&a[i]>o;)a=a._prev;a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e}(e,t,"_first","_last",e._sort?"_start":0),e._recent=t,r||We(e,t),e},Xe=function(e,t){return(oe.ScrollTrigger||le("scrollTrigger",t))&&oe.ScrollTrigger.create(t,e)},Ye=function(e,t,n,r){return Vt(e,t),e._initted?!n&&e._pt&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&d!==Mt.frame?(fe.push(e),e._lazy=[t,r],1):void 0:1},$e=function(e,t,n,r){var i=e._repeat,o=Me(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=o/e._dur),e._dur=o,e._tDur=i?i<0?1e10:Me(o*(i+1)+e._rDelay*i):o,a&&!r?Ve(e,e._tTime=e._tDur*a):e.parent&&Ge(e),n||Be(e.parent,e),e},Ze=function(e){return e instanceof Bt?Be(e):$e(e,e._dur)},Je={_start:0,endTime:de},Qe=function e(t,n){var r,i,o=t.labels,a=t._recent||Je,s=t.duration()>=D?a.endTime(!1):t._dur;return H(n)&&(isNaN(n)||n in o)?"<"===(r=n.charAt(0))||">"===r?("<"===r?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0):(r=n.indexOf("="))<0?(n in o||(o[n]=s),o[n]):(i=+(n.charAt(r-1)+n.substr(r+1)),r>1?e(t,n.substr(0,r-1))+i:s+i):null==n?s:+n},Ke=function(e,t){return e||0===e?t(e):t},et=function(e,t,n){return nt?t:n},tt=function(e){if("string"!=typeof e)return"";var t=ie.exec(e);return t?e.substr(t.index+t[0].length):""},nt=[].slice,rt=function(e,t){return e&&q(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&q(e[0]))&&!e.nodeType&&e!==s},it=function(e,t){return!H(e)||t||!l&&Et()?J(e)?function(e,t,n){return void 0===n&&(n=[]),e.forEach((function(e){var r;return H(e)&&!t||rt(e,1)?(r=n).push.apply(r,it(e)):n.push(e)}))||n}(e,t):rt(e)?nt.call(e,0):e?[e]:[]:nt.call(c.querySelectorAll(e),0)},ot=function(e){return e.sort((function(){return.5-Math.random()}))},at=function(e){if(G(e))return e;var t=q(e)?e:{each:e},n=Lt(t.ease),r=t.from||0,i=parseFloat(t.base)||0,o={},a=r>0&&r<1,s=isNaN(r)||a,l=t.axis,c=r,u=r;return H(r)?c=u={center:.5,edges:.5,end:1}[r]||0:!a&&s&&(c=r[0],u=r[1]),function(e,a,d){var h,f,p,m,g,v,y,b,x,w=(d||t).length,_=o[w];if(!_){if(!(x="auto"===t.grid?0:(t.grid||[1,D])[1])){for(y=-D;y<(y=d[x++].getBoundingClientRect().left)&&xy&&(y=g),gw?w-1:l?"y"===l?w/x:x:Math.max(x,w/x))||0)*("edges"===r?-1:1),_.b=w<0?i-w:i,_.u=tt(t.amount||t.each)||0,n=n&&w<0?Pt(n):n}return w=(_[e]-_.min)/_.max||0,Me(_.b+(n?n(w):w)*_.v)+_.u}},st=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){var r=Math.round(parseFloat(n)/e)*e*t;return(r-r%1)/t+(V(n)?0:tt(n))}},lt=function(e,t){var n,r,i=J(e);return!i&&q(e)&&(n=i=e.radius||D,e.values?(e=it(e.values),(r=!V(e[0]))&&(n*=n)):e=st(e.increment)),Ke(t,i?G(e)?function(t){return r=e(t),Math.abs(r-t)<=n?r:t}:function(t){for(var i,o,a=parseFloat(r?t.x:t),s=parseFloat(r?t.y:0),l=D,c=0,u=e.length;u--;)(i=r?(i=e[u].x-a)*i+(o=e[u].y-s)*o:Math.abs(e[u]-a))(i=Math.abs(i))&&(o=r,s=i);return o},pt=function(e,t,n){var r,i,o=e.vars,a=o[t];if(a)return r=o[t+"Params"],i=o.callbackScope||e,n&&fe.length&&Ce(),r?a.apply(i,r):a.call(i)},mt=function(e){return Fe(e),e.progress()<1&&pt(e,"onInterrupt"),e},gt={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],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]},vt=function(e,t,n){return 255*(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)+.5|0},yt=function(e,t,n){var r,i,o,a,s,l,c,u,d,h,f=e?V(e)?[e>>16,e>>8&255,255&e]:0:gt.black;if(!f){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),gt[e])f=gt[e];else if("#"===e.charAt(0)){if(e.length<6&&(r=e.charAt(1),i=e.charAt(2),o=e.charAt(3),e="#"+r+r+i+i+o+o+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(f=parseInt(e.substr(1,6),16))>>16,f>>8&255,255&f,parseInt(e.substr(7),16)/255];f=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]}else if("hsl"===e.substr(0,3))if(f=h=e.match(Q),t){if(~e.indexOf("="))return f=e.match(K),n&&f.length<4&&(f[3]=1),f}else a=+f[0]%360/360,s=+f[1]/100,r=2*(l=+f[2]/100)-(i=l<=.5?l*(s+1):l+s-l*s),f.length>3&&(f[3]*=1),f[0]=vt(a+1/3,r,i),f[1]=vt(a,r,i),f[2]=vt(a-1/3,r,i);else f=e.match(Q)||gt.transparent;f=f.map(Number)}return t&&!h&&(r=f[0]/255,i=f[1]/255,o=f[2]/255,l=((c=Math.max(r,i,o))+(u=Math.min(r,i,o)))/2,c===u?a=s=0:(d=c-u,s=l>.5?d/(2-c-u):d/(c+u),a=c===r?(i-o)/d+(iw&&(S+=a-_),((n=(i=(M+=a)-S)-T)>0||s)&&(o=++v.frame,y=i-1e3*v.time,v.time=i/=1e3,T+=n+(n>=E?4:E-n),r=1),s||(p=m(e)),r)for(b=0;b=t&&b--},_listeners:C=[]}),Et=function(){return!f&&Mt.wake()},Tt={},Ct=/^[\d.\-M][\d.\-,\s]/,At=/["']/g,kt=function(e){for(var t,n,r,i={},o=e.substr(1,e.length-3).split(":"),a=o[0],s=1,l=o.length;s1&&a.config?a.config.apply(null,~e.indexOf("{")?[kt(o[1])]:(t=e,n=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",n),t.substring(n,~i&&i=1?n:1,o=(r||(t?.3:.45))/(n<1?n:1),a=o/N*(Math.asin(1/i)||0),s=function(e){return 1===e?1:i*Math.pow(2,-10*e)*U((e-a)*o)+1},l="out"===t?s:"in"===t?function(e){return 1-s(1-e)}:zt(s);return o=N/o,l.config=function(n,r){return e(t,n,r)},l},Nt=function e(t,n){void 0===n&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i="out"===t?r:"in"===t?function(e){return 1-r(1-e)}:zt(r);return i.config=function(n){return e(t,n)},i};Se("Linear,Quad,Cubic,Quart,Quint,Strong",(function(e,t){var n=t<5?t+1:t;Ot(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},(function(e){return 1-Math.pow(1-e,n)}),(function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow(2*(1-e),n)/2}))})),Tt.Linear.easeNone=Tt.none=Tt.Linear.easeIn,Ot("Elastic",Dt("in"),Dt("out"),Dt()),k=7.5625,R=1/(P=2.75),Ot("Bounce",(function(e){return 1-L(1-e)}),L=function(e){return e0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,$e(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(Et(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(Ve(this,e),!n._dp||n.parent||We(n,this);n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e0||!this._tDur&&!e)&&qe(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),Ae(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+je(this))%this._dur||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?e:1-e)+je(this),t):this.duration()?Math.min(1,this._time/this._dur):this.ratio},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?Ue(this._tTime,n)+1:1},t.timeScale=function(e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var t=this.parent&&this._ts?He(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e}(this.totalTime(et(-this._delay,this._tDur,t),!0))},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Et(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&(this._tTime-=1e-8)&&1e-8!==Math.abs(this._zTime)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e;var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&qe(t,this,e-this._delay),this}return this._start},t.endTime=function(e){return this._start+(X(e)?this.totalDuration():this.duration())/Math.abs(this._ts)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?He(t.rawTime(e),this):this._tTime:this._tTime},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(t._ts||1),t=t._dp;return n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,Ze(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){return arguments.length?(this._rDelay=e,Ze(this)):this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(Qe(this,e),X(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,X(t))},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!(t&&!(this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e1?(t?(r[e]=t,n&&(r[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this;return new Promise((function(n){var r=G(e)?e:Pe,i=function(){var e=t.then;t.then=null,G(r)&&(r=r(t))&&(r.then||r===t)&&(t.then=e),n(r),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?i():t._prom=i}))},t.kill=function(){mt(this)},e}();Re(Ft.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var Bt=function(e){function t(t,n){var i;return void 0===t&&(t={}),(i=e.call(this,t,n)||this).labels={},i.smoothChildTiming=!!t.smoothChildTiming,i.autoRemoveChildren=!!t.autoRemoveChildren,i._sort=X(t.sortChildren),i.parent&&We(i.parent,r(i)),t.scrollTrigger&&Xe(r(i),t.scrollTrigger),i}i(t,e);var n=t.prototype;return n.to=function(e,t,n){return new Yt(e,Te(arguments,0,this),Qe(this,V(t)?arguments[3]:n)),this},n.from=function(e,t,n){return new Yt(e,Te(arguments,1,this),Qe(this,V(t)?arguments[3]:n)),this},n.fromTo=function(e,t,n,r){return new Yt(e,Te(arguments,2,this),Qe(this,V(t)?arguments[4]:r)),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,Ne(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new Yt(e,t,Qe(this,n),1),this},n.call=function(e,t,n){return qe(this,Yt.delayedCall(0,e,t),Qe(this,n))},n.staggerTo=function(e,t,n,r,i,o,a){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=o,n.onCompleteParams=a,n.parent=this,new Yt(e,n,Qe(this,i)),this},n.staggerFrom=function(e,t,n,r,i,o,a){return n.runBackwards=1,Ne(n).immediateRender=X(n.immediateRender),this.staggerTo(e,t,n,r,i,o,a)},n.staggerFromTo=function(e,t,n,r,i,o,a,s){return r.startAt=n,Ne(r).immediateRender=X(r.immediateRender),this.staggerTo(e,t,r,i,o,a,s)},n.render=function(e,t,n){var r,i,o,s,l,c,u,d,h,f,p,m,g=this._time,v=this._dirty?this.totalDuration():this._tDur,y=this._dur,b=this!==a&&e>v-1e-8&&e>=0?v:e<1e-8?0:e,x=this._zTime<0!=e<0&&(this._initted||!y);if(b!==this._tTime||n||x){if(g!==this._time&&y&&(b+=this._time-g,e+=this._time-g),r=b,h=this._start,c=!(d=this._ts),x&&(y||(g=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(p=this._yoyo,l=y+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*l+e,t,n);if(r=Me(b%l),b===v?(s=this._repeat,r=y):((s=~~(b/l))&&s===b/l&&(r=y,s--),r>y&&(r=y)),f=Ue(this._tTime,l),!g&&this._tTime&&f!==s&&(f=s),p&&1&s&&(r=y-r,m=1),s!==f&&!this._lock){var w=p&&1&f,_=w===(p&&1&s);if(st)for(r=e._first;r&&r._start<=n;){if(!r._dur&&"isPause"===r.data&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(!r._dur&&"isPause"===r.data&&r._start=0)&&!t&&pt(this,"onStart"),r>=g&&e>=0)for(i=this._first;i;){if(o=i._next,(i._act||r>=i._start)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!c){u=0,o&&(b+=this._zTime=-1e-8);break}}i=o}else{i=this._last;for(var S=e<0?e:r;i;){if(o=i._prev,(i._act||S<=i._end)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(S-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(S-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!c){u=0,o&&(b+=this._zTime=S?-1e-8:1e-8);break}}i=o}}if(u&&!t&&(this.pause(),u.render(r>=g?0:-1e-8)._zTime=r>=g?1:-1,this._ts))return this._start=h,Ge(this),this.render(e,t,n);this._onUpdate&&!t&&pt(this,"onUpdate",!0),(b===v&&v>=this.totalDuration()||!b&&g)&&(h!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((e||!y)&&(b===v&&this._ts>0||!b&&this._ts<0)&&Fe(this,1),t||e<0&&!g||!b&&!g||(pt(this,b===v?"onComplete":"onReverseComplete",!0),this._prom&&!(b0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(V(t)||(t=Qe(this,t)),!(e instanceof Ft)){if(J(e))return e.forEach((function(e){return n.add(e,t)})),this;if(H(e))return this.addLabel(e,t);if(!G(e))return this;e=Yt.delayedCall(0,e)}return this!==e?qe(this,e,t):this},n.getChildren=function(e,t,n,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=-D);for(var i=[],o=this._first;o;)o._start>=r&&(o instanceof Yt?t&&i.push(o):(n&&i.push(o),e&&i.push.apply(i,o.getChildren(!0,t,n)))),o=o._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return H(e)?this.removeLabel(e):G(e)?this.killTweensOf(e):(Ie(this,e),e===this._recent&&(this._recent=this._last),Be(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Me(Mt.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=Qe(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=Yt.delayedCall(0,t||de,n);return r.data="isPause",this._hasPause=1,qe(this,r,Qe(this,e))},n.removePause=function(e){var t=this._first;for(e=Qe(this,e);t;)t._start===e&&"isPause"===t.data&&Fe(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)jt!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,r=[],i=it(e),o=this._first,a=V(t);o;)o instanceof Yt?Ee(o._targets,i)&&(a?(!jt||o._initted&&o._ts)&&o.globalTime(0)<=t&&o.globalTime(o.totalDuration())>t:!t||o.isActive())&&r.push(o):(n=o.getTweensOf(i,t)).length&&r.push.apply(r,n),o=o._next;return r},n.tweenTo=function(e,t){t=t||{};var n=this,r=Qe(n,e),i=t,o=i.startAt,a=i.onStart,s=i.onStartParams,l=i.immediateRender,c=Yt.to(n,Re({ease:"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:t.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale())||1e-8,onStart:function(){n.pause();var e=t.duration||Math.abs((r-n._time)/n.timeScale());c._dur!==e&&$e(c,e,0,1).render(c._time,!0,!0),a&&a.apply(c,s||[])}},t));return l?c.render(0):c},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,Re({startAt:{time:Qe(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),ft(this,Qe(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),ft(this,Qe(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);for(var r,i=this._first,o=this.labels;i;)i._start>=n&&(i._start+=e,i._end+=e),i=i._next;if(t)for(r in o)o[r]>=n&&(o[r]+=e);return Be(this)},n.invalidate=function(){var t=this._first;for(this._lock=0;t;)t.invalidate(),t=t._next;return e.prototype.invalidate.call(this)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),Be(this)},n.totalDuration=function(e){var t,n,r,i=0,o=this,s=o._last,l=D;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-e:e));if(o._dirty){for(r=o.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(n=s._start)>l&&o._sort&&s._ts&&!o._lock?(o._lock=1,qe(o,s,n-s._delay,1)._lock=0):l=n,n<0&&s._ts&&(i-=n,(!r&&!o._dp||r&&r.smoothChildTiming)&&(o._start+=n/o._ts,o._time-=n,o._tTime-=n),o.shiftChildren(-n,!1,-1/0),l=0),s._end>i&&s._ts&&(i=s._end),s=t;$e(o,o===a&&o._time>i?o._time:i,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(e){if(a._ts&&(Ae(a,He(e,a)),d=Mt.frame),Mt.frame>=ve){ve+=O.autoSleep||120;var t=a._first;if((!t||!t._ts)&&O.autoSleep&&Mt._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||Mt.sleep()}}},t}(Ft);Re(Bt.prototype,{_lock:0,_hasPause:0,_forcing:0});var jt,Ut=function(e,t,n,r,i,o,a){var s,l,c,u,d,h,f,p,m=new cn(this._pt,e,t,0,1,nn,null,i),g=0,v=0;for(m.b=n,m.e=r,n+="",(f=~(r+="").indexOf("random("))&&(r=dt(r)),o&&(o(p=[n,r],e,t),n=p[0],r=p[1]),l=n.match(te)||[];s=te.exec(r);)u=s[0],d=r.substring(g,s.index),c?c=(c+1)%5:"rgba("===d.substr(-5)&&(c=1),u!==l[v++]&&(h=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:d||1===v?d:",",s:h,c:"="===u.charAt(1)?parseFloat(u.substr(2))*("-"===u.charAt(0)?-1:1):parseFloat(u)-h,m:c&&c<4?Math.round:0},g=te.lastIndex);return m.c=g0)k||(t._startAt=0);else if(P&&!(n<0&&R))return void(n&&(t._zTime=n))}else if(T&&P)if(R)!k&&(t._startAt=0);else if(n&&(w=!1),s=Re({overwrite:!1,data:"isFromStart",lazy:w&&X(_),immediateRender:w,stagger:0,parent:O},r),g&&(s[h.prop]=g),Fe(t._startAt=Yt.set(L,s)),w){if(!n)return}else e(t._startAt,1e-8);for(t._pt=0,_=P&&X(_)||_&&!P,i=0;i")}));else{if(h=A.length,m=w?at(w):de,q(w))for(f in w)~qt.indexOf(f)&&(g||(g={}),g[f]=w[f]);for(u=0;uf-1e-8&&e>=0?f:e<1e-8?0:e;if(p){if(m!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=e<0){if(r=m,u=this.timeline,this._repeat){if(a=p+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*a+e,t,n);if(r=Me(m%a),m===f?(o=this._repeat,r=p):((o=~~(m/a))&&o===m/a&&(r=p,o--),r>p&&(r=p)),(l=this._yoyo&&1&o)&&(d=this._yEase,r=p-r),s=Ue(this._tTime,a),r===h&&!n&&this._initted)return this;o!==s&&(u&&this._yEase&&Rt(u,l),!this.vars.repeatRefresh||l||this._lock||(this._lock=n=1,this.render(Me(a*o),!0).invalidate()._lock=0))}if(!this._initted){if(Ye(this,e<0?e:r,n,t))return this._tTime=0,this;if(p!==this._dur)return this.render(e,t,n)}for(this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=c=(d||this._ease)(r/p),this._from&&(this.ratio=c=1-c),r&&!h&&!t&&pt(this,"onStart"),i=this._pt;i;)i.r(c,i.d),i=i._next;u&&u.render(e<0?e:!r&&l?-1e-8:u._dur*c,t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(e<0&&this._startAt&&this._startAt.render(e,!0,n),pt(this,"onUpdate")),this._repeat&&o!==s&&this.vars.onRepeat&&!t&&this.parent&&pt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(e<0&&this._startAt&&!this._onUpdate&&this._startAt.render(e,!0,!0),(e||!p)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Fe(this,1),t||e<0&&!h||!m&&!h||(pt(this,m===f?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom()))}}else!function(e,t,n,r){var i,o,a,s=e.ratio,l=t<0||!t&&(!e._start&&function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))}(e)||(e._ts<0||e._dp._ts<0)&&"isFromStart"!==e.data&&"isStart"!==e.data)?0:1,c=e._rDelay,u=0;if(c&&e._repeat&&(u=et(0,e._tDur,t),o=Ue(u,c),a=Ue(e._tTime,c),e._yoyo&&1&o&&(l=1-l),o!==a&&(s=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==s||r||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&Ye(e,t,r,n))return;for(a=e._zTime,e._zTime=t||(n?1e-8:0),n||(n=t&&!a),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=u,n||pt(e,"onStart"),i=e._pt;i;)i.r(l,i.d),i=i._next;e._startAt&&t<0&&e._startAt.render(t,!0,!0),e._onUpdate&&!n&&pt(e,"onUpdate"),u&&e._repeat&&!n&&e.parent&&pt(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&Fe(e,1),n||(pt(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),e.prototype.invalidate.call(this)},n.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t))return this._lazy=this._pt=0,this.parent?mt(this):this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,jt&&!0!==jt.vars.overwrite)._first||mt(this),this.parent&&n!==this.timeline.totalDuration()&&$e(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,o,a,s,l,c,u=this._targets,d=e?it(e):u,h=this._ptLookup,f=this._pt;if((!t||"all"===t)&&function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0}(u,d))return"all"===t&&(this._pt=0),mt(this);for(r=this._op=this._op||[],"all"!==t&&(H(t)&&(s={},Se(t,(function(e){return s[e]=1})),t=s),t=function(e,t){var n,r,i,o,a=e[0]?we(e[0]).harness:0,s=a&&a.aliases;if(!s)return t;for(r in n=Oe({},t),s)if(r in n)for(i=(o=s[r].split(",")).length;i--;)n[o[i]]=n[r];return n}(u,t)),c=u.length;c--;)if(~d.indexOf(u[c]))for(s in i=h[c],"all"===t?(r[c]=t,a=i,o={}):(o=r[c]=r[c]||{},a=t),a)(l=i&&i[s])&&("kill"in l.d&&!0!==l.d.kill(s)||Ie(this,l,"_pt"),delete i[s]),"all"!==o&&(o[s]=1);return this._initted&&!this._pt&&f&&mt(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,n){return new t(e,Te(arguments,1))},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,n,r){return new t(e,Te(arguments,2))},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return a.killTweensOf(e,t,n)},t}(Ft);Re(Yt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Se("staggerTo,staggerFrom,staggerFromTo",(function(e){Yt[e]=function(){var t=new Bt,n=nt.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}}));var $t=function(e,t,n){return e[t]=n},Zt=function(e,t,n){return e[t](n)},Jt=function(e,t,n,r){return e[t](r.fp,n)},Qt=function(e,t,n){return e.setAttribute(t,n)},Kt=function(e,t){return G(e[t])?Zt:W(e[t])&&e.setAttribute?Qt:$t},en=function(e,t){return t.set(t.t,t.p,Math.round(1e4*(t.s+t.c*e))/1e4,t)},tn=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},nn=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(1===e&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round(1e4*(n.s+n.c*e))/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},rn=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},on=function(e,t,n,r){for(var i,o=this._pt;o;)i=o._next,o.p===r&&o.modifier(e,t,n),o=i},an=function(e){for(var t,n,r=this._pt;r;)n=r._next,r.p===e&&!r.op||r.op===e?Ie(this,r,"_pt"):r.dep||(t=1),r=n;return!t},sn=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},ln=function(e){for(var t,n,r,i,o=e._pt;o;){for(t=o._next,n=r;n&&n.pr>o.pr;)n=n._next;(o._prev=n?n._prev:i)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:i=o,o=t}e._pt=r},cn=function(){function e(e,t,n,r,i,o,a,s,l){this.t=t,this.s=r,this.c=i,this.p=n,this.r=o||en,this.d=a||this,this.set=s||$t,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=sn,this.m=e,this.mt=n,this.tween=t},e}();Se(be+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(e){return he[e]=1})),oe.TweenMax=oe.TweenLite=Yt,oe.TimelineLite=oe.TimelineMax=Bt,a=new Bt({sortChildren:!1,defaults:z,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),O.stringFilter=St;var un={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){var r=e.map((function(e){return fn.quickSetter(e,t,n)})),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var o=me[t],a=we(e),s=a.harness&&(a.harness.aliases||{})[t]||t,l=o?function(t){var r=new o;h._pt=0,r.init(e,n?t+n:t,h,0,[e]),r.render(1,r),h._pt&&rn(1,h)}:a.set(e,s);return o?l:function(t){return l(e,s,n?t+n:t,a,1)}},isTweening:function(e){return a.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Lt(e.ease,z.ease)),ze(z,e||{})},config:function(e){return ze(O,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach((function(e){return e&&!me[e]&&!oe[e]&&ce(t+" effect requires "+e+" plugin.")})),ge[t]=function(e,t,r){return n(it(e),Re(t||{},i),r)},o&&(Bt.prototype[t]=function(e,n,r){return this.add(ge[t](e,q(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){Tt[e]=Lt(t)},parseEase:function(e,t){return arguments.length?Lt(e,t):Tt},getById:function(e){return a.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,r,i=new Bt(e);for(i.smoothChildTiming=X(e.smoothChildTiming),a.remove(i),i._dp=0,i._time=i._tTime=a._time,n=a._first;n;)r=n._next,!t&&!n._dur&&n instanceof Yt&&n.vars.onComplete===n._targets[0]||qe(i,n,n._start-n._delay),n=r;return qe(a,i,0),i},utils:{wrap:function e(t,n,r){var i=n-t;return J(t)?ut(t,e(0,t.length),n):Ke(r,(function(e){return(i+(e-t)%i)%i+t}))},wrapYoyo:function e(t,n,r){var i=n-t,o=2*i;return J(t)?ut(t,e(0,t.length-1),n):Ke(r,(function(e){return t+((e=(o+(e-t)%o)%o||0)>i?o-e:e)}))},distribute:at,random:ct,snap:lt,normalize:function(e,t,n){return ht(e,t,0,1,n)},getUnit:tt,clamp:function(e,t,n){return Ke(n,(function(n){return et(e,t,n)}))},splitColor:yt,toArray:it,mapRange:ht,pipe:function(){for(var e=arguments.length,t=new Array(e),n=0;n=0?ur[i]:"")+e},hr=function(){"undefined"!=typeof window&&window.document&&(pn=window,mn=pn.document,gn=mn.documentElement,yn=lr("div")||{style:{}},bn=lr("div"),ar=dr(ar),sr=ar+"Origin",yn.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",wn=!!dr("perspective"),vn=1)},fr=function e(t){var n,r=lr("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,o=this.nextSibling,a=this.style.cssText;if(gn.appendChild(r),r.appendChild(this),this.style.display="block",t)try{n=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=e}catch(e){}else this._gsapBBox&&(n=this._gsapBBox());return i&&(o?i.insertBefore(this,o):i.appendChild(this)),gn.removeChild(r),this.style.cssText=a,n},pr=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},mr=function(e){var t;try{t=e.getBBox()}catch(n){t=fr.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===fr||(t=fr.call(e,!0)),!t||t.width||t.x||t.y?t:{x:+pr(e,["x","cx","x1"])||0,y:+pr(e,["y","cy","y1"])||0,width:0,height:0}},gr=function(e){return!(!e.getCTM||e.parentNode&&!e.ownerSVGElement||!mr(e))},vr=function(e,t){if(t){var n=e.style;t in jn&&t!==sr&&(t=ar),n.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),n.removeProperty(t.replace(Vn,"-$1").toLowerCase())):n.removeAttribute(t)}},yr=function(e,t,n,r,i,o){var a=new cn(e._pt,t,n,0,1,o?Kn:Qn);return e._pt=a,a.b=r,a.e=i,e._props.push(n),a},br={deg:1,rad:1,turn:1},xr=function e(t,n,r,i){var o,a,s,l,c=parseFloat(r)||0,u=(r+"").trim().substr((c+"").length)||"px",d=yn.style,h=Wn.test(n),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(h?"Width":"Height"),m="px"===i,g="%"===i;return i===u||!c||br[i]||br[u]?c:("px"!==u&&!m&&(c=e(t,n,r,"px")),l=t.getCTM&&gr(t),!g&&"%"!==u||!jn[n]&&!~n.indexOf("adius")?(d[h?"width":"height"]=100+(m?u:i),a=~n.indexOf("adius")||"em"===i&&t.appendChild&&!f?t:t.parentNode,l&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==mn&&a.appendChild||(a=mn.body),(s=a._gsap)&&g&&s.width&&h&&s.time===Mt.time?Me(c/s.width*100):((g||"%"===u)&&(d.position=cr(t,"position")),a===t&&(d.position="static"),a.appendChild(yn),o=yn[p],a.removeChild(yn),d.position="absolute",h&&g&&((s=we(a)).time=Mt.time,s.width=a[p]),Me(m?o*c/100:o&&c?100/o*c:0))):(o=l?t.getBBox()[h?"width":"height"]:t[p],Me(g?c/o*100:c/100*o)))},wr=function(e,t,n,r){var i;return vn||hr(),t in Xn&&"transform"!==t&&~(t=Xn[t]).indexOf(",")&&(t=t.split(",")[0]),jn[t]&&"transform"!==t?(i=Lr(e,r),i="transformOrigin"!==t?i[t]:Or(cr(e,sr))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=Er[t]&&Er[t](e,t,n)||cr(e,t)||_e(e,t)||("opacity"===t?1:0)),n&&!~(i+"").trim().indexOf(" ")?xr(e,t,i,n)+n:i},_r=function(e,t,n,r){if(!n||"none"===n){var i=dr(t,e,1),o=i&&cr(e,i,1);o&&o!==n?(t=i,n=o):"borderColor"===t&&(n=cr(e,"borderTopColor"))}var a,s,l,c,u,d,h,f,p,m,g,v,y=new cn(this._pt,e.style,t,0,1,nn),b=0,x=0;if(y.b=n,y.e=r,n+="","auto"===(r+="")&&(e.style[t]=r,r=cr(e,t)||r,e.style[t]=n),St(a=[n,r]),r=a[1],l=(n=a[0]).match(ee)||[],(r.match(ee)||[]).length){for(;s=ee.exec(r);)h=s[0],p=r.substring(b,s.index),u?u=(u+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(u=1),h!==(d=l[x++]||"")&&(c=parseFloat(d)||0,g=d.substr((c+"").length),(v="="===h.charAt(1)?+(h.charAt(0)+"1"):0)&&(h=h.substr(2)),f=parseFloat(h),m=h.substr((f+"").length),b=ee.lastIndex-m.length,m||(m=m||O.units[t]||g,b===r.length&&(r+=m,y.e+=m)),g!==m&&(c=xr(e,t,d,m)||0),y._pt={_next:y._pt,p:p||1===x?p:",",s:c,c:v?v*f:f-c,m:u&&u<4||"zIndex"===t?Math.round:0});y.c=b-1;)n=s[i],jn[n]&&(r=1,n="transformOrigin"===n?sr:ar),vr(o,n);r&&(vr(o,ar),l&&(l.svg&&o.removeAttribute("transform"),Lr(o,1),l.uncache=1))}},Er={clearProps:function(e,t,n,r,i){if("isFromStart"!==i.data){var o=e._pt=new cn(e._pt,t,n,0,0,Mr);return o.u=r,o.pr=-10,o.tween=i,e._props.push(n),1}}},Tr=[1,0,0,1,0,0],Cr={},Ar=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},kr=function(e){var t=cr(e,ar);return Ar(t)?Tr:t.substr(7).match(K).map(Me)},Pr=function(e,t){var n,r,i,o,a=e._gsap||we(e),s=e.style,l=kr(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Tr:l:(l!==Tr||e.offsetParent||e===gn||a.svg||(i=s.display,s.display="block",(n=e.parentNode)&&e.offsetParent||(o=1,r=e.nextSibling,gn.appendChild(e)),l=kr(e),i?s.display=i:vr(e,"display"),o&&(r?n.insertBefore(e,r):n?n.appendChild(e):gn.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},Rr=function(e,t,n,r,i,o){var a,s,l,c=e._gsap,u=i||Pr(e,!0),d=c.xOrigin||0,h=c.yOrigin||0,f=c.xOffset||0,p=c.yOffset||0,m=u[0],g=u[1],v=u[2],y=u[3],b=u[4],x=u[5],w=t.split(" "),_=parseFloat(w[0])||0,S=parseFloat(w[1])||0;n?u!==Tr&&(s=m*y-g*v)&&(l=_*(-g/s)+S*(m/s)-(m*x-g*b)/s,_=_*(y/s)+S*(-v/s)+(v*x-y*b)/s,S=l):(_=(a=mr(e)).x+(~w[0].indexOf("%")?_/100*a.width:_),S=a.y+(~(w[1]||w[0]).indexOf("%")?S/100*a.height:S)),r||!1!==r&&c.smooth?(b=_-d,x=S-h,c.xOffset=f+(b*m+x*v)-b,c.yOffset=p+(b*g+x*y)-x):c.xOffset=c.yOffset=0,c.xOrigin=_,c.yOrigin=S,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[sr]="0px 0px",o&&(yr(o,c,"xOrigin",d,_),yr(o,c,"yOrigin",h,S),yr(o,c,"xOffset",f,c.xOffset),yr(o,c,"yOffset",p,c.yOffset)),e.setAttribute("data-svg-origin",_+" "+S)},Lr=function(e,t){var n=e._gsap||new It(e);if("x"in n&&!t&&!n.uncache)return n;var r,i,o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M,E,T,C,A,k,P,R,L,z,D,N=e.style,I=n.scaleX<0,F=cr(e,sr)||"0";return r=i=o=l=c=u=d=h=f=0,a=s=1,n.svg=!(!e.getCTM||!gr(e)),g=Pr(e,n.svg),n.svg&&(T=!n.uncache&&e.getAttribute("data-svg-origin"),Rr(e,T||F,!!T||n.originIsAbsolute,!1!==n.smooth,g)),p=n.xOrigin||0,m=n.yOrigin||0,g!==Tr&&(x=g[0],w=g[1],_=g[2],S=g[3],r=M=g[4],i=E=g[5],6===g.length?(a=Math.sqrt(x*x+w*w),s=Math.sqrt(S*S+_*_),l=x||w?Gn(w,x)*Un:0,(d=_||S?Gn(_,S)*Un+l:0)&&(s*=Math.cos(d*Hn)),n.svg&&(r-=p-(p*x+m*_),i-=m-(p*w+m*S))):(D=g[6],L=g[7],k=g[8],P=g[9],R=g[10],z=g[11],r=g[12],i=g[13],o=g[14],c=(v=Gn(D,R))*Un,v&&(T=M*(y=Math.cos(-v))+k*(b=Math.sin(-v)),C=E*y+P*b,A=D*y+R*b,k=M*-b+k*y,P=E*-b+P*y,R=D*-b+R*y,z=L*-b+z*y,M=T,E=C,D=A),u=(v=Gn(-_,R))*Un,v&&(y=Math.cos(-v),z=S*(b=Math.sin(-v))+z*y,x=T=x*y-k*b,w=C=w*y-P*b,_=A=_*y-R*b),l=(v=Gn(w,x))*Un,v&&(T=x*(y=Math.cos(v))+w*(b=Math.sin(v)),C=M*y+E*b,w=w*y-x*b,E=E*y-M*b,x=T,M=C),c&&Math.abs(c)+Math.abs(l)>359.9&&(c=l=0,u=180-u),a=Me(Math.sqrt(x*x+w*w+_*_)),s=Me(Math.sqrt(E*E+D*D)),v=Gn(M,E),d=Math.abs(v)>2e-4?v*Un:0,f=z?1/(z<0?-z:z):0),n.svg&&(T=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!Ar(cr(e,ar)),T&&e.setAttribute("transform",T))),Math.abs(d)>90&&Math.abs(d)<270&&(I?(a*=-1,d+=l<=0?180:-180,l+=l<=0?180:-180):(s*=-1,d+=d<=0?180:-180)),n.x=r-((n.xPercent=r&&(n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-r)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+"px",n.y=i-((n.yPercent=i&&(n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+"px",n.z=o+"px",n.scaleX=Me(a),n.scaleY=Me(s),n.rotation=Me(l)+"deg",n.rotationX=Me(c)+"deg",n.rotationY=Me(u)+"deg",n.skewX=d+"deg",n.skewY=h+"deg",n.transformPerspective=f+"px",(n.zOrigin=parseFloat(F.split(" ")[2])||0)&&(N[sr]=Or(F)),n.xOffset=n.yOffset=0,n.force3D=O.force3D,n.renderTransform=n.svg?Ir:wn?Nr:Dr,n.uncache=0,n},Or=function(e){return(e=e.split(" "))[0]+" "+e[1]},zr=function(e,t,n){var r=tt(t);return Me(parseFloat(t)+parseFloat(xr(e,"x",n+"px",r)))+r},Dr=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Nr(e,t)},Nr=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,o=n.x,a=n.y,s=n.z,l=n.rotation,c=n.rotationY,u=n.rotationX,d=n.skewX,h=n.skewY,f=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,v=n.target,y=n.zOrigin,b="",x="auto"===g&&e&&1!==e||!0===g;if(y&&("0deg"!==u||"0deg"!==c)){var w,_=parseFloat(c)*Hn,S=Math.sin(_),M=Math.cos(_);_=parseFloat(u)*Hn,w=Math.cos(_),o=zr(v,o,S*w*-y),a=zr(v,a,-Math.sin(_)*-y),s=zr(v,s,M*w*-y+y)}"0px"!==m&&(b+="perspective("+m+") "),(r||i)&&(b+="translate("+r+"%, "+i+"%) "),(x||"0px"!==o||"0px"!==a||"0px"!==s)&&(b+="0px"!==s||x?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+") "),"0deg"!==l&&(b+="rotate("+l+") "),"0deg"!==c&&(b+="rotateY("+c+") "),"0deg"!==u&&(b+="rotateX("+u+") "),"0deg"===d&&"0deg"===h||(b+="skew("+d+", "+h+") "),1===f&&1===p||(b+="scale("+f+", "+p+") "),v.style[ar]=b||"translate(0, 0)"},Ir=function(e,t){var n,r,i,o,a,s=t||this,l=s.xPercent,c=s.yPercent,u=s.x,d=s.y,h=s.rotation,f=s.skewX,p=s.skewY,m=s.scaleX,g=s.scaleY,v=s.target,y=s.xOrigin,b=s.yOrigin,x=s.xOffset,w=s.yOffset,_=s.forceCSS,S=parseFloat(u),M=parseFloat(d);h=parseFloat(h),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),h+=p),h||f?(h*=Hn,f*=Hn,n=Math.cos(h)*m,r=Math.sin(h)*m,i=Math.sin(h-f)*-g,o=Math.cos(h-f)*g,f&&(p*=Hn,a=Math.tan(f-p),i*=a=Math.sqrt(1+a*a),o*=a,p&&(a=Math.tan(p),n*=a=Math.sqrt(1+a*a),r*=a)),n=Me(n),r=Me(r),i=Me(i),o=Me(o)):(n=m,o=g,r=i=0),(S&&!~(u+"").indexOf("px")||M&&!~(d+"").indexOf("px"))&&(S=xr(v,"x",u,"px"),M=xr(v,"y",d,"px")),(y||b||x||w)&&(S=Me(S+y-(y*n+b*i)+x),M=Me(M+b-(y*r+b*o)+w)),(l||c)&&(a=v.getBBox(),S=Me(S+l/100*a.width),M=Me(M+c/100*a.height)),a="matrix("+n+","+r+","+i+","+o+","+S+","+M+")",v.setAttribute("transform",a),_&&(v.style[ar]=a)},Fr=function(e,t,n,r,i,o){var a,s,l=H(i),c=parseFloat(i)*(l&&~i.indexOf("rad")?Un:1),u=o?c*o:c-r,d=r+u+"deg";return l&&("short"===(a=i.split("_")[1])&&(u%=360)!==u%180&&(u+=u<0?360:-360),"cw"===a&&u<0?u=(u+36e9)%360-360*~~(u/360):"ccw"===a&&u>0&&(u=(u-36e9)%360-360*~~(u/360))),e._pt=s=new cn(e._pt,t,n,r,u,$n),s.e=d,s.u="deg",e._props.push(n),s},Br=function(e,t,n){var r,i,o,a,s,l,c,u=bn.style,d=n._gsap;for(i in u.cssText=getComputedStyle(n).cssText+";position:absolute;display:block;",u[ar]=t,mn.body.appendChild(bn),r=Lr(bn,1),jn)(o=d[i])!==(a=r[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(s=tt(o)!==(c=tt(a))?xr(n,i,o,c):parseFloat(o),l=parseFloat(a),e._pt=new cn(e._pt,d,i,s,l-s,Yn),e._pt.u=c||0,e._props.push(i));mn.body.removeChild(bn)};Se("padding,margin,Width,Radius",(function(e,t){var n="Top",r="Right",i="Bottom",o="Left",a=(t<3?[n,r,i,o]:[n+o,n+r,i+r,i+o]).map((function(n){return t<2?e+n:"border"+n+e}));Er[t>1?"border"+e:e]=function(e,t,n,r,i){var o,s;if(arguments.length<4)return o=a.map((function(t){return wr(e,t,n)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(r+"").split(" "),s={},a.forEach((function(e,t){return s[e]=o[t]=o[t]||o[(t-1)/2|0]})),e.init(t,s,i)}}));var jr,Ur,Hr={name:"css",register:hr,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g,v,y,b,x,w,_,S,M=this._props,E=e.style,T=n.vars.startAt;for(d in vn||hr(),t)if("autoRound"!==d&&(a=t[d],!me[d]||!Gt(d,t,n,r,e,i)))if(c=typeof a,u=Er[d],"function"===c&&(c=typeof(a=a.call(n,r,e,i))),"string"===c&&~a.indexOf("random(")&&(a=dt(a)),u)u(this,e,d,a,n)&&(b=1);else if("--"===d.substr(0,2))o=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",h=tt(o),(f=tt(a))?h!==f&&(o=xr(e,d,o,f)+f):h&&(a+=h),this.add(E,"setProperty",o,a,r,i,0,0,d);else if("undefined"!==c){if(T&&d in T?(o="function"==typeof T[d]?T[d].call(n,r,e,i):T[d],d in O.units&&!tt(o)&&(o+=O.units[d]),"="===(o+"").charAt(1)&&(o=wr(e,d))):o=wr(e,d),l=parseFloat(o),(p="string"===c&&"="===a.charAt(1)?+(a.charAt(0)+"1"):0)&&(a=a.substr(2)),s=parseFloat(a),d in Xn&&("autoAlpha"===d&&(1===l&&"hidden"===wr(e,"visibility")&&s&&(l=0),yr(this,E,"visibility",l?"inherit":"hidden",s?"inherit":"hidden",!s)),"scale"!==d&&"transform"!==d&&~(d=Xn[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in jn)if(g||((v=e._gsap).renderTransform&&!t.parseTransform||Lr(e,t.parseTransform),y=!1!==t.smoothOrigin&&v.smooth,(g=this._pt=new cn(this._pt,E,ar,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new cn(this._pt,v,"scaleY",v.scaleY,p?p*s:s-v.scaleY),M.push("scaleY",d),d+="X";else{if("transformOrigin"===d){w=void 0,_=void 0,S=void 0,_=(w=(x=a).split(" "))[0],S=w[1]||"50%","top"!==_&&"bottom"!==_&&"left"!==S&&"right"!==S||(x=_,_=S,S=x),w[0]=Sr[_]||_,w[1]=Sr[S]||S,a=w.join(" "),v.svg?Rr(e,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==v.zOrigin&&yr(this,v,"zOrigin",v.zOrigin,f),yr(this,E,d,Or(o),Or(a)));continue}if("svgOrigin"===d){Rr(e,a,1,y,0,this);continue}if(d in Cr){Fr(this,v,d,l,a,p);continue}if("smoothOrigin"===d){yr(this,v,"smooth",v.smooth,a);continue}if("force3D"===d){v[d]=a;continue}if("transform"===d){Br(this,a,e);continue}}else d in E||(d=dr(d)||d);if(m||(s||0===s)&&(l||0===l)&&!qn.test(a)&&d in E)s||(s=0),(h=(o+"").substr((l+"").length))!==(f=tt(a)||(d in O.units?O.units[d]:h))&&(l=xr(e,d,o,f)),this._pt=new cn(this._pt,m?v:E,d,l,p?p*s:s-l,m||"px"!==f&&"zIndex"!==d||!1===t.autoRound?Yn:Jn),this._pt.u=f||0,h!==f&&(this._pt.b=o,this._pt.r=Zn);else if(d in E)_r.call(this,e,d,o,a);else{if(!(d in e)){le(d,a);continue}this.add(e,d,e[d],a,r,i)}M.push(d)}b&&ln(this)},get:wr,aliases:Xn,getSetter:function(e,t,n){var r=Xn[t];return r&&r.indexOf(",")<0&&(t=r),t in jn&&t!==sr&&(e._gsap.x||wr(e,"x"))?n&&xn===n?"scale"===t?rr:nr:(xn=n||{})&&("scale"===t?ir:or):e.style&&!W(e.style[t])?er:~t.indexOf("-")?tr:Kt(e,t)},core:{_removeProperty:vr,_getMatrix:Pr}};fn.utils.checkPrefix=dr,Ur=Se("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(jr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(e){jn[e]=1})),Se(jr,(function(e){O.units[e]="deg",Cr[e]=1})),Xn[Ur[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+jr,Se("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(e){var t=e.split(":");Xn[t[1]]=Ur[t[0]]})),Se("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(e){O.units[e]="px"})),fn.registerPlugin(Hr);var Gr=fn.registerPlugin(Hr)||fn,Vr=Gr.core.Tween},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(6));else{var i=t.Zdog;i.PathCommand=r(i.Vector)}}(this,(function(e){function t(t,i,o){this.method=t,this.points=i.map(n),this.renderPoints=i.map(r),this.previousPoint=o,this.endRenderPoint=this.renderPoints[this.renderPoints.length-1],"arc"==t&&(this.controlPoints=[new e,new e])}function n(t){return t instanceof e?t:new e(t)}function r(t){return new e(t)}return t.prototype.reset=function(){var e=this.points;this.renderPoints.forEach((function(t,n){var r=e[n];t.set(r)}))},t.prototype.transform=function(e,t,n){this.renderPoints.forEach((function(r){r.transform(e,t,n)}))},t.prototype.render=function(e,t,n){return this[this.method](e,t,n)},t.prototype.move=function(e,t,n){return n.move(e,t,this.renderPoints[0])},t.prototype.line=function(e,t,n){return n.line(e,t,this.renderPoints[0])},t.prototype.bezier=function(e,t,n){var r=this.renderPoints[0],i=this.renderPoints[1],o=this.renderPoints[2];return n.bezier(e,t,r,i,o)},t.prototype.arc=function(e,t,n){var r=this.previousPoint,i=this.renderPoints[0],o=this.renderPoints[1],a=this.controlPoints[0],s=this.controlPoints[1];return a.set(r).lerp(i,9/16),s.set(o).lerp(i,9/16),n.bezier(e,t,a,s,o)},t}))},function(e,t,n){!function(t,r){if(e.exports)e.exports=r(n(5));else{var i=t.Zdog;i.Ellipse=r(i.Shape)}}(this,(function(e){var t=e.subclass({diameter:1,width:void 0,height:void 0,quarters:4,closed:!1});return t.prototype.setPath=function(){var e=(null!=this.width?this.width:this.diameter)/2,t=(null!=this.height?this.height:this.diameter)/2;this.path=[{x:0,y:-t},{arc:[{x:e,y:-t},{x:e,y:0}]}],this.quarters>1&&this.path.push({arc:[{x:e,y:t},{x:0,y:t}]}),this.quarters>2&&this.path.push({arc:[{x:-e,y:t},{x:-e,y:0}]}),this.quarters>3&&this.path.push({arc:[{x:-e,y:-t},{x:0,y:-t}]})},t}))},function(e,t,n){"use strict";n.r(t),n.d(t,"ACESFilmicToneMapping",(function(){return ne})),n.d(t,"AddEquation",(function(){return E})),n.d(t,"AddOperation",(function(){return J})),n.d(t,"AdditiveAnimationBlendMode",(function(){return qt})),n.d(t,"AdditiveBlending",(function(){return w})),n.d(t,"AlphaFormat",(function(){return Ne})),n.d(t,"AlwaysDepth",(function(){return H})),n.d(t,"AlwaysStencilFunc",(function(){return Mn})),n.d(t,"AmbientLight",(function(){return Ld})),n.d(t,"AmbientLightProbe",(function(){return eh})),n.d(t,"AnimationClip",(function(){return Bu})),n.d(t,"AnimationLoader",(function(){return Xu})),n.d(t,"AnimationMixer",(function(){return Rh})),n.d(t,"AnimationObjectGroup",(function(){return kh})),n.d(t,"AnimationUtils",(function(){return Tu})),n.d(t,"ArcCurve",(function(){return td})),n.d(t,"ArrayCamera",(function(){return Ps})),n.d(t,"ArrowHelper",(function(){return wf})),n.d(t,"Audio",(function(){return dh})),n.d(t,"AudioAnalyser",(function(){return vh})),n.d(t,"AudioContext",(function(){return Jd})),n.d(t,"AudioListener",(function(){return uh})),n.d(t,"AudioLoader",(function(){return Qd})),n.d(t,"AxesHelper",(function(){return _f})),n.d(t,"AxisHelper",(function(){return bp})),n.d(t,"BackSide",(function(){return m})),n.d(t,"BasicDepthPacking",(function(){return on})),n.d(t,"BasicShadowMap",(function(){return u})),n.d(t,"BinaryTextureLoader",(function(){return Mp})),n.d(t,"Bone",(function(){return pl})),n.d(t,"BooleanKeyframeTrack",(function(){return Lu})),n.d(t,"BoundingBoxHelper",(function(){return xp})),n.d(t,"Box2",(function(){return Uh})),n.d(t,"Box3",(function(){return er})),n.d(t,"Box3Helper",(function(){return gf})),n.d(t,"BoxBufferGeometry",(function(){return mo})),n.d(t,"BoxGeometry",(function(){return Zl})),n.d(t,"BoxHelper",(function(){return mf})),n.d(t,"BufferAttribute",(function(){return Ei})),n.d(t,"BufferGeometry",(function(){return Xi})),n.d(t,"BufferGeometryLoader",(function(){return jd})),n.d(t,"ByteType",(function(){return Ee})),n.d(t,"Cache",(function(){return Uu})),n.d(t,"Camera",(function(){return xo})),n.d(t,"CameraHelper",(function(){return hf})),n.d(t,"CanvasRenderer",(function(){return Cp})),n.d(t,"CanvasTexture",(function(){return Gl})),n.d(t,"CatmullRomCurve3",(function(){return sd})),n.d(t,"CineonToneMapping",(function(){return te})),n.d(t,"CircleBufferGeometry",(function(){return Jl})),n.d(t,"CircleGeometry",(function(){return Ql})),n.d(t,"ClampToEdgeWrapping",(function(){return he})),n.d(t,"Clock",(function(){return ih})),n.d(t,"ClosedSplineCurve3",(function(){return gp})),n.d(t,"Color",(function(){return yi})),n.d(t,"ColorKeyframeTrack",(function(){return Ou})),n.d(t,"CompressedTexture",(function(){return Hl})),n.d(t,"CompressedTextureLoader",(function(){return Yu})),n.d(t,"ConeBufferGeometry",(function(){return nc})),n.d(t,"ConeGeometry",(function(){return tc})),n.d(t,"CubeCamera",(function(){return _o})),n.d(t,"CubeGeometry",(function(){return Zl})),n.d(t,"CubeReflectionMapping",(function(){return oe})),n.d(t,"CubeRefractionMapping",(function(){return ae})),n.d(t,"CubeTexture",(function(){return So})),n.d(t,"CubeTextureLoader",(function(){return Zu})),n.d(t,"CubeUVReflectionMapping",(function(){return ce})),n.d(t,"CubeUVRefractionMapping",(function(){return ue})),n.d(t,"CubicBezierCurve",(function(){return dd})),n.d(t,"CubicBezierCurve3",(function(){return hd})),n.d(t,"CubicInterpolant",(function(){return Au})),n.d(t,"CullFaceBack",(function(){return s})),n.d(t,"CullFaceFront",(function(){return l})),n.d(t,"CullFaceFrontBack",(function(){return c})),n.d(t,"CullFaceNone",(function(){return a})),n.d(t,"Curve",(function(){return Ku})),n.d(t,"CurvePath",(function(){return bd})),n.d(t,"CustomBlending",(function(){return M})),n.d(t,"CustomToneMapping",(function(){return re})),n.d(t,"CylinderBufferGeometry",(function(){return Kl})),n.d(t,"CylinderGeometry",(function(){return ec})),n.d(t,"Cylindrical",(function(){return Bh})),n.d(t,"DataTexture",(function(){return Eo})),n.d(t,"DataTexture2DArray",(function(){return $o})),n.d(t,"DataTexture3D",(function(){return Zo})),n.d(t,"DataTextureLoader",(function(){return Ju})),n.d(t,"DataUtils",(function(){return Ef})),n.d(t,"DecrementStencilOp",(function(){return fn})),n.d(t,"DecrementWrapStencilOp",(function(){return mn})),n.d(t,"DefaultLoadingManager",(function(){return Gu})),n.d(t,"DepthFormat",(function(){return He})),n.d(t,"DepthStencilFormat",(function(){return Ge})),n.d(t,"DepthTexture",(function(){return Vl})),n.d(t,"DirectionalLight",(function(){return Rd})),n.d(t,"DirectionalLightHelper",(function(){return cf})),n.d(t,"DiscreteInterpolant",(function(){return Pu})),n.d(t,"DodecahedronBufferGeometry",(function(){return ic})),n.d(t,"DodecahedronGeometry",(function(){return oc})),n.d(t,"DoubleSide",(function(){return g})),n.d(t,"DstAlphaFactor",(function(){return N})),n.d(t,"DstColorFactor",(function(){return F})),n.d(t,"DynamicBufferAttribute",(function(){return ap})),n.d(t,"DynamicCopyUsage",(function(){return Ln})),n.d(t,"DynamicDrawUsage",(function(){return Tn})),n.d(t,"DynamicReadUsage",(function(){return kn})),n.d(t,"EdgesGeometry",(function(){return uc})),n.d(t,"EdgesHelper",(function(){return wp})),n.d(t,"EllipseCurve",(function(){return ed})),n.d(t,"EqualDepth",(function(){return W})),n.d(t,"EqualStencilFunc",(function(){return bn})),n.d(t,"EquirectangularReflectionMapping",(function(){return se})),n.d(t,"EquirectangularRefractionMapping",(function(){return le})),n.d(t,"Euler",(function(){return Or})),n.d(t,"EventDispatcher",(function(){return Nn})),n.d(t,"ExtrudeBufferGeometry",(function(){return Fc})),n.d(t,"ExtrudeGeometry",(function(){return jc})),n.d(t,"Face3",(function(){return bi})),n.d(t,"Face4",(function(){return Wf})),n.d(t,"FaceColors",(function(){return $f})),n.d(t,"FileLoader",(function(){return qu})),n.d(t,"FlatShading",(function(){return v})),n.d(t,"Float16BufferAttribute",(function(){return Oi})),n.d(t,"Float32Attribute",(function(){return pp})),n.d(t,"Float32BufferAttribute",(function(){return zi})),n.d(t,"Float64Attribute",(function(){return mp})),n.d(t,"Float64BufferAttribute",(function(){return Di})),n.d(t,"FloatType",(function(){return Pe})),n.d(t,"Fog",(function(){return Fs})),n.d(t,"FogExp2",(function(){return Is})),n.d(t,"Font",(function(){return Xd})),n.d(t,"FontLoader",(function(){return $d})),n.d(t,"FrontSide",(function(){return p})),n.d(t,"Frustum",(function(){return Ao})),n.d(t,"GLBufferAttribute",(function(){return zh})),n.d(t,"GLSL1",(function(){return zn})),n.d(t,"GLSL3",(function(){return Dn})),n.d(t,"GammaEncoding",(function(){return Qt})),n.d(t,"Geometry",(function(){return $l})),n.d(t,"GeometryUtils",(function(){return Tp})),n.d(t,"GreaterDepth",(function(){return X})),n.d(t,"GreaterEqualDepth",(function(){return q})),n.d(t,"GreaterEqualStencilFunc",(function(){return Sn})),n.d(t,"GreaterStencilFunc",(function(){return wn})),n.d(t,"GridHelper",(function(){return rf})),n.d(t,"Group",(function(){return Rs})),n.d(t,"HalfFloatType",(function(){return Re})),n.d(t,"HemisphereLight",(function(){return Sd})),n.d(t,"HemisphereLightHelper",(function(){return nf})),n.d(t,"HemisphereLightProbe",(function(){return Kd})),n.d(t,"IcosahedronBufferGeometry",(function(){return Uc})),n.d(t,"IcosahedronGeometry",(function(){return Hc})),n.d(t,"ImageBitmapLoader",(function(){return Wd})),n.d(t,"ImageLoader",(function(){return $u})),n.d(t,"ImageUtils",(function(){return Gn})),n.d(t,"ImmediateRenderObject",(function(){return Wh})),n.d(t,"IncrementStencilOp",(function(){return hn})),n.d(t,"IncrementWrapStencilOp",(function(){return pn})),n.d(t,"InstancedBufferAttribute",(function(){return Bd})),n.d(t,"InstancedBufferGeometry",(function(){return Fd})),n.d(t,"InstancedInterleavedBuffer",(function(){return Oh})),n.d(t,"InstancedMesh",(function(){return _l})),n.d(t,"Int16Attribute",(function(){return up})),n.d(t,"Int16BufferAttribute",(function(){return ki})),n.d(t,"Int32Attribute",(function(){return hp})),n.d(t,"Int32BufferAttribute",(function(){return Ri})),n.d(t,"Int8Attribute",(function(){return sp})),n.d(t,"Int8BufferAttribute",(function(){return Ti})),n.d(t,"IntType",(function(){return Ae})),n.d(t,"InterleavedBuffer",(function(){return js})),n.d(t,"InterleavedBufferAttribute",(function(){return Hs})),n.d(t,"Interpolant",(function(){return Cu})),n.d(t,"InterpolateDiscrete",(function(){return Bt})),n.d(t,"InterpolateLinear",(function(){return jt})),n.d(t,"InterpolateSmooth",(function(){return Ut})),n.d(t,"InvertStencilOp",(function(){return gn})),n.d(t,"JSONLoader",(function(){return Ap})),n.d(t,"KeepStencilOp",(function(){return un})),n.d(t,"KeyframeTrack",(function(){return Ru})),n.d(t,"LOD",(function(){return sl})),n.d(t,"LatheBufferGeometry",(function(){return Gc})),n.d(t,"LatheGeometry",(function(){return Vc})),n.d(t,"Layers",(function(){return Nr})),n.d(t,"LensFlare",(function(){return Pp})),n.d(t,"LessDepth",(function(){return G})),n.d(t,"LessEqualDepth",(function(){return V})),n.d(t,"LessEqualStencilFunc",(function(){return xn})),n.d(t,"LessStencilFunc",(function(){return yn})),n.d(t,"Light",(function(){return _d})),n.d(t,"LightProbe",(function(){return Dd})),n.d(t,"Line",(function(){return kl})),n.d(t,"Line3",(function(){return Vh})),n.d(t,"LineBasicMaterial",(function(){return Sl})),n.d(t,"LineCurve",(function(){return fd})),n.d(t,"LineCurve3",(function(){return pd})),n.d(t,"LineDashedMaterial",(function(){return Mu})),n.d(t,"LineLoop",(function(){return Ol})),n.d(t,"LinePieces",(function(){return Xf})),n.d(t,"LineSegments",(function(){return Ll})),n.d(t,"LineStrip",(function(){return qf})),n.d(t,"LinearEncoding",(function(){return Zt})),n.d(t,"LinearFilter",(function(){return be})),n.d(t,"LinearInterpolant",(function(){return ku})),n.d(t,"LinearMipMapLinearFilter",(function(){return Se})),n.d(t,"LinearMipMapNearestFilter",(function(){return we})),n.d(t,"LinearMipmapLinearFilter",(function(){return _e})),n.d(t,"LinearMipmapNearestFilter",(function(){return xe})),n.d(t,"LinearToneMapping",(function(){return K})),n.d(t,"Loader",(function(){return Vu})),n.d(t,"LoaderUtils",(function(){return Id})),n.d(t,"LoadingManager",(function(){return Hu})),n.d(t,"LogLuvEncoding",(function(){return en})),n.d(t,"LoopOnce",(function(){return Nt})),n.d(t,"LoopPingPong",(function(){return Ft})),n.d(t,"LoopRepeat",(function(){return It})),n.d(t,"LuminanceAlphaFormat",(function(){return je})),n.d(t,"LuminanceFormat",(function(){return Be})),n.d(t,"MOUSE",(function(){return i})),n.d(t,"Material",(function(){return wi})),n.d(t,"MaterialLoader",(function(){return Nd})),n.d(t,"Math",(function(){return Bn})),n.d(t,"MathUtils",(function(){return Bn})),n.d(t,"Matrix3",(function(){return Un})),n.d(t,"Matrix4",(function(){return Er})),n.d(t,"MaxEquation",(function(){return k})),n.d(t,"Mesh",(function(){return ho})),n.d(t,"MeshBasicMaterial",(function(){return _i})),n.d(t,"MeshDepthMaterial",(function(){return Ms})),n.d(t,"MeshDistanceMaterial",(function(){return Es})),n.d(t,"MeshFaceMaterial",(function(){return Jf})),n.d(t,"MeshLambertMaterial",(function(){return _u})),n.d(t,"MeshMatcapMaterial",(function(){return Su})),n.d(t,"MeshNormalMaterial",(function(){return wu})),n.d(t,"MeshPhongMaterial",(function(){return bu})),n.d(t,"MeshPhysicalMaterial",(function(){return yu})),n.d(t,"MeshStandardMaterial",(function(){return vu})),n.d(t,"MeshToonMaterial",(function(){return xu})),n.d(t,"MinEquation",(function(){return A})),n.d(t,"MirroredRepeatWrapping",(function(){return fe})),n.d(t,"MixOperation",(function(){return Z})),n.d(t,"MultiMaterial",(function(){return Qf})),n.d(t,"MultiplyBlending",(function(){return S})),n.d(t,"MultiplyOperation",(function(){return $})),n.d(t,"NearestFilter",(function(){return pe})),n.d(t,"NearestMipMapLinearFilter",(function(){return ye})),n.d(t,"NearestMipMapNearestFilter",(function(){return ge})),n.d(t,"NearestMipmapLinearFilter",(function(){return ve})),n.d(t,"NearestMipmapNearestFilter",(function(){return me})),n.d(t,"NeverDepth",(function(){return U})),n.d(t,"NeverStencilFunc",(function(){return vn})),n.d(t,"NoBlending",(function(){return b})),n.d(t,"NoColors",(function(){return Yf})),n.d(t,"NoToneMapping",(function(){return Q})),n.d(t,"NormalAnimationBlendMode",(function(){return Wt})),n.d(t,"NormalBlending",(function(){return x})),n.d(t,"NotEqualDepth",(function(){return Y})),n.d(t,"NotEqualStencilFunc",(function(){return _n})),n.d(t,"NumberKeyframeTrack",(function(){return zu})),n.d(t,"Object3D",(function(){return Zr})),n.d(t,"ObjectLoader",(function(){return Ud})),n.d(t,"ObjectSpaceNormalMap",(function(){return ln})),n.d(t,"OctahedronBufferGeometry",(function(){return Wc})),n.d(t,"OctahedronGeometry",(function(){return qc})),n.d(t,"OneFactor",(function(){return R})),n.d(t,"OneMinusDstAlphaFactor",(function(){return I})),n.d(t,"OneMinusDstColorFactor",(function(){return B})),n.d(t,"OneMinusSrcAlphaFactor",(function(){return D})),n.d(t,"OneMinusSrcColorFactor",(function(){return O})),n.d(t,"OrthographicCamera",(function(){return kd})),n.d(t,"PCFShadowMap",(function(){return d})),n.d(t,"PCFSoftShadowMap",(function(){return h})),n.d(t,"PMREMGenerator",(function(){return Bf})),n.d(t,"ParametricBufferGeometry",(function(){return Xc})),n.d(t,"ParametricGeometry",(function(){return Yc})),n.d(t,"Particle",(function(){return ep})),n.d(t,"ParticleBasicMaterial",(function(){return rp})),n.d(t,"ParticleSystem",(function(){return tp})),n.d(t,"ParticleSystemMaterial",(function(){return ip})),n.d(t,"Path",(function(){return xd})),n.d(t,"PerspectiveCamera",(function(){return wo})),n.d(t,"Plane",(function(){return ei})),n.d(t,"PlaneBufferGeometry",(function(){return Ro})),n.d(t,"PlaneGeometry",(function(){return $c})),n.d(t,"PlaneHelper",(function(){return vf})),n.d(t,"PointCloud",(function(){return Kf})),n.d(t,"PointCloudMaterial",(function(){return np})),n.d(t,"PointLight",(function(){return Ad})),n.d(t,"PointLightHelper",(function(){return Qh})),n.d(t,"Points",(function(){return Bl})),n.d(t,"PointsMaterial",(function(){return zl})),n.d(t,"PolarGridHelper",(function(){return of})),n.d(t,"PolyhedronBufferGeometry",(function(){return rc})),n.d(t,"PolyhedronGeometry",(function(){return Zc})),n.d(t,"PositionalAudio",(function(){return gh})),n.d(t,"PropertyBinding",(function(){return Ah})),n.d(t,"PropertyMixer",(function(){return yh})),n.d(t,"QuadraticBezierCurve",(function(){return md})),n.d(t,"QuadraticBezierCurve3",(function(){return gd})),n.d(t,"Quaternion",(function(){return Zn})),n.d(t,"QuaternionKeyframeTrack",(function(){return Nu})),n.d(t,"QuaternionLinearInterpolant",(function(){return Du})),n.d(t,"REVISION",(function(){return r})),n.d(t,"RGBADepthPacking",(function(){return an})),n.d(t,"RGBAFormat",(function(){return Fe})),n.d(t,"RGBAIntegerFormat",(function(){return $e})),n.d(t,"RGBA_ASTC_10x10_Format",(function(){return yt})),n.d(t,"RGBA_ASTC_10x5_Format",(function(){return mt})),n.d(t,"RGBA_ASTC_10x6_Format",(function(){return gt})),n.d(t,"RGBA_ASTC_10x8_Format",(function(){return vt})),n.d(t,"RGBA_ASTC_12x10_Format",(function(){return bt})),n.d(t,"RGBA_ASTC_12x12_Format",(function(){return xt})),n.d(t,"RGBA_ASTC_4x4_Format",(function(){return st})),n.d(t,"RGBA_ASTC_5x4_Format",(function(){return lt})),n.d(t,"RGBA_ASTC_5x5_Format",(function(){return ct})),n.d(t,"RGBA_ASTC_6x5_Format",(function(){return ut})),n.d(t,"RGBA_ASTC_6x6_Format",(function(){return dt})),n.d(t,"RGBA_ASTC_8x5_Format",(function(){return ht})),n.d(t,"RGBA_ASTC_8x6_Format",(function(){return ft})),n.d(t,"RGBA_ASTC_8x8_Format",(function(){return pt})),n.d(t,"RGBA_BPTC_Format",(function(){return wt})),n.d(t,"RGBA_ETC2_EAC_Format",(function(){return at})),n.d(t,"RGBA_PVRTC_2BPPV1_Format",(function(){return rt})),n.d(t,"RGBA_PVRTC_4BPPV1_Format",(function(){return nt})),n.d(t,"RGBA_S3TC_DXT1_Format",(function(){return Je})),n.d(t,"RGBA_S3TC_DXT3_Format",(function(){return Qe})),n.d(t,"RGBA_S3TC_DXT5_Format",(function(){return Ke})),n.d(t,"RGBDEncoding",(function(){return rn})),n.d(t,"RGBEEncoding",(function(){return Kt})),n.d(t,"RGBEFormat",(function(){return Ue})),n.d(t,"RGBFormat",(function(){return Ie})),n.d(t,"RGBIntegerFormat",(function(){return Ye})),n.d(t,"RGBM16Encoding",(function(){return nn})),n.d(t,"RGBM7Encoding",(function(){return tn})),n.d(t,"RGB_ETC1_Format",(function(){return it})),n.d(t,"RGB_ETC2_Format",(function(){return ot})),n.d(t,"RGB_PVRTC_2BPPV1_Format",(function(){return tt})),n.d(t,"RGB_PVRTC_4BPPV1_Format",(function(){return et})),n.d(t,"RGB_S3TC_DXT1_Format",(function(){return Ze})),n.d(t,"RGFormat",(function(){return qe})),n.d(t,"RGIntegerFormat",(function(){return Xe})),n.d(t,"RawShaderMaterial",(function(){return gu})),n.d(t,"Ray",(function(){return Mr})),n.d(t,"Raycaster",(function(){return Dh})),n.d(t,"RectAreaLight",(function(){return Od})),n.d(t,"RedFormat",(function(){return Ve})),n.d(t,"RedIntegerFormat",(function(){return We})),n.d(t,"ReinhardToneMapping",(function(){return ee})),n.d(t,"RepeatWrapping",(function(){return de})),n.d(t,"ReplaceStencilOp",(function(){return dn})),n.d(t,"ReverseSubtractEquation",(function(){return C})),n.d(t,"RingBufferGeometry",(function(){return Jc})),n.d(t,"RingGeometry",(function(){return Qc})),n.d(t,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return Ot})),n.d(t,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Pt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Rt})),n.d(t,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return Lt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return zt})),n.d(t,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return Dt})),n.d(t,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return _t})),n.d(t,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return St})),n.d(t,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Mt})),n.d(t,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Et})),n.d(t,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Tt})),n.d(t,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ct})),n.d(t,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return At})),n.d(t,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return kt})),n.d(t,"Scene",(function(){return Bs})),n.d(t,"SceneUtils",(function(){return kp})),n.d(t,"ShaderChunk",(function(){return Lo})),n.d(t,"ShaderLib",(function(){return zo})),n.d(t,"ShaderMaterial",(function(){return bo})),n.d(t,"ShadowMaterial",(function(){return mu})),n.d(t,"Shape",(function(){return wd})),n.d(t,"ShapeBufferGeometry",(function(){return Kc})),n.d(t,"ShapeGeometry",(function(){return eu})),n.d(t,"ShapePath",(function(){return qd})),n.d(t,"ShapeUtils",(function(){return Dc})),n.d(t,"ShortType",(function(){return Te})),n.d(t,"Skeleton",(function(){return vl})),n.d(t,"SkeletonHelper",(function(){return Jh})),n.d(t,"SkinnedMesh",(function(){return fl})),n.d(t,"SmoothShading",(function(){return y})),n.d(t,"Sphere",(function(){return gr})),n.d(t,"SphereBufferGeometry",(function(){return tu})),n.d(t,"SphereGeometry",(function(){return nu})),n.d(t,"Spherical",(function(){return Fh})),n.d(t,"SphericalHarmonics3",(function(){return zd})),n.d(t,"Spline",(function(){return yp})),n.d(t,"SplineCurve",(function(){return vd})),n.d(t,"SplineCurve3",(function(){return vp})),n.d(t,"SpotLight",(function(){return Td})),n.d(t,"SpotLightHelper",(function(){return Xh})),n.d(t,"Sprite",(function(){return rl})),n.d(t,"SpriteMaterial",(function(){return Gs})),n.d(t,"SrcAlphaFactor",(function(){return z})),n.d(t,"SrcAlphaSaturateFactor",(function(){return j})),n.d(t,"SrcColorFactor",(function(){return L})),n.d(t,"StaticCopyUsage",(function(){return Rn})),n.d(t,"StaticDrawUsage",(function(){return En})),n.d(t,"StaticReadUsage",(function(){return An})),n.d(t,"StereoCamera",(function(){return rh})),n.d(t,"StreamCopyUsage",(function(){return On})),n.d(t,"StreamDrawUsage",(function(){return Cn})),n.d(t,"StreamReadUsage",(function(){return Pn})),n.d(t,"StringKeyframeTrack",(function(){return Iu})),n.d(t,"SubtractEquation",(function(){return T})),n.d(t,"SubtractiveBlending",(function(){return _})),n.d(t,"TOUCH",(function(){return o})),n.d(t,"TangentSpaceNormalMap",(function(){return sn})),n.d(t,"TetrahedronBufferGeometry",(function(){return ru})),n.d(t,"TetrahedronGeometry",(function(){return iu})),n.d(t,"TextBufferGeometry",(function(){return ou})),n.d(t,"TextGeometry",(function(){return au})),n.d(t,"Texture",(function(){return Wn})),n.d(t,"TextureLoader",(function(){return Qu})),n.d(t,"TorusBufferGeometry",(function(){return su})),n.d(t,"TorusGeometry",(function(){return lu})),n.d(t,"TorusKnotBufferGeometry",(function(){return cu})),n.d(t,"TorusKnotGeometry",(function(){return uu})),n.d(t,"Triangle",(function(){return di})),n.d(t,"TriangleFanDrawMode",(function(){return $t})),n.d(t,"TriangleStripDrawMode",(function(){return Yt})),n.d(t,"TrianglesDrawMode",(function(){return Xt})),n.d(t,"TubeBufferGeometry",(function(){return du})),n.d(t,"TubeGeometry",(function(){return hu})),n.d(t,"UVMapping",(function(){return ie})),n.d(t,"Uint16Attribute",(function(){return dp})),n.d(t,"Uint16BufferAttribute",(function(){return Pi})),n.d(t,"Uint32Attribute",(function(){return fp})),n.d(t,"Uint32BufferAttribute",(function(){return Li})),n.d(t,"Uint8Attribute",(function(){return lp})),n.d(t,"Uint8BufferAttribute",(function(){return Ci})),n.d(t,"Uint8ClampedAttribute",(function(){return cp})),n.d(t,"Uint8ClampedBufferAttribute",(function(){return Ai})),n.d(t,"Uniform",(function(){return Lh})),n.d(t,"UniformsLib",(function(){return Oo})),n.d(t,"UniformsUtils",(function(){return yo})),n.d(t,"UnsignedByteType",(function(){return Me})),n.d(t,"UnsignedInt248Type",(function(){return De})),n.d(t,"UnsignedIntType",(function(){return ke})),n.d(t,"UnsignedShort4444Type",(function(){return Le})),n.d(t,"UnsignedShort5551Type",(function(){return Oe})),n.d(t,"UnsignedShort565Type",(function(){return ze})),n.d(t,"UnsignedShortType",(function(){return Ce})),n.d(t,"VSMShadowMap",(function(){return f})),n.d(t,"Vector2",(function(){return jn})),n.d(t,"Vector3",(function(){return Jn})),n.d(t,"Vector4",(function(){return Xn})),n.d(t,"VectorKeyframeTrack",(function(){return Fu})),n.d(t,"Vertex",(function(){return op})),n.d(t,"VertexColors",(function(){return Zf})),n.d(t,"VideoTexture",(function(){return Ul})),n.d(t,"WebGL1Renderer",(function(){return Ns})),n.d(t,"WebGLCubeRenderTarget",(function(){return Mo})),n.d(t,"WebGLMultisampleRenderTarget",(function(){return $n})),n.d(t,"WebGLRenderTarget",(function(){return Yn})),n.d(t,"WebGLRenderTargetCube",(function(){return Ep})),n.d(t,"WebGLRenderer",(function(){return Ds})),n.d(t,"WebGLUtils",(function(){return ks})),n.d(t,"WireframeGeometry",(function(){return fu})),n.d(t,"WireframeHelper",(function(){return _p})),n.d(t,"WrapAroundEnding",(function(){return Vt})),n.d(t,"XHRLoader",(function(){return Sp})),n.d(t,"ZeroCurvatureEnding",(function(){return Ht})),n.d(t,"ZeroFactor",(function(){return P})),n.d(t,"ZeroSlopeEnding",(function(){return Gt})),n.d(t,"ZeroStencilOp",(function(){return cn})),n.d(t,"sRGBEncoding",(function(){return Jt}));const r="124",i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=0,s=1,l=2,c=3,u=0,d=1,h=2,f=3,p=0,m=1,g=2,v=1,y=2,b=0,x=1,w=2,_=3,S=4,M=5,E=100,T=101,C=102,A=103,k=104,P=200,R=201,L=202,O=203,z=204,D=205,N=206,I=207,F=208,B=209,j=210,U=0,H=1,G=2,V=3,W=4,q=5,X=6,Y=7,$=0,Z=1,J=2,Q=0,K=1,ee=2,te=3,ne=4,re=5,ie=300,oe=301,ae=302,se=303,le=304,ce=306,ue=307,de=1e3,he=1001,fe=1002,pe=1003,me=1004,ge=1004,ve=1005,ye=1005,be=1006,xe=1007,we=1007,_e=1008,Se=1008,Me=1009,Ee=1010,Te=1011,Ce=1012,Ae=1013,ke=1014,Pe=1015,Re=1016,Le=1017,Oe=1018,ze=1019,De=1020,Ne=1021,Ie=1022,Fe=1023,Be=1024,je=1025,Ue=Fe,He=1026,Ge=1027,Ve=1028,We=1029,qe=1030,Xe=1031,Ye=1032,$e=1033,Ze=33776,Je=33777,Qe=33778,Ke=33779,et=35840,tt=35841,nt=35842,rt=35843,it=36196,ot=37492,at=37496,st=37808,lt=37809,ct=37810,ut=37811,dt=37812,ht=37813,ft=37814,pt=37815,mt=37816,gt=37817,vt=37818,yt=37819,bt=37820,xt=37821,wt=36492,_t=37840,St=37841,Mt=37842,Et=37843,Tt=37844,Ct=37845,At=37846,kt=37847,Pt=37848,Rt=37849,Lt=37850,Ot=37851,zt=37852,Dt=37853,Nt=2200,It=2201,Ft=2202,Bt=2300,jt=2301,Ut=2302,Ht=2400,Gt=2401,Vt=2402,Wt=2500,qt=2501,Xt=0,Yt=1,$t=2,Zt=3e3,Jt=3001,Qt=3007,Kt=3002,en=3003,tn=3004,nn=3005,rn=3006,on=3200,an=3201,sn=0,ln=1,cn=0,un=7680,dn=7681,hn=7682,fn=7683,pn=34055,mn=34056,gn=5386,vn=512,yn=513,bn=514,xn=515,wn=516,_n=517,Sn=518,Mn=519,En=35044,Tn=35048,Cn=35040,An=35045,kn=35049,Pn=35041,Rn=35046,Ln=35050,On=35042,zn="100",Dn="300 es";function Nn(){}Object.assign(Nn.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}},dispatchEvent:function(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t>8&255]+In[e>>16&255]+In[e>>24&255]+"-"+In[255&t]+In[t>>8&255]+"-"+In[t>>16&15|64]+In[t>>24&255]+"-"+In[63&n|128]+In[n>>8&255]+"-"+In[n>>16&255]+In[n>>24&255]+In[255&r]+In[r>>8&255]+In[r>>16&255]+In[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Fn=e%2147483647),Fn=16807*Fn%2147483647,(Fn-1)/2147483646},degToRad:function(e){return e*Bn.DEG2RAD},radToDeg:function(e){return e*Bn.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((t+r)/2),u=a((t+r)/2),d=o((t-r)/2),h=a((t-r)/2),f=o((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(s*u,l*d,l*h,s*c);break;case"YZY":e.set(l*h,s*u,l*d,s*c);break;case"ZXZ":e.set(l*d,l*h,s*u,s*c);break;case"XZX":e.set(s*u,l*p,l*f,s*c);break;case"YXY":e.set(l*f,s*u,l*p,s*c);break;case"ZYZ":e.set(l*p,l*f,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class jn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Un{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),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.")}set(e,t,n,r,i,o,a,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],h=n[5],f=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],x=r[2],w=r[5],_=r[8];return i[0]=o*p+a*v+s*x,i[3]=o*m+a*y+s*w,i[6]=o*g+a*b+s*_,i[1]=l*p+c*v+u*x,i[4]=l*m+c*y+u*w,i[7]=l*g+c*b+u*_,i[2]=d*p+h*v+f*x,i[5]=d*m+h*y+f*w,i[8]=d*g+h*b+f*_,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*o*c-t*a*l-n*i*c+n*a*s+r*i*l-r*o*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=c*o-a*l,d=a*s-c*i,h=l*i-o*s,f=t*u+n*d+r*h;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return e[0]=u*p,e[1]=(r*l-c*n)*p,e[2]=(a*n-r*o)*p,e[3]=d*p,e[4]=(c*t-r*s)*p,e[5]=(r*i-a*t)*p,e[6]=h*p,e[7]=(n*s-l*t)*p,e[8]=(o*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,o,a){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*o+l*a)+o+e,-r*l,r*s,-r*(-l*o+s*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*l,r[6]=t*a+n*c,r[1]=-n*i+t*s,r[4]=-n*o+t*l,r[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}let Hn;const Gn={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Hn&&(Hn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Hn.width=e.width,Hn.height=e.height;const n=Hn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Hn}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let Vn=0;function Wn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wn.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wn.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:he,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:he,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:be,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:_e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Fe,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Me,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:Zt;Object.defineProperty(this,"id",{value:Vn++}),this.uuid=Bn.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=s,this.offset=new jn(0,0),this.repeat=new jn(1,1),this.center=new jn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Un,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}function qn(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Gn.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Wn.DEFAULT_IMAGE=void 0,Wn.DEFAULT_MAPPING=ie,Wn.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Wn,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={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){const r=this.image;if(void 0===r.uuid&&(r.uuid=Bn.generateUUID()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e1)switch(this.wrapS){case de:e.x=e.x-Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case fe:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case de:e.y=e.y-Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case fe:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Wn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Xn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const o=e.elements,a=o[0],s=o[4],l=o[8],c=o[1],u=o[5],d=o[9],h=o[2],f=o[6],p=o[10];if(Math.abs(s-c)<.01&&Math.abs(l-h)<.01&&Math.abs(d-f)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+h)<.1&&Math.abs(d+f)<.1&&Math.abs(a+u+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(a+1)/2,o=(u+1)/2,m=(p+1)/2,g=(s+c)/4,v=(l+h)/4,y=(d+f)/4;return e>o&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=v/n):o>m?o<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=g/r,i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=v/i,r=y/i),this.set(n,r,i,t),this}let m=Math.sqrt((f-d)*(f-d)+(l-h)*(l-h)+(c-s)*(c-s));return Math.abs(m)<.001&&(m=1),this.x=(f-d)/m,this.y=(l-h)/m,this.z=(c-s)/m,this.w=Math.acos((a+u+p-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){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(){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(){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(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}function Yn(e,t,n){this.width=e,this.height=t,this.scissor=new Xn(0,0,e,t),this.scissorTest=!1,this.viewport=new Xn(0,0,e,t),n=n||{},this.texture=new Wn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:be,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function $n(e,t,n){Yn.call(this,e,t,n),this.samples=4}Yn.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Yn,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),$n.prototype=Object.assign(Object.create(Yn.prototype),{constructor:$n,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Yn.prototype.copy.call(this,e),this.samples=e.samples,this}});class Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return n.copy(e).slerp(t,r)}static slerpFlat(e,t,n,r,i,o,a){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const d=i[o+0],h=i[o+1],f=i[o+2],p=i[o+3];if(u!==p||s!==d||l!==h||c!==f){let e=1-a;const t=s*d+l*h+c*f+u*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,t*n);e=Math.sin(e*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*e+d*i,l=l*e+h*i,c=c*e+f*i,u=u*e+p*i,e===1-a){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,o){const a=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[o],d=i[o+1],h=i[o+2],f=i[o+3];return e[t]=a*f+c*u+s*h-l*d,e[t+1]=s*f+c*d+l*u-a*h,e[t+2]=l*f+c*h+a*d-s*u,e[t+3]=c*f-a*u-s*d-l*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),d=s(n/2),h=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"YXZ":this._x=d*c*u+l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"ZXY":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u-d*h*f;break;case"ZYX":this._x=d*c*u-l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u+d*h*f;break;case"YZX":this._x=d*c*u+l*h*f,this._y=l*h*u+d*c*f,this._z=l*c*f-d*h*u,this._w=l*c*u-d*h*f;break;case"XZY":this._x=d*c*u-l*h*f,this._y=l*h*u-d*c*f,this._z=l*c*f+d*h*u,this._w=l*c*u+d*h*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+a+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(o-r)*e}else if(n>a&&n>u){const e=2*Math.sqrt(1+n-a-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(i+l)/e}else if(a>u){const e=2*Math.sqrt(1+a-n-u);this._w=(i-l)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-a);this._w=(o-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Bn.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+o*a+r*l-i*s,this._y=r*c+o*s+i*a-n*l,this._z=i*c+o*l+n*s-r*a,this._w=o*c-n*a-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,o=this._w;let a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const s=1-a*a;if(s<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,a),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Jn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Kn.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Kn.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l=s*t+o*r-a*n,c=s*n+a*t-i*r,u=s*r+i*n-o*t,d=-i*t-o*n-a*r;return this.x=l*s+d*-i+c*-a-u*-o,this.y=c*s+d*-o+u*-i-l*-a,this.z=u*s+d*-a+l*-o-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Qn.copy(this).projectOnVector(e),this.sub(Qn)}reflect(e){return this.sub(Qn.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Bn.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Qn=new Jn,Kn=new Zn;class er{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Jn(1/0,1/0,1/0),this.max=void 0!==t?t:new Jn(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,l=e.length;si&&(i=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,l=e.count;si&&(i=l),c>o&&(o=c),u>a&&(a=u)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Jn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,rr),rr.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(dr),hr.subVectors(this.max,dr),or.subVectors(e.a,dr),ar.subVectors(e.b,dr),sr.subVectors(e.c,dr),lr.subVectors(ar,or),cr.subVectors(sr,ar),ur.subVectors(or,sr);let t=[0,-lr.z,lr.y,0,-cr.z,cr.y,0,-ur.z,ur.y,lr.z,0,-lr.x,cr.z,0,-cr.x,ur.z,0,-ur.x,-lr.y,lr.x,0,-cr.y,cr.x,0,-ur.y,ur.x,0];return!!tr(t,or,ar,sr,hr)&&(t=[1,0,0,0,1,0,0,0,1],!!tr(t,or,ar,sr,hr)&&(fr.crossVectors(lr,cr),t=[fr.x,fr.y,fr.z],tr(t,or,ar,sr,hr)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Jn),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return rr.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(rr).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(nr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nr)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function tr(e,t,n,r,i){for(let o=0,a=e.length-3;o<=a;o+=3){pr.fromArray(e,o);const a=i.x*Math.abs(pr.x)+i.y*Math.abs(pr.y)+i.z*Math.abs(pr.z),s=t.dot(pr),l=n.dot(pr),c=r.dot(pr);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>a)return!1}return!0}const nr=[new Jn,new Jn,new Jn,new Jn,new Jn,new Jn,new Jn,new Jn],rr=new Jn,ir=new er,or=new Jn,ar=new Jn,sr=new Jn,lr=new Jn,cr=new Jn,ur=new Jn,dr=new Jn,hr=new Jn,fr=new Jn,pr=new Jn,mr=new er;class gr{constructor(e,t){this.center=void 0!==e?e:new Jn,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):mr.setFromPoints(e).getCenter(n);let r=0;for(let i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new er),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const vr=new Jn,yr=new Jn,br=new Jn,xr=new Jn,wr=new Jn,_r=new Jn,Sr=new Jn;class Mr{constructor(e,t){this.origin=void 0!==e?e:new Jn,this.direction=void 0!==t?t:new Jn(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Jn),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,vr)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Jn),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=vr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(vr.copy(this.direction).multiplyScalar(t).add(this.origin),vr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){yr.copy(e).add(t).multiplyScalar(.5),br.copy(t).sub(e).normalize(),xr.copy(this.origin).sub(yr);const i=.5*e.distanceTo(t),o=-this.direction.dot(br),a=xr.dot(this.direction),s=-xr.dot(br),l=xr.lengthSq(),c=Math.abs(1-o*o);let u,d,h,f;if(c>0)if(u=o*s-a,d=o*a-s,f=i*c,u>=0)if(d>=-f)if(d<=f){const e=1/c;u*=e,d*=e,h=u*(u+o*d+2*a)+d*(o*u+d+2*s)+l}else d=i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;else d=-i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;else d<=-f?(u=Math.max(0,-(-o*i+a)),d=u>0?-i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l):d<=f?(u=0,d=Math.min(Math.max(-i,-s),i),h=d*(d+2*s)+l):(u=Math.max(0,-(o*i+a)),d=u>0?i:Math.min(Math.max(-i,-s),i),h=-u*u+d*(d+2*s)+l);else d=o>0?-i:i,u=Math.max(0,-(o*d+a)),h=-u*u+d*(d+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(br).multiplyScalar(d).add(yr),h}intersectSphere(e,t){vr.subVectors(e.center,this.origin);const n=vr.dot(this.direction),r=vr.dot(vr)-n*n,i=e.radius*e.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,o,a,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,o=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,o=(e.min.y-d.y)*c),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(a=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,vr)}intersectTriangle(e,t,n,r,i){wr.subVectors(t,e),_r.subVectors(n,e),Sr.crossVectors(wr,_r);let o,a=this.direction.dot(Sr);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}xr.subVectors(this.origin,e);const s=o*this.direction.dot(_r.crossVectors(xr,_r));if(s<0)return null;const l=o*this.direction.dot(wr.cross(xr));if(l<0)return null;if(s+l>a)return null;const c=-o*xr.dot(Sr);return c<0?null:this.at(c/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class Er{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),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.")}set(e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=h,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Er).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Tr.setFromMatrixColumn(e,0).length(),i=1/Tr.setFromMatrixColumn(e,1).length(),o=1/Tr.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=o*c,n=o*u,r=a*c,i=a*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=o*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*a,t[4]=r*a-n,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=o*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*a,t[4]=-o*u,t[8]=r+n*a,t[1]=n+r*a,t[5]=o*c,t[9]=i-e*a,t[2]=-o*l,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){const e=o*c,n=o*u,r=a*c,i=a*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){const e=o*s,n=o*l,r=a*s,i=a*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=o*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=o*s,n=o*l,r=a*s,i=a*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=o*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=a*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Ar,e,kr)}lookAt(e,t,n){const r=this.elements;return Lr.subVectors(e,t),0===Lr.lengthSq()&&(Lr.z=1),Lr.normalize(),Pr.crossVectors(n,Lr),0===Pr.lengthSq()&&(1===Math.abs(n.z)?Lr.x+=1e-4:Lr.z+=1e-4,Lr.normalize(),Pr.crossVectors(n,Lr)),Pr.normalize(),Rr.crossVectors(Lr,Pr),r[0]=Pr.x,r[4]=Rr.x,r[8]=Lr.x,r[1]=Pr.y,r[5]=Rr.y,r[9]=Lr.y,r[2]=Pr.z,r[6]=Rr.z,r[10]=Lr.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],h=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],w=r[0],_=r[4],S=r[8],M=r[12],E=r[1],T=r[5],C=r[9],A=r[13],k=r[2],P=r[6],R=r[10],L=r[14],O=r[3],z=r[7],D=r[11],N=r[15];return i[0]=o*w+a*E+s*k+l*O,i[4]=o*_+a*T+s*P+l*z,i[8]=o*S+a*C+s*R+l*D,i[12]=o*M+a*A+s*L+l*N,i[1]=c*w+u*E+d*k+h*O,i[5]=c*_+u*T+d*P+h*z,i[9]=c*S+u*C+d*R+h*D,i[13]=c*M+u*A+d*L+h*N,i[2]=f*w+p*E+m*k+g*O,i[6]=f*_+p*T+m*P+g*z,i[10]=f*S+p*C+m*R+g*D,i[14]=f*M+p*A+m*L+g*N,i[3]=v*w+y*E+b*k+x*O,i[7]=v*_+y*T+b*P+x*z,i[11]=v*S+y*C+b*R+x*D,i[15]=v*M+y*A+b*L+x*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],h=e[14];return e[3]*(+i*s*u-r*l*u-i*a*d+n*l*d+r*a*h-n*s*h)+e[7]*(+t*s*h-t*l*d+i*o*d-r*o*h+r*l*c-i*s*c)+e[11]*(+t*l*u-t*a*h-i*o*u+n*o*h+i*a*c-n*l*c)+e[15]*(-r*a*c-t*s*u+t*a*d+r*o*u-n*o*d+n*s*c)}transpose(){const e=this.elements;let t;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(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],h=e[11],f=e[12],p=e[13],m=e[14],g=e[15],v=u*m*l-p*d*l+p*s*h-a*m*h-u*s*g+a*d*g,y=f*d*l-c*m*l-f*s*h+o*m*h+c*s*g-o*d*g,b=c*p*l-f*u*l+f*a*h-o*p*h-c*a*g+o*u*g,x=f*u*s-c*p*s-f*a*d+o*p*d+c*a*m-o*u*m,w=t*v+n*y+r*b+i*x;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/w;return e[0]=v*_,e[1]=(p*d*i-u*m*i-p*r*h+n*m*h+u*r*g-n*d*g)*_,e[2]=(a*m*i-p*s*i+p*r*l-n*m*l-a*r*g+n*s*g)*_,e[3]=(u*s*i-a*d*i-u*r*l+n*d*l+a*r*h-n*s*h)*_,e[4]=y*_,e[5]=(c*m*i-f*d*i+f*r*h-t*m*h-c*r*g+t*d*g)*_,e[6]=(f*s*i-o*m*i-f*r*l+t*m*l+o*r*g-t*s*g)*_,e[7]=(o*d*i-c*s*i+c*r*l-t*d*l-o*r*h+t*s*h)*_,e[8]=b*_,e[9]=(f*u*i-c*p*i-f*n*h+t*p*h+c*n*g-t*u*g)*_,e[10]=(o*p*i-f*a*i+f*n*l-t*p*l-o*n*g+t*a*g)*_,e[11]=(c*a*i-o*u*i-c*n*l+t*u*l+o*n*h-t*a*h)*_,e[12]=x*_,e[13]=(c*p*r-f*u*r+f*n*d-t*p*d-c*n*m+t*u*m)*_,e[14]=(f*a*r-o*p*r-f*n*s+t*p*s+o*n*m-t*a*m)*_,e[15]=(o*u*r-c*a*r+c*n*s-t*u*s-o*n*d+t*a*d)*_,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,l=i*o,c=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,c*a+n,c*s-r*o,0,l*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,l=i+i,c=o+o,u=a+a,d=i*l,h=i*c,f=i*u,p=o*c,m=o*u,g=a*u,v=s*l,y=s*c,b=s*u,x=n.x,w=n.y,_=n.z;return r[0]=(1-(p+g))*x,r[1]=(h+b)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(h-b)*w,r[5]=(1-(d+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(f+y)*_,r[9]=(m-v)*_,r[10]=(1-(d+p))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Tr.set(r[0],r[1],r[2]).length();const o=Tr.set(r[4],r[5],r[6]).length(),a=Tr.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Cr.copy(this);const s=1/i,l=1/o,c=1/a;return Cr.elements[0]*=s,Cr.elements[1]*=s,Cr.elements[2]*=s,Cr.elements[4]*=l,Cr.elements[5]*=l,Cr.elements[6]*=l,Cr.elements[8]*=c,Cr.elements[9]*=c,Cr.elements[10]*=c,t.setFromRotationMatrix(Cr),n.x=i,n.y=o,n.z=a,this}makePerspective(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),d=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,o){const a=this.elements,s=1/(t-e),l=1/(n-r),c=1/(o-i),u=(t+e)*s,d=(n+r)*l,h=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const Tr=new Jn,Cr=new Er,Ar=new Jn(0,0,0),kr=new Jn(1,1,1),Pr=new Jn,Rr=new Jn,Lr=new Jn;class Or{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Or.DefaultOrder;Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=Bn.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],h=i[6],f=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(h,f),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(h,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return zr.makeRotationFromQuaternion(e),this.setFromRotationMatrix(zr,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return Dr.setFromEuler(this),this.setFromQuaternion(Dr,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new Jn(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Or.DefaultOrder="XYZ",Or.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const zr=new Er,Dr=new Zn;class Nr{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function o(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let n=0;n1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Jn),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Kr.getNormalMatrix(e),r=this.coplanarPoint(Jr).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const ti=new Jn,ni=new Jn,ri=new Jn,ii=new Jn,oi=new Jn,ai=new Jn,si=new Jn,li=new Jn,ci=new Jn,ui=new Jn;class di{constructor(e,t,n){this.a=void 0!==e?e:new Jn,this.b=void 0!==t?t:new Jn,this.c=void 0!==n?n:new Jn}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Jn),r.subVectors(n,t),ti.subVectors(e,t),r.cross(ti);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){ti.subVectors(r,t),ni.subVectors(n,t),ri.subVectors(e,t);const o=ti.dot(ti),a=ti.dot(ni),s=ti.dot(ri),l=ni.dot(ni),c=ni.dot(ri),u=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Jn),0===u)return i.set(-2,-1,-1);const d=1/u,h=(l*s-a*c)*d,f=(o*c-a*s)*d;return i.set(1-h-f,f,h)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ii),ii.x>=0&&ii.y>=0&&ii.x+ii.y<=1}static getUV(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,ii),s.set(0,0),s.addScaledVector(i,ii.x),s.addScaledVector(o,ii.y),s.addScaledVector(a,ii.z),s}static isFrontFacing(e,t,n,r){return ti.subVectors(n,t),ni.subVectors(e,t),ti.cross(ni).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ti.subVectors(this.c,this.b),ni.subVectors(this.a,this.b),.5*ti.cross(ni).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Jn),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return di.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new ei),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return di.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return di.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return di.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return di.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Jn);const n=this.a,r=this.b,i=this.c;let o,a;oi.subVectors(r,n),ai.subVectors(i,n),li.subVectors(e,n);const s=oi.dot(li),l=ai.dot(li);if(s<=0&&l<=0)return t.copy(n);ci.subVectors(e,r);const c=oi.dot(ci),u=ai.dot(ci);if(c>=0&&u<=c)return t.copy(r);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return o=s/(s-c),t.copy(n).addScaledVector(oi,o);ui.subVectors(e,i);const h=oi.dot(ui),f=ai.dot(ui);if(f>=0&&h<=f)return t.copy(i);const p=h*l-s*f;if(p<=0&&l>=0&&f<=0)return a=l/(l-f),t.copy(n).addScaledVector(ai,a);const m=c*f-h*u;if(m<=0&&u-c>=0&&h-f>=0)return si.subVectors(i,r),a=(u-c)/(u-c+(h-f)),t.copy(r).addScaledVector(si,a);const g=1/(m+p+d);return o=p*g,a=d*g,t.copy(n).addScaledVector(oi,o).addScaledVector(ai,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const hi={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},fi={h:0,s:0,l:0},pi={h:0,s:0,l:0};function mi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function gi(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function vi(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class yi{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=Bn.euclideanModulo(e,1),t=Bn.clamp(t,0,1),n=Bn.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=mi(i,r,e+1/3),this.g=mi(i,r,e),this.b=mi(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=hi[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=gi(e.r),this.g=gi(e.g),this.b=gi(e.b),this}copyLinearToSRGB(e){return this.r=vi(e.r),this.g=vi(e.g),this.b=vi(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),o=Math.min(t,n,r);let a,s;const l=(o+i)/2;if(o===i)a=0,s=0;else{const e=i-o;switch(s=l<=.5?e/(i+o):e/(2-i-o),i){case t:a=(n-r)/e+(n1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}yi.NAMES=hi,yi.prototype.r=1,yi.prototype.g=1,yi.prototype.b=1;class bi{constructor(e,t,n,r,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Jn,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new yi,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=o}clone(){return(new this.constructor).copy(this)}copy(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(let t=0,n=e.vertexNormals.length;t0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(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),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(wi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),_i.prototype=Object.create(wi.prototype),_i.prototype.constructor=_i,_i.prototype.isMeshBasicMaterial=!0,_i.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};const Si=new Jn,Mi=new jn;function Ei(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=En,this.updateRange={offset:0,count:-1},this.version=0}function Ti(e,t,n){Ei.call(this,new Int8Array(e),t,n)}function Ci(e,t,n){Ei.call(this,new Uint8Array(e),t,n)}function Ai(e,t,n){Ei.call(this,new Uint8ClampedArray(e),t,n)}function ki(e,t,n){Ei.call(this,new Int16Array(e),t,n)}function Pi(e,t,n){Ei.call(this,new Uint16Array(e),t,n)}function Ri(e,t,n){Ei.call(this,new Int32Array(e),t,n)}function Li(e,t,n){Ei.call(this,new Uint32Array(e),t,n)}function Oi(e,t,n){Ei.call(this,new Uint16Array(e),t,n)}function zi(e,t,n){Ei.call(this,new Float32Array(e),t,n)}function Di(e,t,n){Ei.call(this,new Float64Array(e),t,n)}Object.defineProperty(Ei.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Ei.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Ti.prototype=Object.create(Ei.prototype),Ti.prototype.constructor=Ti,Ci.prototype=Object.create(Ei.prototype),Ci.prototype.constructor=Ci,Ai.prototype=Object.create(Ei.prototype),Ai.prototype.constructor=Ai,ki.prototype=Object.create(Ei.prototype),ki.prototype.constructor=ki,Pi.prototype=Object.create(Ei.prototype),Pi.prototype.constructor=Pi,Ri.prototype=Object.create(Ei.prototype),Ri.prototype.constructor=Ri,Li.prototype=Object.create(Ei.prototype),Li.prototype.constructor=Li,Oi.prototype=Object.create(Ei.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isFloat16BufferAttribute=!0,zi.prototype=Object.create(Ei.prototype),zi.prototype.constructor=zi,Di.prototype=Object.create(Ei.prototype),Di.prototype.constructor=Di;class Ni{constructor(){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}computeGroups(e){const t=[];let n,r,i;const o=e.faces;for(r=0;r0,o=r[1]&&r[1].length>0,a=e.morphTargets,s=a.length;let l;if(s>0){l=[];for(let e=0;e0){d=[];for(let e=0;e0&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;gt&&(t=e[n]);return t}const Fi={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Bi(e,t){return new Fi[e](t)}let ji=1;const Ui=new Er,Hi=new Zr,Gi=new Jn,Vi=new er,Wi=new er,qi=new Jn;function Xi(){Object.defineProperty(this,"id",{value:ji+=2}),this.uuid=Bn.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Xi.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Xi,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){return Array.isArray(e)?this.index=new(Ii(e)>65535?Li:Pi)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Un).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Ui.makeRotationX(e),this.applyMatrix4(Ui),this},rotateY:function(e){return Ui.makeRotationY(e),this.applyMatrix4(Ui),this},rotateZ:function(e){return Ui.makeRotationZ(e),this.applyMatrix4(Ui),this},translate:function(e,t,n){return Ui.makeTranslation(e,t,n),this.applyMatrix4(Ui),this},scale:function(e,t,n){return Ui.makeScale(e,t,n),this.applyMatrix4(Ui),this},lookAt:function(e){return Hi.lookAt(e),Hi.updateMatrix(),this.applyMatrix4(Hi.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gi).negate(),this.translate(Gi.x,Gi.y,Gi.z),this},setFromObject:function(e){const t=e.geometry;if(e.isPoints||e.isLine){const e=new zi(3*t.vertices.length,3),n=new zi(3*t.colors.length,3);if(this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){const e=new zi(t.lineDistances.length,1);this.setAttribute("lineDistance",e.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){const t=[];for(let n=0,r=e.length;n0){const t=new Float32Array(3*e.normals.length);this.setAttribute("normal",new Ei(t,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const t=new Float32Array(3*e.colors.length);this.setAttribute("color",new Ei(t,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const t=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new Ei(t,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const t=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new Ei(t,2).copyVector2sArray(e.uvs2))}this.groups=e.groups;for(const n in e.morphTargets){const t=[],r=e.morphTargets[n];for(let e=0,n=r.length;e0){const t=new zi(4*e.skinIndices.length,4);this.setAttribute("skinIndex",t.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const t=new zi(4*e.skinWeights.length,4);this.setAttribute("skinWeight",t.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new er);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Jn(-1/0,-1/0,-1/0),new Jn(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const s in n){const t=n[s],r=t.toJSON(e.data);""!==t.name&&(r.name=t.name),e.data.attributes[s]=r}const r={};let i=!1;for(const s in this.morphAttributes){const t=this.morphAttributes[s],n=[];for(let r=0,i=t.length;r0&&(r[s]=n,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e},clone:function(){return(new Xi).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const l in r){const e=r[l];this.setAttribute(l,e.clone(t))}const i=e.morphAttributes;for(const l in i){const e=[],n=i[l];for(let r=0,i=n.length;r0&&void 0!==arguments[0]?arguments[0]:new Xi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new _i;Zr.call(this),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}function fo(e,t,n,r,i,o,a,s){let l;if(l=t.side===m?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,t.side!==g,s),null===l)return null;uo.copy(s),uo.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(uo);return cn.far?null:{distance:c,point:uo.clone(),object:e}}function po(e,t,n,r,i,o,a,s,l,c,u,d){Ji.fromBufferAttribute(i,c),Qi.fromBufferAttribute(i,u),Ki.fromBufferAttribute(i,d);const h=e.morphTargetInfluences;if(t.morphTargets&&o&&h){ro.set(0,0,0),io.set(0,0,0),oo.set(0,0,0);for(let e=0,t=o.length;e0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zi.copy(n.boundingSphere),Zi.applyMatrix4(i),!1===e.ray.intersectsSphere(Zi))return;if(Yi.copy(i).invert(),$i.copy(e.ray).applyMatrix4(Yi),null!==n.boundingBox&&!1===$i.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,d=n.groups,h=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,f=d.length;n0&&(l=c);for(let n=0,u=s.length;n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],l=[],c=[],u=[];let d=0,h=0;function f(e,t,n,r,i,o,f,p,m,g,v){const y=o/m,b=f/g,x=o/2,w=f/2,_=p/2,S=m+1,M=g+1;let E=0,T=0;const C=new Jn;for(let a=0;a0?1:-1,c.push(C.x,C.y,C.z),u.push(s/m),u.push(1-a/g),E+=1}}for(let a=0;a0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;xo.call(this),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function _o(e,t,n){if(Zr.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new wo(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Jn(1,0,0)),this.add(r);const i=new wo(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Jn(-1,0,0)),this.add(i);const o=new wo(90,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Jn(0,1,0)),this.add(o);const a=new wo(90,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Jn(0,-1,0)),this.add(a);const s=new wo(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Jn(0,0,1)),this.add(s);const l=new wo(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Jn(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}function So(e,t,n,r,i,o,a,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:oe,a=void 0!==a?a:Ie,Wn.call(this,e,t,n,r,i,o,a,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}function Mo(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Yn.call(this,e,e,t),t=t||{},this.texture=new So(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}function Eo(e,t,n,r,i,o,a,s,l,c,u,d){Wn.call(this,null,o,a,s,l,c,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:pe,this.minFilter=void 0!==c?c:pe,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}bo.prototype=Object.create(wi.prototype),bo.prototype.constructor=bo,bo.prototype.isShaderMaterial=!0,bo.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=go(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this},bo.prototype.toJSON=function(e){const t=wi.prototype.toJSON.call(this,e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},xo.prototype=Object.assign(Object.create(Zr.prototype),{constructor:xo,isCamera:!0,copy:function(e,t){return Zr.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Jn),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Zr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Zr.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),wo.prototype=Object.assign(Object.create(xo.prototype),{constructor:wo,isPerspectiveCamera:!0,copy:function(e,t){return xo.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Bn.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*Bn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Bn.RAD2DEG*Math.atan(Math.tan(.5*Bn.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(e,t,n,r,i,o){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*Bn.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/e,t-=o.offsetY*n/a,r*=o.width/e,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=Zr.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),_o.prototype=Object.create(Zr.prototype),_o.prototype.constructor=_o,So.prototype=Object.create(Wn.prototype),So.prototype.constructor=So,So.prototype.isCubeTexture=!0,Object.defineProperty(So.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),Mo.prototype=Object.create(Yn.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isWebGLCubeRenderTarget=!0,Mo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=Fe,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include \n\t\t\t\t#include \n\n\t\t\t}\n\t\t",i="\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t",o=new mo(5,5,5),a=new bo({name:"CubemapFromEquirect",uniforms:go(n),vertexShader:r,fragmentShader:i,side:m,blending:b});a.uniforms.tEquirect.value=t;const s=new ho(o,a),l=t.minFilter;return t.minFilter===_e&&(t.minFilter=be),new _o(1,10,this).update(e,s),t.minFilter=l,s.geometry.dispose(),s.material.dispose(),this},Mo.prototype.clear=function(e,t,n,r){const i=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,r);e.setRenderTarget(i)},Eo.prototype=Object.create(Wn.prototype),Eo.prototype.constructor=Eo,Eo.prototype.isDataTexture=!0;const To=new gr,Co=new Jn;class Ao{constructor(e,t,n,r,i,o){this.planes=[void 0!==e?e:new ei,void 0!==t?t:new ei,void 0!==n?n:new ei,void 0!==r?r:new ei,void 0!==i?i:new ei,void 0!==o?o:new ei]}set(e,t,n,r,i,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],h=n[9],f=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(a-r,u-s,p-d,y-m).normalize(),t[1].setComponents(a+r,u+s,p+d,y+m).normalize(),t[2].setComponents(a+i,u+l,p+h,y+g).normalize(),t[3].setComponents(a-i,u-l,p-h,y-g).normalize(),t[4].setComponents(a-o,u-c,p-f,y-v).normalize(),t[5].setComponents(a+o,u+c,p+f,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),To.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSprite(e){return To.center.set(0,0,0),To.radius=.7071067811865476,To.applyMatrix4(e.matrixWorld),this.intersectsSphere(To)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let i=0;i<6;i++)if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,Co.y=r.normal.y>0?e.max.y:e.min.y,Co.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Co)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function ko(){let e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Po(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,o=t/2,a=Math.floor(n),s=Math.floor(r),l=a+1,c=s+1,u=e/a,d=t/s,h=[],f=[],p=[],m=[];for(let g=0;g 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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, 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_RoughnessDependent( specularColor, dotNV, roughness );\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}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = 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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\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 = clamp( floor( D ) / 255.0, 0.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}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, 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_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\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",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\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",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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",fog_pars_fragment:"#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",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : 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;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\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};\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};\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};\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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\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}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#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\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"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}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef 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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\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 ) || defined( SHADOWMAP_TYPE_VSM )\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",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp 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",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\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}\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 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"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}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \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 \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 = isPerspectiveMatrix( projectionMatrix );\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 \n\t#include \n\t#include \n}"},Oo={common:{diffuse:{value:new yi(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Un},uv2Transform:{value:new Un},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 jn(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 yi(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yi(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Un}},sprite:{diffuse:{value:new yi(15658734)},opacity:{value:1},center:{value:new jn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Un}}},zo={basic:{uniforms:vo([Oo.common,Oo.specularmap,Oo.envmap,Oo.aomap,Oo.lightmap,Oo.fog]),vertexShader:Lo.meshbasic_vert,fragmentShader:Lo.meshbasic_frag},lambert:{uniforms:vo([Oo.common,Oo.specularmap,Oo.envmap,Oo.aomap,Oo.lightmap,Oo.emissivemap,Oo.fog,Oo.lights,{emissive:{value:new yi(0)}}]),vertexShader:Lo.meshlambert_vert,fragmentShader:Lo.meshlambert_frag},phong:{uniforms:vo([Oo.common,Oo.specularmap,Oo.envmap,Oo.aomap,Oo.lightmap,Oo.emissivemap,Oo.bumpmap,Oo.normalmap,Oo.displacementmap,Oo.fog,Oo.lights,{emissive:{value:new yi(0)},specular:{value:new yi(1118481)},shininess:{value:30}}]),vertexShader:Lo.meshphong_vert,fragmentShader:Lo.meshphong_frag},standard:{uniforms:vo([Oo.common,Oo.envmap,Oo.aomap,Oo.lightmap,Oo.emissivemap,Oo.bumpmap,Oo.normalmap,Oo.displacementmap,Oo.roughnessmap,Oo.metalnessmap,Oo.fog,Oo.lights,{emissive:{value:new yi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Lo.meshphysical_vert,fragmentShader:Lo.meshphysical_frag},toon:{uniforms:vo([Oo.common,Oo.aomap,Oo.lightmap,Oo.emissivemap,Oo.bumpmap,Oo.normalmap,Oo.displacementmap,Oo.gradientmap,Oo.fog,Oo.lights,{emissive:{value:new yi(0)}}]),vertexShader:Lo.meshtoon_vert,fragmentShader:Lo.meshtoon_frag},matcap:{uniforms:vo([Oo.common,Oo.bumpmap,Oo.normalmap,Oo.displacementmap,Oo.fog,{matcap:{value:null}}]),vertexShader:Lo.meshmatcap_vert,fragmentShader:Lo.meshmatcap_frag},points:{uniforms:vo([Oo.points,Oo.fog]),vertexShader:Lo.points_vert,fragmentShader:Lo.points_frag},dashed:{uniforms:vo([Oo.common,Oo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Lo.linedashed_vert,fragmentShader:Lo.linedashed_frag},depth:{uniforms:vo([Oo.common,Oo.displacementmap]),vertexShader:Lo.depth_vert,fragmentShader:Lo.depth_frag},normal:{uniforms:vo([Oo.common,Oo.bumpmap,Oo.normalmap,Oo.displacementmap,{opacity:{value:1}}]),vertexShader:Lo.normal_vert,fragmentShader:Lo.normal_frag},sprite:{uniforms:vo([Oo.sprite,Oo.fog]),vertexShader:Lo.sprite_vert,fragmentShader:Lo.sprite_frag},background:{uniforms:{uvTransform:{value:new Un},t2D:{value:null}},vertexShader:Lo.background_vert,fragmentShader:Lo.background_frag},cube:{uniforms:vo([Oo.envmap,{opacity:{value:1}}]),vertexShader:Lo.cube_vert,fragmentShader:Lo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Lo.equirect_vert,fragmentShader:Lo.equirect_frag},distanceRGBA:{uniforms:vo([Oo.common,Oo.displacementmap,{referencePosition:{value:new Jn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Lo.distanceRGBA_vert,fragmentShader:Lo.distanceRGBA_frag},shadow:{uniforms:vo([Oo.lights,Oo.fog,{color:{value:new yi(0)},opacity:{value:1}}]),vertexShader:Lo.shadow_vert,fragmentShader:Lo.shadow_frag}};function Do(e,t,n,r,i){const o=new yi(0);let a,s,l=0,c=null,u=0,d=null;function h(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return o},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;o.set(e),l=t,h(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,h(o,l)},render:function(n,i,f,g){let v=!0===i.isScene?i.background:null;v&&v.isTexture&&(v=t.get(v));const y=e.xr,b=y.getSession&&y.getSession();b&&"additive"===b.environmentBlendMode&&(v=null),null===v?h(o,l):v&&v.isColor&&(h(v,1),g=!0),(e.autoClear||g)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===ce)?(void 0===s&&(s=new ho(new mo(1,1,1),new bo({name:"BackgroundCubeMaterial",uniforms:go(zo.cube.uniforms),vertexShader:zo.cube.vertexShader,fragmentShader:zo.cube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),v.isWebGLCubeRenderTarget&&(v=v.texture),s.material.uniforms.envMap.value=v,s.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,c===v&&u===v.version&&d===e.toneMapping||(s.material.needsUpdate=!0,c=v,u=v.version,d=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):v&&v.isTexture&&(void 0===a&&(a=new ho(new Ro(2,2),new bo({name:"BackgroundMaterial",uniforms:go(zo.background.uniforms),vertexShader:zo.background.vertexShader,fragmentShader:zo.background.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),a.material.uniforms.uvTransform.value.copy(v.matrix),c===v&&u===v.version&&d===e.toneMapping||(a.material.needsUpdate=!0,c=v,u=v.version,d=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function No(e,t,n,r){const i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},l=h(null);let c=l;function u(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function h(e){const t=[],n=[],r=[];for(let o=0;o=0){const o=l[t];if(void 0!==o){const t=o.normalized,i=o.itemSize,a=n.get(o);if(void 0===a)continue;const l=a.buffer,c=a.type,u=a.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,a=n.stride,d=o.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):p(r),e.bindBuffer(34962,l),v(r,i,c,t,a*u,d*u)}else o.isInstancedBufferAttribute?(m(r,o.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)):p(r),e.bindBuffer(34962,l),v(r,i,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(i.instanceMatrix);if(void 0===t)continue;const o=t.buffer,a=t.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),e.bindBuffer(34962,o),e.vertexAttribPointer(r+0,4,a,!1,64,0),e.vertexAttribPointer(r+1,4,a,!1,64,16),e.vertexAttribPointer(r+2,4,a,!1,64,32),e.vertexAttribPointer(r+3,4,a,!1,64,48)}else if("instanceColor"===t){const t=n.get(i.instanceColor);if(void 0===t)continue;const o=t.buffer,a=t.type;m(r,1),e.bindBuffer(34962,o),e.vertexAttribPointer(r,3,a,!1,12,0)}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r,n);break;case 3:e.vertexAttrib3fv(r,n);break;case 4:e.vertexAttrib4fv(r,n);break;default:e.vertexAttrib1fv(r,n)}}}}g()}(i,l,d,y),null!==b&&e.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const n in t){const e=t[n];for(const t in e)d(e[t].object),delete e[t];delete t[n]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function Io(e,t,n,r){const i=r.isWebGL2;let o;this.setMode=function(e){o=e},this.render=function(t,r){e.drawArrays(o,t,r),n.update(r,o,1)},this.renderInstances=function(r,a,s){if(0===s)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](o,r,a,s),n.update(a,o,s)}}function Fo(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),h=e.getParameter(34076),f=e.getParameter(34921),p=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,y=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?e.getParameter(36183):0}}function Bo(e){const t=this;let n=null,r=0,i=!1,o=!1;const a=new ei,s=new Un,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){const o=null!==e?e.length:0;let c=null;if(0!==o){if(c=l.value,!0!==i||null===c){const t=r+4*o,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length0){const a=e.getRenderList(),s=e.getRenderTarget(),l=new Mo(o.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(s),e.setRenderList(a),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function Uo(e){const t={};return{has:function(n){if(void 0!==t[n])return null!==t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,null!==r},get:function(e){return this.has(e)||console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t[e]}}}function Ho(e,t,n,r){const i=new WeakMap,o=new WeakMap;function a(e){const s=e.target,l=i.get(s);null!==l.index&&t.remove(l.index);for(const n in l.attributes)t.remove(l.attributes[n]);s.removeEventListener("dispose",a),i.delete(s);const c=o.get(l);c&&(t.remove(c),o.delete(l)),r.releaseStatesOfGeometry(l),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t65535?Li:Pi)(n,1);s.version=a;const l=o.get(e);l&&t.remove(l),o.set(e,s)}return{get:function(e,t){let r=i.get(t);return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Xi).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(e){const n=e.attributes;for(const i in n)t.update(n[i],34962);const r=e.morphAttributes;for(const i in r){const e=r[i];for(let n=0,r=e.length;n0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Wn.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=pe,this.minFilter=pe,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Zo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Wn.call(this,null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=pe,this.minFilter=pe,this.wrapR=he,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}zo.physical={uniforms:vo([zo.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new jn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new yi(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Lo.meshphysical_vert,fragmentShader:Lo.meshphysical_frag},$o.prototype=Object.create(Wn.prototype),$o.prototype.constructor=$o,$o.prototype.isDataTexture2DArray=!0,Zo.prototype=Object.create(Wn.prototype),Zo.prototype.constructor=Zo,Zo.prototype.isDataTexture3D=!0;const Jo=new Wn,Qo=new $o,Ko=new Zo,ea=new So,ta=[],na=[],ra=new Float32Array(16),ia=new Float32Array(9),oa=new Float32Array(4);function aa(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let o=ta[i];if(void 0===o&&(o=new Float32Array(i),ta[i]=o),0!==t){r.toArray(o,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(o,i)}return o}function sa(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n/gm;function rs(e){return e.replace(ns,is)}function is(e,t){const n=Lo[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return rs(n)}const os=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,as=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ss(e){return e.replace(as,cs).replace(os,ls)}function ls(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),cs(e,t,n,r)}function cs(e,t,n,r){let i="";for(let o=parseInt(t);o0?e.gammaFactor:1,g=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ka).join("\n")}(n),v=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(o),y=i.createProgram();let b,x,w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(b=[v].filter(Ka).join("\n"),b.length>0&&(b+="\n"),x=[g,v].filter(Ka).join("\n"),x.length>0&&(x+="\n")):(b=[us(n),"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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(Ka).join("\n"),x=[g,us(n),"#define SHADER_NAME "+n.shaderName,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+p:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Q?"#define TONE_MAPPING":"",n.toneMapping!==Q?Lo.tonemapping_pars_fragment:"",n.toneMapping!==Q?Qa("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Lo.encodings_pars_fragment,n.map?Za("mapTexelToLinear",n.mapEncoding):"",n.matcap?Za("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Za("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Za("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Za("lightMapTexelToLinear",n.lightMapEncoding):"",Ja("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ka).join("\n")),a=rs(a),a=es(a,n),a=ts(a,n),s=rs(s),s=es(s,n),s=ts(s,n),a=ss(a),s=ss(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",b=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+b,x=["#define varying in",n.glslVersion===Dn?"":"out highp vec4 pc_fragColor;",n.glslVersion===Dn?"":"#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"+x);const _=w+x+s,S=qa(i,35633,w+b+a),M=qa(i,35632,_);if(i.attachShader(y,S),i.attachShader(y,M),void 0!==n.index0AttributeName?i.bindAttribLocation(y,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(y,0,"position"),i.linkProgram(y),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(y).trim(),t=i.getShaderInfoLog(S).trim(),n=i.getShaderInfoLog(M).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(y,35714)){r=!1;const t=$a(i,S,"vertex"),n=$a(i,M,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(y,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:b},fragmentShader:{log:n,prefix:x}})}let E,T;return i.deleteShader(S),i.deleteShader(M),this.getUniforms=function(){return void 0===E&&(E=new Wa(i,y)),E},this.getAttributes=function(){return void 0===T&&(T=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i0,maxBones:M,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&p.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:Q,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===g,flipSided:i.side===m,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&r.sort(e||ps),i.length>1&&i.sort(t||ms)}}}function vs(e){let t=new WeakMap;return{get:function(n,r){const i=t.get(n);let o;return void 0===i?(o=new gs(e),t.set(n,new WeakMap),t.get(n).set(r,o)):(o=i.get(r),void 0===o&&(o=new gs(e),i.set(r,o))),o},dispose:function(){t=new WeakMap}}}function ys(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Jn,color:new yi};break;case"SpotLight":n={position:new Jn,direction:new Jn,color:new yi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Jn,color:new yi,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Jn,skyColor:new yi,groundColor:new yi};break;case"RectAreaLight":n={color:new yi,position:new Jn,halfWidth:new Jn,halfHeight:new Jn}}return e[t.id]=n,n}}}let bs=0;function xs(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function ws(e,t){const n=new ys,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jn,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let l=0;l<9;l++)i.probe.push(new Jn);const o=new Jn,a=new Er,s=new Er;return{setup:function(o){let a=0,s=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,u=0,d=0,h=0,f=0,p=0,m=0,g=0;o.sort(xs);for(let e=0,t=o.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=Oo.LTC_FLOAT_1,i.rectAreaLTC2=Oo.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Oo.LTC_HALF_1,i.rectAreaLTC2=Oo.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=l;const v=i.hash;v.directionalLength===c&&v.pointLength===u&&v.spotLength===d&&v.rectAreaLength===h&&v.hemiLength===f&&v.numDirectionalShadows===p&&v.numPointShadows===m&&v.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=h,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,v.directionalLength=c,v.pointLength=u,v.spotLength=d,v.rectAreaLength=h,v.hemiLength=f,v.numDirectionalShadows=p,v.numPointShadows=m,v.numSpotShadows=g,i.version=bs++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let h=0,f=e.length;h1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(r)?(i=new _s(e,t),n.set(r,[]),n.get(r).push(i)):o>=n.get(r).length?(i=new _s(e,t),n.get(r).push(i)):i=n.get(r)[o],i},dispose:function(){n=new WeakMap}}}function Ms(e){wi.call(this),this.type="MeshDepthMaterial",this.depthPacking=on,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.setValues(e)}function Es(e){wi.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Jn,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.setValues(e)}function Ts(e,t,n){let r=new Ao;const i=new jn,o=new jn,a=new Xn,s=[],l=[],c={},u={0:m,1:p,2:g},h=new bo({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new jn},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=h.clone();v.defines.HORIZONTAL_PASS=1;const y=new Xi;y.setAttribute("position",new Ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new ho(y,h),w=this;function _(n,r){const i=t.update(x);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,x,null),v.uniforms.shadow_pass.value=n.mapPass.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,v,x,null)}function S(e,t,n){const r=e<<0|t<<1|n<<2;let i=s[r];return void 0===i&&(i=new Ms({depthPacking:an,morphTargets:e,skinning:t}),s[r]=i),i}function M(e,t,n){const r=e<<0|t<<1|n<<2;let i=l[r];return void 0===i&&(i=new Es({morphTargets:e,skinning:t}),l[r]=i),i}function E(t,n,r,i,o,a,s){let l=null,d=S,h=t.customDepthMaterial;if(!0===i.isPointLight&&(d=M,h=t.customDistanceMaterial),void 0===h){let e=!1;!0===r.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=d(e,i,!0===t.isInstancedMesh)}else l=h;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const e=l.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=l.clone(),n[t]=i),l=i}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=s===f?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=o,l.farDistance=a),l}function T(n,i,o,a,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===f)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;ln||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/d.x),i.x=o.x*d.x,u.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/d.y),i.y=o.y*d.y,u.mapSize.y=o.y)),null===u.map&&!u.isPointLightShadow&&this.type===f){const e={minFilter:be,magFilter:be,format:Fe};u.map=new Yn(i.x,i.y,e),u.map.texture.name=c.name+".shadowMap",u.mapPass=new Yn(i.x,i.y,e),u.camera.updateProjectionMatrix()}if(null===u.map){const e={minFilter:pe,magFilter:pe,format:Fe};u.map=new Yn(i.x,i.y,e),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const m=u.getViewportCount();for(let e=0;e=1):-1!==se.indexOf("OpenGL ES")&&(ae=parseFloat(/^OpenGL ES (\d)/.exec(se)[1]),oe=ae>=2);let le=null,ce={};const ue=new Xn,de=new Xn;function he(t,n,r){const i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?Bn.floorPowerOfTwo:Math.floor,o=r(i*e.width),a=r(i*e.height);void 0===f&&(f=m(o,a));const s=n?m(o,a):f;return s.width=o,s.height=a,s.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+a+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return Bn.isPowerOfTwo(e.width)&&Bn.isPowerOfTwo(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==pe&&e.minFilter!==be}function b(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function x(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||t.get("EXT_color_buffer_float"),o}function w(e){return e===pe||e===me||e===ve?9728:9729}function _(t){const n=t.target;n.removeEventListener("dispose",_),function(t){const n=r.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),r.remove(t))}(n),n.isVideoTexture&&h.delete(n),a.memory.textures--}function S(t){const n=t.target;n.removeEventListener("dispose",S),function(t){const n=r.get(t),i=r.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}}(n),a.memory.textures--}let M=0;function E(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=a.render.frame;h.get(e)!==t&&(h.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void R(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function T(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;P(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY);const a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),l=r.image[0]&&r.image[0].isDataTexture,u=[];for(let e=0;e<6;e++)u[e]=a||l?l?r.image[e].image:r.image[e]:g(r.image[e],!1,!0,c);const d=u[0],h=v(d)||s,f=o.convert(r.format),p=o.convert(r.type),m=x(r.internalFormat,f,p);let w;if(k(34067,r,h),a){for(let e=0;e<6;e++){w=u[e].mipmaps;for(let t=0;t1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",_),t.__webglTexture=e.createTexture(),a.memory.textures++)}function R(t,r,i){let a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),P(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const l=function(e){return!s&&(e.wrapS!==he||e.wrapT!==he||e.minFilter!==pe&&e.minFilter!==be)}(r)&&!1===v(r.image),c=g(r.image,l,!1,u),d=v(c)||s,h=o.convert(r.format);let f,p=o.convert(r.type),m=x(r.internalFormat,h,p);k(a,r,d);const w=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=r.type===Pe?36012:r.type===ke?33190:r.type===De?35056:33189:r.type===Pe&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===He&&6402===m&&r.type!==Ce&&r.type!==ke&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Ce,p=o.convert(r.type)),r.format===Ge&&6402===m&&(m=34041,r.type!==De&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=De,p=o.convert(r.type))),n.texImage2D(3553,0,m,c.width,c.height,0,h,p,null);else if(r.isDataTexture)if(w.length>0&&d){for(let e=0,t=w.length;e0&&d){for(let e=0,t=w.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),M+=1,e},this.resetTextureUnits=function(){M=0},this.setTexture2D=E,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?R(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?R(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=T,this.setupRenderTarget=function(t){const i=r.get(t),l=r.get(t.texture);t.addEventListener("dispose",S),l.__webglTexture=e.createTexture(),a.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,d=v(t)||s;if(!s||t.texture.format!==Ie||t.texture.type!==Pe&&t.texture.type!==Re||(t.texture.format=Fe,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(let t=0;t<6;t++)i.__webglFramebuffer[t]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=o.convert(t.texture.format),r=o.convert(t.texture.type),a=x(t.texture.internalFormat,n,r),s=z(t);e.renderbufferStorageMultisample(36161,s,a,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),O(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),k(34067,t.texture,d);for(let e=0;e<6;e++)L(i.__webglFramebuffer[e],t,36064,34069+e);y(t.texture,d)&&b(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),k(3553,t.texture,d),L(i.__webglFramebuffer,t,36064,3553),y(t.texture,d)&&b(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&function(t){const n=r.get(t),i=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),E(n.depthTexture,0);const i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===He)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(n.depthTexture.format!==Ge)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(let r=0;r<6;r++)e.bindFramebuffer(36160,n.__webglFramebuffer[r]),n.__webglDepthbuffer[r]=e.createRenderbuffer(),O(n.__webglDepthbuffer[r],t,!1)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),O(n.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(y(t,v(e)||s)){const i=e.isWebGLCubeRenderTarget?34067:3553,o=r.get(t).__webglTexture;n.bindTexture(i,o),b(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(s){const n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const i=t.width,o=t.height;let a=16384;t.depthBuffer&&(a|=256),t.stencilBuffer&&(a|=1024),e.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===D&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),D=!0),e=e.texture),E(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===N&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),N=!0),e=e.texture),T(e,t)}}function ks(e,t,n){const r=n.isWebGL2;return{convert:function(e){let n;if(e===Me)return 5121;if(e===Le)return 32819;if(e===Oe)return 32820;if(e===ze)return 33635;if(e===Ee)return 5120;if(e===Te)return 5122;if(e===Ce)return 5123;if(e===Ae)return 5124;if(e===ke)return 5125;if(e===Pe)return 5126;if(e===Re)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(e===Ne)return 6406;if(e===Ie)return 6407;if(e===Fe)return 6408;if(e===Be)return 6409;if(e===je)return 6410;if(e===He)return 6402;if(e===Ge)return 34041;if(e===Ve)return 6403;if(e===We)return 36244;if(e===qe)return 33319;if(e===Xe)return 33320;if(e===Ye)return 36248;if(e===$e)return 36249;if(e===Ze||e===Je||e===Qe||e===Ke){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(e===Ze)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===Je)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Qe)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ke)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===et||e===tt||e===nt||e===rt){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(e===et)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===tt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===nt)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===rt)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===it)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((e===ot||e===at)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(e===ot)return n.COMPRESSED_RGB8_ETC2;if(e===at)return n.COMPRESSED_RGBA8_ETC2_EAC}return e===st||e===lt||e===ct||e===ut||e===dt||e===ht||e===ft||e===pt||e===mt||e===gt||e===vt||e===yt||e===bt||e===xt||e===_t||e===St||e===Mt||e===Et||e===Tt||e===Ct||e===At||e===kt||e===Pt||e===Rt||e===Lt||e===Ot||e===zt||e===Dt?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):e===wt?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):e===De?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Ps(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];wo.call(this),this.cameras=e}function Rs(){Zr.call(this),this.type="Group"}function Ls(){this._targetRay=null,this._grip=null,this._hand=null}function Os(e,t){const n=this;let r=null,i=1,o=null,a="local-floor",s=null;const l=[],c=new Map,u=new wo;u.layers.enable(1),u.viewport=new Xn;const d=new wo;d.layers.enable(2),d.viewport=new Xn;const h=[u,d],f=new Ps;f.layers.enable(1),f.layers.enable(2);let p=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function v(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(e){o=e,M.setContext(r),M.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function b(e){const t=r.inputSources;for(let n=0;n0&&we(o,e,t),a.length>0&&we(a,e,t),!0===e.isScene&&e.onAfterRender(p,e,t),null!==b&&(q.updateRenderTargetMipmap(b),q.updateMultisampleRenderTarget(b)),G.buffers.depth.setTest(!0),G.buffers.depth.setMask(!0),G.buffers.color.setMask(!0),G.setPolygonOffset(!1),f.pop(),h=f.length>0?f[f.length-1]:null,d=null},this.setFramebuffer=function(e){g!==e&&null===b&&ce.bindFramebuffer(36160,e),g=e},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderList=function(){return d},this.setRenderList=function(e){d=e},this.getRenderTarget=function(){return b},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;b=e,v=t,y=n,e&&void 0===W.get(e).__webglFramebuffer&&q.setupRenderTarget(e);let r=g,i=!1;if(e){const n=W.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=n[t],i=!0):r=e.isWebGLMultisampleRenderTarget?W.get(e).__webglMultisampledFramebuffer:n,S.copy(e.viewport),M.copy(e.scissor),E=e.scissorTest}else S.copy(R).multiplyScalar(A).floor(),M.copy(L).multiplyScalar(A).floor(),E=O;if(x!==r&&(ce.bindFramebuffer(36160,r),x=r),G.viewport(S),G.scissor(M),G.setScissorTest(E),i){const r=W.get(e.texture);ce.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=W.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){let a=!1;s!==x&&(ce.bindFramebuffer(36160,s),a=!0);try{const a=e.texture,s=a.format,l=a.type;if(s!==Fe&&se.convert(s)!==ce.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===Me||se.convert(l)===ce.getParameter(35738)||l===Pe&&(H.isWebGL2||U.get("OES_texture_float")||U.get("WEBGL_color_buffer_float"))||l===Re&&(H.isWebGL2?U.get("EXT_color_buffer_float"):U.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ce.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ce.readPixels(t,n,r,i,se.convert(s),se.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{a&&ce.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=se.convert(t.format);q.setTexture2D(t,0),ce.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),G.unbindTexture()},this.copyTextureToTexture=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=t.image.width,o=t.image.height,a=se.convert(n.format),s=se.convert(n.type);q.setTexture2D(n,0),ce.pixelStorei(37440,n.flipY),ce.pixelStorei(37441,n.premultiplyAlpha),ce.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ce.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?ce.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ce.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&ce.generateMipmap(3553),G.unbindTexture()},this.initTexture=function(e){q.setTexture2D(e,0),G.unbindTexture()},this.resetState=function(){G.reset(),le.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ns(e){Ds.call(this,e)}Ms.prototype=Object.create(wi.prototype),Ms.prototype.constructor=Ms,Ms.prototype.isMeshDepthMaterial=!0,Ms.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Es.prototype=Object.create(wi.prototype),Es.prototype.constructor=Es,Es.prototype.isMeshDistanceMaterial=!0,Es.prototype.copy=function(e){return wi.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Ps.prototype=Object.assign(Object.create(wo.prototype),{constructor:Ps,isArrayCamera:!0}),Rs.prototype=Object.assign(Object.create(Zr.prototype),{constructor:Rs,isGroup:!0}),Object.assign(Ls.prototype,{constructor:Ls,getHandSpace:function(){if(null===this._hand&&(this._hand=new Rs,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(let e=0;e<=window.XRHand.LITTLE_PHALANX_TIP;e++){const e=new Rs;e.matrixAutoUpdate=!1,e.visible=!1,this._hand.joints.push(e),this._hand.add(e)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Rs,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Rs,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let r=null,i=null,o=null;const a=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){o=!0;for(let r=0;r<=window.XRHand.LITTLE_PHALANX_TIP;r++)if(e.hand[r]){const i=t.getJointPose(e.hand[r],n),o=l.joints[r];null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.jointRadius=i.radius),o.visible=null!==i;const a=l.joints[window.XRHand.INDEX_PHALANX_TIP],s=l.joints[window.XRHand.THUMB_PHALANX_TIP],c=a.position.distanceTo(s.position),u=.02,d=.005;l.inputState.pinching&&c>u+d?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&c<=u-d&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}}else null!==a&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==o),this}}),Object.assign(Os.prototype,Nn.prototype),Ns.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Ns,isWebGL1Renderer:!0});class Is{constructor(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new yi(e),this.density=void 0!==t?t:25e-5}clone(){return new Is(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Fs{constructor(e,t,n){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new yi(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}clone(){return new Fs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Bs extends Zr{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function js(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=En,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Bn.generateUUID()}Object.defineProperty(js.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(js.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this},clone:function(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Bn.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new js(new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),this.stride);return t.setUsage(this.usage),t},onUpload:function(e){return this.onUploadCallback=e,this},toJSON:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Bn.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});const Us=new Jn;function Hs(e,t,n,r){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}function Gs(e){wi.call(this),this.type="SpriteMaterial",this.color=new yi(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}let Vs;Object.defineProperties(Hs.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(e){this.data.needsUpdate=e}}}),Object.assign(Hs.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(let t=0,n=this.data.count;te.far||t.push({distance:s,point:Ws.clone(),uv:di.getUV(Ws,Js,Qs,Ks,el,tl,nl,new jn),face:null,object:this})},copy:function(e){return Zr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const ol=new Jn,al=new Jn;function sl(){Zr.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}sl.prototype=Object.assign(Object.create(Zr.prototype),{constructor:sl,isLOD:!0,copy:function(e){Zr.prototype.copy.call(this,e,!1);const t=e.levels;for(let n=0,r=t.length;n1&&void 0!==arguments[1]?arguments[1]:0;t=Math.abs(t);const n=this.levels;let r;for(r=0;r0){let n,r;for(n=1,r=t.length;n0){ol.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ol);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){ol.setFromMatrixPosition(e.matrixWorld),al.setFromMatrixPosition(this.matrixWorld);const n=ol.distanceTo(al)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=Bn.generateUUID(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}Object.assign(vl.prototype,{init:function(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e0&&void 0!==arguments[0]?arguments[0]:new Xi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Sl;Zr.call(this),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}kl.prototype=Object.assign(Object.create(Zr.prototype),{constructor:kl,isLine:!0,copy:function(e){return Zr.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;ea)continue;u.applyMatrix4(this.matrixWorld);const h=e.ray.origin.distanceTo(u);he.far||t.push({distance:h,point:c.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,o=i.count-1;na)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){const r=n.vertices,i=r.length;for(let n=0;na)continue;u.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(u);ie.far||t.push({distance:i,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Pl=new Jn,Rl=new Jn;function Ll(e,t){kl.call(this,e,t),this.type="LineSegments"}function Ol(e,t){kl.call(this,e,t),this.type="LineLoop"}function zl(e){wi.call(this),this.type="PointsMaterial",this.color=new yi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}Ll.prototype=Object.assign(Object.create(kl.prototype),{constructor:Ll,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e0&&void 0!==arguments[0]?arguments[0]:new Xi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zl;Zr.call(this),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}function jl(e,t,n,r,i,o,a){const s=Nl.distanceSqToPoint(e);if(si.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:a})}}function Ul(e,t,n,r,i,o,a,s,l){Wn.call(this,e,t,n,r,i,o,a,s,l),this.format=void 0!==a?a:Ie,this.minFilter=void 0!==o?o:be,this.magFilter=void 0!==i?i:be,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Hl(e,t,n,r,i,o,a,s,l,c,u,d){Wn.call(this,null,o,a,s,l,c,r,i,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Gl(e,t,n,r,i,o,a,s,l){Wn.call(this,e,t,n,r,i,o,a,s,l),this.needsUpdate=!0}function Vl(e,t,n,r,i,o,a,s,l,c){if((c=void 0!==c?c:He)!==He&&c!==Ge)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===He&&(n=Ce),void 0===n&&c===Ge&&(n=De),Wn.call(this,null,r,i,o,a,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==a?a:pe,this.minFilter=void 0!==s?s:pe,this.flipY=!1,this.generateMipmaps=!1}Bl.prototype=Object.assign(Object.create(Zr.prototype),{constructor:Bl,isPoints:!0,copy:function(e){return Zr.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Il.copy(n.boundingSphere),Il.applyMatrix4(r),Il.radius+=i,!1===e.ray.intersectsSphere(Il))return;Dl.copy(r).invert(),Nl.copy(e.ray).applyMatrix4(Dl);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,s=n.length;i0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Ul.prototype=Object.assign(Object.create(Wn.prototype),{constructor:Ul,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Hl.prototype=Object.create(Wn.prototype),Hl.prototype.constructor=Hl,Hl.prototype.isCompressedTexture=!0,Gl.prototype=Object.create(Wn.prototype),Gl.prototype.constructor=Gl,Gl.prototype.isCanvasTexture=!0,Vl.prototype=Object.create(Wn.prototype),Vl.prototype.constructor=Vl,Vl.prototype.isDepthTexture=!0;let Wl=0;const ql=new Er,Xl=new Zr,Yl=new Jn;function $l(){Object.defineProperty(this,"id",{value:Wl+=2}),this.uuid=Bn.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}$l.prototype=Object.assign(Object.create(Nn.prototype),{constructor:$l,isGeometry:!0,applyMatrix4:function(e){const t=(new Un).getNormalMatrix(e);for(let n=0,r=this.vertices.length;n0)for(let d=0;d0&&void 0!==arguments[0])||arguments[0];const t=new Array(this.vertices.length);for(let n=0,r=this.vertices.length;n0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let t=0,n=this.faces.length;t2&&void 0!==arguments[2]?arguments[2]:0;if(!e||!e.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);const i=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,l=e.faces,c=this.colors,u=e.colors;void 0!==t&&(n=(new Un).getNormalMatrix(t));for(let d=0,h=a.length;d0&&void 0!==arguments[0]?arguments[0]:4;const t={},n=[],r=[],i=Math.pow(10,e);for(let s=0,l=this.vertices.length;s=0;s--){const e=o[s];this.faces.splice(e,1);for(let t=0,n=this.faceVertexUvs.length;t0,a=e.vertexNormals.length>0,s=1!==e.color.r||1!==e.color.g||1!==e.color.b,l=e.vertexColors.length>0;let p=0;if(p=c(p,0,0),p=c(p,1,t),p=c(p,2,r),p=c(p,3,i),p=c(p,4,o),p=c(p,5,a),p=c(p,6,s),p=c(p,7,l),n.push(p),n.push(e.a,e.b,e.c),n.push(e.materialIndex),i){const e=this.faceVertexUvs[0][f];n.push(h(e[0]),h(e[1]),h(e[2]))}if(o&&n.push(u(e.normal)),a){const t=e.vertexNormals;n.push(u(t[0]),u(t[1]),u(t[2]))}if(s&&n.push(d(e.color)),l){const t=e.vertexColors;n.push(d(t[0]),d(t[1]),d(t[2]))}}function c(e,t,n){return n?e|1<0&&(e.data.colors=o),s.length>0&&(e.data.uvs=[s]),e.data.faces=n,e},clone:function(){return(new $l).copy(this)},copy:function(e){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=e.name;const t=e.vertices;for(let d=0,h=t.length;d0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],o=[],a=[],s=[],l=new Jn,c=new jn;o.push(0,0,0),a.push(0,0,1),s.push(.5,.5);for(let u=0,d=3;u<=t;u++,d+=3){const i=n+u/t*r;l.x=e*Math.cos(i),l.y=e*Math.sin(i),o.push(l.x,l.y,l.z),a.push(0,0,1),c.x=(o[d]/e+1)/2,c.y=(o[d+1]/e+1)/2,s.push(c.x,c.y)}for(let u=1;u<=t;u++)i.push(u,u+1,0);this.setIndex(i),this.setAttribute("position",new zi(o,3)),this.setAttribute("normal",new zi(a,3)),this.setAttribute("uv",new zi(s,2))}}class Ql extends $l{constructor(e,t,n,r){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Jl(e,t,n,r)),this.mergeVertices()}}class Kl extends Xi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],u=[],d=[],h=[];let f=0;const p=[],m=n/2;let g=0;function v(n){const i=f,o=new jn,p=new Jn;let v=0;const y=!0===n?e:t,b=!0===n?1:-1;for(let e=1;e<=r;e++)u.push(0,m*b,0),d.push(0,b,0),h.push(.5,.5),f++;const x=f;for(let e=0;e<=r;e++){const t=e/r*s+a,n=Math.cos(t),i=Math.sin(t);p.x=y*i,p.y=m*b,p.z=y*n,u.push(p.x,p.y,p.z),d.push(0,b,0),o.x=.5*n+.5,o.y=.5*i*b+.5,h.push(o.x,o.y),f++}for(let e=0;e0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new zi(u,3)),this.setAttribute("normal",new zi(d,3)),this.setAttribute("uv",new zi(h,2))}}class ec extends $l{constructor(e,t,n,r,i,o,a,s){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Kl(e,t,n,r,i,o,a,s)),this.mergeVertices()}}class tc extends ec{constructor(e,t,n,r,i,o,a){super(0,e,t,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}}class nc extends Kl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}}class rc extends Xi{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],o=[];function a(e,t,n,r){const i=r+1,o=[];for(let a=0;a<=i;a++){o[a]=[];const r=e.clone().lerp(n,a/i),s=t.clone().lerp(n,a/i),l=i-a;for(let e=0;e<=l;e++)o[a][e]=0===e&&a===i?r:r.clone().lerp(s,e/l)}for(let a=0;a.9&&a<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.setAttribute("position",new zi(i,3)),this.setAttribute("normal",new zi(i.slice(),3)),this.setAttribute("uv",new zi(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}}class ic extends rc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2,r=1/n;super([-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,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}}class oc extends $l{constructor(e,t){super(),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ic(e,t)),this.mergeVertices()}}const ac=new Jn,sc=new Jn,lc=new Jn,cc=new di;class uc extends Xi{constructor(e,t){super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1,e.isGeometry&&(e=(new Xi).fromGeometry(e));const n=Math.pow(10,4),r=Math.cos(Bn.DEG2RAD*t),i=e.getIndex(),o=e.getAttribute("position"),a=i?i.count:o.count,s=[0,0,0],l=["a","b","c"],c=new Array(3),u={},d=[];for(let h=0;h0)for(o=t;o=t;o-=r)a=Lc(o,e[o],e[o+1],a);return a&&Tc(a,a.next)&&(Oc(a),a=a.next),a}function hc(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Tc(r,r.next)&&0!==Ec(r.prev,r,r.next))r=r.next;else{if(Oc(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function fc(e,t,n,r,i,o,a){if(!e)return;!a&&o&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=wc(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,o?mc(e,r,i,o):pc(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Oc(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?fc(e=gc(hc(e),t,n),t,n,r,i,o,2):2===a&&vc(e,t,n,r,i,o):fc(hc(e),t,n,r,i,o,1);break}}function pc(e){const t=e.prev,n=e,r=e.next;if(Ec(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(Sc(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ec(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function mc(e,t,n,r){const i=e.prev,o=e,a=e.next;if(Ec(i,o,a)>=0)return!1;const s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,d=wc(s,l,t,n,r),h=wc(c,u,t,n,r);let f=e.prevZ,p=e.nextZ;for(;f&&f.z>=d&&p&&p.z<=h;){if(f!==e.prev&&f!==e.next&&Sc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ec(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==e.prev&&p!==e.next&&Sc(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ec(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=d;){if(f!==e.prev&&f!==e.next&&Sc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ec(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&Sc(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ec(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function gc(e,t,n){let r=e;do{const i=r.prev,o=r.next.next;!Tc(i,o)&&Cc(i,r,r.next,o)&&Pc(i,o)&&Pc(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Oc(r),Oc(r.next),r=e=o),r=r.next}while(r!==e);return hc(r)}function vc(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Mc(a,e)){let s=Rc(a,e);return a=hc(a,a.next),s=hc(s,s.next),fc(a,t,n,r,i,o),void fc(s,t,n,r,i,o)}e=e.next}a=a.next}while(a!==e)}function yc(e,t){return e.x-t.x}function bc(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a){if(a=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x=n.x&&n.x>=l&&r!==n.x&&Sc(io.x||n.x===o.x&&xc(o,n)))&&(o=n,d=u)),n=n.next}while(n!==s);return o}(e,t)){const n=Rc(t,e);hc(t,t.next),hc(n,n.next)}}function xc(e,t){return Ec(e.prev,e,t.prev)<0&&Ec(t.next,e,e.next)<0}function wc(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function _c(e){let t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Mc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Cc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Pc(e,t)&&Pc(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ec(e.prev,e,t.prev)||Ec(e,t.prev,t))||Tc(e,t)&&Ec(e.prev,e,e.next)>0&&Ec(t.prev,t,t.next)>0)}function Ec(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Tc(e,t){return e.x===t.x&&e.y===t.y}function Cc(e,t,n,r){const i=kc(Ec(e,t,n)),o=kc(Ec(e,t,r)),a=kc(Ec(n,r,e)),s=kc(Ec(n,r,t));return i!==o&&a!==s||!(0!==i||!Ac(e,n,t))||!(0!==o||!Ac(e,r,t))||!(0!==a||!Ac(n,e,r))||!(0!==s||!Ac(n,t,r))}function Ac(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function kc(e){return e>0?1:e<0?-1:0}function Pc(e,t){return Ec(e.prev,e,e.next)<0?Ec(e,t,e.next)>=0&&Ec(e,e.prev,t)>=0:Ec(e,t,e.prev)<0||Ec(e,e.next,t)<0}function Rc(e,t){const n=new zc(e.i,e.x,e.y),r=new zc(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Lc(e,t,n,r){const i=new zc(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Oc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function zc(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Dc={area:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i80*n){s=c=e[0],l=u=e[1];for(let t=n;tc&&(c=d),h>u&&(u=h);f=Math.max(c-s,u-l),f=0!==f?1/f:0}return fc(o,a,n,s,l,f),a}(n,r);for(let s=0;s2&&e[t-1].equals(e[0])&&e.pop()}function Ic(e,t){for(let n=0;nNumber.EPSILON){const d=Math.sqrt(u),h=Math.sqrt(l*l+c*c),f=t.x-s/d,p=t.y+a/d,m=((n.x-c/h-f)*c-(n.y+l/h-p)*l)/(a*c-s*l);r=f+a*m-e.x,i=p+s*m-e.y;const g=r*r+i*i;if(g<=2)return new jn(r,i);o=Math.sqrt(g/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(c)&&(e=!0),e?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new jn(r/o,i/o)}const R=[];for(let t=0,n=T.length,r=n-1,i=t+1;t=0;t--){const e=t/f,n=u*Math.cos(e*Math.PI/2),r=d*Math.sin(e*Math.PI/2)+h;for(let t=0,i=T.length;t=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*f;e0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[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],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}}class Hc extends $l{constructor(e,t){super(),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Uc(e,t)),this.mergeVertices()}}class Gc extends Xi{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=Bn.clamp(r,0,2*Math.PI);const i=[],o=[],a=[],s=1/t,l=new Jn,c=new jn;for(let u=0;u<=t;u++){const i=n+u*s*r,d=Math.sin(i),h=Math.cos(i);for(let n=0;n<=e.length-1;n++)l.x=e[n].x*d,l.y=e[n].y,l.z=e[n].x*h,o.push(l.x,l.y,l.z),c.x=u/t,c.y=n/(e.length-1),a.push(c.x,c.y)}for(let u=0;u0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}}class qc extends $l{constructor(e,t){super(),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Wc(e,t)),this.mergeVertices()}}function Xc(e,t,n){Xi.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};const r=[],i=[],o=[],a=[],s=1e-5,l=new Jn,c=new Jn,u=new Jn,d=new Jn,h=new Jn;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const f=t+1;for(let p=0;p<=n;p++){const r=p/n;for(let n=0;n<=t;n++){const f=n/t;e(f,r,c),i.push(c.x,c.y,c.z),f-s>=0?(e(f-s,r,u),d.subVectors(c,u)):(e(f+s,r,u),d.subVectors(u,c)),r-s>=0?(e(f,r-s,u),h.subVectors(c,u)):(e(f,r+s,u),h.subVectors(u,c)),l.crossVectors(d,h).normalize(),o.push(l.x,l.y,l.z),a.push(f,r)}}for(let p=0;p0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;super(),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},n=Math.max(3,n);const a=[],s=[],l=[],c=[];let u=e;const d=(t-e)/(r=Math.max(1,r)),h=new Jn,f=new jn;for(let p=0;p<=r;p++){for(let e=0;e<=n;e++){const r=i+e/n*o;h.x=u*Math.cos(r),h.y=u*Math.sin(r),s.push(h.x,h.y,h.z),l.push(0,0,1),f.x=(h.x/t+1)/2,f.y=(h.y/t+1)/2,c.push(f.x,f.y)}u+=d}for(let p=0;p1&&void 0!==arguments[1]?arguments[1]:12;super(),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],o=[];let a=0,s=0;if(!1===Array.isArray(e))l(e);else for(let c=0;c0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const s=Math.min(o+a,Math.PI);let l=0;const c=[],u=new Jn,d=new Jn,h=[],f=[],p=[],m=[];for(let g=0;g<=n;g++){const h=[],v=g/n;let y=0;0==g&&0==o?y=.5/t:g==n&&s==Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const s=n/t;u.x=-e*Math.cos(r+s*i)*Math.sin(o+v*a),u.y=e*Math.cos(o+v*a),u.z=e*Math.sin(r+s*i)*Math.sin(o+v*a),f.push(u.x,u.y,u.z),d.copy(u).normalize(),p.push(d.x,d.y,d.z),m.push(s+y,1-v),h.push(l++)}c.push(h)}for(let g=0;g0)&&h.push(t,r,a),(g!==n-1||s0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}}class iu extends $l{constructor(e,t){super(),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ru(e,t)),this.mergeVertices()}}class ou extends Fc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Xi;const r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t),this.type="TextBufferGeometry"}}class au extends $l{constructor(e,t){super(),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new ou(e,t)),this.mergeVertices()}}class su extends Xi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const o=[],a=[],s=[],l=[],c=new Jn,u=new Jn,d=new Jn;for(let h=0;h<=n;h++)for(let o=0;o<=r;o++){const f=o/r*i,p=h/n*Math.PI*2;u.x=(e+t*Math.cos(p))*Math.cos(f),u.y=(e+t*Math.cos(p))*Math.sin(f),u.z=t*Math.sin(p),a.push(u.x,u.y,u.z),c.x=e*Math.cos(f),c.y=e*Math.sin(f),d.subVectors(u,c).normalize(),s.push(d.x,d.y,d.z),l.push(o/r),l.push(h/n)}for(let h=1;h<=n;h++)for(let e=1;e<=r;e++){const t=(r+1)*h+e-1,n=(r+1)*(h-1)+e-1,i=(r+1)*(h-1)+e,a=(r+1)*h+e;o.push(t,n,a),o.push(n,i,a)}this.setIndex(o),this.setAttribute("position",new zi(a,3)),this.setAttribute("normal",new zi(s,3)),this.setAttribute("uv",new zi(l,2))}}class lu extends $l{constructor(e,t,n,r,i){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new su(e,t,n,r,i)),this.mergeVertices()}}class cu extends Xi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},n=Math.floor(n),r=Math.floor(r);const a=[],s=[],l=[],c=[],u=new Jn,d=new Jn,h=new Jn,f=new Jn,p=new Jn,m=new Jn,g=new Jn;for(let y=0;y<=n;++y){const a=y/n*i*Math.PI*2;v(a,i,o,e,h),v(a+.01,i,o,e,f),m.subVectors(f,h),g.addVectors(f,h),p.crossVectors(m,g),g.crossVectors(p,m),p.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,o=-t*Math.cos(i),a=t*Math.sin(i);u.x=h.x+(o*g.x+a*p.x),u.y=h.y+(o*g.y+a*p.y),u.z=h.z+(o*g.z+a*p.z),s.push(u.x,u.y,u.z),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(y/n),c.push(e/r)}}for(let y=1;y<=n;y++)for(let e=1;e<=r;e++){const t=(r+1)*(y-1)+(e-1),n=(r+1)*y+(e-1),i=(r+1)*y+e,o=(r+1)*(y-1)+e;a.push(t,n,o),a.push(n,i,o)}function v(e,t,n,r,i){const o=Math.cos(e),a=Math.sin(e),s=n/t*e,l=Math.cos(s);i.x=r*(2+l)*.5*o,i.y=r*(2+l)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(a),this.setAttribute("position",new zi(s,3)),this.setAttribute("normal",new zi(l,3)),this.setAttribute("uv",new zi(c,2))}}class uu extends $l{constructor(e,t,n,r,i,o,a){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new cu(e,t,n,r,i,o)),this.mergeVertices()}}class du extends Xi{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const a=new Jn,s=new Jn,l=new jn;let c=new Jn;const u=[],d=[],h=[],f=[];function p(i){c=e.getPointAt(i/t,c);const l=o.normals[i],h=o.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),o=-Math.cos(t);s.x=o*l.x+i*h.x,s.y=o*l.y+i*h.y,s.z=o*l.z+i*h.z,s.normalize(),d.push(s.x,s.y,s.z),a.x=c.x+n*s.x,a.y=c.y+n*s.y,a.z=c.z+n*s.z,u.push(a.x,a.y,a.z)}}!function(){for(let e=0;e4&&void 0!==arguments[4]?arguments[4]:30;const o=e.clone();o.name=t;const a=[];for(let l=0;l=r)){s.push(e.times[o]);for(let n=0;no.tracks[l].times[0]&&(s=o.tracks[l].times[0]);for(let l=0;l1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;r<=0&&(r=30);const i=n.tracks.length,o=t/r;for(let a=0;a=t.times[d]){const e=d*l+s,n=e+l-s;h=Tu.arraySlice(t.values,e,n)}else{const e=t.createInterpolant(),n=s,r=l-s;e.evaluate(o),h=Tu.arraySlice(e.resultBuffer,n,r)}"quaternion"===r&&(new Zn).fromArray(h).normalize().conjugate().toArray(h);const f=i.times.length;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Wt;this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Bn.generateUUID(),this.duration<0&&this.resetDuration()}function ju(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return zu;case"vector":case"vector2":case"vector3":case"vector4":return Fu;case"color":return Ou;case"quaternion":return Nu;case"bool":case"boolean":return Lu;case"string":return Iu}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];Tu.flattenJSON(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}Object.assign(Cu.prototype,{evaluate:function(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let o;n:{r:if(!(e=i)break e;{const a=t[1];e=i)break t}o=n,n=0}}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const e=this.getValueSize();this.times=Tu.arraySlice(n,i,o),this.values=Tu.arraySlice(this.values,i*e,o*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==i;a++){const t=n[a];if("number"==typeof t&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,t),e=!1;break}if(null!==o&&o>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,t,o),e=!1;break}o=t}if(void 0!==r&&Tu.isTypedArray(r))for(let a=0,s=r.length;a!==s;++a){const t=r[a];if(isNaN(t)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,t),e=!1;break}}return e},optimize:function(){const e=Tu.arraySlice(this.times),t=Tu.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Ut,i=e.length-1;let o=1;for(let a=1;a0){e[o]=e[i];for(let e=i*n,r=o*n,a=0;a!==n;++a)t[r+a]=t[e+a];++o}return o!==e.length?(this.times=Tu.arraySlice(e,0,o),this.values=Tu.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this},clone:function(){const e=Tu.arraySlice(this.times,0),t=Tu.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Lu.prototype=Object.assign(Object.create(Ru.prototype),{constructor:Lu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Bt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ou.prototype=Object.assign(Object.create(Ru.prototype),{constructor:Ou,ValueTypeName:"color"}),zu.prototype=Object.assign(Object.create(Ru.prototype),{constructor:zu,ValueTypeName:"number"}),Du.prototype=Object.assign(Object.create(Cu.prototype),{constructor:Du,interpolate_:function(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t);let l=e*a;for(let c=l+a;l!==c;l+=4)Zn.slerpFlat(i,0,o,l-a,o,l,s);return i}}),Nu.prototype=Object.assign(Object.create(Ru.prototype),{constructor:Nu,ValueTypeName:"quaternion",DefaultInterpolation:jt,InterpolantFactoryMethodLinear:function(e){return new Du(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Iu.prototype=Object.assign(Object.create(Ru.prototype),{constructor:Iu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Bt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Fu.prototype=Object.assign(Object.create(Ru.prototype),{constructor:Fu,ValueTypeName:"vector"}),Object.assign(Bu,{parse:function(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(ju(n[o]).scale(r));const i=new Bu(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i},toJSON:function(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let i=0,o=n.length;i!==o;++i)t.push(Ru.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){const i=t.length,o=[];for(let a=0;a1){const e=n[1];let i=r[e];i||(r[e]=i=[]),i.push(t)}}const o=[];for(const a in r)o.push(Bu.CreateFromMorphTargetSequence(a,r[a],t,n));return o},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const o=[],a=[];Tu.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let c=0;c0||0===e.search(/^data\:image\/jpeg/);i.format=r?Ie:Fe,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(Ku.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let r=0;const i=n.length;let o;o=t||e*n[i-1];let a,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),a=n[r]-o,a<0)s=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===o)return r/(i-1);const c=n[r];return(r+(o-c)/(n[r+1]-c))/(i-1)},getTangent:function(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),o=this.getPoint(r),a=t||(i.isVector2?new jn:new Jn);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new Jn,r=[],i=[],o=[],a=new Jn,s=new Er;for(let h=0;h<=e;h++){const t=h/e;r[h]=this.getTangentAt(t,new Jn),r[h].normalize()}i[0]=new Jn,o[0]=new Jn;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(let h=1;h<=e;h++){if(i[h]=i[h-1].clone(),o[h]=o[h-1].clone(),a.crossVectors(r[h-1],r[h]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(Bn.clamp(r[h-1].dot(r[h]),-1,1));i[h].applyMatrix4(s.makeRotationAxis(a,e))}o[h].crossVectors(r[h],i[h])}if(!0===t){let t=Math.acos(Bn.clamp(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),ed.prototype=Object.create(Ku.prototype),ed.prototype.constructor=ed,ed.prototype.isEllipseCurve=!0,ed.prototype.getPoint=function(e,t){const n=t||new jn,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)r;)i-=r;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;Ku.call(this),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}function ld(e,t,n,r,i){const o=.5*(r-t),a=.5*(i-n),s=e*e;return(2*n-2*r+o+a)*(e*s)+(-3*n+3*r-2*o-a)*s+o*e+n}function cd(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ud(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function dd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new jn,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new jn;Ku.call(this),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function hd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Jn,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Jn;Ku.call(this),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}function fd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn;Ku.call(this),this.type="LineCurve",this.v1=e,this.v2=t}function pd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn;Ku.call(this),this.type="LineCurve3",this.v1=e,this.v2=t}function md(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new jn;Ku.call(this),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}function gd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jn,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Jn;Ku.call(this),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}function vd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ku.call(this),this.type="SplineCurve",this.points=e}sd.prototype=Object.create(Ku.prototype),sd.prototype.constructor=sd,sd.prototype.isCatmullRomCurve3=!0,sd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn,n=this.points,r=n.length,i=(r-(this.closed?0:1))*e;let o,a,s=Math.floor(i),l=i-s;this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/r)+1)*r:0===l&&s===r-1&&(s=r-2,l=1),this.closed||s>0?o=n[(s-1)%r]:(rd.subVectors(n[0],n[1]).add(n[0]),o=rd);const c=n[s%r],u=n[(s+1)%r];if(this.closed||s+21&&void 0!==arguments[1]?arguments[1]:new jn,n=this.v0,r=this.v1,i=this.v2,o=this.v3;return t.set(ud(e,n.x,r.x,i.x,o.x),ud(e,n.y,r.y,i.y,o.y)),t},dd.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},dd.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},dd.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},hd.prototype=Object.create(Ku.prototype),hd.prototype.constructor=hd,hd.prototype.isCubicBezierCurve3=!0,hd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn,n=this.v0,r=this.v1,i=this.v2,o=this.v3;return t.set(ud(e,n.x,r.x,i.x,o.x),ud(e,n.y,r.y,i.y,o.y),ud(e,n.z,r.z,i.z,o.z)),t},hd.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},hd.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},hd.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},fd.prototype=Object.create(Ku.prototype),fd.prototype.constructor=fd,fd.prototype.isLineCurve=!0,fd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t},fd.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},fd.prototype.getTangent=function(e,t){const n=t||new jn;return n.copy(this.v2).sub(this.v1).normalize(),n},fd.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},fd.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},fd.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},pd.prototype=Object.create(Ku.prototype),pd.prototype.constructor=pd,pd.prototype.isLineCurve3=!0,pd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t},pd.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},pd.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},pd.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},pd.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},md.prototype=Object.create(Ku.prototype),md.prototype.constructor=md,md.prototype.isQuadraticBezierCurve=!0,md.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn,n=this.v0,r=this.v1,i=this.v2;return t.set(cd(e,n.x,r.x,i.x),cd(e,n.y,r.y,i.y)),t},md.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},md.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},md.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},gd.prototype=Object.create(Ku.prototype),gd.prototype.constructor=gd,gd.prototype.isQuadraticBezierCurve3=!0,gd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn,n=this.v0,r=this.v1,i=this.v2;return t.set(cd(e,n.x,r.x,i.x),cd(e,n.y,r.y,i.y),cd(e,n.z,r.z,i.z)),t},gd.prototype.copy=function(e){return Ku.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},gd.prototype.toJSON=function(){const e=Ku.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},gd.prototype.fromJSON=function(e){return Ku.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},vd.prototype=Object.create(Ku.prototype),vd.prototype.constructor=vd,vd.prototype.isSplineCurve=!0,vd.prototype.getPoint=function(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new jn,n=this.points,r=(n.length-1)*e,i=Math.floor(r),o=r-i,a=n[0===i?i:i-1],s=n[i],l=n[i>n.length-2?n.length-1:i+1],c=n[i>n.length-3?n.length-1:i+2];return t.set(ld(o,a.x,s.x,l.x,c.x),ld(o,a.y,s.y,l.y,c.y)),t},vd.prototype.copy=function(e){Ku.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t1&&void 0!==arguments[1]?arguments[1]:1;Zr.call(this),this.type="Light",this.color=new yi(e),this.intensity=t}function Sd(e,t,n){_d.call(this,e,n),this.type="HemisphereLight",this.position.copy(Zr.DefaultUp),this.updateMatrix(),this.groundColor=new yi(t)}function Md(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new jn(512,512),this.map=null,this.mapPass=null,this.matrix=new Er,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ao,this._frameExtents=new jn(1,1),this._viewportCount=1,this._viewports=[new Xn(0,0,1,1)]}function Ed(){Md.call(this,new wo(50,1,.5,500)),this.focus=1}function Td(e,t,n,r,i,o){_d.call(this,e,t),this.type="SpotLight",this.position.copy(Zr.DefaultUp),this.updateMatrix(),this.target=new Zr,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new Ed}function Cd(){Md.call(this,new wo(90,1,.5,500)),this._frameExtents=new jn(4,2),this._viewportCount=6,this._viewports=[new Xn(2,1,1,1),new Xn(0,1,1,1),new Xn(3,1,1,1),new Xn(1,1,1,1),new Xn(3,0,1,1),new Xn(1,0,1,1)],this._cubeDirections=[new Jn(1,0,0),new Jn(-1,0,0),new Jn(0,0,1),new Jn(0,0,-1),new Jn(0,1,0),new Jn(0,-1,0)],this._cubeUps=[new Jn(0,1,0),new Jn(0,1,0),new Jn(0,1,0),new Jn(0,1,0),new Jn(0,0,1),new Jn(0,0,-1)]}function Ad(e,t,n,r){_d.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Cd}function kd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;xo.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}function Pd(){Md.call(this,new kd(-5,5,5,-5,.5,500))}function Rd(e,t){_d.call(this,e,t),this.type="DirectionalLight",this.position.copy(Zr.DefaultUp),this.updateMatrix(),this.target=new Zr,this.shadow=new Pd}function Ld(e,t){_d.call(this,e,t),this.type="AmbientLight"}function Od(e,t,n,r){_d.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}bd.prototype=Object.assign(Object.create(Ku.prototype),{constructor:bd,add:function(e){this.curves.push(e)},closePath:function(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new fd(t,e))},getPoint:function(e){const t=e*this.getLength(),n=this.getCurveLengths();let r=0;for(;r=t){const e=n[r]-t,i=this.curves[r],o=i.getLength(),a=0===o?0:1-e/o;return i.getPointAt(a)}r++}return null},getLength:function(){const e=this.getCurveLengths();return e[e.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;const e=[];let t=0;for(let n=0,r=this.curves.length;n0&&void 0!==arguments[0]?arguments[0]:40;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=[];let n;for(let r=0,i=this.curves;r1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){Ku.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return bd.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=bd.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return bd.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),wd.prototype=Object.assign(Object.create(xd.prototype),{constructor:wd,getPointsHoles:function(e){const t=[];for(let n=0,r=this.holes.length;n1&&void 0!==arguments[1]?arguments[1]:0;const n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),Ad.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ad,isPointLight:!0,copy:function(e){return _d.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),kd.prototype=Object.assign(Object.create(xo.prototype),{constructor:kd,isOrthographicCamera:!0,copy:function(e,t){return xo.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,o=i+e*this.view.width,a-=t*this.view.offsetY,s=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=Zr.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),Pd.prototype=Object.assign(Object.create(Md.prototype),{constructor:Pd,isDirectionalLightShadow:!0,updateMatrices:function(e){Md.prototype.updateMatrices.call(this,e)}}),Rd.prototype=Object.assign(Object.create(_d.prototype),{constructor:Rd,isDirectionalLight:!0,copy:function(e){return _d.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Ld.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ld,isAmbientLight:!0}),Od.prototype=Object.assign(Object.create(_d.prototype),{constructor:Od,isRectAreaLight:!0,copy:function(e){return _d.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){const t=_d.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}});class zd{constructor(){Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Jn)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*i),t.addScaledVector(o[3],.488603*n),t.addScaledVector(o[4],n*r*1.092548),t.addScaledVector(o[5],r*i*1.092548),t.addScaledVector(o[6],.315392*(3*i*i-1)),t.addScaledVector(o[7],n*i*1.092548),t.addScaledVector(o[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],1.023328*r),t.addScaledVector(o[2],1.023328*i),t.addScaledVector(o[3],1.023328*n),t.addScaledVector(o[4],.858086*n*r),t.addScaledVector(o[5],.858086*r*i),t.addScaledVector(o[6],.743125*i*i-.247708),t.addScaledVector(o[7],.858086*n*i),t.addScaledVector(o[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}function Dd(e,t){_d.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new zd}function Nd(e){Vu.call(this,e),this.textures={}}Dd.prototype=Object.assign(Object.create(_d.prototype),{constructor:Dd,isLightProbe:!0,copy:function(e){return _d.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){const t=_d.prototype.toJSON.call(this,e);return t.object.sh=this.sh.toArray(),t}}),Nd.prototype=Object.assign(Object.create(Vu.prototype),{constructor:Nd,load:function(e,t,n,r){const i=this,o=new qu(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=new Eu[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new yi).setHex(e.sheen)),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.vertexTangents&&(r.vertexTangents=e.vertexTangents),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const i in e.uniforms){const t=e.uniforms[i];switch(r.uniforms[i]={},t.type){case"t":r.uniforms[i].value=n(t.value);break;case"c":r.uniforms[i].value=(new yi).setHex(t.value);break;case"v2":r.uniforms[i].value=(new jn).fromArray(t.value);break;case"v3":r.uniforms[i].value=(new Jn).fromArray(t.value);break;case"v4":r.uniforms[i].value=(new Xn).fromArray(t.value);break;case"m3":r.uniforms[i].value=(new Un).fromArray(t.value);break;case"m4":r.uniforms[i].value=(new Er).fromArray(t.value);break;default:r.uniforms[i].value=t.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const i in e.extensions)r.extensions[i]=e.extensions[i];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new jn).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new jn).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});const Id={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n0){const n=new Hu(t);i=new $u(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;tNumber.EPSILON){if(l<0&&(n=t[o],s=-s,a=t[i],l=-l),e.ya.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const i=Dc.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);let a,s,l;const c=[];if(1===o.length)return s=o[0],l=new wd,l.curves=s.curves,c.push(l),c;let u=!i(o[0].getPoints());u=e?!u:u;const d=[],h=[];let f,p,m=[],g=0;h[g]=void 0,m[g]=[];for(let v=0,y=o.length;v1){let e=!1;const t=[];for(let n=0,r=h.length;n0&&(e||(m=d))}for(let v=0,y=h.length;v1&&void 0!==arguments[1]?arguments[1]:100,this.data);for(let r=0,i=n.length;r0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e1&&void 0!==arguments[1]?arguments[1]:2048;this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let i=n,o=r;i!==o;++i)t[i]=t[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){Zn.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){const o=this._workIndex*i;Zn.multiplyQuaternionsFlat(e,o,e,t,e,n),Zn.slerpFlat(e,t,e,t,e,o,r)},_lerp:function(e,t,n,r,i){const o=1-r;for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]*o+e[n+a]*r}},_lerpAdditive:function(e,t,n,r,i){for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]+e[n+o]*r}}});const bh=new RegExp("[\\[\\]\\.:\\/]","g"),xh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",wh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),_h=/(WCOD+)?/.source.replace("WCOD",xh),Sh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Mh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Eh=new RegExp("^"+wh+_h+Sh+Mh+"$"),Th=["material","materials","bones"];function Ch(e,t,n){const r=n||Ah.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Ah(e,t,n){this.path=t,this.parsedPath=n||Ah.parseTrackName(t),this.node=Ah.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function kh(){this.uuid=Bn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}Object.assign(Ch.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Ah,{Composite:Ch,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Ah.Composite(e,t,n):new Ah(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(bh,"")},parseTrackName:function(e){const t=Eh.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==Th.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r=i){const o=i++,c=e[o];t[c.uuid]=l,e[l]=c,t[s]=o,e[o]=a;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[l];t[l]=r,t[o]=i}}}this.nCachedObjects_=i},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,o=e.length;for(let a=0,s=arguments.length;a!==s;++a){const s=arguments[a].uuid,l=t[s];if(void 0!==l)if(delete t[s],l0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,o.push(e),a.push(t),i.push(u);for(let d=c,h=s.length;d!==h;++d){const n=s[d];u[d]=new Ah(n,e,t)}return u},unsubscribe_:function(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];t[e[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}});class Ph{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,o=i.length,a=new Array(o),s={endingStart:Ht,endingEnd:Ht};for(let l=0;l!==o;++l){const e=i[l].createInterpolant(null);a[l]=e,e.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=It,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,o=n/r;e.warp(1,i,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;if(this.blendMode===qt)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(o),t[n].accumulateAdditive(a);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(o),t[n].accumulate(r,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const o=n===Ft;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(n===Nt){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Gt,r.endingEnd=Gt):(r.endingStart=e?this.zeroSlopeAtStart?Gt:Ht:Vt,r.endingEnd=t?this.zeroSlopeAtEnd?Gt:Ht:Vt)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}function Rh(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Rh.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Rh,_bindAction:function(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let u=0;u!==i;++u){const e=r[u],i=e.name;let l=c[i];if(void 0!==l)o[u]=l;else{if(l=o[u],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,s,i));continue}const r=t&&t._propertyBindings[u].binding.parsedPath;l=new yh(Ah.create(n,i,r),e.ValueTypeName,e.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,s,i),o[u]=l}a[u].resultBuffer=l.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1;for(let l=0;l!==n;++l)t[l]._update(r,e,i,o);const a=this._bindings,s=this._nActiveBindings;for(let l=0;l!==s;++l)a[l].apply(o);return this},setTime:function(e){this.time=0;for(let t=0;t0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}clone(){return(new this.constructor).copy(this)}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Bn.clamp(t/this.radius,-1,1))),this}}class Bh{constructor(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}clone(){return(new this.constructor).copy(this)}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}}const jh=new jn;class Uh{constructor(e,t){Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==e?e:new jn(1/0,1/0),this.max=void 0!==t?t:new jn(-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new jn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new jn),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return jh.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Hh=new Jn,Gh=new Jn;class Vh{constructor(e,t){this.start=void 0!==e?e:new Jn,this.end=void 0!==t?t:new Jn}set(e,t){return this.start.copy(e),this.end.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Jn),e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Jn),e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Jn),this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Hh.subVectors(e,this.start),Gh.subVectors(this.end,this.start);const n=Gh.dot(Gh);let r=Gh.dot(Hh)/n;return t&&(r=Bn.clamp(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Jn),this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}function Wh(e){Zr.call(this),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Wh.prototype=Object.create(Zr.prototype),Wh.prototype.constructor=Wh,Wh.prototype.isImmediateRenderObject=!0;const qh=new Jn;class Xh extends Zr{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new Xi,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,s=32;o0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;n=new yi(n),r=new yi(r);const i=t/2,o=e/t,a=e/2,s=[],l=[];for(let u=0,d=0,h=-a;u<=t;u++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);const e=u===i?n:r;e.toArray(l,d),d+=3,e.toArray(l,d),d+=3,e.toArray(l,d),d+=3,e.toArray(l,d),d+=3}const c=new Xi;c.setAttribute("position",new zi(s,3)),c.setAttribute("color",new zi(l,3)),super(c,new Sl({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class of extends Ll{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;i=new yi(i),o=new yi(o);const a=[],s=[];for(let c=0;c<=t;c++){const n=c/t*(2*Math.PI),r=Math.sin(n)*e,l=Math.cos(n)*e;a.push(0,0,0),a.push(r,0,l);const u=1&c?i:o;s.push(u.r,u.g,u.b),s.push(u.r,u.g,u.b)}for(let c=0;c<=n;c++){const t=1&c?i:o,l=e-e/n*c;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:16776960;const 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=new Float32Array(24),i=new Xi;i.setIndex(new Ei(n,1)),i.setAttribute("position",new Ei(r,3)),super(i,new Sl({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&pf.setFromObject(this.object),pf.isEmpty())return;const t=pf.min,n=pf.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Ll.prototype.copy.call(this,e),this.object=e.object,this}}class gf extends Ll{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const 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=new Xi;r.setIndex(new Ei(n,1)),r.setAttribute("position",new zi([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new Sl({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class vf extends kl{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960,r=new Xi;r.setAttribute("position",new zi([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],3)),r.computeBoundingSphere(),super(r,new Sl({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const i=new Xi;i.setAttribute("position",new zi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),i.computeBoundingSphere(),this.add(new ho(i,new _i({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?m:p,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const yf=new Jn;let bf,xf;class wf extends Zr{constructor(e,t,n,r,i,o){super(),this.type="ArrowHelper",void 0===e&&(e=new Jn(0,0,1)),void 0===t&&(t=new Jn(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===bf&&(bf=new Xi,bf.setAttribute("position",new zi([0,0,0,0,1,0],3)),xf=new Kl(0,.5,1,5,1),xf.translate(0,-.5,0)),this.position.copy(t),this.line=new kl(bf,new Sl({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new ho(xf,new _i({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{yf.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(yf,t)}}setLength(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class _f extends Ll{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new Xi;n.setAttribute("position",new zi(t,3)),n.setAttribute("color",new zi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new Sl({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}const Sf=new Float32Array(1),Mf=new Int32Array(Sf.buffer),Ef={toHalfFloat:function(e){Sf[0]=e;const t=Mf[0];let n=t>>16&32768,r=t>>12&2047;const i=t>>23&255;return i<103?n:i>142?(n|=31744,n|=(255==i?0:1)&&8388607&t,n):i<113?(r|=2048,n|=(r>>114-i)+(r>>113-i&1),n):(n|=i-112<<10|r>>1,n+=1&r,n)}},Tf=Math.pow(2,8),Cf=[.125,.215,.35,.446,.526,.582],Af=5+Cf.length,kf={[Zt]:0,[Jt]:1,[Kt]:2,[tn]:3,[nn]:4,[rn]:5,[Qt]:6},Pf=new kd,{_lodPlanes:Rf,_sizeLods:Lf,_sigmas:Of}=function(){const e=[],t=[],n=[];let r=8;for(let i=0;i4?a=Cf[i-8+4-1]:0==i&&(a=0),n.push(a);const s=1/(o-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],d=6,h=6,f=3,p=2,m=1,g=new Float32Array(f*h*d),v=new Float32Array(p*h*d),y=new Float32Array(m*h*d);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,f*h*e),v.set(u,p*h*e);const i=[e,e,e,e,e,e];y.set(i,m*h*e)}const b=new Xi;b.setAttribute("position",new Ei(g,f)),b.setAttribute("uv",new Ei(v,p)),b.setAttribute("faceIndex",new Ei(y,m)),e.push(b),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),zf=new yi;let Df=null;const Nf=(1+Math.sqrt(5))/2,If=1/Nf,Ff=[new Jn(1,1,1),new Jn(-1,1,1),new Jn(1,1,-1),new Jn(-1,1,-1),new Jn(0,Nf,If),new Jn(0,Nf,-If),new Jn(If,0,Nf),new Jn(-If,0,Nf),new Jn(Nf,If,0),new Jn(-Nf,If,0)];class Bf{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=new gu({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Jn(0,1,0)},inputEncoding:{value:kf[Zt]},outputEncoding:{value:kf[Zt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:b,depthTest:!1,depthWrite:!1}),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Df=this._renderer.getRenderTarget();const i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Vf(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Gf(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e2?Tf:0,Tf,Tf),s.setRenderTarget(r),s.render(e,i)}s.toneMapping=c,s.outputEncoding=l,s.setClearColor(zf,u)}_textureToCubeUV(e,t){const n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Vf()):null==this._equirectShader&&(this._equirectShader=Gf());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,i=new ho(Rf[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=kf[e.encoding],o.outputEncoding.value=kf[t.texture.encoding],Hf(t,0,0,3*Tf,2*Tf),n.setRenderTarget(t),n.render(i,Pf)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let r=1;r20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to 20"));const m=[];let g=0;for(let y=0;y<20;++y){const e=y/f,t=Math.exp(-e*e/2);m.push(t),0==y?g+=t:y4?r-8+4:0),3*v,2*v),s.setRenderTarget(t),s.render(c,Pf)}}function jf(e){return void 0!==e&&e.type===Me&&(e.encoding===Zt||e.encoding===Jt||e.encoding===Qt)}function Uf(e){const t=new Yn(3*Tf,3*Tf,e);return t.texture.mapping=ce,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Hf(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Gf(){return new gu({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new jn(1,1)},inputEncoding:{value:kf[Zt]},outputEncoding:{value:kf[Zt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:b,depthTest:!1,depthWrite:!1})}function Vf(){return new gu({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:kf[Zt]},outputEncoding:{value:kf[Zt]}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t".concat("\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t","\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t"),blending:b,depthTest:!1,depthWrite:!1})}function Wf(e,t,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new bi(e,t,n,i,o,a)}const qf=0,Xf=1,Yf=0,$f=1,Zf=2;function Jf(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function Qf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function Kf(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Bl(e,t)}function ep(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new rl(e)}function tp(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Bl(e,t)}function np(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new zl(e)}function rp(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new zl(e)}function ip(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new zl(e)}function op(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Jn(e,t,n)}function ap(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Ei(e,t).setUsage(Tn)}function sp(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Ti(e,t)}function lp(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Ci(e,t)}function cp(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ai(e,t)}function up(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ki(e,t)}function dp(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Pi(e,t)}function hp(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Ri(e,t)}function fp(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Li(e,t)}function pp(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new zi(e,t)}function mp(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Di(e,t)}function gp(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),sd.call(this,e),this.type="catmullrom",this.closed=!0}function vp(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),sd.call(this,e),this.type="catmullrom"}function yp(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),sd.call(this,e),this.type="catmullrom"}function bp(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new _f(e)}function xp(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new mf(e,t)}function wp(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Ll(new uc(e.geometry),new Sl({color:void 0!==t?t:16777215}))}function _p(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Ll(new fu(e.geometry),new Sl({color:void 0!==t?t:16777215}))}function Sp(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new qu(e)}function Mp(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Ju(e)}function Ep(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new Mo(e,n)}Ku.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Ku.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(bd.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const t=new $l;for(let n=0,r=e.length;n0&&t-1 in e)}S.fn=S.prototype={jquery:"3.5.1",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+I+")"+I+"*"),W=new RegExp(I+"|>"),q=new RegExp(j),X=new RegExp("^"+F+"$"),Y={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{O.apply(P=z.call(w.childNodes),w.childNodes),P[w.childNodes.length].nodeType}catch(e){O={apply:P.length?function(e,t){L.apply(e,z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,c,u,d,p,v,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(h(t),t=t||f,m)){if(11!==w&&(d=K.exec(e)))if(o=d[1]){if(9===w){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(y&&(c=y.getElementById(o))&&b(t,c)&&c.id===o)return r.push(c),r}else{if(d[2])return O.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!C[e+" "]&&(!g||!g.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(v=e,y=t,1===w&&(W.test(e)||V.test(e))){for((y=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((u=t.getAttribute("id"))?u=u.replace(re,ie):t.setAttribute("id",u=x)),s=(p=a(e)).length;s--;)p[s]=(u?"#"+u:":scope")+" "+be(p[s]);v=p.join(",")}try{return O.apply(r,y.querySelectorAll(v)),r}catch(t){C(e,!0)}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(H,"$1"),t,r,i)}function le(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ce(e){return e[x]=!0,e}function ue(e){var t=f.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ce((function(t){return t=+t,ce((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!$.test(t||n&&n.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=f&&9===a.nodeType&&a.documentElement?(p=(f=a).documentElement,m=!o(f),w!=f&&(i=f.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ue((function(e){return p.appendChild(e).appendChild(f.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ue((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ue((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=ue((function(e){return p.appendChild(e).id=x,!f.getElementsByName||!f.getElementsByName(x).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Q.test(f.querySelectorAll))&&(ue((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+I+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+I+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),(t=f.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+I+"*name"+I+"*="+I+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ue((function(e){e.innerHTML="";var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+I+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ue((function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),v.push("!=",j)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(p.compareDocumentPosition),b=t||Q.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==f||e.ownerDocument==w&&b(w,e)?-1:t==f||t.ownerDocument==w&&b(w,t)?1:u?D(u,e)-D(u,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==f?-1:t==f?1:i?-1:o?1:u?D(u,e)-D(u,t):0;if(i===o)return he(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?he(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0},f):f},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(h(e),n.matchesSelector&&m&&!C[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){C(t,!0)}return se(t,f,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=f&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=f&&h(e);var i=r.attrHandle[t.toLowerCase()],o=i&&k.call(r.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:n.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(A),d){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return u=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=se.selectors={cacheLength:50,createPseudo:ce,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&q.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=M[e+" "];return t||(t=new RegExp("(^|"+I+")"+e+"("+I+"|$)"))&&M(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,h,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(g){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(b=(f=(c=(u=(d=(h=g)[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&c[1])&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){u[e]=[_,f,b];break}}else if(y&&(b=f=(c=(u=(d=(h=t)[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===_&&c[1]),!1===b)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&((u=(d=h[x]||(h[x]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=D(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ce((function(e){var t=[],n=[],r=s(e.replace(H,"$1"));return r[x]?ce((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return se(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ce((function(e){return X.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;s-1&&(o[c]=!(a[c]=d))}}else v=_e(v===a?v.splice(p,v.length):v),i?i(null,a,v,l):O.apply(a,v)}))}function Me(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],l=a?1:0,u=xe((function(e){return e===t}),s,!0),d=xe((function(e){return D(t,e)>-1}),s,!0),h=[function(e,n,r){var i=!a&&(r||n!==c)||((t=n).nodeType?u(e,n,r):d(e,n,r));return t=null,i}];l1&&we(h),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(H,"$1"),n,l0,i=e.length>0,o=function(o,a,s,l,u){var d,p,g,v=0,y="0",b=o&&[],x=[],w=c,S=o||i&&r.find.TAG("*",u),M=_+=null==w?1:Math.random()||.1,E=S.length;for(u&&(c=a==f||a||u);y!==E&&null!=(d=S[y]);y++){if(i&&d){for(p=0,a||d.ownerDocument==f||(h(d),s=!m);g=e[p++];)if(g(d,a||f,s)){l.push(d);break}u&&(_=M)}n&&((d=!g&&d)&&v--,o&&b.push(d))}if(v+=y,n&&y!==v){for(p=0;g=t[p++];)g(b,x,a,s);if(o){if(v>0)for(;y--;)b[y]||x[y]||(x[y]=R.call(l));x=_e(x)}O.apply(l,x),u&&!o&&x.length>0&&v+t.length>1&&se.uniqueSort(l)}return u&&(_=M,c=w),b};return n?ce(o):o}(o,i))).selector=e}return s},l=se.select=function(e,t,n,i){var o,l,c,u,d,h="function"==typeof e&&e,f=!i&&a(e=h.selector||e);if(n=n||[],1===f.length){if((l=f[0]=f[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===t.nodeType&&m&&r.relative[l[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=Y.needsContext.test(e)?0:l.length;o--&&(c=l[o],!r.relative[u=c.type]);)if((d=r.find[u])&&(i=d(c.matches[0].replace(te,ne),ee.test(l[0].type)&&ve(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return O.apply(n,i),n;break}}return(h||s(e,f))(i,t,!m,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=x.split("").sort(A).join("")===x,n.detectDuplicates=!!d,h(),n.sortDetached=ue((function(e){return 1&e.compareDocumentPosition(f.createElement("fieldset"))})),ue((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ue((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ue((function(e){return null==e.getAttribute("disabled")}))||de(N,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(n);S.find=E,S.expr=E.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=E.uniqueSort,S.text=E.getText,S.isXMLDoc=E.isXML,S.contains=E.contains,S.escapeSelector=E.escape;var T=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=S.expr.match.needsContext;function k(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function R(e,t,n){return v(t)?S.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?S.grep(e,(function(e){return u.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(R(this,e||[],!1))},not:function(e){return this.pushStack(R(this,e||[],!0))},is:function(e){return!!R(this,"string"==typeof e&&A.test(e)?S(e):e||[],!1).length}});var L,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||L,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:O.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),P.test(r[1])&&S.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=b.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,L=S(b);var z=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(S(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(k(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(D[e]||S.uniqueSort(i),z.test(e)&&i.reverse()),this.pushStack(i)}}));var I=/[^\x20\t\r\n\f]+/g;function F(e){return e}function B(e){throw e}function j(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(I)||[],(function(e,n){t[n]=!0})),t}(e):S.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(e){var t=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(n){S.each(t,(function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,i){var o=0;function a(e,t,r,i){return function(){var s=this,l=arguments,c=function(){var n,c;if(!(e=o&&(r!==B&&(s=void 0,l=[n]),t.rejectWith(s,l))}};e?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),n.setTimeout(u))}}return S.Deferred((function(n){t[0][3].add(a(0,n,v(i)?i:F,n.notifyWith)),t[1][3].add(a(0,n,v(e)?e:F)),t[2][3].add(a(0,n,v(r)?r:B))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(t,(function(e,n){var a=n[2],s=n[5];i[n[1]]=a.add,s&&a.add((function(){r=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=S.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(j(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)j(i[n],a(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&U.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){n.setTimeout((function(){throw e}))};var H=S.Deferred();function G(){b.removeEventListener("DOMContentLoaded",G),n.removeEventListener("load",G),S.ready()}S.fn.ready=function(e){return H.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||H.resolveWith(b,[S]))}}),S.ready.then=H.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",G),n.addEventListener("load",G));var V=function(e,t,n,r,i,o,a){var s=0,l=e.length,c=null==n;if("object"===_(n))for(s in i=!0,n)V(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),c&&(a?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(S(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each((function(){Q.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){S.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:S.Callbacks("once memory").add((function(){J.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;fe=b.createDocumentFragment().appendChild(b.createElement("div")),(pe=b.createElement("input")).setAttribute("type","radio"),pe.setAttribute("checked","checked"),pe.setAttribute("name","t"),fe.appendChild(pe),g.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="",g.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue,fe.innerHTML="",g.option=!!fe.lastChild;var ye={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function be(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&k(e,t)?S.merge([e],n):n}function xe(e,t){for(var n=0,r=e.length;n",""]);var we=/<|&#?\w+;/;function _e(e,t,n,r,i){for(var o,a,s,l,c,u,d=t.createDocumentFragment(),h=[],f=0,p=e.length;f-1)i&&i.push(o);else if(c=ae(o),a=be(d.appendChild(o),"script"),c&&xe(a),n)for(u=0;o=a[u++];)ve.test(o.type||"")&&n.push(o);return d}var Se=/^key/,Me=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ce(){return!1}function Ae(e,t){return e===function(){try{return b.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ce;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,r,n)}))}function Pe(e,t,n){n?(J.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=J.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),J.set(this,t,o),r=n(this,t),this[t](),o!==(i=J.get(this,t))||r?J.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else o.length&&(J.set(this,t,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===J.get(e,t)&&S.event.add(e,t,Te)}S.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g=J.get(e);if($(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(oe,i),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(I)||[""]).length;c--;)f=m=(s=Ee.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=S.event.special[f]||{},u=S.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,u):h.push(u),S.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,d,h,f,p,m,g=J.hasData(e)&&J.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(I)||[""]).length;c--;)if(f=m=(s=Ee.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},h=l[f=(r?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)u=h[o],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||S.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)S.event.remove(e,f+t[c],n,r,!0);S.isEmptyObject(l)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=S.event.fix(e),c=(J.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:S.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l\s*$/g;function ze(e,t){return k(e,"table")&&k(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ne(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(J.hasData(e)&&(s=J.get(e).events))for(i in J.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof p&&!g.checkClone&&Le.test(p))return e.each((function(i){var o=e.eq(i);m&&(t[0]=p.call(this,i,o.html())),Be(o,t,n,r)}));if(h&&(o=(i=_e(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=S.map(be(i,"script"),De)).length;d0&&xe(a,!l&&be(e,"script")),s},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return je(this,e,!0)},remove:function(e){return je(this,e)},text:function(e){return V(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Be(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ze(this,e).appendChild(e)}))},prepend:function(){return Be(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ze(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Re.test(e)&&!ye[(ge.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n3,oe.removeChild(e)),s}}))}();var Xe=["Webkit","Moz","ms"],Ye=b.createElement("div").style,$e={};function Ze(e){return S.cssProps[e]||$e[e]||(e in Ye?e:$e[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Xe.length;n--;)if((e=Xe[n]+t)in Ye)return e}(e)||e)}var Je=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Ke={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:"0",fontWeight:"400"};function tt(e,t,n){var r=re.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function nt(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=S.css(e,n+ie[a],!0,i)),r?("content"===n&&(l-=S.css(e,"padding"+ie[a],!0,i)),"margin"!==n&&(l-=S.css(e,"border"+ie[a]+"Width",!0,i))):(l+=S.css(e,"padding"+ie[a],!0,i),"padding"!==n?l+=S.css(e,"border"+ie[a]+"Width",!0,i):s+=S.css(e,"border"+ie[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function rt(e,t,n){var r=He(e),i=(!g.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ue.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&i||!g.reliableTrDimensions()&&k(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+nt(e,t,n||(i?"border":"content"),o,r,a)+"px"}function it(e,t,n,r,i){return new it.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=Y(t),l=Qe.test(t),c=e.style;if(l||(t=Ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t];"string"===(o=typeof n)&&(i=re.exec(n))&&i[1]&&(n=ce(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=Y(t);return Qe.test(t)||(t=Ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in et&&(i=et[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Je.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?rt(e,t,r):Ge(e,Ke,(function(){return rt(e,t,r)}))},set:function(e,n,r){var i,o=He(e),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,o),l=r?nt(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-nt(e,t,"border",!1,o)-.5)),l&&(i=re.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),tt(0,n,l)}}})),S.cssHooks.marginLeft=qe(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Ge(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ie[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=tt)})),S.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=He(e),i=t.length;a1)}}),S.Tween=it,it.prototype={constructor:it,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=it.propHooks[this.prop];return e&&e.get?e.get(this):it.propHooks._default.get(this)},run:function(e){var t,n=it.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):it.propHooks._default.set(this),this}},it.prototype.init.prototype=it.prototype,it.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},it.propHooks.scrollTop=it.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=it.prototype.init,S.fx.step={};var ot,at,st=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function ct(){at&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ct):n.setTimeout(ct,S.fx.interval),S.fx.tick())}function ut(){return n.setTimeout((function(){ot=void 0})),ot=Date.now()}function dt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ie[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ht(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&k(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(I);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=mt[t]||S.find.attr;mt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=mt[a],mt[a]=i,i=null!=n(e,t,r)?a:null,mt[a]=o),i}}));var gt=/^(?:input|select|textarea|button)$/i,vt=/^(?:a|area)$/i;function yt(e){return(e.match(I)||[]).join(" ")}function bt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)||[]}S.fn.extend({prop:function(e,t){return V(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||vt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){S(this).addClass(e.call(this,t,bt(this)))}));if((t=xt(e)).length)for(;n=this[l++];)if(i=bt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=yt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(v(e))return this.each((function(t){S(this).removeClass(e.call(this,t,bt(this)))}));if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)for(;n=this[l++];)if(i=bt(n),r=1===n.nodeType&&" "+yt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=yt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):v(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,bt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=S(this),a=xt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=bt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(bt(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(wt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},g.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in n;var _t=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,r,i){var o,a,s,l,c,u,d,h,p=[r||b],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=r=r||b,3!==r.nodeType&&8!==r.nodeType&&!_t.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(e=e[S.expando]?e:new S.Event(m,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:S.makeArray(t,[e]),d=S.event.special[m]||{},i||!d.trigger||!1!==d.trigger.apply(r,t))){if(!i&&!d.noBubble&&!y(r)){for(l=d.delegateType||m,_t.test(l+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||b)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?l:d.bindType||m,(u=(J.get(a,"events")||Object.create(null))[e.type]&&J.get(a,"handle"))&&u.apply(a,t),(u=c&&a[c])&&u.apply&&$(a)&&(e.result=u.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!$(r)||c&&v(r[m])&&!y(r)&&((s=r[c])&&(r[c]=null),S.event.triggered=m,e.isPropagationStopped()&&h.addEventListener(m,St),r[m](),e.isPropagationStopped()&&h.removeEventListener(m,St),S.event.triggered=void 0,s&&(r[c]=s)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),g.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}}));var Mt=n.location,Et={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var Ct=/\[\]$/,At=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Pt=/^(?:input|select|textarea|keygen)/i;function Rt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,(function(t,i){n||Ct.test(e)?r(e,i):Rt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)Rt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(n in e)Rt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Pt.test(this.nodeName)&&!kt.test(e)&&(this.checked||!me.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(At,"\r\n")}})):{name:t.name,value:n.replace(At,"\r\n")}})).get()}});var Lt=/%20/g,Ot=/#.*$/,zt=/([?&])_=[^&]*/,Dt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,It=/^\/\//,Ft={},Bt={},jt="*/".concat("*"),Ut=b.createElement("a");function Ht(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(I)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Gt(e,t,n,r){var i={},o=e===Bt;function a(s){var l;return i[s]=!0,S.each(e[s]||[],(function(e,s){var c=s(t,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),a(c),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Vt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Ut.href=Mt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":jt,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Vt(Vt(e,S.ajaxSettings),t):Vt(S.ajaxSettings,e)},ajaxPrefilter:Ht(Ft),ajaxTransport:Ht(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,c,u,d,h,f=S.ajaxSetup({},t),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?S(p):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),y=f.statusCode||{},x={},w={},_="canceled",M={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Dt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)M.always(e[M.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||_;return r&&r.abort(t),E(0,t),this}};if(g.promise(M),f.url=((e||f.url||Mt.href)+"").replace(It,Mt.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(I)||[""],null==f.crossDomain){l=b.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ut.protocol+"//"+Ut.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Gt(Ft,f,t,M),c)return M;for(d in(u=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Nt.test(f.type),i=f.url.replace(Ot,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Lt,"+")):(h=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(Tt.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(zt,"$1"),h=(Tt.test(i)?"&":"?")+"_="+Et.guid+++h),f.url=i+h),f.ifModified&&(S.lastModified[i]&&M.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&M.setRequestHeader("If-None-Match",S.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&M.setRequestHeader("Content-Type",f.contentType),M.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+jt+"; q=0.01":""):f.accepts["*"]),f.headers)M.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,M,f)||c))return M.abort();if(_="abort",v.add(f.complete),M.done(f.success),M.fail(f.error),r=Gt(Bt,f,t,M)){if(M.readyState=1,u&&m.trigger("ajaxSend",[M,f]),c)return M;f.async&&f.timeout>0&&(s=n.setTimeout((function(){M.abort("timeout")}),f.timeout));try{c=!1,r.send(x,E)}catch(e){if(c)throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,a,l){var d,h,b,x,w,_=t;c||(c=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",M.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,M,a)),!d&&S.inArray("script",f.dataTypes)>-1&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var i,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,x,M,d),d?(f.ifModified&&((w=M.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=w),(w=M.getResponseHeader("etag"))&&(S.etag[i]=w)),204===e||"HEAD"===f.type?_="nocontent":304===e?_="notmodified":(_=x.state,h=x.data,d=!(b=x.error))):(b=_,!e&&_||(_="error",e<0&&(e=0))),M.status=e,M.statusText=(t||_)+"",d?g.resolveWith(p,[h,_,M]):g.rejectWith(p,[M,_,b]),M.statusCode(y),y=void 0,u&&m.trigger(d?"ajaxSuccess":"ajaxError",[M,f,d?h:b]),v.fireWith(p,[M,_]),u&&(m.trigger("ajaxComplete",[M,f]),--S.active||S.event.trigger("ajaxStop")))}return M},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},qt=S.ajaxSettings.xhr();g.cors=!!qt&&"withCredentials"in qt,g.ajax=qt=!!qt,S.ajaxTransport((function(e){var t,r;if(g.cors||qt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=S("