1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[48233],{681:(e,t,i)=>{i.d(t,{N:()=>o});var n=i(17246),r=i(10892),s=i(93154),a=i(71865);let o=s.forwardRef((e,t)=>{let{makeDefault:i,camera:o,regress:l,domElement:h,enableDamping:c=!0,keyEvents:u=!1,onChange:d,onStart:p,onEnd:f,...m}=e,g=(0,r.C)(e=>e.invalidate),v=(0,r.C)(e=>e.camera),_=(0,r.C)(e=>e.gl),x=(0,r.C)(e=>e.events),y=(0,r.C)(e=>e.setEvents),M=(0,r.C)(e=>e.set),S=(0,r.C)(e=>e.get),b=(0,r.C)(e=>e.performance),T=o||v,w=h||x.connected||_.domElement,E=s.useMemo(()=>new a.N(T),[T]);return(0,r.D)(()=>{E.enabled&&E.update()},-1),s.useEffect(()=>(u&&E.connect(!0===u?w:u),E.connect(w),()=>void E.dispose()),[u,w,l,E,g]),s.useEffect(()=>{let e=e=>{g(),l&&b.regress(),d&&d(e)},t=e=>{p&&p(e)},i=e=>{f&&f(e)};return E.addEventListener("change",e),E.addEventListener("start",t),E.addEventListener("end",i),()=>{E.removeEventListener("start",t),E.removeEventListener("end",i),E.removeEventListener("change",e)}},[d,p,f,E,g,y]),s.useEffect(()=>{if(i){let e=S().controls;return M({controls:E}),()=>M({controls:e})}},[i,E]),s.createElement("primitive",(0,n.A)({ref:t,object:E,enableDamping:c},m))})},5019:(e,t,i)=>{i.d(t,{Hl:()=>c});var n=i(10892),r=i(93154),s=i(78999),a=i(55592),o=i(76987),l=i(35466);function h(e){let{ref:t,children:i,fallback:o,resize:h,style:c,gl:u,events:d=n.f,eventSource:p,eventPrefix:f,shadows:m,linear:g,flat:v,legacy:_,orthographic:x,frameloop:y,dpr:M,performance:S,raycaster:b,camera:T,scene:w,onPointerMissed:E,onCreated:A,...R}=e;r.useMemo(()=>(0,n.e)(s),[]);let C=(0,n.u)(),[I,P]=(0,a.A)({scroll:!0,debounce:{scroll:50,resize:0},...h}),L=r.useRef(null),U=r.useRef(null);r.useImperativeHandle(t,()=>L.current);let N=(0,n.a)(E),[D,O]=r.useState(!1),[F,B]=r.useState(!1);if(D)throw D;if(F)throw F;let z=r.useRef(null);(0,n.b)(()=>{let e=L.current;P.width>0&&P.height>0&&e&&(z.current||(z.current=(0,n.c)(e)),async function(){await z.current.configure({gl:u,scene:w,events:d,shadows:m,linear:g,flat:v,legacy:_,orthographic:x,frameloop:y,dpr:M,performance:S,raycaster:b,camera:T,size:P,onPointerMissed:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return null==N.current?void 0:N.current(...t)},onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,n.i)(p)?p.current:p:U.current),f&&e.setEvents({compute:(e,t)=>{let i=e[f+"X"],n=e[f+"Y"];t.pointer.set(i/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==A||A(e)}}),z.current.render((0,l.jsx)(C,{children:(0,l.jsx)(n.E,{set:B,children:(0,l.jsx)(r.Suspense,{fallback:(0,l.jsx)(n.B,{set:O}),children:null!=i?i:null})})}))}())}),r.useEffect(()=>{let e=L.current;if(e)return()=>(0,n.d)(e)},[]);let k=p?"none":"auto";return(0,l.jsx)("div",{ref:U,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...c},...R,children:(0,l.jsx)("div",{ref:I,style:{width:"100%",height:"100%"},children:(0,l.jsx)("canvas",{ref:L,style:{display:"block"},children:o})})})}function c(e){return(0,l.jsx)(o.Af,{children:(0,l.jsx)(h,{...e})})}i(67996),i(45657),i(99380)},9460:(e,t,i)=>{i.d(t,{p:()=>c}),i(93154);var n=i(391),r=i(76259),s=i(68992),a=i(10892);let o=null,l="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function h(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2?arguments[2]:void 0;return s=>{i&&i(s),e&&(o||(o=new n.Z),o.setDecoderPath("string"==typeof e?e:l),s.setDRACOLoader(o)),t&&s.setMeshoptDecoder("function"==typeof r.f?(0,r.f)():r.f)}}let c=(e,t,i,n)=>(0,a.G)(s.B,e,h(t,i,n));c.preload=(e,t,i,n)=>a.G.preload(s.B,e,h(t,i,n)),c.clear=e=>a.G.clear(s.B,e),c.setDecoderPath=e=>{l=e}},10892:(e,t,i)=>{let n,r,s,a,o;i.d(t,{B:()=>E,C:()=>K,D:()=>J,E:()=>A,G:()=>ee,a:()=>T,b:()=>b,c:()=>ey,d:()=>eS,e:()=>es,f:()=>eF,i:()=>M,o:()=>eb,s:()=>V,u:()=>w});var l,h=i(93154),c=i(67996),u=i(27072),d=i(78999),p=i(45257),f=i(89043),m=i(45657),g=i.n(m),v=i(99380),_=i(35466),x=i(76987);function y(e){let t=e.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}i(50791),(l||(l=i.t(h,2))).act;let M=e=>e&&e.hasOwnProperty("current"),S=e=>null!=e&&("string"==typeof e||"number"==typeof e||e.isColor),b=((e,t)=>"undefined"!=typeof window&&((null==(e=window.document)?void 0:e.createElement)||(null==(t=window.navigator)?void 0:t.product)==="ReactNative"))()?h.useLayoutEffect:h.useEffect;function T(e){let t=h.useRef(e);return b(()=>void(t.current=e),[e]),t}function w(){let e=(0,x.u5)(),t=(0,x.y3)();return h.useMemo(()=>i=>{let{children:n}=i,r=(0,x.Nz)(e,!0,e=>e.type===h.StrictMode)?h.StrictMode:h.Fragment;return(0,_.jsx)(r,{children:(0,_.jsx)(t,{children:n})})},[e,t])}
1function E(e){let{set:t}=e;return b(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}let A=(e=>((e=class extends h.Component{componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}constructor(...e){super(...e),this.state={error:!1}}}).getDerivedStateFromError=()=>({error:!0}),e))();function R(e){var t;let i="undefined"!=typeof window?null!=(t=window.devicePixelRatio)?t:2:1;return Array.isArray(e)?Math.min(Math.max(e[0],i),e[1]):e}function C(e){var t;return null==(t=e.__r3f)?void 0:t.root.getState()}let I={obj:e=>e===Object(e)&&!I.arr(e)&&"function"!=typeof e,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,boo:e=>"boolean"==typeof e,und:e=>void 0===e,nul:e=>null===e,arr:e=>Array.isArray(e),equ(e,t){let i,{arrays:n="shallow",objects:r="reference",strict:s=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(typeof e!=typeof t||!!e!=!!t)return!1;if(I.str(e)||I.num(e)||I.boo(e))return e===t;let a=I.obj(e);if(a&&"reference"===r)return e===t;let o=I.arr(e);if(o&&"reference"===n)return e===t;if((o||a)&&e===t)return!0;for(i in e)if(!(i in t))return!1;if(a&&"shallow"===n&&"shallow"===r){for(i in s?t:e)if(!I.equ(e[i],t[i],{strict:s,objects:"reference"}))return!1}else for(i in s?t:e)if(e[i]!==t[i])return!1;if(I.und(i)){if(o&&0===e.length&&0===t.length||a&&0===Object.keys(e).length&&0===Object.keys(t).length)return!0;if(e!==t)return!1}return!0}},P=["children","key","ref"];function L(e,t,i,n){let r=null==e?void 0:e.__r3f;return!r&&(r={root:t,type:i,parent:null,children:[],props:function(e){let t={};for(let i in e)P.includes(i)||(t[i]=e[i]);return t}(n),object:e,eventCount:0,handlers:{},isHidden:!1},e&&(e.__r3f=r)),r}function U(e,t){let i=e[t];if(!t.includes("-"))return{root:e,key:t,target:i};for(let r of(i=e,t.split("-"))){var n;t=r,e=i,i=null==(n=i)?void 0:n[t]}return{root:e,key:t,target:i}}let N=/-\d+$/;function D(e,t){if(I.str(t.props.attach)){if(N.test(t.props.attach)){let i=t.props.attach.replace(N,""),{root:n,key:r}=U(e.object,i);Array.isArray(n[r])||(n[r]=[])}let{root:i,key:n}=U(e.object,t.props.attach);t.previousAttach=i[n],i[n]=t.object}else I.fun(t.props.attach)&&(t.previousAttach=t.props.attach(e.object,t.object))}function O(e,t){if(I.str(t.props.attach)){let{root:i,key:n}=U(e.object,t.props.attach),r=t.previousAttach;void 0===r?delete i[n]:i[n]=r}else null==t.previousAttach||t.previousAttach(e.object,t.object);delete t.previousAttach}let F=[...P,"args","dispose","attach","object","onUpdate","dispose"],B=new Map,z=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],k=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function V(e,t){var i,n;let r=e.__r3f,s=r&&y(r).getState(),a=null==r?void 0:r.eventCount;for(let i in t){let a=t[i];if(F.includes(i))continue;if(r&&k.test(i)){"function"==typeof a?r.handlers[i]=a:delete r.handlers[i],r.eventCount=Object.keys(r.handlers).length;continue}if(void 0===a)continue;let{root:o,key:l,target:h}=U(e,i);h instanceof u.zgK&&a instanceof u.zgK?h.mask=a.mask:h instanceof u.Q1f&&S(a)?h.set(a):null!==h&&"object"==typeof h&&"function"==typeof h.set&&"function"==typeof h.copy&&null!=a&&a.constructor&&h.constructor===a.constructor?h.copy(a):null!==h&&"object"==typeof h&&"function"==typeof h.set&&Array.isArray(a)?"function"==typeof h.fromArray?h.fromArray(a):h.set(...a):null!==h&&"object"==typeof h&&"function"==typeof h.set&&"number"==typeof a?"function"==typeof h.setScalar?h.setScalar(a):h.set(a):(o[l]=a,s&&!s.linear&&z.includes(l)&&null!=(n=o[l])&&n.isTexture&&o[l].format===u.GWd&&o[l].type===u.OUM&&(o[l].colorSpace=u.er$))}if(null!=r&&r.parent&&null!=s&&s.internal&&null!=(i=r.object)&&i.isObject3D&&a!==r.eventCount){let e=r.object,t=s.internal.interaction.indexOf(e);t>-1&&s.internal.interaction.splice(t,1),r.eventCount&&null!==e.raycast&&s.internal.interaction.push(e)}return r&&void 0===r.props.attach&&(r.object.isBufferGeometry?r.props.attach="geometry":r.object.isMaterial&&(r.props.attach="material")),r&&H(r),e}function H(e){var t;if(!e.parent)return;null==e.props.onUpdate||e.props.onUpdate(e.object);let i=null==(t=e.root)||null==t.getState?void 0:t.getState();i&&0===i.internal.frames&&i.invalidate()}function G(e,t){!e.manual&&(e&&e.isOrthographicCamera?(e.left=-(t.width/2),e.right=t.width/2,e.top=t.height/2,e.bottom=-(t.height/2)):e.aspect=t.width/t.height,e.updateProjectionMatrix())}let W=e=>null==e?void 0:e.isObject3D;function j(e){return(e.eventObject||e.object).uuid+"/"+e.index+e.instanceId}function X(e,t,i,n){let r=i.get(t);r&&(i.delete(t),0===i.size&&(e.delete(n),r.target.releasePointerCapture(n)))}let q=e=>!!(null!=e&&e.render),Y=h.createContext(null);function Z(){let e=h.useContext(Y);if(!e)throw Error("R3F: Hooks can only be used within the Canvas component!");return e}function K(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e=>e,t=arguments.length>1?arguments[1]:void 0;return Z()(e,t)}function J(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Z(),n=i.getState().internal.subscribe,r=T(e);return b(()=>n(r,t,i),[t,n,i]),null}let Q=new WeakMap;function $(e,t){return function(i){let n;for(var r,s=arguments.length,a=Array(s>1?s-1:0),o=1;o<s;o++)a[o-1]=arguments[o];return"function"==typeof i&&(null==i||null==(r=i.prototype)?void 0:r.constructor)===i?(n=Q.get(i))||(n=new i,Q.set(i,n)):n=i,e&&e(n),Promise.all(a.map(e=>new Promise((i,r)=>n.load(e,e=>{W(null==e?void 0:e.scene)&&Object.assign(e,function(e){let t={nodes:{},materials:{},meshes:{}};return e&&e.traverse(e=>{e.name&&(t.nodes[e.name]=e),e.material&&!t.materials[e.material.name]&&(t.materials[e.material.name]=e.material),e.isMesh&&!t.meshes[e.name]&&(t.meshes[e.name]=e)}),t}(e.scene)),i(e)},t,t=>r(Error("Could not load ".concat(e,": ").concat(null==t?void 0:t.message)))))))}}function ee(e,t,i,n){let r=Array.isArray(t)?t:[t],s=(0,f.DY)($(i,n),[e,...r],{equal:I.equ});return Array.isArray(t)?s:s[0]}ee.preload=function(e,t,i){let n=Array.isArray(t)?t:[t];return(0,f.uv)($(i),[e,...n])},ee.clear=function(e,t){let i=Array.isArray(t)?t:[t];return(0,f.IU)([e,...i])};let et={},ei=/^three(?=[A-Z])/,en=e=>"".concat(e[0].toUpperCase()).concat(e.slice(1)),er=0;function es(e){if("function"==typeof e){let t="".concat(er++);return et[t]=e,t}Object.assign(et,e)}function ea(e,t){let i=en(e),n=et[i];if("primitive"!==e&&!n)throw Error("R3F: ".concat(i," is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively"));if("primitive"===e&&!t.object)throw Error("R3F: Primitives without 'object' are invalid!");if(void 0!==t.args&&!Array.isArray(t.args))throw Error("R3F: The args prop must be an array!")}function eo(e){if(e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?D(e.parent,e):W(e.object)&&!1!==e.props.visible&&(e.object.visible=!0),e.isHidden=!1,H(e)}}function el(e,t,i){let n=t.root.getState();if(e.parent||e.object===n.scene){if(!t.object){var r,s;let e=et[en(t.type)];t.object=null!=(r=t.props.object)?r:new e(...null!=(s=t.props.args
1)?s:[]),t.object.__r3f=t}if(V(t.object,t.props),t.props.attach)D(e,t);else if(W(t.object)&&W(e.object)){let n=e.object.children.indexOf(null==i?void 0:i.object);if(i&&-1!==n){let i=e.object.children.indexOf(t.object);-1!==i?(e.object.children.splice(i,1),e.object.children.splice(i<n?n-1:n,0,t.object)):(t.object.parent=e.object,e.object.children.splice(n,0,t.object),t.object.dispatchEvent({type:"added"}),e.object.dispatchEvent({type:"childadded",child:t.object}))}else e.object.add(t.object)}for(let e of t.children)el(t,e);H(t)}}function eh(e,t){t&&(t.parent=e,e.children.push(t),el(e,t))}function ec(e,t,i){if(!t||!i)return;t.parent=e;let n=e.children.indexOf(i);-1!==n?e.children.splice(n,0,t):e.children.push(t),el(e,t,i)}function eu(e){if("function"==typeof e.dispose){let t=()=>{try{e.dispose()}catch(e){}};"undefined"!=typeof IS_REACT_ACT_ENVIRONMENT?t():(0,v.unstable_scheduleCallback)(v.unstable_IdlePriority,t)}}function ed(e,t,i){if(!t)return;t.parent=null;let n=e.children.indexOf(t);-1!==n&&e.children.splice(n,1),t.props.attach?O(e,t):W(t.object)&&W(e.object)&&(e.object.remove(t.object),function(e,t){let{internal:i}=e.getState();i.interaction=i.interaction.filter(e=>e!==t),i.initialHits=i.initialHits.filter(e=>e!==t),i.hovered.forEach((e,n)=>{(e.eventObject===t||e.object===t)&&i.hovered.delete(n)}),i.capturedMap.forEach((e,n)=>{X(i.capturedMap,t,e,n)})}(y(t),t.object));let r=null!==t.props.dispose&&!1!==i;for(let e=t.children.length-1;e>=0;e--){let i=t.children[e];ed(t,i,r)}t.children.length=0,delete t.object.__r3f,r&&"primitive"!==t.type&&"Scene"!==t.object.type&&eu(t.object),void 0===i&&H(t)}let ep=[],ef=()=>{},em={},eg=0,ev=function(e){let t=g()(e);return t.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:h.version}),t}({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:function(e,t,i){var n;return ea(e=en(e)in et?e:e.replace(ei,""),t),"primitive"===e&&null!=(n=t.object)&&n.__r3f&&delete t.object.__r3f,L(t.object,i,e,t)},removeChild:ed,appendChild:eh,appendInitialChild:eh,insertBefore:ec,appendChildToContainer(e,t){let i=e.getState().scene.__r3f;t&&i&&eh(i,t)},removeChildFromContainer(e,t){let i=e.getState().scene.__r3f;t&&i&&ed(i,t)},insertInContainerBefore(e,t,i){let n=e.getState().scene.__r3f;t&&i&&n&&ec(n,t,i)},getRootHostContext:()=>em,getChildHostContext:()=>em,commitUpdate(e,t,i,n,r){var s,a,o;ea(t,n);let l=!1;if("primitive"===e.type&&i.object!==n.object||(null==(s=n.args)?void 0:s.length)!==(null==(a=i.args)?void 0:a.length)?l=!0:null!=(o=n.args)&&o.some((e,t)=>{var n;return e!==(null==(n=i.args)?void 0:n[t])})&&(l=!0),l)ep.push([e,{...n},r]);else{let t=function(e,t){let i={};for(let n in t)if(!F.includes(n)&&!I.equ(t[n],e.props[n]))for(let e in i[n]=t[n],t)e.startsWith("".concat(n,"-"))&&(i[e]=t[e]);for(let n in e.props){if(F.includes(n)||t.hasOwnProperty(n))continue;let{root:r,key:s}=U(e.object,n);if(r.constructor&&0===r.constructor.length){let e=function(e){let t=B.get(e.constructor);try{t||(t=new e.constructor,B.set(e.constructor,t))}catch(e){}return t}(r);I.und(e)||(i[s]=e[s])}else i[s]=0}return i}(e,n);Object.keys(t).length&&(Object.assign(e.props,t),V(e.object,t))}(null===r.sibling||(4&r.flags)==0)&&function(){for(let[e]of ep){let t=e.parent;if(t)for(let i of(e.props.attach?O(t,e):W(e.object)&&W(t.object)&&t.object.remove(e.object),e.children))i.props.attach?O(e,i):W(i.object)&&W(e.object)&&e.object.remove(i.object);e.isHidden&&eo(e),e.object.__r3f&&delete e.object.__r3f,"primitive"!==e.type&&eu(e.object)}for(let[n,r,s]of ep){n.props=r;let a=n.parent;if(a){let r=et[en(n.type)];n.object=null!=(e=n.props.object)?e:new r(...null!=(t=n.props.args)?t:[]),n.object.__r3f=n;var e,t,i=n.object;for(let e of[s,s.alternate])if(null!==e)if("function"==typeof e.ref){null==e.refCleanup||e.refCleanup();let t=e.ref(i);"function"==typeof t&&(e.refCleanup=t)}else e.ref&&(e.ref.current=i);for(let e of(V(n.object,n.props),n.props.attach?D(a,n):W(n.object)&&W(a.object)&&a.object.add(n.object),n.children))e.props.attach?D(n,e):W(e.object)&&W(n.object)&&n.object.add(e.object);H(n)}}ep.length=0}()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:e=>null==e?void 0:e.object,prepareForCommit:()=>null,preparePortalMount:e=>L(e.getState().scene,e,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:function(e){if(!e.isHidden){var t;e.props.attach&&null!=(t=e.parent)&&t.object?O(e.parent,e):W(e.object)&&(e.object.visible=!1),e.isHidden=!0,H(e)}},unhideInstance:eo,createTextInstance:ef,hideTextInstance:ef,unhideTextInstance:ef,scheduleTimeout:"function"==typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"==typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){}
1,prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:h.createContext(null),setCurrentUpdatePriority(e){eg=e},getCurrentUpdatePriority:()=>eg,resolveUpdatePriority(){var e;if(0!==eg)return eg;switch("undefined"!=typeof window&&(null==(e=window.event)?void 0:e.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return c.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return c.ContinuousEventPriority;default:return c.DefaultEventPriority}},resetFormInstance(){}}),e_=new Map,ex={objects:"shallow",strict:!1};function ey(e){let t,i,n=e_.get(e),r=null==n?void 0:n.fiber,s=null==n?void 0:n.store,a="function"==typeof reportError?reportError:console.error,o=s||((e,t)=>{let i=(0,p.h)((i,n)=>{let r,s=new u.Pq0,a=new u.Pq0,o=new u.Pq0;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n().camera,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n().size,{width:r,height:l,top:h,left:c}=i,u=r/l;t.isVector3?o.copy(t):o.set(...t);let d=e.getWorldPosition(s).distanceTo(o);if(e&&e.isOrthographicCamera)return{width:r/e.zoom,height:l/e.zoom,top:h,left:c,factor:1,distance:d,aspect:u};{let t=2*Math.tan(e.fov*Math.PI/180/2)*d,i=r/l*t;return{width:i,height:t,top:h,left:c,factor:r/i,distance:d,aspect:u}}}let c=e=>i(t=>({performance:{...t.performance,current:e}})),d=new u.I9Y;return{set:i,get:n,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return e(n(),t)},advance:(e,i)=>t(e,i,n()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new u.zD7,pointer:d,mouse:d,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{let e=n();r&&clearTimeout(r),e.performance.current!==e.performance.min&&c(e.performance.min),r=setTimeout(()=>c(n().performance.max),e.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:l},setEvents:e=>i(t=>({...t,events:{...t.events,...e}})),setSize:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=n().camera,h={width:e,height:t,top:r,left:s};i(e=>({size:h,viewport:{...e.viewport,...l(o,a,h)}}))},setDpr:e=>i(t=>{let i=R(e);return{viewport:{...t.viewport,dpr:i,initialDpr:t.viewport.initialDpr||i}}}),setFrameloop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always",t=n().clock;t.stop(),t.elapsedTime=0,"never"!==e&&(t.start(),t.elapsedTime=0),i(()=>({frameloop:e}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:h.createRef(),active:!1,frames:0,priority:0,subscribe:(e,t,i)=>{let r=n().internal;return r.priority=r.priority+ +(t>0),r.subscribers.push({ref:e,priority:t,store:i}),r.subscribers=r.subscribers.sort((e,t)=>e.priority-t.priority),()=>{let i=n().internal;null!=i&&i.subscribers&&(i.priority=i.priority-(t>0),i.subscribers=i.subscribers.filter(t=>t.ref!==e))}}}}}),n=i.getState(),r=n.size,s=n.viewport.dpr,a=n.camera;return i.subscribe(()=>{let{camera:e,size:t,viewport:n,gl:o,set:l}=i.getState();if(t.width!==r.width||t.height!==r.height||n.dpr!==s){r=t,s=n.dpr,G(e,t),n.dpr>0&&o.setPixelRatio(n.dpr);let i="undefined"!=typeof HTMLCanvasElement&&o.domElement instanceof HTMLCanvasElement;o.setSize(t.width,t.height,i)}e!==a&&(a=e,l(t=>({viewport:{...t.viewport,...t.viewport.getCurrentViewport(e)}})))}),i.subscribe(t=>e(t)),i})(eN,eD),l=r||ev.createContainer(o,c.ConcurrentRoot,null,!1,null,"",a,a,a,null);n||e_.set(e,{fiber:l,store:o});let f=!1,m=null;return{async configure(){var n,r;let s,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m=new Promise(e=>s=e);let{gl:l,size:h,scene:c,events:p,onCreated:g,shadows:v=!1,linear:_=!1,flat:x=!1,legacy:y=!1,orthographic:M=!1,frameloop:S="always",dpr:b=[1,2],performance:T,raycaster:w,camera:E,onPointerMissed:A}=a,C=o.getState(),P=C.gl;if(!C.gl){let t={canvas:e,powerPreference:"high-performance",antialias:!0,alpha:!0},i="function"==typeof l?await l(t):l;P=q(i)?i:new d.WebGLRenderer({...t,...l}),C.set({gl:P})}let U=C.raycaster;U||C.set({raycaster:U=new u.tBo});let{params:N,...D}=w||{};if(I.equ(D,U,ex)||V(U,{...D}),I.equ(N,U.params,ex)||V(U,{params:{...U.params,...N}}),!C.camera||C.camera===i&&!I.equ(i,E,ex)){i=E;let e=null==E?void 0:E.isCamera,t=e?E:M?new u.qUd(0,0,0,0,.1,1e3):new u.ubm(75,0,.1,1e3);!e&&(t.position.z=5,E&&(V(t,E),!t.manual&&("aspect"in E||"left"in E||"right"in E||"bottom"in E||"top"in E)&&(t.manual=!0,t.updateProjectionMatrix())),C.camera||null!=E&&E.rotation||t.lookAt(0,0,0)),C.set({camera:t}),U.camera=t}if(!C.scene){let e;null!=c&&c.isScene?L(e=c,o,"",{}):(L(e=new u.Z58,o,"",{}
1),c&&V(e,c)),C.set({scene:e})}p&&!C.events.handlers&&C.set({events:p(o)});let O=function(e,t){if(!t&&"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&e.parentElement){let{width:t,height:i,top:n,left:r}=e.parentElement.getBoundingClientRect();return{width:t,height:i,top:n,left:r}}return!t&&"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?{width:e.width,height:e.height,top:0,left:0}:{width:0,height:0,top:0,left:0,...t}}(e,h);if(I.equ(O,C.size,ex)||C.setSize(O.width,O.height,O.top,O.left),b&&C.viewport.dpr!==R(b)&&C.setDpr(b),C.frameloop!==S&&C.setFrameloop(S),C.onPointerMissed||C.set({onPointerMissed:A}),T&&!I.equ(T,C.performance,ex)&&C.set(e=>({performance:{...e.performance,...T}})),!C.xr){let e=(e,t)=>{let i=o.getState();"never"!==i.frameloop&&eD(e,!0,i,t)},t=()=>{let t=o.getState();t.gl.xr.enabled=t.gl.xr.isPresenting,t.gl.xr.setAnimationLoop(t.gl.xr.isPresenting?e:null),t.gl.xr.isPresenting||eN(t)},i={connect(){let e=o.getState().gl;e.xr.addEventListener("sessionstart",t),e.xr.addEventListener("sessionend",t)},disconnect(){let e=o.getState().gl;e.xr.removeEventListener("sessionstart",t),e.xr.removeEventListener("sessionend",t)}};"function"==typeof(null==(n=P.xr)?void 0:n.addEventListener)&&i.connect(),C.set({xr:i})}if(P.shadowMap){let e=P.shadowMap.enabled,t=P.shadowMap.type;if(P.shadowMap.enabled=!!v,I.boo(v))P.shadowMap.type=u.Wk7;else if(I.str(v)){let e={basic:u.bTm,percentage:u.QP0,soft:u.Wk7,variance:u.RyA};P.shadowMap.type=null!=(r=e[v])?r:u.Wk7}else I.obj(v)&&Object.assign(P.shadowMap,v);(e!==P.shadowMap.enabled||t!==P.shadowMap.type)&&(P.shadowMap.needsUpdate=!0)}return u.ppV.enabled=!y,f||(P.outputColorSpace=_?u.Zr2:u.er$,P.toneMapping=x?u.y_p:u.FV),C.legacy!==y&&C.set(()=>({legacy:y})),C.linear!==_&&C.set(()=>({linear:_})),C.flat!==x&&C.set(()=>({flat:x})),!l||I.fun(l)||q(l)||I.equ(l,P,ex)||V(P,l),t=g,f=!0,s(),this},render(i){return f||m||this.configure(),m.then(()=>{ev.updateContainer((0,_.jsx)(eM,{store:o,children:i,onCreated:t,rootElement:e}),l,null,()=>void 0)}),o},unmount(){eS(e)}}}function eM(e){let{store:t,children:i,onCreated:n,rootElement:r}=e;return b(()=>{let e=t.getState();e.set(e=>({internal:{...e.internal,active:!0}})),n&&n(e),t.getState().events.connected||null==e.events.connect||e.events.connect(r)},[]),(0,_.jsx)(Y.Provider,{value:t,children:i})}function eS(e,t){let i=e_.get(e),n=null==i?void 0:i.fiber;if(n){let r=null==i?void 0:i.store.getState();r&&(r.internal.active=!1),ev.updateContainer(null,n,null,()=>{r&&setTimeout(()=>{try{null==r.events.disconnect||r.events.disconnect(),null==(i=r.gl)||null==(n=i.renderLists)||null==n.dispose||n.dispose(),null==(s=r.gl)||null==s.forceContextLoss||s.forceContextLoss(),null!=(a=r.gl)&&a.xr&&r.xr.disconnect();var i,n,s,a,o=r.scene;for(let e in"Scene"!==o.type&&(null==o.dispose||o.dispose()),o){let t=o[e];(null==t?void 0:t.type)!=="Scene"&&(null==t||null==t.dispose||t.dispose())}e_.delete(e),t&&t(e)}catch(e){}},500)})}}function eb(e,t,i){return(0,_.jsx)(eT,{children:e,container:t,state:i})}function eT(e){let{state:t={},children:i,container:n}=e,{events:r,size:s,...a}=t,o=Z(),[l]=h.useState(()=>new u.tBo),[c]=h.useState(()=>new u.I9Y),d=T((e,t)=>{let i;if(t.camera&&s){let n=t.camera;i=e.viewport.getCurrentViewport(n,new u.Pq0,s),n!==e.camera&&G(n,s)}return{...e,...t,scene:n,raycaster:l,pointer:c,mouse:c,previousRoot:o,events:{...e.events,...t.events,...r},size:{...e.size,...s},viewport:{...e.viewport,...i},setEvents:e=>t.set(t=>({...t,events:{...t.events,...e}}))}}),f=h.useMemo(()=>{let e=(0,p.h)((e,t)=>({...a,set:e,get:t})),t=t=>e.setState(e=>d.current(t,e));return t(o.getState()),o.subscribe(t),e},[o,n]);return(0,_.jsx)(_.Fragment,{children:ev.createPortal((0,_.jsx)(Y.Provider,{value:f,children:i}),f,null)})}let ew=new Set,eE=new Set,eA=new Set;function eR(e,t){if(e.size)for(let{callback:i}of e.values())i(t)}function eC(e,t){switch(e){case"before":return eR(ew,t);case"after":return eR(eE,t);case"tail":return eR(eA,t)}}function eI(e,t,i){let s=t.clock.getDelta();"never"===t.frameloop&&"number"==typeof e&&(s=e-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=e),n=t.internal.subscribers;for(let e=0;e<n.length;e++)(r=n[e]).ref.current(r.store.getState(),s,i);return!t.internal.priority&&t.gl.render&&t.gl.render(t.scene,t.camera),t.internal.frames=Math.max(0,t.internal.frames-1),"always"===t.frameloop?1:t.internal.frames}let eP=!1,eL=!1;function eU(e){for(let i of(a=requestAnimationFrame(eU),eP=!0,s=0,eC("before",e),eL=!0,e_.values())
1){var t;(o=i.store.getState()).internal.active&&("always"===o.frameloop||o.internal.frames>0)&&!(null!=(t=o.gl.xr)&&t.isPresenting)&&(s+=eI(e,o))}if(eL=!1,eC("after",e),0===s)return eC("tail",e),eP=!1,cancelAnimationFrame(a)}function eN(e){var t;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return e_.forEach(e=>eN(e.store.getState(),i));(null==(t=e.gl.xr)||!t.isPresenting)&&e.internal.active&&"never"!==e.frameloop&&(i>1?e.internal.frames=Math.min(60,e.internal.frames+i):eL?e.internal.frames=2:e.internal.frames=1,eP||(eP=!0,requestAnimationFrame(eU)))}function eD(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(t&&eC("before",e),i)eI(e,i,n);else for(let t of e_.values())eI(e,t.store.getState());t&&eC("after",e)}let eO={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function eF(e){let{handlePointer:t}=function(e){function t(e){return e.filter(e=>["Move","Over","Enter","Out","Leave"].some(t=>{var i;return null==(i=e.__r3f)?void 0:i.handlers["onPointer"+t]}))}function i(t){let{internal:i}=e.getState();for(let e of i.hovered.values())if(!t.length||!t.find(t=>t.object===e.object&&t.index===e.index&&t.instanceId===e.instanceId)){let n=e.eventObject.__r3f;if(i.hovered.delete(j(e)),null!=n&&n.eventCount){let i=n.handlers,r={...e,intersections:t};null==i.onPointerOut||i.onPointerOut(r),null==i.onPointerLeave||i.onPointerLeave(r)}}}function n(e,t){for(let i=0;i<t.length;i++){let n=t[i].__r3f;null==n||null==n.handlers.onPointerMissed||n.handlers.onPointerMissed(e)}}return{handlePointer:function(r){switch(r){case"onPointerLeave":case"onPointerCancel":return()=>i([]);case"onLostPointerCapture":return t=>{let{internal:n}=e.getState();"pointerId"in t&&n.capturedMap.has(t.pointerId)&&requestAnimationFrame(()=>{n.capturedMap.has(t.pointerId)&&(n.capturedMap.delete(t.pointerId),i([]))})}}return function(s){let{onPointerMissed:a,internal:o}=e.getState();o.lastEvent.current=s;let l="onPointerMove"===r,h="onClick"===r||"onContextMenu"===r||"onDoubleClick"===r,c=function(t,i){let n=e.getState(),r=new Set,s=[],a=i?i(n.internal.interaction):n.internal.interaction;for(let e=0;e<a.length;e++){let t=C(a[e]);t&&(t.raycaster.camera=void 0)}n.previousRoot||null==n.events.compute||n.events.compute(t,n);let o=a.flatMap(function(e){let i=C(e);if(!i||!i.events.enabled||null===i.raycaster.camera)return[];if(void 0===i.raycaster.camera){var n;null==i.events.compute||i.events.compute(t,i,null==(n=i.previousRoot)?void 0:n.getState()),void 0===i.raycaster.camera&&(i.raycaster.camera=null)}return i.raycaster.camera?i.raycaster.intersectObject(e,!0):[]}).sort((e,t)=>{let i=C(e.object),n=C(t.object);return i&&n&&n.events.priority-i.events.priority||e.distance-t.distance}).filter(e=>{let t=j(e);return!r.has(t)&&(r.add(t),!0)});for(let e of(n.events.filter&&(o=n.events.filter(o,n)),o)){let t=e.object;for(;t;){var l;null!=(l=t.__r3f)&&l.eventCount&&s.push({...e,eventObject:t}),t=t.parent}}if("pointerId"in t&&n.internal.capturedMap.has(t.pointerId))for(let e of n.internal.capturedMap.get(t.pointerId).values())r.has(j(e.intersection))||s.push(e.intersection);return s}(s,l?t:void 0),d=h?function(t){let{internal:i}=e.getState(),n=t.offsetX-i.initialClick[0],r=t.offsetY-i.initialClick[1];return Math.round(Math.sqrt(n*n+r*r))}(s):0;"onPointerDown"===r&&(o.initialClick=[s.offsetX,s.offsetY],o.initialHits=c.map(e=>e.eventObject)),h&&!c.length&&d<=2&&(n(s,o.interaction),a&&a(s)),l&&i(c),!function(e,t,n,r){if(e.length){let s={stopped:!1};for(let a of e){let o=C(a.object);if(o||a.object.traverseAncestors(e=>{let t=C(e);if(t)return o=t,!1}),o){let{raycaster:l,pointer:h,camera:c,internal:d}=o,p=new u.Pq0(h.x,h.y,0).unproject(c),f=e=>{var t,i;return null!=(t=null==(i=d.capturedMap.get(e))?void 0:i.has(a.eventObject))&&t},m=e=>{let i={intersection:a,target:t.target};d.capturedMap.has(e)?d.capturedMap.get(e).set(a.eventObject,i):d.capturedMap.set(e,new Map([[a.eventObject,i]])),t.target.setPointerCapture(e)},g=e=>{let t=d.capturedMap.get(e);t&&X(d.capturedMap,a.eventObject,t,e)},v={};for(let e in t){let i=t[e];"function"!=typeof i&&(v[e]=i)}let _={...a,...v,pointer:h,intersections:e,stopped:s.stopped,delta:n,unprojectedPoint:p,ray:l.ray,camera:c,stopPropagation(){let n="pointerId"in t&&d.capturedMap.get(t.pointerId);(!n||n.has(a.eventObject))&&(_.stopped=s.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(e=>e.eventObject===a.eventObject)&&i([...e.slice(0,e.indexOf(a)),a]))},target:{hasPointerCapture:f,setPointerCapture:m,releasePointerCapture:g},currentTarget:{hasPointerCapture:f,setPointerCapture:m,releasePointerCapture:g},nativeEvent:t};if(r(_),!0===s.stopped)break}}}}(c,s,d,function(e){let t=e.eventObject,i=t.__r3f;if(!(null!=i&&i.eventCount))return;let a=i.handlers;if(l){if(a.onPointerOver||a.onPointerEnter||a.onPointerOut||a.onPointerLeave){let t=j(e),i=o.hovered.get(t);i?i.stopped&&e.stopPropagation():(o.hovered.set(t,e),null==a.onPointerOver||a.onPointerOver(e),null==a.onPointerEnter||a.onPointerEnter(e))}null==a.onPointerMove||a.onPointerMove(e)}else{let i=a[r];i?(!h||o.initialHits.includes(t))&&(n(s,o.interaction.filter(e=>!o.initialHits.includes(e))),i(e)):h&&o.initialHits.includes(t)&&n(s,o.interaction.filter(e=>!o.initialHits.includes(e)))}})}}}}(e);return{priority:1,enabled:!0,compute(e,t,i){t.pointer.set(e.offsetX/t.size.width*2-1,-(2*(e.offsetY/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)},connected:void 0,handlers:Object.keys(eO).reduce((e,i)=>({...e,[i]:t(i)}),{}),update:()=>{var t;let{events:i,internal:n}=e.getState();null!=(t=n.lastEvent)&&t.current&&i.handlers&&i.handlers.onPointerMove(n.lastEvent.current)},connect:t=>
1{let{set:i,events:n}=e.getState();if(null==n.disconnect||n.disconnect(),i(e=>({events:{...e.events,connected:t}})),n.handlers)for(let e in n.handlers){let i=n.handlers[e],[r,s]=eO[e];t.addEventListener(r,i,{passive:s})}},disconnect:()=>{let{set:t,events:i}=e.getState();if(i.connected){if(i.handlers)for(let e in i.handlers){let t=i.handlers[e],[n]=eO[e];i.connected.removeEventListener(n,t)}t(e=>({events:{...e.events,connected:void 0}}))}}}}},12408:(e,t,i)=>{i.r(t),i.d(t,{STLLoader:()=>r});var n=i(27072);class r extends n.aHM{load(e,t,i,r){let s=this,a=new n.Y9S(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){try{t(s.parse(i))}catch(t){r&&r(t),s.manager.itemError(e)}},i,r)}parse(e){let t=function(e){if("string"!=typeof e)return e;{let t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=255&e.charCodeAt(i);return t.buffer||t}}(e);return!function(e){let t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;let i=[115,111,108,105,100];for(let e=0;e<5;e++)if(function(e,t,i){for(let n=0,r=e.length;n<r;n++)if(e[n]!==t.getUint8(i+n))return!1;return!0}(i,t,e))return!1;return!0}(t)?function(e){let t,i=new n.LoY,r=/solid([\s\S]*?)endsolid/g,s=/facet([\s\S]*?)endfacet/g,a=/solid\s(.+)/,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,l=RegExp("vertex"+o+o+o,"g"),h=RegExp("normal"+o+o+o,"g"),c=[],u=[],d=[],p=new n.Pq0,f=0,m=0,g=0;for(;null!==(t=r.exec(e));){m=g;let e=t[0],n=null!==(t=a.exec(e))?t[1]:"";for(d.push(n);null!==(t=s.exec(e));){let e=t[0];for(;null!==(t=h.exec(e));)p.x=parseFloat(t[1]),p.y=parseFloat(t[2]),p.z=parseFloat(t[3]);for(;null!==(t=l.exec(e));)c.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),u.push(p.x,p.y,p.z),g++}let r=m,o=g-m;i.userData.groupNames=d,i.addGroup(r,o,f),f++}return i.setAttribute("position",new n.qtW(c,3)),i.setAttribute("normal",new n.qtW(u,3)),i}("string"!=typeof e?new TextDecoder().decode(e):e):function(e){let t,i,r,s,a=new DataView(e),o=a.getUint32(80,!0),l,h,c,u=!1,d;for(let e=0;e<70;e++)0x434f4c4f==a.getUint32(e,!1)&&82==a.getUint8(e+4)&&61==a.getUint8(e+5)&&(u=!0,d=new Float32Array(3*o*3),t=a.getUint8(e+6)/255,i=a.getUint8(e+7)/255,r=a.getUint8(e+8)/255,s=a.getUint8(e+9)/255);let p=new n.LoY,f=new Float32Array(3*o*3),m=new Float32Array(3*o*3),g=new n.Q1f;for(let e=0;e<o;e++){let s=84+50*e,o=a.getFloat32(s,!0),p=a.getFloat32(s+4,!0),v=a.getFloat32(s+8,!0);if(u){let e=a.getUint16(s+48,!0);(32768&e)==0?(l=(31&e)/31,h=(e>>5&31)/31,c=(e>>10&31)/31):(l=t,h=i,c=r)}for(let t=1;t<=3;t++){let i=s+12*t,r=3*e*3+(t-1)*3;f[r]=a.getFloat32(i,!0),f[r+1]=a.getFloat32(i+4,!0),f[r+2]=a.getFloat32(i+8,!0),m[r]=o,m[r+1]=p,m[r+2]=v,u&&(g.setRGB(l,h,c,n.er$),d[r]=g.r,d[r+1]=g.g,d[r+2]=g.b)}}return p.setAttribute("position",new n.THS(f,3)),p.setAttribute("normal",new n.THS(m,3)),u&&(p.setAttribute("color",new n.THS(d,3)),p.hasColors=!0,p.alpha=s),p}(t)}constructor(e){super(e)}}},25500:(e,t,i)=>{i.d(t,{o:()=>a});var n=i(17246),r=i(27072),s=i(93154);let a=s.forwardRef(function(e,t){let{children:i,object:a,disable:o,disableX:l,disableY:h,disableZ:c,left:u,right:d,top:p,bottom:f,front:m,back:g,onCentered:v,precise:_=!0,cacheKey:x=0,...y}=e,M=s.useRef(null),S=s.useRef(null),b=s.useRef(null),[T]=s.useState(()=>new r.NRn),[w]=s.useState(()=>new r.Pq0),[E]=s.useState(()=>new r.iyt);return s.useLayoutEffect(()=>{S.current.matrixWorld.identity(),T.setFromObject(null!=a?a:b.current,_);let e=T.max.x-T.min.x,t=T.max.y-T.min.y,i=T.max.z-T.min.z;T.getCenter(w),T.getBoundingSphere(E);let n=p?t/2:f?-t/2:0,r=u?-e/2:d?e/2:0,s=m?i/2:g?-i/2:0;S.current.position.set(o||l?0:-w.x+r,o||h?0:-w.y+n,o||c?0:-w.z+s),null==v||v({parent:M.current.parent,container:M.current,width:e,height:t,depth:i,boundingBox:T,boundingSphere:E,center:w,verticalAlignment:n,horizontalAlignment:r,depthAlignment:s})},[x,v,p,u,m,o,l,h,c,a,_,d,f,g,T,w,E]),s.useImperativeHandle(t,()=>M.current,[]),s.createElement("group",(0,n.A)({ref:M},y),s.createElement("group",{ref:S},s.createElement("group",{ref:b},i)))})},27072:(e,t,i)=>{let n,r,s,a,o;i.d(t,{$EB:()=>M,$Ed:()=>
1aR,$Kf:()=>sK,$NF:()=>lH,$O9:()=>eE,$Yl:()=>j,$_I:()=>eL,$ei:()=>L,$p8:()=>l9,A$4:()=>rF,AKb:()=>l_,ALV:()=>nc,AQS:()=>iY,Am1:()=>hp,B69:()=>rt,B6O:()=>of,BER:()=>ep,BH$:()=>aG,BKk:()=>sr,BND:()=>cL,BRH:()=>lW,BXX:()=>e8,B_h:()=>ta,CR7:()=>t9,CSG:()=>lh,CV9:()=>ob,CVz:()=>ti,CWW:()=>tw,Cfg:()=>eA,CmU:()=>hr,CwR:()=>hL,D$Q:()=>li,DAe:()=>tO,DXC:()=>aV,Df:()=>la,Dmk:()=>ej,E0M:()=>cD,EAD:()=>s0,EQC:()=>tP,EZo:()=>T,EdD:()=>E,F1T:()=>sc,F1l:()=>cm,FCc:()=>aH,FFZ:()=>iu,FNr:()=>lu,FV:()=>eh,FXf:()=>C,FZo:()=>ht,Fn:()=>tx,Fpm:()=>cc,FvD:()=>a$,Fvi:()=>ef,Fvt:()=>ld,G3T:()=>tE,G4u:()=>iA,GBG:()=>lA,GJx:()=>eM,GOR:()=>a2,GWd:()=>eZ,GYF:()=>sJ,GZZ:()=>oy,G_z:()=>ll,Gu$:()=>o3,Gwm:()=>$,GxU:()=>rR,H23:()=>ty,H2z:()=>cB,HIg:()=>eY,HLH:()=>t0,HO_:()=>tT,HPb:()=>t5,HXV:()=>te,HgN:()=>i8,HiM:()=>l4,Hit:()=>lE,Ho_:()=>a8,Hrb:()=>rO,Hrq:()=>ix,I46:()=>sZ,I9Y:()=>iV,IE4:()=>e4,IUQ:()=>nr,IWo:()=>cP,Iit:()=>st,Ipv:()=>oa,Iw4:()=>hq,IzY:()=>cO,Jnc:()=>p,K52:()=>ee,KDk:()=>tr,KLL:()=>tK,KPJ:()=>lU,KRh:()=>en,Ke9:()=>tD,Kef:()=>tS,Ktl:()=>im,Kwu:()=>w,Kzg:()=>hu,LAk:()=>eu,Ld9:()=>cF,LiQ:()=>O,LlO:()=>sn,LoY:()=>rZ,LuO:()=>hQ,M4G:()=>h4,MBL:()=>lR,MOq:()=>iy,MSw:()=>o2,MW4:()=>rz,Mjd:()=>eo,N1A:()=>aF,N2s:()=>hU,N5j:()=>tV,NRn:()=>nu,NTi:()=>b,NZq:()=>eU,Nex:()=>cz,Nt7:()=>k,Nv2:()=>aK,Nwf:()=>hG,Nz6:()=>e5,O0B:()=>ns,O3Y:()=>o5,O49:()=>tB,O9p:()=>nY,ONl:()=>aY,OUM:()=>eN,Oax:()=>rk,Om:()=>ey,OuU:()=>B,P5j:()=>hW,PFK:()=>cw,PJ3:()=>tI,PPD:()=>ao,PTz:()=>iH,Pdi:()=>ly,Pem:()=>aQ,Pf$:()=>hw,Pq0:()=>iG,Q1f:()=>ry,QCA:()=>oZ,QP0:()=>g,Qev:()=>iC,Qrf:()=>th,R1W:()=>cx,R3r:()=>sm,RJ4:()=>tF,ROr:()=>t1,RQf:()=>ek,RcT:()=>t7,RiT:()=>lI,Riy:()=>tn,Rkk:()=>tk,RlV:()=>nF,RoJ:()=>sS,RrE:()=>W,Ru$:()=>t2,RyA:()=>_,S$4:()=>t_,S20:()=>oo,SUR:()=>hs,SYV:()=>aJ,ScU:()=>lG,T6I:()=>lw,TDQ:()=>os,THS:()=>rL,TM5:()=>iR,TMh:()=>it,Tap:()=>lj,TdN:()=>iT,TiK:()=>io,TkQ:()=>e1,U3G:()=>Q,UJ6:()=>lb,UPV:()=>o6,UTZ:()=>em,Ufg:()=>o$,UpK:()=>sz,UtB:()=>ce,UtX:()=>hd,V3x:()=>eW,V9B:()=>rT,VCu:()=>a3,VGF:()=>e2,VT0:()=>eQ,VVr:()=>tQ,Vb5:()=>d,VnP:()=>oM,Vnu:()=>ip,Vwu:()=>ck,VxR:()=>tZ,W9U:()=>tM,WBB:()=>oJ,WNZ:()=>u,WTh:()=>cR,Wdf:()=>ib,Wew:()=>eH,Wk7:()=>v,Wyr:()=>iS,XG_:()=>tb,XIg:()=>S,XJ7:()=>o9,XMJ:()=>hY,XTe:()=>ha,XrR:()=>er,Y9S:()=>lB,YHV:()=>h6,YJl:()=>sp,YOZ:()=>lT,YRT:()=>lk,Yhb:()=>lS,Yuy:()=>eB,Z0B:()=>o_,Z58:()=>s_,ZLX:()=>s7,ZM4:()=>cU,ZQM:()=>e$,Zcv:()=>an,Zpd:()=>o4,Zr2:()=>tY,ZyN:()=>l8,_4j:()=>ln,_QJ:()=>td,_Ut:()=>si,_xc:()=>cf,a$r:()=>eR,a55:()=>iU,a5J:()=>tu,aEY:()=>H,aHM:()=>lD,aJ8:()=>ed,aMy:()=>tA,aVO:()=>lc,agE:()=>id,amv:()=>ir,b4q:()=>su,bC7:()=>tm,bCz:()=>A,bI3:()=>tW,bTm:()=>m,baL:()=>rN,bdM:()=>o0,bkx:()=>ez,brA:()=>K,bw0:()=>et,c5h:()=>a1,c90:()=>e3,cHt:()=>eF,cRK:()=>sg,cZY:()=>cl,caT:()=>ei,cj9:()=>ik,czI:()=>to,dAo:()=>oS,dYF:()=>nh,dcC:()=>eJ,dhZ:()=>tN,dth:()=>lq,dwI:()=>iX,dzP:()=>hJ,e0p:()=>X,eB$:()=>sx,eHc:()=>Y,eHs:()=>sM,eaF:()=>r8,eoi:()=>il,er$:()=>tq,ezk:()=>lM,f4X:()=>D,fBL:()=>eO,fJr:()=>t3,fP5:()=>hE,fTw:()=>cy,fc6:()=>rD,g7M:()=>ec,gJ2:()=>eG,gO9:()=>R,gPd:()=>nn,gWB:()=>ic,ghU:()=>eS,h2z:()=>tU,hB5:()=>x,hIf:()=>iv,hZF:()=>lC,h_9:()=>lN,hdd:()=>z,hgQ:()=>G,hjs:()=>h8,hsX:()=>y,hxR:()=>eT,hy7:()=>eg,hzE:()=>cM,i7d:()=>ss,i7u:()=>iw,iNn:()=>r7,iOZ:()=>a0,iUH:()=>eP,ibB:()=>ol,ie2:()=>F,imn:()=>rb,ix0:()=>eV,iyt:()=>nC,j6:()=>o8,jGm:()=>oE,jR7:()=>e6,jUj:()=>sv,jej:()=>i1,jf0:()=>tX,jsO:()=>t8,jut:()=>hi,jzd:()=>ih,k6Q:()=>e9,k6q:()=>eC,k8v:()=>tG,kBv:()=>h,kEx:()=>lz,kG0:()=>t$,kLi:()=>i7,kO0:()=>ia,kRr:()=>eI,kTW:()=>eb,kTp:()=>e7,kYr:()=>t6,k_V:()=>h9,keZ:()=>hv,klZ:()=>ie,kn4:()=>nB,kqe:()=>tJ,kxk:()=>sD,kyO:()=>ea,l2R:()=>lL,lGu:()=>Z,lGw:()=>lx,lMl:()=>rm,lPF:()=>iQ,lc7:()=>tR,ljd:()=>tC,lxW:()=>se,lyL:()=>tf,mcG:()=>i0,mrM:()=>aC,nCl:()=>l$,nEu:()=>oe,nNL:()=>el,nST:()=>I,nWS:()=>na,nZQ:()=>h_,nc$:()=>hZ,nzx:()=>oQ,o6l:()=>sd,oVO:()=>t4,oh6:()=>h$,ojh:()=>U,ojs:()=>tv,ov9:()=>q,pBf:()=>tt,pFK:()=>a7,pHI:()=>ew,pPE:()=>hj,paN:()=>e0,ppV:()=>i4,psI:()=>tc,q2:()=>lt,qBx:()=>lo,qFE:()=>a9,qU7:()=>a5,qUd:()=>l5,qa3:()=>ts,qad:()=>N,qq$:()=>iJ,qtW:()=>rV,r6x:()=>hn,rFo:()=>no,rKP:()=>o1,rOG:()=>iM,rQf:()=>tL,rSH:()=>tl,rYR:()=>tz,rjZ:()=>a4,s0K:()=>ox,sKt:()=>ii,sPf:()=>l,tBo:()=>h1,tJf:()=>eD,tXL:()=>
vendor: 5,623 bytes, line 1
1ls,tcD:()=>a6,tz3:()=>lP,uB5:()=>tp,uSd:()=>lr,uV5:()=>ex,uWO:()=>s1,uXQ:()=>ig,ubm:()=>sh,uf3:()=>ac,uov:()=>i_,ure:()=>l7,v9J:()=>iE,veJ:()=>lX,vim:()=>is,vmz:()=>rB,vyJ:()=>tj,wAk:()=>oA,wTz:()=>tH,wfO:()=>e_,wn6:()=>V,wrO:()=>eq,wtR:()=>c,wvS:()=>rU,xFO:()=>ev,xJ6:()=>oX,xOk:()=>he,xSv:()=>J,xZx:()=>hP,xfg:()=>oT,y3Z:()=>tg,y9J:()=>nl,yT7:()=>eX,y_p:()=>es,ypk:()=>oR,ywQ:()=>f,zD7:()=>hx,zdS:()=>eK,zgK:()=>nZ,znC:()=>P});let l="180",h={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},c={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},u=0,d=1,p=2,f=3,m=0,g=1,v=2,_=3,x=0,y=1,M=2,S=0,b=1,T=2,w=3,E=4,A=5,R=100,C=101,I=102,P=103,L=104,U=200,N=201,D=202,O=203,F=204,B=205,z=206,k=207,V=208,H=209,G=210,W=211,j=212,X=213,q=214,Y=0,Z=1,K=2,J=3,Q=4,$=5,ee=6,et=7,ei=0,en=1,er=2,es=0,ea=1,eo=2,el=3,eh=4,ec=5,eu=6,ed=7,ep="attached",ef="detached",em=300,eg=301,ev=302,e_=303,ex=304,ey=306,eM=1e3,eS=1001,eb=1002,eT=1003,ew=1004,eE=1004,eA=1005,eR=1005,eC=1006,eI=1007,eP=1007,eL=1008,eU=1008,eN=1009,eD=1010,eO=1011,eF=1012,eB=1013,ez=1014,ek=1015,eV=1016,eH=1017,eG=1018,eW=1020,ej=35902,eX=35899,eq=1021,eY=1022,eZ=1023,eK=1026,eJ=1027,eQ=1028,e$=1029,e0=1030,e1=1031,e2=1032,e3=1033,e4=33776,e5=33777,e6=33778,e8=33779,e9=35840,e7=35841,te=35842,tt=35843,ti=36196,tn=37492,tr=37496,ts=37808,ta=37809,to=37810,tl=37811,th=37812,tc=37813,tu=37814,td=37815,tp=37816,tf=37817,tm=37818,tg=37819,tv=37820,t_=37821,tx=36492,ty=36494,tM=36495,tS=36283,tb=36284,tT=36285,tw=36286,tE=2200,tA=2201,tR=2202,tC=2300,tI=2301,tP=2302,tL=2400,tU=2401,tN=2402,tD=2500,tO=2501,tF=0,tB=1,tz=2,tk=3200,tV=3201,tH=3202,tG=3203,tW=0,tj=1,tX="",tq="srgb",tY="srgb-linear",tZ="linear",tK="srgb",tJ=0,tQ=7680,t$=7681,t0=7682,t1=7683,t2=34055,t3=34056,t4=5386,t5=512,t6=513,t8=514,t9=515,t7=516,ie=517,it=518,ii=519,ir=512,is=513,ia=514,io=515,il=516,ih=517,ic=518,iu=519,id=35044,ip=35048,im=35040,ig=35045,iv=35049,i_=35041,ix=35046,iy=35050,iM=35042,iS="100",ib="300 es",iT=2e3,iw=2001,iE={COMPUTE:"compute",RENDER:"render"},iA={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},iR={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};class iC{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){let i=this._listeners;return void 0!==i&&void 0!==i[e]&&-1!==i[e].indexOf(t)}removeEventListener(e,t){let i=this._listeners;if(void 0===i)return;let n=i[e];if(void 0!==n){let e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let i=t[e.type];if(void 0!==i){e.target=this;let t=i.slice(0);for(let i=0,n=t.length;i<n;i++)t[i].call(this,e);e.target=null}}}let iI=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],iP=1234567,iL=Math.PI/180,iU=180/Math.PI;function iN(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0;return(iI[255&e]+iI[e>>8&255]+iI[e>>16&255]+iI[e>>24&255]+"-"+iI[255&t]+iI[t>>8&255]+"-"+iI[t>>16&15|64]+iI[t>>24&255]+"-"+iI[63&i|128]+iI[i>>8&255]+"-"+iI[i>>16&255]+iI[i>>24&255]+iI[255&n]+iI[n>>8&255]+iI[n>>16&255]+iI[n>>24&255]).toLowerCase()}function iD(e,t,i){return Math.max(t,Math.min(i,e))}function iO(e,t){return(e%t+t)%t}function iF(e,t,i){return(1-i)*e+i*t}function iB(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/0xffffffff;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/0x7fffffff,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error("Invalid component type.")}}function iz(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(0xffffffff*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(0x7fffffff*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw Error("Invalid component type.")}}let ik={DEG2RAD:iL,RAD2DEG:iU,generateUUID:iN,clamp:iD,euclideanModulo:iO,mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:iF,damp:function(e,t,i,n){return iF(e,t,1-Math.exp(-i*n))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;
vendor: 4,478 bytes, line 1
1return t-Math.abs(iO(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-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){void 0!==e&&(iP=e);let t=iP+=0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000},degToRad:function(e){return e*iL},radToDeg:function(e){return e*iU},isPowerOfTwo:function(e){return(e&e-1)==0&&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,i,n,r){let s=Math.cos,a=Math.sin,o=s(i/2),l=a(i/2),h=s((t+n)/2),c=a((t+n)/2),u=s((t-n)/2),d=a((t-n)/2),p=s((n-t)/2),f=a((n-t)/2);switch(r){case"XYX":e.set(o*c,l*u,l*d,o*h);break;case"YZY":e.set(l*d,o*c,l*u,o*h);break;case"ZXZ":e.set(l*u,l*d,o*c,o*h);break;case"XZX":e.set(o*c,l*f,l*p,o*h);break;case"YXY":e.set(l*p,o*c,l*f,o*h);break;case"ZYZ":e.set(l*f,l*p,o*c,o*h)}},normalize:iz,denormalize:iB};class iV{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 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 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){return 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){return 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){let t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[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=iD(this.x,e.x,t.x),this.y=iD(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=iD(this.x,e,t),this.y=iD(this.y,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iD(i,e,t))}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=Math.trunc(this.x),this.y=Math.trunc(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}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iD(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y;return t*t+i*i}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,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){return this.x=e.getX(t),this.y=e.getY(t),this}
vendor: 4,955 bytes, line 1
1rotateAround(e,t){let i=Math.cos(t),n=Math.sin(t),r=this.x-e.x,s=this.y-e.y;return this.x=r*i-s*n+e.x,this.y=r*n+s*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}constructor(e=0,t=0){iV.prototype.isVector2=!0,this.x=e,this.y=t}}class iH{static slerpFlat(e,t,i,n,r,s,a){let o=i[n+0],l=i[n+1],h=i[n+2],c=i[n+3],u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(0===a){e[t+0]=o,e[t+1]=l,e[t+2]=h,e[t+3]=c;return}if(1===a){e[t+0]=u,e[t+1]=d,e[t+2]=p,e[t+3]=f;return}if(c!==f||o!==u||l!==d||h!==p){let e=1-a,t=o*u+l*d+h*p+c*f,i=t>=0?1:-1,n=1-t*t;if(n>Number.EPSILON){let r=Math.sqrt(n),s=Math.atan2(r,t*i);e=Math.sin(e*s)/r,a=Math.sin(a*s)/r}let r=a*i;if(o=o*e+u*r,l=l*e+d*r,h=h*e+p*r,c=c*e+f*r,e===1-a){let e=1/Math.sqrt(o*o+l*l+h*h+c*c);o*=e,l*=e,h*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=h,e[t+3]=c}static multiplyQuaternionsFlat(e,t,i,n,r,s){let a=i[n],o=i[n+1],l=i[n+2],h=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return e[t]=a*p+h*c+o*d-l*u,e[t+1]=o*p+h*u+l*c-a*d,e[t+2]=l*p+h*d+a*u-o*c,e[t+3]=h*p-a*c-o*u-l*d,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,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=e._x,n=e._y,r=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(i/2),h=a(n/2),c=a(r/2),u=o(i/2),d=o(n/2),p=o(r/2);switch(s){case"XYZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"YXZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"ZXY":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"ZYX":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"YZX":this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p;break;case"XZY":this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,i=t[0],n=t[4],r=t[8],s=t[1],a=t[5],o=t[9],l=t[2],h=t[6],c=t[10],u=i+a+c;if(u>0){let e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(h-o)*e,this._y=(r-l)*e,this._z=(s-n)*e}else if(i>a&&i>c){let e=2*Math.sqrt(1+i-a-c);this._w=(h-o)/e,this._x=.25*e,this._y=(n+s)/e,this._z=(r+l)/e}else if(a>c){let e=2*Math.sqrt(1+a-i-c);this._w=(r-l)/e,this._x=(n+s)/e,this._y=.25*e,this._z=(o+h)/e}else{let e=2*Math.sqrt(1+c-i-a);this._w=(s-n)/e,this._x=(r+l)/e,this._y=(o+h)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(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=i,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(iD(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(0===i)return this;let n=Math.min(1,t/i);return this.slerp(e,n),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){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,n=e._y,r=e._z,s=e._w,a=t._x,o=t._y,l=t._z,h=t._w;return this._x=i*h+s*a+n*l-r*o,this._y=n*h+s*o+r*a-i*l,this._z=r*h+s*l+i*o-n*a,this._w=s*h-i*a-n*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);let i=this._x,n=this._y,r=this._z,s=this._w,a=s*e._w+i*e._x+n*e._y+r*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=s,this._x=i,this._y=n,this._z=r,this;let o=1-a*a;if(o<=Number.EPSILON){let e=1-t;return this._w=e*s+t*this._w,this._x=e*i+t*this._x,this._y=e*n+t*this._y,this._z=e*r+t*this._z,this.normalize(),this}let l=Math.sqrt(o),h=Math.atan2(l,a),c=Math.sin((1-t)*h)/l,u=Math.sin(t*h
vendor: 4,408 bytes, line 1
1)/l;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}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._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}}class iG{set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,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 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 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){return 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){return 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){return 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 this.applyQuaternion(ij.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ij.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=e.elements,s=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(e){let t=this.x,i=this.y,n=this.z,r=e.x,s=e.y,a=e.z,o=e.w,l=2*(s*n-a*i),h=2*(a*t-r*n),c=2*(r*i-s*t);return this.x=t+o*l+s*c-a*h,this.y=i+o*h+a*l-r*c,this.z=n+o*c+r*h-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,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=iD(this.x,e.x,t.x),this.y=iD(this.y,e.y,t.y),this.z=iD(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=iD(this.x,e,t),this.y=iD(this.y,e,t),this.z=iD(this.z,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iD(i,e,t))}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}
vendor: 7,530 bytes, line 1
1round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let i=e.x,n=e.y,r=e.z,s=t.x,a=t.y,o=t.z;return this.x=n*o-r*a,this.y=r*s-i*o,this.z=i*a-n*s,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return iW.copy(this).projectOnVector(e),this.sub(iW)}reflect(e){return this.sub(iW.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:Math.acos(iD(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}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,i){let n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}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){return 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}randomDirection(){let e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}constructor(e=0,t=0,i=0){iG.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}}let iW=new iG,ij=new iH;class iX{set(e,t,i,n,r,s,a,o,l){let h=this.elements;return h[0]=e,h[1]=n,h[2]=a,h[3]=t,h[4]=r,h[5]=o,h[6]=i,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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){let i=e.elements,n=t.elements,r=this.elements,s=i[0],a=i[3],o=i[6],l=i[1],h=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],_=n[4],x=n[7],y=n[2],M=n[5],S=n[8];return r[0]=s*f+a*v+o*y,r[3]=s*m+a*_+o*M,r[6]=s*g+a*x+o*S,r[1]=l*f+h*v+c*y,r[4]=l*m+h*_+c*M,r[7]=l*g+h*x+c*S,r[2]=u*f+d*v+p*y,r[5]=u*m+d*_+p*M,r[8]=u*g+d*x+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8];return t*s*h-t*a*l-i*r*h+i*a*o+n*r*l-n*s*o}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=h*s-a*l,u=a*o-h*r,d=l*r-s*o,p=t*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);let f=1/p;return e[0]=c*f,e[1]=(n*l-h*i)*f,e[2]=(a*i-n*s)*f,e[3]=u*f,e[4]=(h*t-n*o)*f,e[5]=(n*r-a*t)*f,e[6]=d*f,e[7]=(i*o-l*t)*f,e[8]=(s*t-i*r)*f,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let 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,i,n,r,s,a){let o=Math.cos(r),l=Math.sin(r);return this.set(i*o,i*l,-i*(o*s+l*a)+s+e,-n*l,n*o,-n*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(iq.makeScale(e,t)),this}rotate(e){return this.premultiply(iq.makeRotation(-e)),this}translate(e,t){return this.premultiply(iq.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<9;i++)this.elements[i]=e[i+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,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}constructor(e,t,i,n,r,s,a,o,l){iX.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,s,a,o,l)}}let iq=new iX;function iY(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}let iZ={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function iK(e,t){return new iZ[e](t)}function iJ(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function iQ(){let e=iJ("canvas");return e.style.display="block",e}let i$={};function i0(e){e in i$||(i$[e]=!0)}function i1(e,t,i){return new Promise(function(n,r){setTimeout(function s(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(s,i);break;default:n()}},i)})}let i2=new iX().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),i3=new iX().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.20397
17,1.0569715),i4=function(){let e={enabled:!0,workingColorSpace:tY,spaces:{},convert:function(e,t,i){return!1!==this.enabled&&t!==i&&t&&i&&(this.spaces[t].transfer===tK&&(e.r=i5(e.r),e.g=i5(e.g),e.b=i5(e.b)),this.spaces[t].primaries!==this.spaces[i].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===tK&&(e.r=i6(e.r),e.g=i6(e.g),e.b=i6(e.b))),e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===tX?tZ:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.workingColorSpace;return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,i){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.workingColorSpace;return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,i){return i0("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,i)},toWorkingColorSpace:function(t,i){return i0("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,i)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],n=[.3127,.329];return e.define({[tY]:{primaries:t,whitePoint:n,transfer:tZ,toXYZ:i2,fromXYZ:i3,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:tq},outputColorSpaceConfig:{drawingBufferColorSpace:tq}},[tq]:{primaries:t,whitePoint:n,transfer:tK,toXYZ:i2,fromXYZ:i3,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:tq}}}),e}();function i5(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function i6(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class i8{static getDataURL(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/png";if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===n&&(n=iJ("canvas")),n.width=e.width,n.height=e.height;let i=n.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=n}return t.toDataURL(i)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=iJ("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let n=i.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e<r.length;e++)r[e]=255*i5(r[e]/255);return i.putImageData(n,0,0),t}if(!e.data)return e;{let t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*i5(t[e]/255)):t[e]=i5(t[e]);return{data:t,width:e.width,height:e.height}}}}let i9=0;class i7{getSize(e){let t=this.data;return"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):t instanceof VideoFrame?e.set(t.displayHeight,t.displayWidth,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];let i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(ne(n[t].image)):e.push(ne(n[t]))}else e=ne(n);i.url=e}return t||(e.images[this.uuid]=i),i}constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:i9++}),this.uuid=iN(),this.data=e,this.dataReady=!0,this.version=0}}function ne(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?i8.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:{}}let nt=0,ni=new iG;class nn extends iC{get width(){return this.source.getSize(ni).x}get height(){return this.source.getSize(ni).y}get depth(){return this.source.getSize(ni).z}get image(){return this.source.data}set image(e){void 0===e&&(e=null),this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.colorSpace
vendor: 6,571 bytes, line 1
1=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let i=e[t];if(void 0===i)continue;let n=this[t];void 0!==n&&(n&&i&&n.isVector2&&i.isVector2||n&&i&&n.isVector3&&i.isVector3||n&&i&&n.isMatrix3&&i.isMatrix3?n.copy(i):this[t]=i)}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==em)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case eM:e.x=e.x-Math.floor(e.x);break;case eS:e.x=e.x<0?0:1;break;case eb: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 eM:e.y=e.y-Math.floor(e.y);break;case eS:e.y=e.y<0?0:1;break;case eb: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}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}constructor(e=nn.DEFAULT_IMAGE,t=nn.DEFAULT_MAPPING,i=eS,n=eS,r=eC,s=eL,a=eZ,o=eN,l=nn.DEFAULT_ANISOTROPY,h=tX){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:nt++}),this.uuid=iN(),this.name="",this.source=new i7(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new iV(0,0),this.repeat=new iV(1,1),this.center=new iV(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new iX,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!e&&!!e.depth&&e.depth>1,this.pmremVersion=0}}nn.DEFAULT_IMAGE=null,nn.DEFAULT_MAPPING=em,nn.DEFAULT_ANISOTROPY=1;class nr{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,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,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 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 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){return 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){return 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}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,i=this.y,n=this.z,r=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let 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,i,n,r,s=e.elements,a=s[0],o=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(.01>Math.abs(o-h)&&.01>Math.abs(l-d)&&.01>Math.abs(u-p)){if(.1>Math.abs(o+h)&&.1>Math.abs(l+d)&&.1>Math.abs(u+p)&&.1>Math.abs(a+c+f-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(a+1)/2,s=(c+1)/2,m=(f+1)/2,g=(o+h)/4,v=(l+d)/4,_=(u+p)/4;return e>s&&e>m?e<.01?(i=0,n=.707106781,r=.707106781):(n=g/(i=Math.sqrt(e)),r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(i=g/(n=Math.sqrt(s)),r=_/n):m<.01?(i=.707106781,n=.707106781,r=0):(i=v/(r=Math.sqrt(m)),n=_/r),this.set(i,n,r,t),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-o)*(h-o));return .001>Math.abs(m)&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(h-o)/m,this.w=Math.acos((a+c+f-1)/2),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],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=iD(this.x,e.x,t.x),this.y=iD(this.y,e.y,t.y),this.z=iD(this.z,e.z,t.z),this.w=iD(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=iD(this.x,e,t),this.y=iD(this.y,e,t),this.z=iD(this.z,e,t),this.w=iD(this.w,e,t),this}clampLength(e,t){let i=this.length();return this.divideScalar(i||1).multiplyScalar(iD(i,e,t))}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}
vendor: 4,995 bytes, line 1
1round(){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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,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){return 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}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}constructor(e=0,t=0,i=0,n=1){nr.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=n}}class ns extends iC{_setTextureOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={minFilter:eC,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,r=this.textures.length;n<r;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i,this.textures[n].isArrayTexture=this.textures[n].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let i=Object.assign({},e.textures[t].image);this.textures[t].source=new i7(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:eC,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new nr(0,0,e,t),this.scissorTest=!1,this.viewport=new nr(0,0,e,t);let n=new nn({width:e,height:t,depth:i.depth});this.textures=[];let r=i.count;for(let e=0;e<r;e++)this.textures[e]=n.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}}class na extends ns{constructor(e=1,t=1,i={}
vendor: 19,854 bytes, line 1
1){super(e,t,i),this.isWebGLRenderTarget=!0}}class no extends nn{addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}}class nl extends na{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new no(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class nh extends nn{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=eT,this.minFilter=eT,this.wrapR=eS,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class nc extends na{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new nh(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class nu{set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(np.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(np.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=np.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Infinity,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);let i=e.geometry;if(void 0!==i){let n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,i=n.count;t<i;t++)!0===e.isMesh?e.getVertexPosition(t,np):np.fromBufferAttribute(n,t),np.applyMatrix4(e.matrixWorld),this.expandByPoint(np);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),nf.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),nf.copy(i.boundingBox)),nf.applyMatrix4(e.matrixWorld),this.union(nf)}let n=e.children;for(let e=0,i=n.length;e<i;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}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 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.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,np),np.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(nM),nS.subVectors(this.max,nM),nm.subVectors(e.a,nM),ng.subVectors(e.b,nM),nv.subVectors(e.c,nM),n_.subVectors(ng,nm),nx.subVectors(nv,ng),ny.subVectors(nm,nv);let t=[0,-n_.z,n_.y,0,-nx.z,nx.y,0,-ny.z,ny.y,n_.z,0,-n_.x,nx.z,0,-nx.x,ny.z,0,-ny.x,-n_.y,n_.x,0,-nx.y,nx.x,0,-ny.y,ny.x,0];return!!nw(t,nm,ng,nv,nS)&&!!nw(t=[1,0,0,0,1,0,0,0,1],nm,ng,nv,nS)&&(nb.crossVectors(n_,nx),nw(t=[nb.x,nb.y,nb.z],nm,ng,nv,nS))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,np).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(np).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()||(nd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),nd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),nd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),nd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),nd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),nd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),nd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),nd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(nd)),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)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}constructor(e=new iG(Infinity,Infinity,Infinity),t=new iG(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}}let nd=[new iG,new iG,new iG,new iG,new iG,new iG,new iG,new iG],np=new iG,nf=new nu,nm=new iG,ng=new iG,nv=new iG,n_=new iG,nx=new iG,ny=new iG,nM=new iG,nS=new iG,nb=new iG,nT=new iG;function nw(e,t,i,n,r){for(let s=0,a=e.length-3;s<=a;s+=3){nT.fromArray(e,s);let a=r.x*Math.abs(nT.x)+r.y*Math.abs(nT.y)+r.z*Math.abs(nT.z),o=t.dot(nT),l=i.dot(nT),h=n.dot(nT);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>a)return!1}return!0}let nE=new nu,nA=new iG,nR=new iG;class nC{set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;void 0!==t?i.copy(t):nE.setFromPoints(e).getCenter(i);let n=0;for(let t=0,r=e.length;t<r;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?e.makeEmpty():(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}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;nA.subVectors(e,this.center);let t=nA.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),i=(e-this.radius)*.5;this.center.addScaledVector(nA,i/e),this.radius+=i}return this}union(e){return e.isEmpty()||(this.isEmpty()?this.copy(e):!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(nR.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(nA.copy(e.center).add(nR)),this.expandByPoint(nA.copy(e.center).sub(nR)))),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}constructor(e=new iG,t=-1){this.isSphere=!0,this.center=e,this.radius=t}}let nI=new iG,nP=new iG,nL=new iG,nU=new iG,nN=new iG,nD=new iG,nO=new iG;class nF{set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,nI)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=nI.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nI.copy(this.origin).addScaledVector(this.direction,t),nI.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){let r,s,a,o;nP.copy(e).add(t).multiplyScalar(.5),nL.copy(t).sub(e).normalize(),nU.copy(this.origin).sub(nP);let l=.5*e.distanceTo(t),h=-this.direction.dot(nL),c=nU.dot(this.direction),u=-nU.dot(nL),d=nU.lengthSq(),p=Math.abs(1-h*h);if(p>0)if(r=h*u-c,s=h*c-u,o=l*p,r>=0)if(s>=-o)if(s<=o){let e=1/p;r*=e,s*=e,a=r*(r+h*s+2*c)+s*(h*r+s+2*u)+d}else a=-(r=Math.max(0,-(h*(s=l)+c)))*r+s*(s+2*u)+d;else a=-(r=Math.max(0,-(h*(s=-l)+c)))*r+s*(s+2*u)+d;else s<=-o?(s=(r=Math.max(0,-(-h*l+c)))>0?-l:Math.min(Math.max(-l,-u),l),a=-r*r+s*(s+2*u)+d):s<=o?(r=0,a=(s=Math.min(Math.max(-l,-u),l))*(s+2*u)+d):(s=(r=Math.max(0,-(h*l+c)))>0?l:Math.min(Math.max(-l,-u),l),a=-r*r+s*(s+2*u)+d);else s=h>0?-l:l,a=-(r=Math.max(0,-(h*s+c)))*r+s*(s+2*u)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,r),n&&n.copy(nP).addScaledVector(nL,s),a}intersectSphere(e,t){nI.subVectors(e.center,this.origin);let i=nI.dot(this.direction),n=nI.dot(nI)-i*i,r=e.radius*e.radius;if(n>r)return null;let s=Math.sqrt(r-n),a=i-s,o=i+s;return o<0?null:a<0?this.at(o,t):this.at(a,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let i,n,r,s,a,o,l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return(l>=0?(i=(e.min.x-u.x)*l,n=(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,n=(e.min.x-u.x)*l),h>=0?(r=(e.min.y-u.y)*h,s=(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,s=(e.min.y-u.y)*h),i>s||r>n||((r>i||isNaN(i))&&(i=r),(s<n||isNaN(n))&&(n=s),c>=0?(a=(e.min.z-u.z)*c,o=(e.max.z-u.z)*c):(a=(e.max.z-u.z)*c,o=(e.min.z-u.z)*c),i>o||a>n||((a>i||i!=i)&&(i=a),(o<n||n!=n)&&(n=o),n<0)))?null:this.at(i>=0?i:n,t)}intersectsBox(e){return null!==this.intersectBox(e,nI)}intersectTriangle(e,t,i,n,r){let s;nN.subVectors(t,e),nD.subVectors(i,e),nO.crossVectors(nN,nD);let a=this.direction.dot(nO);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}nU.subVectors(this.origin,e);let o=s*this.direction.dot(nD.crossVectors(nU,nD));if(o<0)return null;let l=s*this.direction.dot(nN.cross(nU));if(l<0||o+l>a)return null;let h=-s*nU.dot(nO);return h<0?null:this.at(h/a,r)}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)}clone(){return new this.constructor().copy(this)}constructor(e=new iG,t=new iG(0,0,-1)){this.origin=e,this.direction=t}}class nB{set(e,t,i,n,r,s,a,o,l,h,c,u,d,p,f,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new nB().fromArray(this.elements)}copy(e){let t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){let t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,i=e.elements,n=1/nz.setFromMatrixColumn(e,0).length(),r=1/nz.setFromMatrixColumn(e,1).length(),s=1/nz.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*r,t[5]=i[5]*r,t[6]=i[6]*r,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,i=e.x,n=e.y,r=e.z,s=Math.cos(i),a=Math.sin(i),o=Math.cos(n),l=Math.sin(n),h=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){let e=s*h,i=s*c,n=a*h,r=a*c;t[0]=o*h,t[4]=-o*c,t[8]=l,t[1]=i+n*l,t[5]=e-r*l,t[9]=-a*o,t[2]=r-e*l,t[6]=n+i*l,t[10]=s*o}else if("YXZ"===e.order){let e=o*h,i=o*c,n=l*h,r=l*c;t[0]=e+r*a,t[4]=n*a-i,t[8]=s*l,t[1]=s*c,t[5]=s*h,t[9]=-a,t[2]=i*a-n,t[6]=r+e*a,t[10]=s*o}else if("ZXY"===e.order){let e=o*h,i=o*c,n=l*h,r=l*c;t[0]=e-r*a,t[4]=-s*c,t[8]=n+i*a,t[1]=i+n*a,t[5]=s*h,t[9]=r-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){let e=s*h,i=s*c,n=a*h,r=a*c;t[0]=o*h,t[4]=n*l-i,t[8]=e*l+r,t[1]=o*c,t[5]=r*l+e,t[9]=i*l-n,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){let e=s*o,i=s*l,n=a*o,r=a*l;t[0]=o*h,t[4]=r-e*c,t[8]=n*c+i,t[1]=c,t[5]=s*h,t[9]=-a*h,t[2]=-l*h,t[6]=i*c+n,t[10]=e-r*c}else if("XZY"===e.order){let e=s*o,i=s*l,n=a*o,r=a*l;t[0]=o*h,t[4]=-c,t[8]=l*h,t[1]=e*c+r,t[5]=s*h,t[9]=i*c-n,t[2]=n*c-i,t[6]=a*h,t[10]=r*c+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(nV,e,nH)}lookAt(e,t,i){let n=this.elements;return nj.subVectors(e,t),0===nj.lengthSq()&&(nj.z=1),nj.normalize(),nG.crossVectors(i,nj),0===nG.lengthSq()&&(1===Math.abs(i.z)?nj.x+=1e-4:nj.z+=1e-4,nj.normalize(),nG.crossVectors(i,nj)),nG.normalize(),nW.crossVectors(nj,nG),n[0]=nG.x,n[4]=nW.x,n[8]=nj.x,n[1]=nG.y,n[5]=nW.y,n[9]=nj.y,n[2]=nG.z,n[6]=nW.z,n[10]=nj.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let i=e.elements,n=t.elements,r=this.elements,s=i[0],a=i[4],o=i[8],l=i[12],h=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],_=i[7],x=i[11],y=i[15],M=n[0],S=n[4],b=n[8],T=n[12],w=n[1],E=n[5],A=n[9],R=n[13],C=n[2],I=n[6],P=n[10],L=n[14],U=n[3],N=n[7],D=n[11],O=n[15];return r[0]=s*M+a*w+o*C+l*U,r[4]=s*S+a*E+o*I+l*N,r[8]=s*b+a*A+o*P+l*D,r[12]=s*T+a*R+o*L+l*O,r[1]=h*M+c*w+u*C+d*U,r[5]=h*S+c*E+u*I+d*N,r[9]=h*b+c*A+u*P+d*D,r[13]=h*T+c*R+u*L+d*O,r[2]=p*M+f*w+m*C+g*U,r[6]=p*S+f*E+m*I+g*N,r[10]=p*b+f*A+m*P+g*D,r[14]=p*T+f*R+m*L+g*O,r[3]=v*M+_*w+x*C+y*U,r[7]=v*S+_*E+x*I+y*N,r[11]=v*b+_*A+x*P+y*D,r[15]=v*T+_*R+x*L+y*O,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],s=e[1],a=e[5],o=e[9],l=e[13],h=e[2],c=e[6],u=e[10],d=e[14],p=e[3],f=e[7];return p*(r*o*c-n*l*c-r*a*u+i*l*u+n*a*d-i*o*d)+f*(t*o*d-t*l*u+r*s*u-n*s*d+n*l*h-r*o*h)+e[11]*(t*l*c-t*a*d-r*s*c+i*s*d+r*a*h-i*l*h)+e[15]*(-n*a*h-t*o*c+t*a*u+n*s*c-i*s*u+i*o*h)}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(e,t,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){let e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=c*m*l-f*u*l+f*o*d-a*m*d-c*o*g+a*u*g,_=p*u*l-h*m*l-p*o*d+s*m*d+h*o*g-s*u*g,x=h*f*l-p*c*l+p*a*d-s*f*d-h*a*g+s*c*g,y=p*c*o-h*f*o-p*a*u+s*f*u+h*a*m-s*c*m,M=t*v+i*_+n*x+r*y;if(0===M)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/M;return e[0]=v*S,e[1]=(f*u*r-c*m*r-f*n*d+i*m*d+c*n*g-i*u*g)*S,e[2]=(a*m*r-f*o*r+f*n*l-i*m*l-a*n*g+i*o*g)*S,e[3]=(c*o*r-a*u*r-c*n*l+i*u*l+a*n*d-i*o*d)*S,e[4]=_*S,e[5]=(h*m*r-p*u*r+p*n*d-t*m*d-h*n*g+t*u*g)*S,e[6]=(p*o*r-s*m*r-p*n*l+t*m*l+s*n*g-t*o*g)*S,e[7]=(s*u*r-h*o*r+h*n*l-t*u*l-s*n*d+t*o*d)*S,e[8]=x*S,e[9]=(p*c*r-h*f*r-p*i*d+t*f*d+h*i*g-t*c*g)*S,e[10]=(s*f*r-p*a*r+p*i*l-t*f*l-s*i*g+t*a*g)*S,e[11]=(h*a*r-s*c*r-h*i*l+t*c*l+s*i*d-t*a*d)*S,e[12]=y*S,e[13]=(h*f*n-p*c*n+p*i*u-t*f*u-h*i*m+t*c*m)*S,e[14]=(p*a*n-s*f*n-p*i*o+t*f*o+s*i*m-t*a*m)*S,e[15]=(s*c*n-h*a*n+h*i*o-t*c*o-s*i*u+t*a*u)*S,this}scale(e){let t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2];return Math.sqrt(Math.max(t,e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let i=Math.cos(t),n=Math.sin(t),r=1-i,s=e.x,a=e.y,o=e.z,l=r*s,h=r*a;return this.set(l*s+i,l*a-n*o,l*o+n*a,0,l*a+n*o,h*a+i,h*o-n*s,0,l*o-n*a,h*o+n*s,r*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,r,s){return this.set(1,i,r,0,e,1,s,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){let n=this.elements,r=t._x,s=t._y,a=t._z,o=t._w,l=r+r,h=s+s,c=a+a,u=r*l,d=r*h,p=r*c,f=s*h,m=s*c,g=a*c,v=o*l,_=o*h,x=o*c,y=i.x,M=i.y,S=i.z;return n[0]=(1-(f+g))*y,n[1]=(d+x)*y,n[2]=(p-_)*y,n[3]=0,n[4]=(d-x)*M,n[5]=(1-(u+g))*M,n[6]=(m+v)*M,n[7]=0,n[8]=(p+_)*S,n[9]=(m-v)*S,n[10]=(1-(u+f))*S,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){let n=this.elements,r=nz.set(n[0],n[1],n[2]).length(),s=nz.set(n[4],n[5],n[6]).length(),a=nz.set(n[8],n[9],n[10]).length();0>this.determinant()&&(r=-r),e.x=n[12],e.y=n[13],e.z=n[14],nk.copy(this);let o=1/r,l=1/s,h=1/a;return nk.elements[0]*=o,nk.elements[1]*=o,nk.elements[2]*=o,nk.elements[4]*=l,nk.elements[5]*=l,nk.elements[6]*=l,nk.elements[8]*=h,nk.elements[9]*=h,nk.elements[10]*=h,t.setFromRotationMatrix(nk),i.x=r,i.y=s,i.z=a,this}makePerspective(e,t,i,n,r,s){let a,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:iT,h=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(h)a=r/(s-r),o=s*r/(s-r);else if(l===iT)a=-(s+r)/(s-r),o=-2*s*r/(s-r);else if(l===iw)a=-s/(s-r),o=-s*r/(s-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);
1return c[0]=2*r/(t-e),c[4]=0,c[8]=(t+e)/(t-e),c[12]=0,c[1]=0,c[5]=2*r/(i-n),c[9]=(i+n)/(i-n),c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=o,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,i,n,r,s){let a,o,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:iT,h=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=this.elements;if(h)a=1/(s-r),o=s/(s-r);else if(l===iT)a=-2/(s-r),o=-(s+r)/(s-r);else if(l===iw)a=-1/(s-r),o=-r/(s-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return c[0]=2/(t-e),c[4]=0,c[8]=0,c[12]=-(t+e)/(t-e),c[1]=0,c[5]=2/(i-n),c[9]=0,c[13]=-(i+n)/(i-n),c[2]=0,c[6]=0,c[10]=a,c[14]=o,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<16;i++)this.elements[i]=e[i+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,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}constructor(e,t,i,n,r,s,a,o,l,h,c,u,d,p,f,m){nB.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,r,s,a,o,l,h,c,u,d,p,f,m)}}let nz=new iG,nk=new nB,nV=new iG(0,0,0),nH=new iG(1,1,1),nG=new iG,nW=new iG,nj=new iG,nX=new nB,nq=new iH;class nY{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,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=i,this._order=n,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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.elements,r=n[0],s=n[4],a=n[8],o=n[1],l=n[5],h=n[9],c=n[2],u=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(iD(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(u,l),this._z=0);break;case"YXZ":this._x=Math.asin(-iD(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,r),this._z=0);break;case"ZXY":this._x=Math.asin(iD(u,-1,1)),.9999999>Math.abs(u)?(this._y=Math.atan2(-c,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-iD(c,-1,1)),.9999999>Math.abs(c)?(this._x=Math.atan2(u,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(iD(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-c,r)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-iD(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(u,l),this._y=Math.atan2(a,r)):(this._x=Math.atan2(-h,d),this._y=0)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return nX.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nX,t,i)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return nq.setFromEuler(this),this.setFromQuaternion(nq,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}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}
vendor: 4,813 bytes, line 1
1constructor(e=0,t=0,i=0,n=nY.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}}nY.DEFAULT_ORDER="XYZ";class nZ{set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!=0}isEnabled(e){return(this.mask&1<<e)!=0}constructor(){this.mask=1}}let nK=0,nJ=new iG,nQ=new iH,n$=new nB,n0=new iG,n1=new iG,n2=new iG,n3=new iH,n4=new iG(1,0,0),n5=new iG(0,1,0),n6=new iG(0,0,1),n8={type:"added"},n9={type:"removed"},n7={type:"childadded",child:null},re={type:"childremoved",child:null};class rt extends iC{onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return nQ.setFromAxisAngle(e,t),this.quaternion.multiply(nQ),this}rotateOnWorldAxis(e,t){return nQ.setFromAxisAngle(e,t),this.quaternion.premultiply(nQ),this}rotateX(e){return this.rotateOnAxis(n4,e)}rotateY(e){return this.rotateOnAxis(n5,e)}rotateZ(e){return this.rotateOnAxis(n6,e)}translateOnAxis(e,t){return nJ.copy(e).applyQuaternion(this.quaternion),this.position.add(nJ.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(n4,e)}translateY(e){return this.translateOnAxis(n5,e)}translateZ(e){return this.translateOnAxis(n6,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(n$.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?n0.copy(e):n0.set(e,t,i);let n=this.parent;this.updateWorldMatrix(!0,!1),n1.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?n$.lookAt(n1,n0,this.up):n$.lookAt(n0,n1,this.up),this.quaternion.setFromRotationMatrix(n$),n&&(n$.extractRotation(n.matrixWorld),nQ.setFromRotationMatrix(n$),this.quaternion.premultiply(nQ.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this||e&&e.isObject3D&&(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(n8),n7.child=e,this.dispatchEvent(n7),n7.child=null),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}let t=this.children.indexOf(e);return -1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(n9),re.child=e,this.dispatchEvent(re),re.child=null),this}removeFromParent(){let e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),n$.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),n$.multiply(e.parent.matrixWorld)),e.applyMatrix4(n$),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(n8),n7.child=e,this.dispatchEvent(n7),n7.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){let n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&i.push(this);let n=this.children;for(let r=0,s=n.length;r<s;r++)n[r].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n1,e,n2),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(n1,n3,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){let t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix
vendor: 59,845 bytes, line 1
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].updateMatrixWorld(e)}updateWorldMatrix(e,t){let i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){let e=this.children;for(let t=0,i=e.length;t<i;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let n={};function r(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),n.instanceInfo=this._instanceInfo.map(e=>({...e})),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(e),n.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(n.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){let n=i[t];r(e.shapes,n)}else r(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(r(e.materials,this.material[i]));n.material=t}else n.material=r(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){let i=this.animations[t];n.animations.push(r(e.animations,i))}}if(t){let t=s(e.geometries),n=s(e.materials),r=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),h=s(e.animations),c=s(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),h.length>0&&(i.animations=h),c.length>0&&(i.nodes=c)}return i.object=n,i;function s(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){let i=e.children[t];this.add(i.clone())}return this}constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nK++}),this.uuid=iN(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=rt.DEFAULT_UP.clone();let e=new iG,t=new nY,i=new iH,n=new iG(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new nB},normalMatrix:{value:new iX}}),this.matrix=new nB,this.matrixWorld=new nB,this.matrixAutoUpdate=rt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=rt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new nZ,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}}rt.DEFAULT_UP=new iG(0,1,0),rt.DEFAULT_MATRIX_AUTO_UPDATE=!0,rt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let ri=new iG,rn=new iG,rr=new iG,rs=new iG,ra=new iG,ro=new iG,rl=new iG,rh=new iG,rc=new iG,ru=new iG,rd=new nr,rp=new nr,rf=new nr;class rm{static getNormal(e,t,i,n){n.subVectors(i,t),ri.subVectors(e,t),n.cross(ri);let r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(e,t,i,n,r){ri.subVectors(n,t),rn.subVectors(i,t),rr.subVectors(e,t);let s=ri.dot(ri),a=ri.dot(rn),o=ri.dot(rr),l=rn.dot(rn),h=rn.dot(rr),c=s*l-a*a;if(0===c)return r.set(0,0,0),null;let u=1/c,d=(l*o-a*h)*u,p=(s*h-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,rs)&&rs.x>=0&&rs.y>=0&&rs.x+rs.y<=1}static getInterpolation(e,t,i,n,r,s,a,o){return null===this.getBarycoord(e,t,i,n,rs)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(r,rs.x),o.addScaledVector(s,rs.y),o.addScaledVector(a,rs.z),o)}static getInterpolatedAttribute(e,t,i,n,r,s){return rd.setScalar(0),rp.setScalar(0),rf.setScalar(0),rd.fromBufferAttribute(e,t),rp.fromBufferAttribute(e,i),rf.fromBufferAttribute(e,n),s.setScalar(0),s.addScaledVector(rd,r.x),s.addScaledVector(rp,r.y),s.addScaledVector(rf,r.z),s}static isFrontFacing(e,t,i,n){return ri.subVectors(i,t),rn.subVectors(e,t),0>ri.cross(rn).dot(n)}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),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 ri.subVectors(this.c,this.b),rn.subVectors(this.a,this.b),.5*ri.cross(rn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return rm.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return rm.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,r){return rm.getInterpolation(e,this.a,this.b,this.c,t,i,n,r)}containsPoint(e){return rm.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return rm.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let i,n,r=this.a,s=this.b,a=this.c;ra.subVectors(s,r),ro.subVectors(a,r),rh.subVectors(e,r);let o=ra.dot(rh),l=ro.dot(rh);if(o<=0&&l<=0)return t.copy(r);rc.subVectors(e,s);let h=ra.dot(rc),c=ro.dot(rc);if(h>=0&&c<=h)return t.copy(s);let u=o*c-h*l;if(u<=0&&o>=0&&h<=0)return i=o/(o-h),t.copy(r).addScaledVector(ra,i);ru.subVectors(e,a);let d=ra.dot(ru),p=ro.dot(ru);if(p>=0&&d<=p)return t.copy(a);let f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),t.copy(r).addScaledVector(ro,n);let m=h*p-d*c;if(m<=0&&c-h>=0&&d-p>=0)return rl.subVectors(a,s),n=(c-h)/(c-h+(d-p)),t.copy(s).addScaledVector(rl,n);let g=1/(m+f+u);return i=f*g,n=u*g,t.copy(r).addScaledVector(ra,i).addScaledVector(ro,n)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}constructor(e=new iG,t=new iG,i=new iG){this.a=e,this.b=t,this.c=i}}let rg={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32},rv={h:0,s:0,l:0},r_={h:0,s:0,l:0};function rx(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*6*(2/3-i):e}class ry{set(e,t,i){return void 0===t&&void 0===i?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,i),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tq;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,i4.colorSpaceToWorking(this,t),this}setRGB(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i4.workingColorSpace;return this.r=e,this.g=t,this.b=i,i4.colorSpaceToWorking(this,n),this}setHSL(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i4.workingColorSpace;if(e=iO(e,1),t=iD(t,0,1),i=iD(i,0,1),0===t)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,r=2*i-n;this.r=rx(r,n,e+1/3),this.g=rx(r,n,e),this.b=rx(r,n,e-1/3)}return i4.colorSpaceToWorking(this,n),this}setStyle(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tq;function n(e){void 0!==e&&parseFloat(e)}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){let e,r=t[1],s=t[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setRGB(Math.min(255,parseInt(e[1],10))/255,Math.min(255,parseInt(e[2],10))/255,Math.min(255,parseInt(e[3],10))/255,i);if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setRGB(Math.min(100,parseInt(e[1],10))/100,Math.min(100,parseInt(e[2],10))/100,Math.min(100,parseInt(e[3],10))/100,i);break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setHSL(parseFloat(e[1])/360,parseFloat(e[2])/100,parseFloat(e[3])/100,i)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){let e=t[1],n=e.length;if(3===n)return this.setRGB(parseInt(e.charAt(0),16)/15,parseInt(e.charAt(1),16)/15,parseInt(e.charAt(2),16)/15,i);if(6===n)return this.setHex(parseInt(e,16),i)}else if(e&&e.length>0)return this.setColorName(e,i);return this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tq,i=rg[e.toLowerCase()];return void 0!==i&&this.setHex(i,t),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}copySRGBToLinear(e){return this.r=i5(e.r),this.g=i5(e.g),this.b=i5(e.b),this}copyLinearToSRGB(e){return this.r=i6(e.r),this.g=i6(e.g),this.b=i6(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tq;return i4.workingToColorSpace(rM.copy(this),e),65536*Math.round(iD(255*rM.r,0,255))+256*Math.round(iD(255*rM.g,0,255))+Math.round(iD(255*rM.b,0,255))}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tq;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i4.workingColorSpace;i4.workingToColorSpace(rM.copy(this),n);let r=rM.r,s=rM.g,a=rM.b,o=Math.max(r,s,a),l=Math.min(r,s,a),h=(l+o)/2;if(l===o)t=0,i=0;else{let e=o-l;switch(i=h<=.5?e/(o+l):e/(2-o-l),o){case r:t=(s-a)/e+6*(s<a);break;case s:t=(a-r)/e+2;break;case a:t=(r-s)/e+4}t/=6}return e.h=t,e.s=i,e.l=h,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i4.workingColorSpace;return i4.workingToColorSpace(rM.copy(this),t),e.r=rM.r,e.g=rM.g,e.b=rM.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tq;i4.workingToColorSpace(rM.copy(this),e);let t=rM.r,i=rM.g,n=rM.b;return e!==tq?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}offsetHSL(e,t,i){return this.getHSL(rv),this.setHSL(rv.h+e,rv.s+t,rv.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(rv),e.getHSL(r_);let i=iF(rv.h,r_.h,t),n=iF(rv.s,r_.s,t),r=iF(rv.l,r_.l,t);return this.setHSL(i,n,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,n=this.b,r=e.elements;return this.r=r[0]*t+r[3]*i+r[6]*n,this.g=r[1]*t+r[4]*i+r[7]*n,this.b=r[2]*t+r[5]*i+r[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&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),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}}let rM=new ry;ry.NAMES=rg;let rS=0;class rb extends iC{get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(let t in e){let i=e[t];if(void 0===i)continue;let n=this[t];void 0!==n&&(n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i)}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function n(e){let t=[];for(let i in e){let n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(i.blending=this.blending),this.side!==x&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),this.blendSrc!==F&&(i.blendSrc=this.blendSrc),this.blendDst!==B&&(i.blendDst=this.blendDst),this.blendEquation!==R&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==J&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ii&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==tQ&&(i.stencilFail=this.stencilFail),this.stencilZFail!==tQ&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==tQ&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){let t=n(e.textures),r=n(e.images);t.length>0&&(i.textures=t),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,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;let t=e.clippingPlanes,i=null;if(null!==t){let e=t.length;i=Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rS++}),this.uuid=iN(),this.name="",this.type="Material",this.blending=b,this.side=x,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=F,this.blendDst=B,this.blendEquation=R,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ry(0,0,0),this.blendAlpha=0,this.depthFunc=J,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ii,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tQ,this.stencilZFail=tQ,this.stencilZPass=tQ,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}}class rT extends rb{copy(e){return super.copy(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.envMapRotation.copy(e.envMapRotation),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.fog=e.fog,this}constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ry(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nY,this.combine=ei,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}let rw=function(){let e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),r=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(n[e]=0,n[256|e]=32768,r[e]=24,r[256|e]=24):t<-14?(n[e]=1024>>-t-14,n[256|e]=1024>>-t-14|32768,r[e]=-t-1,r[256|e]=-t-1):t<=15?(n[e]=t+15<<10,n[256|e]=t+15<<10|32768,r[e]=13,r[256|e]=13):t<128?(n[e]=31744,n[256|e]=64512,r[e]=24,r[256|e]=24):(n[e]=31744,n[256|e]=64512,r[e]=13,r[256|e]=13)}let s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;(8388608&t)==0;)t<<=1,i-=8388608;t&=-8388609,i+=0x38800000,s[e]=t|i}for(let e=1024;e<2048;++e)s[e]=0x38000000+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=0x47800000,a[32]=0x80000000;for(let e=33;e<63;++e)a[e]=0x80000000+(e-32<<23);a[63]=0xc7800000;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:i,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}();function rE(e){e=iD(e,-65504,65504),rw.floatView[0]=e;let t=rw.uint32View[0],i=t>>23&511;return rw.baseTable[i]+((8388607&t)>>rw.shiftTable[i])}function rA(e){let t=e>>10;return rw.uint32View[0]=rw.mantissaTable[rw.offsetTable[t]+(1023&e)]+rw.exponentTable[t],rw.floatView[0]}class rR{static toHalfFloat(e){return rE(e)}static fromHalfFloat(e){return rA(e)}}let rC=new iG,rI=new iV,rP=0;class rL{onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(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.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)rI.fromBufferAttribute(this,t),rI.applyMatrix3(e),this.setXY(t,rI.x,rI.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix3(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyMatrix4(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.applyNormalMatrix(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)rC.fromBufferAttribute(this,t),rC.transformDirection(e),this.setXYZ(t,rC.x,rC.y,rC.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=iB(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=iz(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=iB(t,this.array)),t}setX(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=iB(t,this.array)),t}setY(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=iB(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=iB(t,this.array)),t}setW(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array),r=iz(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==id&&(e.usage=this.usage),e}constructor(e,t,i=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:rP++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=id,this.updateRanges=[],this.gpuType=ek,this.version=0}}class rU extends rL{constructor(e,t,i){super(new Int8Array(e),t,i)}}class rN extends rL{constructor(e,t,i){super(new Uint8Array(e),t,i)}}class rD extends rL{constructor(e,t,i){super(new Uint8ClampedArray(e),t,i)}}class rO extends rL{constructor(e,t,i){super(new Int16Array(e),t,i)}}class rF extends rL{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class rB extends rL{constructor(e,t,i){super(new Int32Array(e),t,i)}}class rz extends rL{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class rk extends rL{getX(e){let t=rA(this.array[e*this.itemSize]);return this.normalized&&(t=iB(t,this.array)),t}setX(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize]=rE(t),this}getY(e){let t=rA(this.array[e*this.itemSize+1]);return this.normalized&&(t=iB(t,this.array)),t}setY(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+1]=rE(t),this}getZ(e){let t=rA(this.array[e*this.itemSize+2]);return this.normalized&&(t=iB(t,this.array)),t}setZ(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+2]=rE(t),this}getW(e){let t=rA(this.array[e*this.itemSize+3]);return this.normalized&&(t=iB(t,this.array)),t}setW(e,t){return this.normalized&&(t=iz(t,this.array)),this.array[e*this.itemSize+3]=rE(t),this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array)),this.array[e+0]=rE(t),this.array[e+1]=rE(i),this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array)),this.array[e+0]=rE(t),this.array[e+1]=rE(i),this.array[e+2]=rE(n),this}setXYZW(e,t,i,n,r){return e*=this.itemSize,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array),r=iz(r,this.array)),this.array[e+0]=rE(t),this.array[e+1]=rE(i),this.array[e+2]=rE(n),this.array[e+3]=rE(r),this}constructor(e,t,i){super(new Uint16Array(e),t,i),this.isFloat16BufferAttribute=!0}}class rV extends rL{constructor(e,t,i){super(new Float32Array(e),t,i)}}let rH=0,rG=new nB,rW=new rt,rj=new iG,rX=new nu,rq=new nu,rY=new iG;class rZ extends iC{getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(iY(e)?rz:rF)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);let i=this.attributes.normal;if(void 0!==i){let t=new iX().getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}let n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return rG.makeRotationFromQuaternion(e),this.applyMatrix4(rG),this}rotateX(e){return rG.makeRotationX(e),this.applyMatrix4(rG),this}rotateY(e){return rG.makeRotationY(e),this.applyMatrix4(rG),this}rotateZ(e){return rG.makeRotationZ(e),this.applyMatrix4(rG),this}translate(e,t,i){return rG.makeTranslation(e,t,i),this.applyMatrix4(rG),this}scale(e,t,i){return rG.makeScale(e,t,i),this.applyMatrix4(rG),this}lookAt(e){return rW.lookAt(e),rW.updateMatrix(),this.applyMatrix4(rW.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(rj).negate(),this.translate(rj.x,rj.y,rj.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t.push(n.x,n.y,n.z||0)}this.setAttribute("position",new rV(t,3))}else{let i=Math.min(e.length,t.count);for(let n=0;n<i;n++){let i=e[n];t.setXYZ(n,i.x,i.y,i.z||0)}e.length,t.count,t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new nu);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return void this.boundingBox.set(new iG(-1/0,-1/0,-1/0),new iG(Infinity,Infinity,Infinity));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rX.setFromBufferAttribute(i),this.morphTargetsRelative?(rY.addVectors(this.boundingBox.min,rX.min),this.boundingBox.expandByPoint(rY),rY.addVectors(this.boundingBox.max,rX.max),this.boundingBox.expandByPoint(rY)):(this.boundingBox.expandByPoint(rX.min),this.boundingBox.expandByPoint(rX.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new nC);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return void this.boundingSphere.set(new iG,1/0);if(e){let i=this.boundingSphere.center;if(rX.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){let i=t[e];rq.setFromBufferAttribute(i),this.morphTargetsRelative?(rY.addVectors(rX.min,rq.min),rX.expandByPoint(rY),rY.addVectors(rX.max,rq.max),rX.expandByPoint(rY)):(rX.expandByPoint(rq.min),rX.expandByPoint(rq.max))}rX.getCenter(i);let n=0;for(let t=0,r=e.count;t<r;t++)rY.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(rY));if(t)for(let r=0,s=t.length;r<s;r++){let s=t[r],a=this.morphTargetsRelative;for(let t=0,r=s.count;t<r;t++)rY.fromBufferAttribute(s,t),a&&(rj.fromBufferAttribute(e,t),rY.add(rj)),n=Math.max(n,i.distanceToSquared(rY))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return;let i=t.position,n=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new rL(new Float32Array(4*i.count),4));let s=this.getAttribute("tangent"),a=[],o=[];for(let e=0;e<i.count;e++)a[e]=new iG,o[e]=new iG;let l=new iG,h=new iG,c=new iG,u=new iV,d=new iV,p=new iV,f=new iG,m=new iG,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){let n=g[t],s=n.start,v=n.count;for(let t=s,n=s+v;t<n;t+=3)!function(e,t,n){l.fromBufferAttribute(i,e),h.fromBufferAttribute(i,t),c.fromBufferAttribute(i,n),u.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),p.fromBufferAttribute(r,n),h.sub(l),c.sub(l),d.sub(u),p.sub(u);let s=1/(d.x*p.y-p.x*d.y);isFinite(s)&&(f.copy(h).multiplyScalar(p.y).addScaledVector(c,-d.y).multiplyScalar(s),m.copy(c).multiplyScalar(d.x).addScaledVector(h,-p.x).multiplyScalar(s),a[e].add(f),a[t].add(f),a[n].add(f),o[e].add(m),o[t].add(m),o[n].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new iG,_=new iG,x=new iG,y=new iG;function M(e){x.fromBufferAttribute(n,e),y.copy(x);let t=a[e];v.copy(t),v.sub(x.multiplyScalar(x.dot(t))).normalize(),_.crossVectors(y,t);let i=_.dot(o[e]);s.setXYZW(e,v.x,v.y,v.z,i<0?-1:1)}for(let t=0,i=g.length;t<i;++t){let i=g[t],n=i.start,r=i.count;for(let t=n,i=n+r;t<i;t+=3)M(e.getX(t+0)),M(e.getX(t+1)),M(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i)i=new rL(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);let n=new iG,r=new iG,s=new iG,a=new iG,o=new iG,l=new iG,h=new iG,c=new iG;if(e)for(let u=0,d=e.count;u<d;u+=3){let d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);n.fromBufferAttribute(t,d),r.fromBufferAttribute(t,p),s.fromBufferAttribute(t,f),h.subVectors(s,r),c.subVectors(n,r),h.cross(c),a.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),a.add(h),o.add(h),l.add(h),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,a=t.count;e<a;e+=3)n.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),h.subVectors(s,r),c.subVectors(n,r),h.cross(c),i.setXYZ(e+0,h.x,h.y,h.z),i.setXYZ(e+1,h.x,h.y,h.z),i.setXYZ(e+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)rY.fromBufferAttribute(e,t),rY.normalize(),e.setXYZ(t,rY.x,rY.y,rY.z)}toNonIndexed(){function e(e,t){let i=e.array,n=e.itemSize,r=e.normalized,s=new i.constructor(t.length*n),a=0,o=0;for(let r=0,l=t.length;r<l;r++){a=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*n;for(let e=0;e<n;e++)s[o++]=i[a++]}return new rL(s,n,r)}if(null===this.index)return this;let t=new rZ,i=this.index.array,n=this.attributes;for(let r in n){let s=e(n[r],i);t.setAttribute(r,s)}let r=this.morphAttributes;for(let n in r){let s=[],a=r[n];for(let t=0,n=a.length;t<n;t++){let n=e(a[t],i);s.push(n)}t.morphAttributes[n]=s}t.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let e=0,i=s.length;e<i;e++){let i=s[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){let e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){let t=this.parameters;for(let i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};let t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let i=this.attributes;for(let t in i){let n=i[t];e.data.attributes[t]=n.toJSON(e.data)}let n={},r=!1;for(let t in this.morphAttributes){let i=this.morphAttributes[t],s=[];for(let t=0,n=i.length;t<n;t++){let n=i[t];s.push(n.toJSON(e.data))}s.length>0&&(n[t]=s,r=!0)}r&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));let a=this.boundingSphere;return null!==a&&(e.data.boundingSphere=a.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let i=e.index;null!==i&&this.setIndex(i.clone());let n=e.attributes;for(let e in n){let i=n[e];this.setAttribute(e,i.clone(t))}let r=e.morphAttributes;for(let e in r){let i=[],n=r[e];for(let e=0,r=n.length;e<r;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;let s=e.groups;for(let e=0,t=s.length;e<t;e++){let t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}let a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());let o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:rH++}),this.uuid=iN(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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={}}}let rK=new nB,rJ=new nF,rQ=new nC,r$=new iG,r0=new iG,r1=new iG,r2=new iG,r3=new iG,r4=new iG,r5=new iG,r6=new iG;class r8 extends rt{copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let i=this.geometry,n=i.attributes.position,r=i.morphAttributes.position,s=i.morphTargetsRelative;t.fromBufferAttribute(n,e);let a=this.morphTargetInfluences;if(r&&a){r4.set(0,0,0);for(let i=0,n=r.length;i<n;i++){let n=a[i],o=r[i];0!==n&&(r3.fromBufferAttribute(o,e),s?r4.addScaledVector(r3,n):r4.addScaledVector(r3.sub(t),n))}t.add(r4)}return t}raycast(e,t){let i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0!==n)null===i.boundingSphere&&i.computeBoundingSphere(),rQ.copy(i.boundingSphere),rQ.applyMatrix4(r),rJ.copy(e.ray).recast(e.near),!1===rQ.containsPoint(rJ.origin)&&(null===rJ.intersectSphere(rQ,r$)||rJ.origin.distanceToSquared(r$)>(e.far-e.near)**2)||(rK.copy(r).invert(),rJ.copy(e.ray).applyMatrix4(rK),(null===i.boundingBox||!1!==rJ.intersectsBox(i.boundingBox))&&this._computeIntersections(e,t,rJ))}_computeIntersections(e,t,i){let n,r=this.geometry,s=this.material,a=r.index,o=r.attributes.position,l=r.attributes.uv,h=r.attributes.uv1,c=r.attributes.normal,u=r.groups,d=r.drawRange;if(null!==a)if(Array.isArray(s))for(let r=0,o=u.length;r<o;r++){let o=u[r],p=s[o.materialIndex],f=Math.max(o.start,d.start),m=Math.min(a.count,Math.min(o.start+o.count,d.start+d.count));for(let r=f;r<m;r+=3){let s=a.getX(r);(n=r9(this,p,e,i,l,h,c,s,a.getX(r+1),a.getX(r+2)))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=o.materialIndex,t.push(n))}}else{let r=Math.max(0,d.start),o=Math.min(a.count,d.start+d.count);for(let u=r;u<o;u+=3){let r=a.getX(u);(n=r9(this,s,e,i,l,h,c,r,a.getX(u+1),a.getX(u+2)))&&(n.faceIndex=Math.floor(u/3),t.push(n))}}else if(void 0!==o)if(Array.isArray(s))for(let r=0,a=u.length;r<a;r++){let a=u[r],p=s[a.materialIndex],f=Math.max(a.start,d.start),m=Math.min(o.count,Math.min(a.start+a.count,d.start+d.count));for(let r=f;r<m;r+=3)(n=r9(this,p,e,i,l,h,c,r,r+1,r+2))&&(n.faceIndex=Math.floor(r/3),n.face.materialIndex=a.materialIndex,t.push(n))}else{let r=Math.max(0,d.start),a=Math.min(o.count,d.start+d.count);for(let o=r;o<a;o+=3)(n=r9(this,s,e,i,l,h,c,o,o+1,o+2))&&(n.faceIndex=Math.floor(o/3),t.push(n))}}constructor(e=new rZ,t=new rT){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}}function r9(e,t,i,n,r,s,a,o,l,h){e.getVertexPosition(o,r0),e.getVertexPosition(l,r1),e.getVertexPosition(h,r2);let c=function(e,t,i,n,r,s,a,o){if(null===(t.side===y?n.intersectTriangle(a,s,r,!0,o):n.intersectTriangle(r,s,a,t.side===x,o)))return null;r6.copy(o),r6.applyMatrix4(e.matrixWorld);let l=i.ray.origin.distanceTo(r6);return l<i.near||l>i.far?null:{distance:l,point:r6.clone(),object:e}}(e,t,i,n,r0,r1,r2,r5);if(c){let e=new iG;rm.getBarycoord(r5,r0,r1,r2,e),r&&(c.uv=rm.getInterpolatedAttribute(r,o,l,h,e,new iV)),s&&(c.uv1=rm.getInterpolatedAttribute(s,o,l,h,e,new iV)),a&&(c.normal=rm.getInterpolatedAttribute(a,o,l,h,e,new iG),c.normal.dot(n.direction)>0&&c.normal.multiplyScalar(-1));let t={a:o,b:l,c:h,normal:new iG,materialIndex:0};rm.getNormal(r0,r1,r2,t.normal),c.face=t,c.barycoord=e}return c}class r7 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new r7(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}constructor(e=1,t=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};let a=this;n=Math.floor(n),r=Math.floor(r);let o=[],l=[],h=[],c=[],u=0,d=0;function p(e,t,i,n,r,s,p,f,m,g,v){let _=s/m,x=p/g,y=s/2,M=p/2,S=f/2,b=m+1,T=g+1,w=0,E=0,A=new iG;for(let s=0;s<T;s++){let a=s*x-M;for(let o=0;o<b;o++){let u=o*_-y;A[e]=u*n,A[t]=a*r,A[i]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[i]=f>0?1:-1,h.push(A.x,A.y,A.z),c.push(o/m),c.push(1-s/g),w+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let i=u+t+b*e,n=u+t+b*(e+1),r=u+(t+1)+b*(e+1),s=u+(t+1)+b*e;o.push(i,n,s),o.push(n,r,s),E+=6}a.addGroup(d,E,v),d+=E,u+=w}p("z","y","x",-1,-1,i,t,e,s=Math.floor(s),r,0),p("z","y","x",1,-1,i,t,-e,s,r,1),p("x","z","y",1,1,e,i,t,n,s,2),p("x","z","y",1,-1,e,i,-t,n,s,3),p("x","y","z",1,-1,e,t,i,n,r,4),p("x","y","z",-1,-1,e,t,-i,n,r,5),this.setIndex(o),this.setAttribute("position",new rV(l,3)),this.setAttribute("normal",new rV(h,3)),this.setAttribute("uv",new rV(c,2))}}function se(e){let t={};for(let i in e)for(let n in t[i]={},e[i]){let r=e[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?t[i][n]=null:t[i][n]=r.clone():Array.isArray(r)?t[i][n]=r.slice():t[i][n]=r}return t}function st(e){let t={};for(let i=0;i<e.length;i++){let n=se(e[i]);for(let e in n)t[e]=n[e]}return t}function si(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:i4.workingColorSpace}let sn={clone:se,merge:st};class sr extends rb{copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=se(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);for(let i in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}}class ss extends rt{get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new nB,this.projectionMatrix=new nB,this.projectionMatrixInverse=new nB,this.coordinateSystem=iT,this._reversedDepth=!1}}let sa=new iG,so=new iV,sl=new iV;class sh extends ss{copy(e,t){return super.copy(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(e){let t=.5*this.getFilmHeight()/e;this.fov=2*iU*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*iL*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*iU*Math.atan(Math.tan(.5*iL*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){sa.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(sa.x,sa.y).multiplyScalar(-e/sa.z),sa.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(sa.x,sa.y).multiplyScalar(-e/sa.z)}getViewSize(e,t){return this.getViewBounds(e,so,sl),t.subVectors(sl,so)}setViewOffset(e,t,i,n,r,s){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=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*iL*this.fov)/this.zoom,i=2*t,n=this.aspect*i,r=-.5*n,s=this.view;if(null!==this.view&&this.view.enabled){let e=s.fullWidth,a=s.fullHeight;r+=s.offsetX*n/e,t-=s.offsetY*i/a,n*=s.width/e,i*=s.height/a}let a=this.filmOffset;0!==a&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(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}constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}}class sc extends rt{updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,n,r,s,a,o]=t;for(let e of t)this.remove(e);if(e===iT)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(e===iw)i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1);else throw Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,s,a,o,l,h]=this.children,c=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let f=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,n),e.render(t,r),e.setRenderTarget(i,1,n),e.render(t,s),e.setRenderTarget(i,2,n),e.render(t,a),e.setRenderTarget(i,3,n),e.render(t,o),e.setRenderTarget(i,4,n),e.render(t,l),i.texture.generateMipmaps=f,e.setRenderTarget(i,5,n),e.render(t,h),e.setRenderTarget(c,u,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let n=new sh(-90,1,e,t);n.layers=this.layers,this.add(n);let r=new sh(-90,1,e,t);r.layers=this.layers,this.add(r);let s=new sh(-90,1,e,t);s.layers=this.layers,this.add(s);let a=new sh(-90,1,e,t);a.layers=this.layers,this.add(a);let o=new sh(-90,1,e,t);o.layers=this.layers,this.add(o);let l=new sh(-90,1,e,t);l.layers=this.layers,this.add(l)}}class su extends nn{get images(){return this.image}set images(e){this.image=e}constructor(e=[],t=eg,i,n,r,s,a,o,l,h){super(e,t,i,n,r,s,a,o,l,h),this.isCubeTexture=!0,this.flipY=!1}}class sd extends na{fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
vendor: 15,489 bytes, line 1
1=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i=new r7(5,5,5),n=new sr({name:"CubemapFromEquirect",uniforms:se({tEquirect:{value:null}}),vertexShader:"\n\n varying vec3 vWorldDirection;\n\n vec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n }\n\n void main() {\n\n vWorldDirection = transformDirection( position, modelMatrix );\n\n #include <begin_vertex>\n #include <project_vertex>\n\n }\n ",fragmentShader:"\n\n uniform sampler2D tEquirect;\n\n varying vec3 vWorldDirection;\n\n #include <common>\n\n void main() {\n\n vec3 direction = normalize( vWorldDirection );\n\n vec2 sampleUV = equirectUv( direction );\n\n gl_FragColor = texture2D( tEquirect, sampleUV );\n\n }\n ",side:y,blending:S});n.uniforms.tEquirect.value=t;let r=new r8(i,n),s=t.minFilter;return t.minFilter===eL&&(t.minFilter=eC),new sc(1,10,this).update(e,r),t.minFilter=s,r.geometry.dispose(),r.material.dispose(),this}clear(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,i,n);e.setRenderTarget(r)}constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1};this.texture=new su([i,i,i,i,i,i]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}}class sp extends rt{constructor(){super(),this.isGroup=!0,this.type="Group"}}let sf={type:"move"};class sm{getHandSpace(){return null===this._hand&&(this._hand=new sp,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new sp,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new iG,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new iG),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new sp,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new iG,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new iG),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(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(e,t,i){let n=null,r=null,s=null,a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let n of(s=!0,e.hand.values())){let e=t.getJointPose(n,i),r=this._getHandJoint(l,n);null!==e&&(r.matrix.fromArray(e.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.matrixWorldNeedsUpdate=!0,r.jointRadius=e.radius),r.visible=null!==e}let n=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=n.position.distanceTo(r.position);l.inputState.pinching&&a>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=.015&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&null!==(r=t.getPose(e.gripSpace,i))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1);null!==a&&(null===(n=t.getPose(e.targetRaySpace,i))&&null!==r&&(n=r),null!==n&&(a.matrix.fromArray(n.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,n.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(n.linearVelocity)):a.hasLinearVelocity=!1,n.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(n.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(sf)))}return null!==a&&(a.visible=null!==n),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let i=new sp;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}constructor(){this._targetRay=null,this._grip=null,this._hand=null}}class sg{clone(){return new sg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ry(e),this.density=t}}class sv{clone(){return new sv(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ry(e),this.near=t,this.far=i}}class s_ extends rt{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()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new nY,this.environmentIntensity=1,this.environmentRotation=new nY,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}class sx{onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let n=0,r=this.stride;n<r;n++)this.array[e+n]=t.array[i+n];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=iN()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=iN()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=id,this.updateRanges=[],this.version=0,this.uuid=iN()}}let sy=new iG;class sM{get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)sy.fromBufferAttribute(this,t),sy.applyMatrix4(e),this.setXYZ(t,sy.x,sy.y,sy.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)sy.fromBufferAttribute(this,t),sy.applyNormalMatrix(e),this.setXYZ(t,sy.x,sy.y,sy.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)sy.fromBufferAttribute(this,t),sy.transformDirection(e),this.setXYZ(t,sy.x,sy.y,sy.z);return this}getComponent(e,t){let i=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(i=iB(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=iz(i,this.array)),this.data.array[e*this.data.stride+this.offset+t]=i,this}setX(e,t){return this.normalized&&(t=iz(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=iz(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=iz(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=iz(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=iB(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=iB(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=iB(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=iB(t,this.array)),t}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this}setXYZW(e,t,i,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=iz(t,this.array),i=iz(i,this.array),n=iz(n,this.array),r=iz(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=n,this.data.array[e+3]=r,this}clone(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new sM(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized);{let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return new rL(new this.array.constructor(e),this.itemSize,this.normalized)}}toJSON(e){if(void 0!==e)return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized};{let e=[];for(let t=0;t<this.count;t++){let i=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[i+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}}constructor(e,t,i,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=n}}class sS extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new ry(0xffffff),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}}let sb=new iG,sT=new iG,sw=new iG,sE=new iV,sA=new iV,sR=new nB,sC=new iG,sI=new iG,sP=new iG,sL=new iV,sU=new iV,sN=new iV;class sD extends rt{raycast(e,t){let i,n;e.camera,sT.setFromMatrixScale(this.matrixWorld),sR.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),sw.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&sT.multiplyScalar(-sw.z);let r=this.material.rotation;0!==r&&(n=Math.cos(r),i=Math.sin(r));let s=this.center;sO(sC.set(-.5,-.5,0),sw,s,sT,i,n),sO(sI.set(.5,-.5,0),sw,s,sT,i,n),sO(sP.set(.5,.5,0),sw,s,sT,i,n),sL.set(0,0),sU.set(1,0),sN.set(1,1);let a=e.ray.intersectTriangle(sC,sI,sP,!1,sb);if(null===a&&(sO(sI.set(-.5,.5,0),sw,s,sT,i,n),sU.set(0,1),null===(a=e.ray.intersectTriangle(sC,sP,sI,!1,sb))))return;let o=e.ray.origin.distanceTo(sb);o<e.near||o>e.far||t.push({distance:o,point:sb.clone(),uv:rm.getInterpolation(sb,sC,sI,sP,sL,sU,sN,new iV),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}constructor(e=new sS){if(super(),this.isSprite=!0,this.type="Sprite",void 0===r){r=new rZ;let e=new sx(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);r.setIndex([0,1,2,0,2,3]),r.setAttribute("position",new sM(e,3,0,!1)),r.setAttribute("uv",new sM(e,2,3,!1))}this.geometry=r,this.material=e,this.center=new iV(.5,.5),this.count=1}}function sO(e,t,i,n,r,s){sE.subVectors(e,i).addScalar(.5).multiply(n),void 0!==r?(sA.x=s*sE.x-r*sE.y,sA.y=r*sE.x+s*sE.y):sA.copy(sE),e.copy(t),e.x+=sA.x,e.y+=sA.y,e.applyMatrix4(sR)}let sF=new iG,sB=new iG;class sz extends rt{copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,i=t.length;e<i;e++){let i=t[e];this.addLevel(i.object.clone(),i.distance,i.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;i=Math.abs(i);let r=this.levels;for(t=0;t<r.length&&!(i<r[t].distance);t++);return r.splice(t,0,{distance:i,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){let t=this.levels;for(let i=0;i<t.length;i++)if(t[i].distance===e){let e=t.splice(i,1);return this.remove(e[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){let t=this.levels;if(t.length>0){let i,n;for(i=1,n=t.length;i<n;i++){let n=t[i].distance;if(t[i].object.visible&&(n-=n*t[i].hysteresis),e<n)break}return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){sF.setFromMatrixPosition(this.matrixWorld);let i=e.ray.origin.distanceTo(sF);this.getObjectForDistance(i).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){let i,n;sF.setFromMatrixPosition(e.matrixWorld),sB.setFromMatrixPosition(this.matrixWorld);let r=sF.distanceTo(sB)/e.zoom;for(i=1,t[0].object.visible=!0,n=t.length;i<n;i++){let e=t[i].distance;if(t[i].object.visible&&(e-=e*t[i].hysteresis),r>=e)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;
1i<n;i++)t[i].object.visible=!1}}toJSON(e){let t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];let i=this.levels;for(let e=0,n=i.length;e<n;e++){let n=i[e];t.object.levels.push({object:n.object.uuid,distance:n.distance,hysteresis:n.hysteresis})}return t}constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}}let sk=new iG,sV=new nr,sH=new nr,sG=new iG,sW=new nB,sj=new iG,sX=new nC,sq=new nB,sY=new nF;class sZ extends r8{computeBoundingBox(){let e=this.geometry;null===this.boundingBox&&(this.boundingBox=new nu),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,sj),this.boundingBox.expandByPoint(sj)}computeBoundingSphere(){let e=this.geometry;null===this.boundingSphere&&(this.boundingSphere=new nC),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let e=0;e<t.count;e++)this.getVertexPosition(e,sj),this.boundingSphere.expandByPoint(sj)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let i=this.material,n=this.matrixWorld;if(void 0!==i)null===this.boundingSphere&&this.computeBoundingSphere(),sX.copy(this.boundingSphere),sX.applyMatrix4(n),!1!==e.ray.intersectsSphere(sX)&&(sq.copy(n).invert(),sY.copy(e.ray).applyMatrix4(sq),(null===this.boundingBox||!1!==sY.intersectsBox(this.boundingBox))&&this._computeIntersections(e,t,sY))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new nr,t=this.geometry.attributes.skinWeight;for(let i=0,n=t.count;i<n;i++){e.fromBufferAttribute(t,i);let n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===ep?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===ef&&this.bindMatrixInverse.copy(this.bindMatrix).invert()}applyBoneTransform(e,t){let i=this.skeleton,n=this.geometry;sV.fromBufferAttribute(n.attributes.skinIndex,e),sH.fromBufferAttribute(n.attributes.skinWeight,e),sk.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){let n=sH.getComponent(e);if(0!==n){let r=sV.getComponent(e);sW.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),t.addScaledVector(sG.copy(sk).applyMatrix4(sW),n)}}return t.applyMatrix4(this.bindMatrixInverse)}constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=ep,this.bindMatrix=new nB,this.bindMatrixInverse=new nB,this.boundingBox=null,this.boundingSphere=null}}class sK extends rt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class sJ extends nn{constructor(e=null,t=1,i=1,n,r,s,a,o,l=eT,h=eT,c,u){super(null,s,a,o,l,h,n,r,c,u),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let sQ=new nB,s$=new nB;class s0{init(){let 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){this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new nB)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){let t=new nB;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){let t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){let e=this.bones,t=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=e.length;n<r;n++){let r=e[n]?e[n].matrixWorld:s$;sQ.multiplyMatrices(r,t[n]),sQ.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new s0(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length),t=new Float32Array((e=Math.max(e=4*Math.ceil(e/4),4))*e*4);t.set(this.boneMatrices);let i=new sJ(t,e,e,eZ,ek);return i.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=i,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){let i=this.bones[t];if(i.name===e)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,n=e.bones.length;i<n;i++){let n=t[e.bones[i]];void 0===n&&(n=new sK),this.bones.push(n),this.boneInverses.push(new nB().fromArray(e.boneInverses[i])
vendor: 4,483 bytes, line 1
1)}return this.init(),this}toJSON(){let e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;let t=this.bones,i=this.boneInverses;for(let n=0,r=t.length;n<r;n++){let r=t[n];e.bones.push(r.uuid);let s=i[n];e.boneInverses.push(s.toArray())}return e}constructor(e=[],t=[]){this.uuid=iN(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}}class s1 extends rL{copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}constructor(e,t,i,n=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}}let s2=new nB,s3=new nB,s4=[],s5=new nu,s6=new nB,s8=new r8,s9=new nC;class s7 extends r8{computeBoundingBox(){let e=this.geometry,t=this.count;null===this.boundingBox&&(this.boundingBox=new nu),null===e.boundingBox&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,s2),s5.copy(e.boundingBox).applyMatrix4(s2),this.boundingBox.union(s5)}computeBoundingSphere(){let e=this.geometry,t=this.count;null===this.boundingSphere&&(this.boundingSphere=new nC),null===e.boundingSphere&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,s2),s9.copy(e.boundingSphere).applyMatrix4(s2),this.boundingSphere.union(s9)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.morphTexture&&(this.morphTexture=e.morphTexture.clone()),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}getMorphAt(e,t){let i=t.morphTargetInfluences,n=this.morphTexture.source.data.data,r=e*(i.length+1)+1;for(let e=0;e<i.length;e++)i[e]=n[r+e]}raycast(e,t){let i=this.matrixWorld,n=this.count;if((s8.geometry=this.geometry,s8.material=this.material,void 0!==s8.material)&&(null===this.boundingSphere&&this.computeBoundingSphere(),s9.copy(this.boundingSphere),s9.applyMatrix4(i),!1!==e.ray.intersectsSphere(s9)))for(let r=0;r<n;r++){this.getMatrixAt(r,s2),s3.multiplyMatrices(i,s2),s8.matrixWorld=s3,s8.raycast(e,s4);for(let e=0,i=s4.length;e<i;e++){let i=s4[e];i.instanceId=r,i.object=this,t.push(i)}s4.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new s1(new Float32Array(3*this.instanceMatrix.count).fill(1),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}setMorphAt(e,t){let i=t.morphTargetInfluences,n=i.length+1;null===this.morphTexture&&(this.morphTexture=new sJ(new Float32Array(n*this.count),n,this.count,eQ,ek));let r=this.morphTexture.source.data.data,s=0;for(let e=0;e<i.length;e++)s+=i[e];let a=this.geometry.morphTargetsRelative?1:1-s,o=n*e;r[o]=a,r.set(i,o+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),null!==this.morphTexture&&(this.morphTexture.dispose(),this.morphTexture=null)}constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new s1(new Float32Array(16*i),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let e=0;e<i;e++)this.setMatrixAt(e,s6)}}let ae=new iG,at=new iG,ai=new iX;class an{set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){let n=ae.subVectors(i,t).cross(at.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(ae),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;
1let r=-(e.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null:t.copy(e.start).addScaledVector(i,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||ai.getNormalMatrix(e),n=this.coplanarPoint(ae).applyMatrix4(e),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}constructor(e=new iG(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}}let ar=new nC,as=new iV(.5,.5),aa=new iG;class ao{set(e,t,i,n,r,s){let a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(s),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:iT,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.planes,r=e.elements,s=r[0],a=r[1],o=r[2],l=r[3],h=r[4],c=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],_=r[13],x=r[14],y=r[15];if(n[0].setComponents(l-s,d-h,g-p,y-v).normalize(),n[1].setComponents(l+s,d+h,g+p,y+v).normalize(),n[2].setComponents(l+a,d+c,g+f,y+_).normalize(),n[3].setComponents(l-a,d-c,g-f,y-_).normalize(),i)n[4].setComponents(o,u,m,x).normalize(),n[5].setComponents(l-o,d-u,g-m,y-x).normalize();else if(n[4].setComponents(l-o,d-u,g-m,y-x).normalize(),t===iT)n[5].setComponents(l+o,d+u,g+m,y+x).normalize();else if(t===iw)n[5].setComponents(o,u,m,x).normalize();else throw Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),ar.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),ar.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ar)}intersectsSprite(e){return ar.center.set(0,0,0),ar.radius=.7071067811865476+as.distanceTo(e.center),ar.applyMatrix4(e.matrixWorld),this.intersectsSphere(ar)}intersectsSphere(e){let t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(i)<n)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let n=t[i];if(aa.x=n.normal.x>0?e.max.x:e.min.x,aa.y=n.normal.y>0?e.max.y:e.min.y,aa.z=n.normal.z>0?e.max.z:e.min.z,0>n.distanceToPoint(aa))return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(0>t[i].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}constructor(e=new an,t=new an,i=new an,n=new an,r=new an,s=new an){this.planes=[e,t,i,n,r,s]}}let al=new nB,ah=new ao;class ac{intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let i=0;i<t.cameras.length;i++){let n=t.cameras[i];if(al.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ah.setFromProjectionMatrix(al,n.coordinateSystem,n.reversedDepth),ah.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let i=0;i<t.cameras.length;i++){let n=t.cameras[i];if(al.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ah.setFromProjectionMatrix(al,n.coordinateSystem,n.reversedDepth),ah.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let i=0;i<t.cameras.length;i++){let n=t.cameras[i];if(al.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ah.setFromProjectionMatrix(al,n.coordinateSystem,n.reversedDepth),ah.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let i=0;i<t.cameras.length;i++){let n=t.cameras[i];if(al.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ah.setFromProjectionMatrix(al,n.coordinateSystem,n.reversedDepth),ah.intersectsBox(e))return!0}return!1}
1containsPoint(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let i=0;i<t.cameras.length;i++){let n=t.cameras[i];if(al.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),ah.setFromProjectionMatrix(al,n.coordinateSystem,n.reversedDepth),ah.containsPoint(e))return!0}return!1}clone(){return new ac}constructor(){this.coordinateSystem=iT}}function au(e,t){return e-t}function ad(e,t){return e.z-t.z}function ap(e,t){return t.z-e.z}class af{push(e,t,i,n){let r=this.pool,s=this.list;this.index>=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});let a=r[this.index];s.push(a),this.index++,a.start=e,a.count=t,a.z=i,a.index=n}reset(){this.list.length=0,this.index=0}constructor(){this.index=0,this.pool=[],this.list=[]}}let am=new nB,ag=new ry(1,1,1),av=new ao,a_=new ac,ax=new nu,ay=new nC,aM=new iG,aS=new iG,ab=new iG,aT=new af,aw=new r8,aE=[];function aA(e,t){if(e.constructor!==t.constructor){let i=Math.min(e.length,t.length);for(let n=0;n<i;n++)t[n]=e[n]}else{let i=Math.min(e.length,t.length);t.set(new e.constructor(e.buffer,0,i))}}class aR extends r8{get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(4*this._maxInstanceCount),t=new sJ(new Float32Array((e=Math.max(e=4*Math.ceil(e/4),4))*e*4),e,e,eZ,ek);this._matricesTexture=t}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount),t=new sJ(new Uint32Array((e=Math.ceil(e))*e),e,e,e$,ez);this._indirectTexture=t}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount),t=new sJ(new Float32Array((e=Math.ceil(e))*e*4).fill(1),e,e,eZ,ek);t.colorSpace=i4.workingColorSpace,this._colorsTexture=t}_initializeGeometry(e){let t=this.geometry,i=this._maxVertexCount,n=this._maxIndexCount;if(!1===this._geometryInitialized){for(let n in e.attributes){let{array:r,itemSize:s,normalized:a}=e.getAttribute(n),o=new rL(new r.constructor(i*s),s,a);t.setAttribute(n,o)}if(null!==e.getIndex()){let e=i>65535?new Uint32Array(n):new Uint16Array(n);t.setIndex(new rL(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(let i in t.attributes){if(!e.hasAttribute(i))throw Error('THREE.BatchedMesh: Added geometry missing "'.concat(i,'". All geometries must have consistent attributes.'));let n=e.getAttribute(i),r=t.getAttribute(i);if(n.itemSize!==r.itemSize||n.normalized!==r.normalized)throw Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid instanceId ".concat(e,". Instance is either out of range or has been deleted."))}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||!1===t[e].active)throw Error("THREE.BatchedMesh: Invalid geometryId ".concat(e,". Geometry is either out of range or has been deleted."))}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new nu);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let i=0,n=t.length;i<n;i++){if(!1===t[i].active)continue;let n=t[i].geometryIndex;this.getMatrixAt(i,am),this.getBoundingBoxAt(n,ax).applyMatrix4(am),e.union(ax)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new nC);let e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let i=0,n=t.length;i<n;i++){if(!1===t[i].active)continue;let n=t[i].geometryIndex;this.getMatrixAt(i,am),this.getBoundingSphereAt(n,ay).applyMatrix4(am),e.union(ay)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&0===this._availableInstanceIds.length)throw Error("THREE.BatchedMesh: Maximum item count reached.");let t={visible:!0,active:!0,geometryIndex:e},i=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(au),i=this._availableInstanceIds.shift(),this._instanceInfo[i]=t):(i=this._instanceInfo.length,this._instanceInfo.push(t));let n=this._matricesTexture;am.identity().toArray(n.image.data,16*i),n.needsUpdate=!0;let r=this._colorsTexture;return r&&(ag.toArray(r.image.data,4*i),r.needsUpdate=!0),this._visibilityChanged=!0,i}
1addGeometry(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=-1===i?e.getAttribute("position").count:i;let a=e.getIndex();if(null!==a&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=-1===n?a.count:n),-1!==r.indexStart&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(au),s[t=this._availableGeometryIds.shift()]=r):(t=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(t,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,t}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);let i=this.geometry,n=null!==i.getIndex(),r=i.getIndex(),s=t.getIndex(),a=this._geometryInfo[e];if(n&&s.count>a.reservedIndexCount||t.attributes.position.count>a.reservedVertexCount)throw Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");let o=a.vertexStart,l=a.reservedVertexCount;for(let e in a.vertexCount=t.getAttribute("position").count,i.attributes){let n=t.getAttribute(e),r=i.getAttribute(e);!function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let r=e.count;for(let s=0;s<r;s++)for(let r=0;r<n;r++)t.setComponent(s+i,r,e.getComponent(s,r))}else t.array.set(e.array,i*n);t.needsUpdate=!0}(n,r,o);let s=n.itemSize;for(let e=n.count;e<l;e++){let t=o+e;for(let e=0;e<s;e++)r.setComponent(t,e,0)}r.needsUpdate=!0,r.addUpdateRange(o*s,l*s)}if(n){let e=a.indexStart,i=a.reservedIndexCount;a.indexCount=t.getIndex().count;for(let t=0;t<s.count;t++)r.setX(e+t,o+s.getX(t));for(let t=s.count;t<i;t++)r.setX(e+t,o);r.needsUpdate=!0,r.addUpdateRange(e,a.reservedIndexCount)}return a.start=n?a.indexStart:a.vertexStart,a.count=n?a.indexCount:a.vertexCount,a.boundingBox=null,null!==t.boundingBox&&(a.boundingBox=t.boundingBox.clone()),a.boundingSphere=null,null!==t.boundingSphere&&(a.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){let t=this._geometryInfo;if(e>=t.length||!1===t[e].active)return this;let i=this._instanceInfo;for(let t=0,n=i.length;t<n;t++)i[t].active&&i[t].geometryIndex===e&&this.deleteInstance(t);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0,i=this._geometryInfo,n=i.map((e,t)=>t).sort((e,t)=>i[e].vertexStart-i[t].vertexStart),r=this.geometry;for(let s=0,a=i.length;s<a;s++){let a=i[n[s]];if(!1!==a.active){if(null!==r.index){if(a.indexStart!==t){let{indexStart:i,vertexStart:n,reservedIndexCount:s}=a,o=r.index,l=o.array,h=e-n;for(let e=i;e<i+s;e++)l[e]=l[e]+h;o.array.copyWithin(t,i,i+s),o.addUpdateRange(t,s),a.indexStart=t}t+=a.reservedIndexCount}if(a.vertexStart!==e){let{vertexStart:t,reservedVertexCount:i}=a,n=r.attributes;for(let r in n){let s=n[r],{array:a,itemSize:o}=s;a.copyWithin(e*o,t*o,(t+i)*o),s.addUpdateRange(e*o,i*o)}a.vertexStart=e}e+=a.reservedVertexCount,a.start=r.index?a.indexStart:a.vertexStart,this._nextIndexStart=r.index?a.indexStart+a.reservedIndexCount:0,this._nextVertexStart=a.vertexStart+a.reservedVertexCount}}return this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;let i=this.geometry,n=this._geometryInfo[e];if(null===n.boundingBox){let e=new nu,t=i.index,r=i.attributes.position;for(let i=n.start,s=n.start+n.count;i<s;i++){let n=i;t&&(n=t.getX(n)),e.expandByPoint(aM.fromBufferAttribute(r,n))}n.boundingBox=e}return t.copy(n.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;let i=this.geometry,n=this._geometryInfo[e];if(null===n.boundingSphere){let t=new nC;this.getBoundingBoxAt(e,ax),ax.getCenter(t.center);let r=i.index,s=i.attributes.position,a=0;for(let e=n.start,i=n.start+n.count;e<i;e++){let i=e;r&&(i=r.getX(i)),aM.fromBufferAttribute(s,i),a=Math.max(a,t.center.distanceToSquared(aM))}t.radius=Math.sqrt(a),n.boundingSphere=t}return t.copy(n.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);let i=this._matricesTexture,n=this._matricesTexture.image.data;return t.toArray(n,16*e),i.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,16*e)}setColorAt(e,t){return this.validateInstanceId(e),null===this._colorsTexture&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,4*e),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,4*e)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t||(this._instanceInfo[e].visible=t,this._visibilityChanged=!0),this}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.validateGeometryId(e);let i=this._geometryInfo[e];return t.vertexStart=i.vertexStart,t.vertexCount=i.vertexCount,t.reservedVertexCount=i.reservedVertexCount,t.indexStart=i.indexStart,t.indexCount=i.indexCount,t.reservedIndexCount=i.reservedIndexCount,t.start=i.start,t.count=i.count,t}setInstanceCount(e){let t=this._availableInstanceIds,i=this._instanceInfo;for(t.sort(au);t[t.length-1]===i.length-1;)i.pop(),t.pop();if(e<i.length)throw Error("BatchedMesh: Instance ids outside the range ".concat(e," are being used. Cannot shrink instance count."));let n=new Int32Array(e),r=new Int32Array(e);aA(this._multiDrawCounts,n),aA(this._multiDrawStarts,r),this._multiDrawCounts=n,this._multiDrawStarts=r,this._maxInstanceCount=e;let s=this._indirectTexture,a=this._matricesTexture,o=this._colorsTexture;s.dispose(),this._initIndirectTexture(),aA(s.image.data,this._indirectTexture.image.data),a.dispose(),this._initMatricesTexture(),aA(a.image.data,this._matricesTexture.image.data),o&&(o.dispose(),this._initColorsTexture(),aA(o.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){let i=[...this._geometryInfo].filter(e=>e.active);if(Math.max(...i.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error("BatchedMesh: Geometry vertex values are being used outside the range ".concat(t,". Cannot shrink further."));if(this.geometry.index&&Math.max(...i.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error("BatchedMesh: Geometry index values are being used outside the range ".concat(t,". Cannot shrink further."));let n=this.geometry;n.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new rZ,this._initializeGeometry(n));let r=this.geometry;for(let e in n.index&&aA(n.index.array,r.index.array),n.attributes)aA(n.attributes[e].array,r.attributes[e].array)}raycast(e,t){let i=this._instanceInfo,n=this._geometryInfo,r=this.matrixWorld,s=this.geometry;aw.material=this.material,aw.geometry.index=s.index,aw.geometry.attributes=s.attributes,null===aw.geometry.boundingBox&&
1(aw.geometry.boundingBox=new nu),null===aw.geometry.boundingSphere&&(aw.geometry.boundingSphere=new nC);for(let s=0,a=i.length;s<a;s++){if(!i[s].visible||!i[s].active)continue;let a=i[s].geometryIndex,o=n[a];aw.geometry.setDrawRange(o.start,o.count),this.getMatrixAt(s,aw.matrixWorld).premultiply(r),this.getBoundingBoxAt(a,aw.geometry.boundingBox),this.getBoundingSphereAt(a,aw.geometry.boundingSphere),aw.raycast(e,aE);for(let e=0,i=aE.length;e<i;e++){let i=aE[e];i.object=this,i.batchId=s,t.push(i)}aE.length=0}aw.material=null,aw.geometry.index=null,aw.geometry.attributes={},aw.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=null!==e.boundingBox?e.boundingBox.clone():null,this.boundingSphere=null!==e.boundingSphere?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(e=>({...e,boundingBox:null!==e.boundingBox?e.boundingBox.clone():null,boundingSphere:null!==e.boundingSphere?e.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),null!==this._colorsTexture&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,null!==this._colorsTexture&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,i,n,r){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let s=n.getIndex(),a=null===s?1:s.array.BYTES_PER_ELEMENT,o=this._instanceInfo,l=this._multiDrawStarts,h=this._multiDrawCounts,c=this._geometryInfo,u=this.perObjectFrustumCulled,d=this._indirectTexture,p=d.image.data,f=i.isArrayCamera?a_:av;u&&!i.isArrayCamera&&(am.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),av.setFromProjectionMatrix(am,i.coordinateSystem,i.reversedDepth));let m=0;if(this.sortObjects){am.copy(this.matrixWorld).invert(),aM.setFromMatrixPosition(i.matrixWorld).applyMatrix4(am),aS.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(am);for(let e=0,t=o.length;e<t;e++)if(o[e].visible&&o[e].active){let t=o[e].geometryIndex;this.getMatrixAt(e,am),this.getBoundingSphereAt(t,ay).applyMatrix4(am);let n=!1;if(u&&(n=!f.intersectsSphere(ay,i)),!n){let i=c[t],n=ab.subVectors(ay.center,aM).dot(aS);aT.push(i.start,i.count,n,e)}}let e=aT.list,t=this.customSort;null===t?e.sort(r.transparent?ap:ad):t.call(this,e,i);for(let t=0,i=e.length;t<i;t++){let i=e[t];l[m]=i.start*a,h[m]=i.count,p[m]=i.index,m++}aT.reset()}else for(let e=0,t=o.length;e<t;e++)if(o[e].visible&&o[e].active){let t=o[e].geometryIndex,n=!1;if(u&&(this.getMatrixAt(e,am),this.getBoundingSphereAt(t,ay).applyMatrix4(am),n=!f.intersectsSphere(ay,i)),!n){let i=c[t];l[m]=i.start*a,h[m]=i.count,p[m]=e,m++}}d.needsUpdate=!0,this._multiDrawCount=m,this._visibilityChanged=!1}onBeforeShadow(e,t,i,n,r,s){this.onBeforeRender(e,null,n,r,s)}constructor(e,t,i=2*t,n){super(new rZ,n),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}}class aC extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new ry(0xffffff),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}}let aI=new iG,aP=new iG,aL=new nB,aU=new nF,aN=new nC,aD=new iG,aO=new iG;class aF extends rt{copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)aI.fromBufferAttribute(t,e-1),aP.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=aI.distanceTo(aP);e.setAttribute("lineDistance",new rV(i,1))}return this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,r=e.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),aN.copy(i.boundingSphere),aN.applyMatrix4(n),aN.radius+=r,!1===e.ray.intersectsSphere(aN))return;aL.copy(n).invert(),aU.copy(e.ray).applyMatrix4(aL);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=this.isLineSegments?2:1,h=i.index,c=i.attributes.position;if(null!==h){let i=Math.max(0,s.start),n=Math.min(h.count,s.start+s.count);for(let r=i,s=n-1;r<s;r+=l){let i=aB(this,e,aU,o,h.getX(r),h.getX(r+1),r);
1i&&t.push(i)}if(this.isLineLoop){let r=aB(this,e,aU,o,h.getX(n-1),h.getX(i),n-1);r&&t.push(r)}}else{let i=Math.max(0,s.start),n=Math.min(c.count,s.start+s.count);for(let r=i,s=n-1;r<s;r+=l){let i=aB(this,e,aU,o,r,r+1,r);i&&t.push(i)}if(this.isLineLoop){let r=aB(this,e,aU,o,n-1,i,n-1);r&&t.push(r)}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}constructor(e=new rZ,t=new aC){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}}function aB(e,t,i,n,r,s,a){let o=e.geometry.attributes.position;if(aI.fromBufferAttribute(o,r),aP.fromBufferAttribute(o,s),i.distanceSqToSegment(aI,aP,aD,aO)>n)return;aD.applyMatrix4(e.matrixWorld);let l=t.ray.origin.distanceTo(aD);if(!(l<t.near)&&!(l>t.far))return{distance:l,point:aO.clone().applyMatrix4(e.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:e}}let az=new iG,ak=new iG;class aV extends aF{computeLineDistances(){let e=this.geometry;if(null===e.index){let t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)az.fromBufferAttribute(t,e),ak.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+az.distanceTo(ak);e.setAttribute("lineDistance",new rV(i,1))}return this}constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}}class aH extends aF{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class aG extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ry(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}}let aW=new nB,aj=new nF,aX=new nC,aq=new iG;class aY extends rt{copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,n=this.matrixWorld,r=e.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),aX.copy(i.boundingSphere),aX.applyMatrix4(n),aX.radius+=r,!1===e.ray.intersectsSphere(aX))return;aW.copy(n).invert(),aj.copy(e.ray).applyMatrix4(aW);let a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=i.index,h=i.attributes.position;if(null!==l){let i=Math.max(0,s.start),r=Math.min(l.count,s.start+s.count);for(let s=i;s<r;s++){let i=l.getX(s);aq.fromBufferAttribute(h,i),aZ(aq,i,o,n,e,t,this)}}else{let i=Math.max(0,s.start),r=Math.min(h.count,s.start+s.count);for(let s=i;s<r;s++)aq.fromBufferAttribute(h,s),aZ(aq,s,o,n,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){let t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}constructor(e=new rZ,t=new aG){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}}function aZ(e,t,i,n,r,s,a){let o=aj.distanceSqToPoint(e);if(o<i){let i=new iG;aj.closestPointToPoint(e,i),i.applyMatrix4(n);let l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:i,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class aK extends nn{clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}constructor(e,t,i,n,r=eC,s=eC,a,o,l){super(e,t,i,n,r,s,a,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let h=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){h.needsUpdate=!0,h._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}}
vendor: 4,100 bytes, line 1
1class aJ extends aK{update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}constructor(e,t,i,n,r,s,a,o){super({},e,t,i,n,r,s,a,o),this.isVideoFrameTexture=!0}}class aQ extends nn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=eT,this.minFilter=eT,this.generateMipmaps=!1,this.needsUpdate=!0}}class a$ extends nn{constructor(e,t,i,n,r,s,a,o,l,h,c,u){super(null,s,a,o,l,h,n,r,c,u),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class a0 extends a${addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}constructor(e,t,i,n,r,s){super(e,t,i,r,s),this.isCompressedArrayTexture=!0,this.image.depth=n,this.wrapR=eS,this.layerUpdates=new Set}}class a1 extends a${constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,eg),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class a2 extends nn{constructor(e,t,i,n,r,s,a,o,l){super(e,t,i,n,r,s,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class a3 extends nn{copy(e){return super.copy(e),this.source=new i7(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}constructor(e,t,i=ez,n,r,s,a=eT,o=eT,l,h=eK,c=1){if(h!==eK&&h!==eJ)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},n,r,s,a,o,h,i,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}}class a4 extends nn{copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}}class a5 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new a5(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}constructor(e=1,t=1,i=4,n=8,r=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:i,radialSegments:n,heightSegments:r},t=Math.max(0,t),i=Math.max(1,Math.floor(i)),n=Math.max(3,Math.floor(n));let s=[],a=[],o=[],l=[],h=t/2,c=Math.PI/2*e,u=t,d=2*c+u,p=2*i+(r=Math.max(1,Math.floor(r))),f=n+1,m=new iG,g=new iG;for(let v=0;v<=p;v++){let _=0,x=0,y=0,M=0;if(v<=i){let t=v/i,n=t*Math.PI/2;x=-h-e*Math.cos(n),y=e*Math.sin(n),M=-e*Math.cos(n),_=t*c}else if(v<=i+r){let n=(v-i)/r;x=-h+n*t,y=e,M=0,_=c+n*u}else{let t=(v-i-r)/i,n=t*Math.PI/2;x=h+e*Math.sin(n),y=e*Math.cos(n),M=e*Math.sin(n),_=c+u+t*c}let S=Math.max(0,Math.min(1,_/d)),b=0;0===v?b=.5/n:v===p&&(b=-.5/n);for(let e=0;e<=n;e++){let t=e/n,i=t*Math.PI*2,r=Math.sin(i),s=Math.cos(i);g.x=-y*s,g.y=x,g.z=y*r,a.push(g.x,g.y,g.z),m.set(-y*s,M,y*r),m.normalize(),o.push(m.x,m.y,m.z),l.push(t+b,S)}if(v>0){let e=(v-1)*f;for(let t=0;t<n;t++){let i=e+t,n=e+t+1,r=v*f+t,a=v*f+t+1;s.push(i,n,r),s.push(n,a,r)}}}this.setIndex(s),this.setAttribute("position",new rV(a,3)),this.setAttribute("normal",new rV(o,3)),this.setAttribute("uv",new rV(l,2))}}class a6 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new a6(e.radius,e.segments,e.thetaStart,e.thetaLength)}constructor(e=1,t=32,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},t=Math.max(3,t);let r=[],s=[],a=[],o=[],l=new iG,h=new iV;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let r=0,c=3;r<=t;r++,c+=3){let u=i+r/t*n;l.x=e*Math.cos(u),l.y=e*Math.sin(u),s.push(l.x,l.y,l.z),a.push(0,0,1),h.x=(s[c]/e+1)/2,h.y=(s[c+1]/e+1)/2,o.push(h.x,h.y)}for(let e=1;e<=t;e++)r.push(e,e+1,0);this.setIndex(r),this.setAttribute("position",new rV(s,3)),this.setAttribute("normal",new rV(a,3)),this.setAttribute("uv",new rV(o,2))}}class a8 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new a8(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.o
vendor: 1,655 bytes, line 1
1penEnded,e.thetaStart,e.thetaLength)}constructor(e=1,t=1,i=1,n=32,r=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o};let l=this;n=Math.floor(n),r=Math.floor(r);let h=[],c=[],u=[],d=[],p=0,f=[],m=i/2,g=0;function v(i){let r=p,s=new iV,f=new iG,v=0,_=!0===i?e:t,x=!0===i?1:-1;for(let e=1;e<=n;e++)c.push(0,m*x,0),u.push(0,x,0),d.push(.5,.5),p++;let y=p;for(let e=0;e<=n;e++){let t=e/n*o+a,i=Math.cos(t),r=Math.sin(t);f.x=_*r,f.y=m*x,f.z=_*i,c.push(f.x,f.y,f.z),u.push(0,x,0),s.x=.5*i+.5,s.y=.5*r*x+.5,d.push(s.x,s.y),p++}for(let e=0;e<n;e++){let t=r+e,n=y+e;!0===i?h.push(n,n+1,t):h.push(n+1,n,t),v+=3}l.addGroup(g,v,!0===i?1:2),g+=v}(function(){let s=new iG,v=new iG,_=0,x=(t-e)/i;for(let l=0;l<=r;l++){let h=[],g=l/r,_=g*(t-e)+e;for(let e=0;e<=n;e++){let t=e/n,r=t*o+a,l=Math.sin(r),f=Math.cos(r);v.x=_*l,v.y=-g*i+m,v.z=_*f,c.push(v.x,v.y,v.z),s.set(l,x,f).normalize(),u.push(s.x,s.y,s.z),d.push(t,1-g),h.push(p++)}f.push(h)}for(let i=0;i<n;i++)for(let n=0;n<r;n++){let s=f[n][i],a=f[n+1][i],o=f[n+1][i+1],l=f[n][i+1];(e>0||0!==n)&&(h.push(s,a,l),_+=3),(t>0||n!==r-1)&&(h.push(a,o,l),_+=3)}l.addGroup(g,_,0),g+=_})(),!1===s&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(h),this.setAttribute("position",new rV(c,3)),this.setAttribute("normal",new rV(u,3)),this.setAttribute("uv",new rV(d,2))}}class a9 extends a8{static fromJSON(e){return new a9(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}constructor(e=1,t=1,i=32,n=1,r=!1,s=0,a=2*Math.PI){super(0,e,t,i,n,r,s,a),this.type="C
1oneGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:a}}}class a7 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new a7(e.vertices,e.indices,e.radius,e.details)}constructor(e=[],t=[],i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n};let r=[],s=[];function a(e){r.push(e.x,e.y,e.z)}function o(t,i){let n=3*t;i.x=e[n+0],i.y=e[n+1],i.z=e[n+2]}function l(e,t,i,n){n<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=n/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}(function(e){let i=new iG,n=new iG,r=new iG;for(let s=0;s<t.length;s+=3)o(t[s+0],i),o(t[s+1],n),o(t[s+2],r),function(e,t,i,n){let r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];let a=e.clone().lerp(i,n/r),o=t.clone().lerp(i,n/r),l=r-n;for(let e=0;e<=l;e++)0===e&&n===r?s[n][e]=a:s[n][e]=a.clone().lerp(o,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){let i=Math.floor(t/2);t%2==0?(a(s[e][i+1]),a(s[e+1][i]),a(s[e][i])):(a(s[e][i+1]),a(s[e+1][i+1]),a(s[e+1][i]))}}(i,n,r,e)})(n),function(e){let t=new iG;for(let i=0;i<r.length;i+=3)t.x=r[i+0],t.y=r[i+1],t.z=r[i+2],t.normalize().multiplyScalar(e),r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z}(i),function(){let e=new iG;for(let i=0;i<r.length;i+=3){var t;e.x=r[i+0],e.y=r[i+1],e.z=r[i+2];let n=h(e)/2/Math.PI+.5,a=Math.atan2(-(t=e).y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5;s.push(n,1-a)}(function(){let e=new iG,t=new iG,i=new iG,n=new iG,a=new iV,o=new iV,c=new iV;for(let u=0,d=0;u<r.length;u+=9,d+=6){e.set(r[u+0],r[u+1],r[u+2]),t.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),a.set(s[d+0],s[d+1]),o.set(s[d+2],s[d+3]),c.set(s[d+4],s[d+5]),n.copy(e).add(t).add(i).divideScalar(3);let p=h(n);l(a,d+0,e,p),l(o,d+2,t,p),l(c,d+4,i,p)}})(),function(){for(let e=0;e<s.length;e+=6){let t=s[e+0],i=s[e+2],n=s[e+4],r=Math.max(t,i,n),a=Math.min(t,i,n);r>.9&&a<.1&&(t<.2&&(s[e+0]+=1),i<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new rV(r,3)),this.setAttribute("normal",new rV(r.slice(),3)),this.setAttribute("uv",new rV(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}}class oe extends a7{static fromJSON(e){return new oe(e.radius,e.detail)}constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2,n=1/i;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,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[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,
119,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}}let ot=new iG,oi=new iG,on=new iG,or=new rm;class os extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){let i=Math.cos(iL*t),n=e.getIndex(),r=e.getAttribute("position"),s=n?n.count:r.count,a=[0,0,0],o=["a","b","c"],l=[,,,],h={},c=[];for(let e=0;e<s;e+=3){n?(a[0]=n.getX(e),a[1]=n.getX(e+1),a[2]=n.getX(e+2)):(a[0]=e,a[1]=e+1,a[2]=e+2);let{a:t,b:s,c:u}=or;if(t.fromBufferAttribute(r,a[0]),s.fromBufferAttribute(r,a[1]),u.fromBufferAttribute(r,a[2]),or.getNormal(on),l[0]="".concat(Math.round(1e4*t.x),",").concat(Math.round(1e4*t.y),",").concat(Math.round(1e4*t.z)),l[1]="".concat(Math.round(1e4*s.x),",").concat(Math.round(1e4*s.y),",").concat(Math.round(1e4*s.z)),l[2]="".concat(Math.round(1e4*u.x),",").concat(Math.round(1e4*u.y),",").concat(Math.round(1e4*u.z)),l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let e=0;e<3;e++){let t=(e+1)%3,n=l[e],r=l[t],s=or[o[e]],u=or[o[t]],d="".concat(n,"_").concat(r),p="".concat(r,"_").concat(n);p in h&&h[p]?(on.dot(h[p].normal)<=i&&(c.push(s.x,s.y,s.z),c.push(u.x,u.y,u.z)),h[p]=null):d in h||(h[d]={index0:a[e],index1:a[t],normal:on.clone()})}}for(let e in h)if(h[e]){let{index0:t,index1:i}=h[e];ot.fromBufferAttribute(r,t),oi.fromBufferAttribute(r,i),c.push(ot.x,ot.y,ot.z),c.push(oi.x,oi.y,oi.z)}this.setAttribute("position",new rV(c,3))}}}class oa{getPoint(){}getPointAt(e,t){let i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],i,n=this.getPoint(0),r=0;t.push(0);for(let s=1;s<=e;s++)t.push(r+=(i=this.getPoint(s/e)).distanceTo(n)),n=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getLengths(),r=0,s=n.length;t=i||e*n[s-1];let a=0,o=s-1,l;for(;a<=o;)if((l=n[r=Math.floor(a+(o-a)/2)]-t)<0)a=r+1;else if(l>0)o=r-1;else{o=r;break}if(n[r=o]===t)return r/(s-1);let h=n[r],c=n[r+1];return(r+(t-h)/(c-h))/(s-1)}getTangent(e,t){let i=e-1e-4,n=e+1e-4;i<0&&(i=0),n>1&&(n=1);let r=this.getPoint(i),s=this.getPoint(n),a=t||(r.isVector2?new iV:new iG);return a.copy(s).sub(r).normalize(),a}getTangentAt(e,t){let i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=new iG,n=[],r=[],s=[],a=new iG,o=new nB;for(let t=0;t<=e;t++){let i=t/e;n[t]=this.getTangentAt(i,new iG)}r[0]=new iG,s[0]=new iG;let l=Number.MAX_VALUE,h=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);h<=l&&(l=h,i.set(1,0,0)),c<=l&&(l=c,i.set(0,1,0)),u<=l&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],a),s[0].crossVectors(n[0],r[0]);for(let t=1;t<=e;t++){if(r[t]=r[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(n[t-1],n[t]),a.length()>Number.EPSILON){a.normalize();let e=Math.acos(iD(n[t-1].dot(n[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(a,e))}s[t].crossVectors(n[t],r[t])}if(!0===t){let t=Math.acos(iD(r[0].dot(r[e]),-1,1));t/=e,n[0].dot(a.crossVectors(r[0],r[e]))>0&&(t=-t);for(let i=1;i<=e;i++)r[i].applyMatrix4(o.makeRotationAxis(n[i],t*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.t
1ype,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}}class oo extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV,i=2*Math.PI,n=this.aEndAngle-this.aStartAngle,r=Math.abs(n)<Number.EPSILON;for(;n<0;)n+=i;for(;n>i;)n-=i;n<Number.EPSILON&&(n=r?0:i),!0!==this.aClockwise||r||(n===i?n=-i:n-=i);let s=this.aStartAngle+e*n,a=this.aX+this.xRadius*Math.cos(s),o=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),i=a-this.aX,n=o-this.aY;a=i*e-n*t+this.aX,o=i*t+n*e+this.aY}return t.set(a,o)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}constructor(e=0,t=0,i=1,n=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}}class ol extends oo{constructor(e,t,i,n,r,s){super(e,t,i,i,n,r,s),this.isArcCurve=!0,this.type="ArcCurve"}}function oh(){let e=0,t=0,i=0,n=0;function r(r,s,a,o){e=r,t=a,i=-3*r+3*s-2*a-o,n=2*r-2*s+a+o}return{initCatmullRom:function(e,t,i,n,s){r(t,i,s*(i-e),s*(n-t))},initNonuniformCatmullRom:function(e,t,i,n,s,a,o){let l=(t-e)/s-(i-e)/(s+a)+(i-t)/a,h=(i-t)/a-(n-t)/(a+o)+(n-i)/o;r(t,i,l*=a,h*=a)},calc:function(r){let s=r*r;return e+t*r+i*s+s*r*n}}}let oc=new iG,ou=new oh,od=new oh,op=new oh;class of extends oa{getPoint(e){let t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iG,r=this.points,s=r.length,a=(s-!this.closed)*e,o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:0===l&&o===s-1&&(o=s-2,l=1),this.closed||o>0?t=r[(o-1)%s]:(oc.subVectors(r[0],r[1]).add(r[0]),t=oc);let h=r[o%s],c=r[(o+1)%s];if(this.closed||o+2<s?i=r[(o+2)%s]:(oc.subVectors(r[s-1],r[s-2]).add(r[s-1]),i=oc),"centripetal"===this.curveType||"chordal"===this.curveType){let e="chordal"===this.curveType?.5:.25,n=Math.pow(t.distanceToSquared(h),e),r=Math.pow(h.distanceToSquared(c),e),s=Math.pow(c.distanceToSquared(i),e);r<1e-4&&(r=1),n<1e-4&&(n=r),s<1e-4&&(s=r),ou.initNonuniformCatmullRom(t.x,h.x,c.x,i.x,n,r,s),od.initNonuniformCatmullRom(t.y,h.y,c.y,i.y,n,r,s),op.initNonuniformCatmullRom(t.z,h.z,c.z,i.z,n,r,s)}else"catmullrom"===this.curveType&&(ou.initCatmullRom(t.x,h.x,c.x,i.x,this.tension),od.initCatmullRom(t.y,h.y,c.y,i.y,this.tension),op.initCatmullRom(t.z,h.z,c.z,i.z,this.tension));return n.set(ou.calc(l),od.calc(l),op.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(new iG().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}constructor(e=[],t=!1,i="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=n}}function om(e,t,i,n,r){let s=(n-t)*.5,a=(r-i)*.5,o=e*e;return e*o*(2*i-2*n+s+a)+(-3*i+3*n-2*s-a)*o+s*e+i}function og(e,t,i,n){return function(e,t){let i=1-e;return i*i*t}(e,t)+2*(1-e)*e*i+e*e*n}function ov(e,t,i,n,r){return function(e,t){let i=1-e;return i*i*i*t}(e,t)+function(e,t){let i=1-e;return 3*i*i*e*t}(e,i)+3*(1-e)*e*e*n+e*e*e*r}class o_ extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV,i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(ov(e,i.x,n.x,r.x,s.x),ov(e,i.y,n.y,r.y,s.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new iV,t=new iV,i=new iV,n=new iV){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=n}}class ox extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iG,i=this.v0,n=this.v1,r=this.v2,s=this.v3;return t.set(ov(e,i.x,n.x,r.x,s.x),ov(e,i.y,n.y,r.y,s.y),ov(e,i.z,n.z,r.z,s.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}constructor(e=new iG,t=new iG,i=new iG,n=new iG){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=n}}class oy extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new iV,t=new iV){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}}class oM extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iG;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iG;return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new iG,t=new iG){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}}class oS extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV,i=this.v0,n=this.v1,r=this.v2;return t.set(og(e,i.x,n.x,r.x),og(e,i.y,n.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new iV,t=new iV,i=new iV){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}
1}class ob extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iG,i=this.v0,n=this.v1,r=this.v2;return t.set(og(e,i.x,n.x,r.x),og(e,i.y,n.y,r.y),og(e,i.z,n.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){let e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}constructor(e=new iG,t=new iG,i=new iG){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}}class oT extends oa{getPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iV,i=this.points,n=(i.length-1)*e,r=Math.floor(n),s=n-r,a=i[0===r?r:r-1],o=i[r],l=i[r>i.length-2?i.length-1:r+1],h=i[r>i.length-3?i.length-1:r+2];return t.set(om(s,a.x,o.x,l.x,h.x),om(s,a.y,o.y,l.y,h.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){let i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){let i=e.points[t];this.points.push(new iV().fromArray(i))}return this}constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}}var ow=Object.freeze({__proto__:null,ArcCurve:ol,CatmullRomCurve3:of,CubicBezierCurve:o_,CubicBezierCurve3:ox,EllipseCurve:oo,LineCurve:oy,LineCurve3:oM,QuadraticBezierCurve:oS,QuadraticBezierCurve3:ob,SplineCurve:oT});class oE extends oa{add(e){this.curves.push(e)}closePath(){let e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){let i=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new ow[i](t,e))}return this}getPoint(e,t){let i=e*this.getLength(),n=this.getCurveLengths(),r=0;for(;r<n.length;){if(n[r]>=i){let e=n[r]-i,s=this.curves[r],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}r++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let i=0,n=this.curves.length;i<n;i++)e.push(t+=this.curves[i].getLength());return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[];for(let n=0,r=this.curves;n<r.length;n++){let s=r[n],a=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,o=s.getPoints(a);for(let t=0;t<o.length;t++){let n=o[t];e&&e.equals(n)||(i.push(n),e=n)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this}toJSON(){let e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){let i=this.curves[t];e.curves.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){let i=e.curves[t];this.curves.push(new ow[i.type]().fromJSON(i))}return this}constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}}class oA extends oE{setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){let i=new oy(this.currentPoint.clone(),new iV(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,n){let r=new oS(this.currentPoint.clone(),new iV(e,t),new iV(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(e,t,i,n,r,s){let a=new o_(this.currentPoint.clone(),new iV(e,t),new iV(i,n),new iV(r,s));return this.curves.push(a),this.currentPoint.set(r,s),this}splineThru(e){let t=new oT([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,n,r,s){let a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,i,n,r,s),this}absarc(e,t,i,n,r,s){return this.absellipse(e,t,i,i,n,r,s),this}ellipse(e,t,i,n,r,s,a,o){let l=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+l,t+h,i,n,r,s,a,o),this}absellipse(e,t,i,n,r,s,a,o){let l=new oo(e,t,i,n,r,s,a,o);if(this.curves.length>0){let e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);let h=l.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}constructor(e){super(),this.type="Path",this.currentPoint=new iV,e&&this.setFromPoints(e)}}class oR extends oA{getPointsHoles(e){let t=[];for(let i=0,n=this.holes.length;i<n;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push(i.clone())}return this}toJSON(){let e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){let i=this.holes[t];e.holes.push(i.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){let i=e.holes[t];this.holes.push(new oA().fromJSON(i))}return this}constructor(e){super(e),this.uuid=iN(),this.type="Shape",this.holes=[]}}function oC(e,t,i,n,r){let s;if(r===function(e,t,i,n){let r=0;for(let s=t,a=i-n;s<i;
1s+=n)r+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return r}(e,t,i,n)>0)for(let r=t;r<i;r+=n)s=oH(r/n|0,e[r],e[r+1],s);else for(let r=i-n;r>=t;r-=n)s=oH(r/n|0,e[r],e[r+1],s);return s&&oO(s,s.next)&&(oG(s),s=s.next),s}function oI(e,t){if(!e)return e;t||(t=e);let i=e,n;do if(n=!1,!i.steiner&&(oO(i,i.next)||0===oD(i.prev,i,i.next))){if(oG(i),(i=t=i.prev)===i.next)break;n=!0}else i=i.next;while(n||i!==t);return t}function oP(e,t){let i=e.x-t.x;return 0===i&&0==(i=e.y-t.y)&&(i=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),i}function oL(e,t,i,n,r){return(e=((e=((e=((e=((e=(e-i)*r|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-n)*r|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function oU(e,t,i,n,r,s,a,o){return(r-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(n-o)>=(i-a)*(t-o)&&(i-a)*(s-o)>=(r-a)*(n-o)}function oN(e,t,i,n,r,s,a,o){return(e!==a||t!==o)&&oU(e,t,i,n,r,s,a,o)}function oD(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function oO(e,t){return e.x===t.x&&e.y===t.y}function oF(e,t,i,n){let r=oz(oD(e,t,i)),s=oz(oD(e,t,n)),a=oz(oD(i,n,e)),o=oz(oD(i,n,t));return!!(r!==s&&a!==o||0===r&&oB(e,i,t)||0===s&&oB(e,n,t)||0===a&&oB(i,e,n)||0===o&&oB(i,t,n))}function oB(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function oz(e){return e>0?1:e<0?-1:0}function ok(e,t){return 0>oD(e.prev,e,e.next)?oD(e,t,e.next)>=0&&oD(e,e.prev,t)>=0:0>oD(e,t,e.prev)||0>oD(e,e.next,t)}function oV(e,t){let i=oW(e.i,e.x,e.y),n=oW(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function oH(e,t,i,n){let r=oW(e,t,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function oG(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 oW(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class oj{static triangulate(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;return function(e,t){let i,n,r,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,a=t&&t.length,o=a?t[0]*s:e.length,l=oC(e,0,o,s,!0),h=[];if(!l||l.next===l.prev)return h;if(a&&(l=function(e,t,i,n){let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i]*n,o=i<s-1?t[i+1]*n:e.length,l=oC(e,a,o,n,!1);l===l.next&&(l.steiner=!0),r.push(function(e){let t=e,i=e;do(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next;while(t!==e);return i}(l))}r.sort(oP);for(let e=0;e<r.length;e++)i=function(e,t){let i=function(e,t){let i,n=t,r=e.x,s=e.y,a=-1/0;if(oO(e,n))return n;do{if(oO(e,n.next))return n.next;if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){let e=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,i=n.x<n.next.x?n:n.next,e===r))return i}n=n.next}while(n!==t);if(!i)return null;let o=i,l=i.x,h=i.y,c=1/0;n=i;do{if(r>=n.x&&n.x>=l&&r!==n.x&&oU(s<h?r:a,s,l,h,s<h?a:r,s,n.x,n.y)){var u,d;let t=Math.abs(s-n.y)/(r-n.x);ok(n,e)&&(t<c||t===c&&(n.x>i.x||n.x===i.x&&(u=i,d=n,0>oD(u.prev,u,d.prev)&&0>oD(d.next,u,u.next))))&&(i=n,c=t)}n=n.next}while(n!==o);return i}(e,t);if(!i)return t;let n=oV(i,e);return oI(n,n.next),oI(i,i.next)}(r[e],i);return i}(e,t,l,s)),e.length>80*s){i=1/0,n=1/0;let t=-1/0,a=-1/0;for(let r=s;r<o;r+=s){let s=e[r],o=e[r+1];s<i&&(i=s),o<n&&(n=o),s>t&&(t=s),o>a&&(a=o)}r=0!==(r=Math.max(t-i,a-n))?32767/r:0}return function e(t,i,n,r,s,a,o){if(!t)return;!o&&a&&function(e,t,i,n){let r=e;do 0===r.z&&(r.z=oL(r.x,r.y,t,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){let t,i=1;do{let n,r=e;e=null;let s=null;for(t=0;r;){t++;let a=r,o=0;for(let e=0;e<i&&(o++,a=a.nextZ);e++);let l=i;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||r.z<=a.z)?(n=r,r=r.nextZ,o--):(n=a,a=a.nextZ,l--),s?s.nextZ=n:e=n,n.prevZ=s,s=n;r=a}s.nextZ=null,i*=2}while(t>1)}(r)}(t,r,s,a);let l=t;for(;t.prev!==t.next;){let h=t.prev,c=t.next;if(a?function(e,t,i,n){let r=e.prev,s=e.next;if(oD(r,e,s)>=0)return!1;let a=r.x,o=e.x,l=s.x,h=r.y,c=e.y,u=s.y,d=Math.min(a,o,l),p=Math.min(h,c,u),f=Math.max(a,o,l),m=Math.max(h,c,u),g=oL(d,p,t,i,n),v=oL(f,m,t,i,n),_=e.prevZ,x=e.nextZ;for(;_&&_.z>=g&&x&&x.z<=v;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==s&&oN(a,h,o,c,l,u,_.x,_.y)&&oD(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=d&&x.x<=f&&x.y>=p&&x.y<=m&&x!==r&&x!==s&&oN(a,h,o,c,l,u,x.x,x.y)&&oD(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=m&&_!==r&&_!==s&&oN(a,h,o,c,l,u,_.x,_.y)&&oD(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=v;){if(x.x>=d&&x.x<=f&&x.y>=p&&x.y<=m&&x!==r&&x!==s&&oN(a,h,o,c,l,u,x.x,x.y)&&oD(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}(t,r,s,a):function(e){let t=e.prev,i=e.next;if(oD(t,e,i)>=0)return!1;let n=t.x,r=e.x,s=i.x,a=t.y,o=e.y,l=i.y,h=Math.min(n,r,s),c=Math.min(a,o,l),u=Math.max(n,r,s),d=Math.max(a,o,l),p=i.next;for(;p!==t;){if(p.x>=h&&p.x<=u&&p.y>=c&&p.y<=d&&oN(n,a,r,o,s,l,p.x,p.y)&&oD(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}(t)){i.push(h.i,t.i,c.i),oG(t),t=c.next,l=c.next;continue}if((t=c)===l){o?1===o?e(t=function(e,t){let i=e;do{let n=i.prev,r=i.next.next;!oO(n,r)&&oF(n,i,i.next,r)&&ok(n,r)&&ok(r,n)&&(t.push(n.i,i.i,r.i),oG(i),oG(i.next),i=e=r),i=i.next}while(i!==e);return oI(i)}(oI(t),i),i,n,r,s,a,2):2===o&&function(t,i,n,r,s,a){let o=t;
1do{let t=o.next.next;for(;t!==o.prev;){var l,h;if(o.i!==t.i&&(l=o,h=t,l.next.i!==h.i&&l.prev.i!==h.i&&!function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&oF(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(l,h)&&(ok(l,h)&&ok(h,l)&&function(e,t){let i=e,n=!1,r=(e.x+t.x)/2,s=(e.y+t.y)/2;do i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next;while(i!==e);return n}(l,h)&&(oD(l.prev,l,h.prev)||oD(l,h.prev,h))||oO(l,h)&&oD(l.prev,l,l.next)>0&&oD(h.prev,h,h.next)>0))){let l=oV(o,t);o=oI(o,o.next),l=oI(l,l.next),e(o,i,n,r,s,a,0),e(l,i,n,r,s,a,0);return}t=t.next}o=o.next}while(o!==t)}(t,i,n,r,s,a):e(oI(t),i,n,r,s,a,1);break}}}(l,h,s,i,n,r,0),h}(e,t,i)}}class oX{static area(e){let t=e.length,i=0;for(let n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return .5*i}static isClockWise(e){return 0>oX.area(e)}static triangulateShape(e,t){let i=[],n=[],r=[];oq(e),oY(i,e);let s=e.length;t.forEach(oq);for(let e=0;e<t.length;e++)n.push(s),s+=t[e].length,oY(i,t[e]);let a=oj.triangulate(i,n);for(let e=0;e<a.length;e+=3)r.push(a.slice(e,e+3));return r}}function oq(e){let t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function oY(e,t){for(let i=0;i<t.length;i++)e.push(t[i].x),e.push(t[i].y)}class oZ extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return function(e,t,i){if(i.shapes=[],Array.isArray(e))for(let t=0,n=e.length;t<n;t++){let n=e[t];i.shapes.push(n.uuid)}else i.shapes.push(e.uuid);return i.options=Object.assign({},t),void 0!==t.extrudePath&&(i.options.extrudePath=t.extrudePath.toJSON()),i}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){let i=[];for(let n=0,r=e.shapes.length;n<r;n++){let r=t[e.shapes[n]];i.push(r)}let n=e.options.extrudePath;return void 0!==n&&(e.options.extrudePath=new ow[n.type]().fromJSON(n)),new oZ(i,e.options)}constructor(e=new oR([new iV(.5,.5),new iV(-.5,.5),new iV(-.5,-.5),new iV(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];let i=this,n=[],r=[];for(let s=0,a=e.length;s<a;s++)!function(e){let s,a,o,l,h,c=[],u=void 0!==t.curveSegments?t.curveSegments:12,d=void 0!==t.steps?t.steps:1,p=void 0!==t.depth?t.depth:1,f=void 0===t.bevelEnabled||t.bevelEnabled,m=void 0!==t.bevelThickness?t.bevelThickness:.2,g=void 0!==t.bevelSize?t.bevelSize:m-.1,v=void 0!==t.bevelOffset?t.bevelOffset:0,_=void 0!==t.bevelSegments?t.bevelSegments:3,x=t.extrudePath,y=void 0!==t.UVGenerator?t.UVGenerator:oK,M,S=!1;x&&(M=x.getSpacedPoints(d),S=!0,f=!1,s=x.computeFrenetFrames(d,!1),a=new iG,o=new iG,l=new iG),f||(_=0,m=0,g=0,v=0);let b=e.extractPoints(u),T=b.shape,w=b.holes;if(!oX.isClockWise(T)){T=T.reverse();for(let e=0,t=w.length;e<t;e++){let t=w[e];oX.isClockWise(t)&&(w[e]=t.reverse())}}function E(e){let t=1e-10*1e-10,i=e[0];for(let n=1;n<=e.length;n++){let r=n%e.length,s=e[r],a=s.x-i.x,o=s.y-i.y,l=a*a+o*o,h=Math.max(Math.abs(s.x),Math.abs(s.y),Math.abs(i.x),Math.abs(i.y));if(l<=t*h*h){e.splice(r,1),n--;continue}i=s}}E(T),w.forEach(E);let A=w.length,R=T;for(let e=0;e<A;e++){let t=w[e];T=T.concat(t)}function C(e,t,i){return e.clone().addScaledVector(t,i)}let I=T.length;function P(e,t,i){let n,r,s,a=e.x-t.x,o=e.y-t.y,l=i.x-e.x,h=i.y-e.y,c=a*a+o*o;if(Math.abs(a*h-o*l)>Number.EPSILON){let u=Math.sqrt(c),d=Math.sqrt(l*l+h*h),p=t.x-o/u,f=t.y+a/u,m=((i.x-h/d-p)*h-(i.y+l/d-f)*l)/(a*h-o*l),g=(n=p+a*m-e.x)*n+(r=f+o*m-e.y)*r;if(g<=2)return new iV(n,r);s=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(o)===Math.sign(h)&&(e=!0),e?(n=-o,r=a,s=Math.sqrt(c)):(n=a,r=o,s=Math.sqrt(c/2))}return new iV(n/s,r/s)}let L=[];for(let e=0,t=R.length,i=t-1,n=e+1;e<t;e++,i++,n++)i===t&&(i=0),n===t&&(n=0),L[e]=P(R[e],R[i],R[n]);let U=[],N,D=L.concat();for(let e=0;e<A;e++){let t=w[e];N=[];for(let e=0,i=t.length,n=i-1,r=e+1;e<i;e++,n++,r++)n===i&&(n=0),r===i&&(r=0),N[e]=P(t[e],t[n],t[r]);U.push(N),D=D.concat(N)}if(0===_)h=oX.triangulateShape(R,w);else{let e=[],t=[];for(let i=0;i<_;i++){let n=i/_,r=m*Math.cos(n*Math.PI/2),s=g*Math.sin(n*Math.PI/2)+v;for(let t=0,i=R.length;t<i;t++){let i=C(R[t],L[t],s);z(i.x,i.y,-r),0===n&&e.push(i)}for(let e=0;e<A;e++){let i=w[e];N=U[e];let a=[];for(let e=0,t=i.length;e<t;e++){let t=C(i[e],N[e],s);z(t.x,t.y,-r),0===n&&a.push(t)}0===n&&t.push(a)}}h=oX.triangulateShape(e,t)}let O=h.length,F=g+v;for(let e=0;e<I;e++){let t=f?C(T[e],D[e],F):T[e];S?(o.copy(s.normals[0]).multiplyScalar(t.x),a.copy(s.binormals[0]).multiplyScalar(t.y),l.copy(M[0]).add(o).add(a),z(l.x,l.y,l.z)):z(t.x,t.y,0)}for(let e=1;e<=d;e++)for(let t=0;t<I;t++){let i=f?C(T[t],D[t],F):T[t];S?(o.copy(s.normals[e]).multiplyScalar(i.x),a.copy(s.binormals[e]).multiplyScalar(i.y),l.copy(M[e]).add(o).add(a),z(l.x,l.y,l.z)):z(i.x,i.y,p/d*e)}for(let e=_-1;e>=0;e--){let t=e/_,i=m*Math.cos(t*Math.PI/2),n=g*Math.sin(t*Math.PI/2)+v;for(let e=0,t=R.length;e<t;e++){let t=C(R[e],L[e],n);z(t.x,t.y,p+i)}for(let e=0,t=w.length;e<t;e++){let t=w[e];N=U[e];for(let e=0,r=t.length;e<r;e++){let r=C(t[e],N[e],n);S?z(r.x,r.y+M[d-1].y,M[d-1].x+i):z(r.x,r.y,p+i)}}}function B(e,t){let r=e.length;for(;--r>=0;){let s=r,a=r-1;a<0&&(a=e.length-1);for(let e=0,r=d+2*_;e<r;e++){let r=I*e,o=I*(e+1);!function(e,t,r,s){V(e),V(t),V(s),V(t),V(r),V(s);let a=n.length/3,o=y.generateSideWallUV(i,n,a-6,a-3,a-2,a-1);H(o[0]),H(o[1]),H(o[3]),H(o[1]),H(o[2]),H(o[3])}(t+s+r,t+a+r,t+a+o,t+s+o)}}}function z(e,t,i){c.push(e),c.push(t),c.push(i)}function k(e,t,r){V(e),V(t),V(r);let s=n.length/3,a=y.generateTopUV(i,n,s-3,s-2,s-1);H(a[0]),H(a[1]),H(a[2])}function V(e){n.push(c[3*e+0]),n.push(c[3*e+1]),n.push(c[3*e+2])}function H(e){r.push(e.x),r.push(e.y)}(function(){let e=n.length/3;if(f){let e=0*I;for(let t=0;t<O;t++){let i=h[t];k(i[2]+e,i[1]+e,i[0]+e)}e=I*(d+2*_);for(let t=0;t<O;t++){let i=h[t];k(i[0]+e,i[1]+e,i[2]+e)}}else{for(let e=0;e<O;e++){let t=h[e];k(t[2],t[1],t[0])}for(let e=0;e<O;e++){let t=h[e];k(t[0]+I*d,t[1]+I*d,t[2]+I*d)}}i.addGroup(e,n.length/3-e,0)})(),function(){let e=n.length/3,t=0;B(R,0),t+=R.length;for(let e=0,i=w.length;e<i;e++){let i=w[e];B(i,t),t+=i.length}i.addGroup(e,n.length/3-e,1)}()}(e[s]);this.setAttribute("position",new rV(n,3)),this.setAttribute("uv",new rV(r,2)),this.computeVertexNormals()}}let oK={generateTopUV:function(e,t,i,n,r){let s=t[3*i],a=t[3*i+1],o=t[3*n],l=t[3*n+1],h=t[3*r],c=t[3*r+1];return[new iV(s,a),new iV(o,l),new iV(h,c)]},generateSideWallUV:function(e,t,i,n,r,s){let a=t[3*i],o=t[3*i+1],l=t[3*i+2],h=t[3*n],c=t[3*n+1],u=t[3*n+2],d=t[3*r],p=t[3*r+1],f=t[3*r+2],m=t[3*s],g=t[3*s+1],v=t[3*s+2];return Math.abs(o-c)<Math.abs(a-h)?[new iV(a,1-l),new iV(h,1-u),new iV(d,1-f),new iV(m,1-v)]:[new iV(o,1-l),new iV(c,1-u),new iV(p,1-f),new iV(g,1-v)]}};
vendor: 5,156 bytes, line 1
1class oJ extends a7{static fromJSON(e){return new oJ(e.radius,e.detail)}constructor(e=1,t=0){let i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[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="IcosahedronGeometry",this.parameters={radius:e,detail:t}}}class oQ extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new oQ(e.points,e.segments,e.phiStart,e.phiLength)}constructor(e=[new iV(0,-.5),new iV(.5,0),new iV(0,.5)],t=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=Math.floor(t),n=iD(n,0,2*Math.PI);let r=[],s=[],a=[],o=[],l=[],h=1/t,c=new iG,u=new iV,d=new iG,p=new iG,f=new iG,m=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:m=e[t+1].x-e[t].x,d.x=+(g=e[t+1].y-e[t].y),d.y=-m,d.z=0*g,f.copy(d),d.normalize(),o.push(d.x,d.y,d.z);break;case e.length-1:o.push(f.x,f.y,f.z);break;default:m=e[t+1].x-e[t].x,d.x=+(g=e[t+1].y-e[t].y),d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),o.push(d.x,d.y,d.z),f.copy(p)}for(let r=0;r<=t;r++){let d=i+r*h*n,p=Math.sin(d),f=Math.cos(d);for(let i=0;i<=e.length-1;i++){c.x=e[i].x*p,c.y=e[i].y,c.z=e[i].x*f,s.push(c.x,c.y,c.z),u.x=r/t,u.y=i/(e.length-1),a.push(u.x,u.y);let n=o[3*i+0]*p,h=o[3*i+1],d=o[3*i+0]*f;l.push(n,h,d)}}for(let i=0;i<t;i++)for(let t=0;t<e.length-1;t++){let n=t+i*e.length,s=n+e.length,a=n+e.length+1,o=n+1;r.push(n,s,o),r.push(a,o,s)}this.setIndex(r),this.setAttribute("position",new rV(s,3)),this.setAttribute("uv",new rV(a,2)),this.setAttribute("normal",new rV(l,3))}}class o$ extends a7{static fromJSON(e){return new o$(e.radius,e.detail)}constructor(e=1,t=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="OctahedronGeometry",this.parameters={radius:e,detail:t}}}class o0 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new o0(e.width,e.height,e.widthSegments,e.heightSegments)}constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};let r=e/2,s=t/2,a=Math.floor(i),o=Math.floor(n),l=a+1,h=o+1,c=e/a,u=t/o,d=[],p=[],f=[],m=[];for(let e=0;e<h;e++){let t=e*u-s;for(let i=0;i<l;i++){let n=i*c-r;p.push(n,-t,0),f.push(0,0,1),m.push(i/a),m.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<a;t++){let i=t+l*e,n=t+l*(e+1),r=t+1+l*(e+1),s=t+1+l*e;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new rV(p,3)),this.setAttribute("normal",new rV(f,3)),this.setAttribute("uv",new rV(m,2))}}class o1 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new o1(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}constructor(e=.5,t=1,i=32,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);let a=[],o=[],l=[],h=[],c=e,u=(t-e)/(n=Math.max(1,n)),d=new iG,p=new iV;for(let e=0;e<=n;e++){for(let e=0;e<=i;e++){let n=r+e/i*s;d.x=c*Math.cos(n),d.y=c*Math.sin(n),o.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/t+1)/2,p.y=(d.y/t+1)/2,h.push(p.x,p.y)}c+=u}for(let e=0;e<n;e++){let t=e*(i+1);for(let e=0;e<i;e++){let n=e+t,r=n+i+1,s=n+i+2,o=n+1;a.push(n,r,o),a.push(r,s,o)}}this.setIndex(a),this.setAttribute("position",new rV(o,3)),this.setAttribute("normal",new rV(l,3)),this.setAttribute("uv",new rV(h,2))}}class o2 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let i=0,n=e.length;i<n;i++){let n=e[i];t.shapes.push(n.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){let i=[];for(let n=0,r=e.shapes.length;n<r;n++){let r=t[e.shapes[n]];i.push(r)}return new o2(i,e.curveSegments)}constructor(e=new oR([new iV(0,.5),new iV(-.5,-.5),new iV(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};let i=[],n=[],r=[],s=[],a=0,o=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(a,o,t),a+=o,o=0;function l(e){let a=n.length/3,l=e.extractPoints(t),h=l.shape,c=l.holes;!1===oX.isClockWise(h)&&(h=h.reverse());for(let e=0,t=c.length;e<t;e++){let t=c[e];!0===oX.isClockWise(t)&&(c[e]=t.reverse())}let u=oX.triangulateShape(h,c);for(let e=0,t=c.length;e<t;e++){let t=c[e];h=h.concat(t)}for(let e=0,t=h.length;e<t;e++){let t=h[e];n.push(t.x,t.y,0),r.push(0,0,1),s.push(t.x,t.y)}for(let e=0,t=u.length;e<t;e++){let t=u[e],n=t[0]+a,r=t[1]+a,s=t[2]+a;i.push(n,r,s),o+=3}}this.setIndex(i),this.setAttribute("position",new rV(n,3)),this.setAttribute("normal",new rV(r,3)),this.setAttribute("uv",new rV(s,2))}}class o3 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}
vendor: 4,186 bytes, line 1
1static fromJSON(e){return new o3(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}constructor(e=1,t=32,i=16,n=0,r=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));let o=Math.min(s+a,Math.PI),l=0,h=[],c=new iG,u=new iG,d=[],p=[],f=[],m=[];for(let d=0;d<=i;d++){let g=[],v=d/i,_=0;0===d&&0===s?_=.5/t:d===i&&o===Math.PI&&(_=-.5/t);for(let i=0;i<=t;i++){let o=i/t;c.x=-e*Math.cos(n+o*r)*Math.sin(s+v*a),c.y=e*Math.cos(s+v*a),c.z=e*Math.sin(n+o*r)*Math.sin(s+v*a),p.push(c.x,c.y,c.z),u.copy(c).normalize(),f.push(u.x,u.y,u.z),m.push(o+_,1-v),g.push(l++)}h.push(g)}for(let e=0;e<i;e++)for(let n=0;n<t;n++){let t=h[e][n+1],r=h[e][n],a=h[e+1][n],l=h[e+1][n+1];(0!==e||s>0)&&d.push(t,r,l),(e!==i-1||o<Math.PI)&&d.push(r,a,l)}this.setIndex(d),this.setAttribute("position",new rV(p,3)),this.setAttribute("normal",new rV(f,3)),this.setAttribute("uv",new rV(m,2))}}class o4 extends a7{static fromJSON(e){return new o4(e.radius,e.detail)}constructor(e=1,t=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="TetrahedronGeometry",this.parameters={radius:e,detail:t}}}class o5 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new o5(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}constructor(e=1,t=.4,i=12,n=48,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);let s=[],a=[],o=[],l=[],h=new iG,c=new iG,u=new iG;for(let s=0;s<=i;s++)for(let d=0;d<=n;d++){let p=d/n*r,f=s/i*Math.PI*2;c.x=(e+t*Math.cos(f))*Math.cos(p),c.y=(e+t*Math.cos(f))*Math.sin(p),c.z=t*Math.sin(f),a.push(c.x,c.y,c.z),h.x=e*Math.cos(p),h.y=e*Math.sin(p),u.subVectors(c,h).normalize(),o.push(u.x,u.y,u.z),l.push(d/n),l.push(s/i)}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){let i=(n+1)*e+t-1,r=(n+1)*(e-1)+t-1,a=(n+1)*(e-1)+t,o=(n+1)*e+t;s.push(i,r,o),s.push(r,a,o)}this.setIndex(s),this.setAttribute("position",new rV(a,3)),this.setAttribute("normal",new rV(o,3)),this.setAttribute("uv",new rV(l,2))}}class o6 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new o6(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}constructor(e=1,t=.4,i=64,n=8,r=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:n,p:r,q:s},i=Math.floor(i),n=Math.floor(n);let a=[],o=[],l=[],h=[],c=new iG,u=new iG,d=new iG,p=new iG,f=new iG,m=new iG,g=new iG;for(let a=0;a<=i;++a){let _=a/i*r*Math.PI*2;v(_,r,s,e,d),v(_+.01,r,s,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=n;++e){let r=e/n*Math.PI*2,s=-t*Math.cos(r),p=t*Math.sin(r);c.x=d.x+(s*g.x+p*f.x),c.y=d.y+(s*g.y+p*f.y),c.z=d.z+(s*g.z+p*f.z),o.push(c.x,c.y,c.z),u.subVectors(c,d).normalize(),l.push(u.x,u.y,u.z),h.push(a/i),h.push(e/n)}}for(let e=1;e<=i;e++)for(let t=1;t<=n;t++){let i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),s=(n+1)*e+t,o=(n+1)*(e-1)+t;a.push(i,r,o),a.push(r,s,o)}function v(e,t,i,n,r){let s=Math.cos(e),a=Math.sin(e),o=i/t*e,l=Math.cos(o);r.x=n*(2+l)*.5*s,r.y=n*(2+l)*a*.5,r.z=n*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new rV(o,3)),this.setAttribute("normal",new rV(l,3)),this.setAttribute("uv",new rV(h,2))}}class o8 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){let e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new o8(new ow[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}constructor(e=new ob(new iG(-1,-1,0),new iG(-1,1,0),new iG(1,1,0)),t=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r};let s=e.computeFrenetFrames(t,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;
vendor: 15,110 bytes, line 1
1let a=new iG,o=new iG,l=new iV,h=new iG,c=[],u=[],d=[],p=[];function f(r){h=e.getPointAt(r/t,h);let l=s.normals[r],d=s.binormals[r];for(let e=0;e<=n;e++){let t=e/n*Math.PI*2,r=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+r*d.x,o.y=s*l.y+r*d.y,o.z=s*l.z+r*d.z,o.normalize(),u.push(o.x,o.y,o.z),a.x=h.x+i*o.x,a.y=h.y+i*o.y,a.z=h.z+i*o.z,c.push(a.x,a.y,a.z)}}(function(){for(let e=0;e<t;e++)f(e);f(!1===r?t:0),function(){for(let e=0;e<=t;e++)for(let i=0;i<=n;i++)l.x=e/t,l.y=i/n,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=n;t++){let i=(n+1)*(e-1)+(t-1),r=(n+1)*e+(t-1),s=(n+1)*e+t,a=(n+1)*(e-1)+t;p.push(i,r,a),p.push(r,s,a)}}()})(),this.setIndex(p),this.setAttribute("position",new rV(c,3)),this.setAttribute("normal",new rV(u,3)),this.setAttribute("uv",new rV(d,2))}}class o9 extends rZ{copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){let t=[],i=new Set,n=new iG,r=new iG;if(null!==e.index){let s=e.attributes.position,a=e.index,o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){let l=o[e],h=l.start,c=l.count;for(let e=h,o=h+c;e<o;e+=3)for(let o=0;o<3;o++){let l=a.getX(e+o),h=a.getX(e+(o+1)%3);n.fromBufferAttribute(s,l),r.fromBufferAttribute(s,h),!0===o7(n,r,i)&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}}else{let s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let a=0;a<3;a++){let o=3*e+a,l=3*e+(a+1)%3;n.fromBufferAttribute(s,o),r.fromBufferAttribute(s,l),!0===o7(n,r,i)&&(t.push(n.x,n.y,n.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new rV(t,3))}}}function o7(e,t,i){let n="".concat(e.x,",").concat(e.y,",").concat(e.z,"-").concat(t.x,",").concat(t.y,",").concat(t.z),r="".concat(t.x,",").concat(t.y,",").concat(t.z,"-").concat(e.x,",").concat(e.y,",").concat(e.z);return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n),i.add(r),!0)}var le=Object.freeze({__proto__:null,BoxGeometry:r7,CapsuleGeometry:a5,CircleGeometry:a6,ConeGeometry:a9,CylinderGeometry:a8,DodecahedronGeometry:oe,EdgesGeometry:os,ExtrudeGeometry:oZ,IcosahedronGeometry:oJ,LatheGeometry:oQ,OctahedronGeometry:o$,PlaneGeometry:o0,PolyhedronGeometry:a7,RingGeometry:o1,ShapeGeometry:o2,SphereGeometry:o3,TetrahedronGeometry:o4,TorusGeometry:o5,TorusKnotGeometry:o6,TubeGeometry:o8,WireframeGeometry:o9});class lt extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new ry(0),this.transparent=!0,this.fog=!0,this.setValues(e)}}class li extends sr{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ln extends rb{copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new ry(0xffffff),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ry(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nY,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lr extends ln{get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new iV(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return iD(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new ry(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new ry(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new ry(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}}class ls extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ry(0xffffff),this.specular=new ry(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ry(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nY,this.combine=ei,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class la extends rb{copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ry(0xffffff),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ry(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}}class lo extends rb{copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}}class ll extends rb{copy(e){return super.copy(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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),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.flatShading=e.flatShading,this.fog=e.fog,this}constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ry(0xffffff),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ry(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nY,this.combine=ei,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}}class lh extends rb{copy(e){return super.copy(e),this.depthPacking=e.depthPacking,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}constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=tk,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}}class lc extends rb{copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}}class lu extends rb{copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}
1constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ry(0xffffff),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tW,this.normalScale=new iV(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}}class ld extends aC{copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}}function lp(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}function lf(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lm(e){let t=e.length,i=Array(t);for(let e=0;e!==t;++e)i[e]=e;return i.sort(function(t,i){return e[t]-e[i]}),i}function lg(e,t,i){let n=e.length,r=new e.constructor(n);for(let s=0,a=0;a!==n;++s){let n=i[s]*t;for(let i=0;i!==t;++i)r[a++]=e[n+i]}return r}function lv(e,t,i,n){let r=1,s=e[0];for(;void 0!==s&&void 0===s[n];)s=e[r++];if(void 0===s)return;let a=s[n];if(void 0!==a)if(Array.isArray(a))do void 0!==(a=s[n])&&(t.push(s.time),i.push(...a)),s=e[r++];while(void 0!==s);else if(void 0!==a.toArray)do void 0!==(a=s[n])&&(t.push(s.time),a.toArray(i,i.length)),s=e[r++];while(void 0!==s);else do void 0!==(a=s[n])&&(t.push(s.time),i.push(a)),s=e[r++];while(void 0!==s)}class l_{static convertArray(e,t){return lp(e,t)}static isTypedArray(e){return lf(e)}static getKeyframeOrder(e){return lm(e)}static sortedArray(e,t,i){return lg(e,t,i)}static flattenJSON(e,t,i,n){lv(e,t,i,n)}static subclip(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;return function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30,s=e.clone();s.name=t;let a=[];for(let e=0;e<s.tracks.length;++e){let t=s.tracks[e],o=t.getValueSize(),l=[],h=[];for(let e=0;e<t.times.length;++e){let s=t.times[e]*r;if(!(s<i)&&!(s>=n)){l.push(t.times[e]);for(let i=0;i<o;++i)h.push(t.values[e*o+i])}}0!==l.length&&(t.times=lp(l,t.times.constructor),t.values=lp(h,t.values.constructor),a.push(t))}s.tracks=a;let o=1/0;for(let e=0;e<s.tracks.length;++e)o>s.tracks[e].times[0]&&(o=s.tracks[e].times[0]);for(let e=0;e<s.tracks.length;++e)s.tracks[e].shift(-1*o);return s.resetDuration(),s}(e,t,i,n,r)}static makeClipAdditive(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;n<=0&&(n=30);let r=i.tracks.length,s=t/n;for(let t=0;t<r;++t){let n,r=i.tracks[t],a=r.ValueTypeName;if("bool"===a||"string"===a)continue;let o=e.tracks.find(function(e){return e.name===r.name&&e.ValueTypeName===a});if(void 0===o)continue;let l=0,h=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=h/3);let c=0,u=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=u/3);let d=r.times.length-1;if(s<=r.times[0]){let e=l,t=h-l;n=r.values.slice(e,t)}else if(s>=r.times[d]){let e=d*h+l,t=e+h-l;n=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=l,i=h-l;e.evaluate(s),n=e.resultBuffer.slice(t,i)}"quaternion"===a&&new iH().fromArray(n).normalize().conjugate().toArray(n);let p=o.times.length;for(let e=0;e<p;++e){let t=e*u+c;if("quaternion"===a)iH.multiplyQuaternionsFlat(o.values,t,n,0,o.values,t);else{let e=u-2*c;for(let i=0;i<e;++i)o.values[t+i]-=n[i]}}}return e.blendMode=tO,e}(e,t,i,n)}}class lx{evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{let s;i:{n:if(!(e<n)){for(let s=i+2;;){if(void 0===n){if(e<r)break n;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(r=n,e<(n=t[++i]))break t}s=t.length;break i}if(!(e>=r)){let a=t[1];e<a&&(i=2,r=a);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(i===s)break;if(n=r,e>=(r=t[--i-1]))break t}s=i,i=0;break i}break e}for(;i<s;){let n=i+s>>>1;e<t[n]?s=n:i=n+1}if(n=t[i],void 0===(r=t[i-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===n)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n;for(let e=0;e!==n;++e)t[e]=i[r+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}constructor(e,t,i,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}}class ly extends lx{intervalChanged_(e,t,i){let n=this.parameterPositions,r=e-2,s=e+1,a=n[r],o=n[s];if(void 0===a)switch(this.getSettings_().endingStart){case tU:r=e,a=2*t-i;break;case tN:r=n.length-2,a=t+n[r]-n[r+1];break;default:r=e,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case tU:s=e,o=2*i-t;break;case tN:s=1,o=i+n[1]-n[0];break;default:s=e-1,o=t}let l=(i-t)*.5,h=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-i),this._offsetPrev=r*h,this._offsetNext=s*h}interpolate_(e,t,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,h=this._offsetPrev,c=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-t)/(n-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,_=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-
1d*f;for(let e=0;e!==a;++e)r[e]=g*s[h+e]+v*s[l+e]+_*s[o+e]+x*s[c+e];return r}constructor(e,t,i,n){super(e,t,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:tL,endingEnd:tL}}}class lM extends lx{interpolate_(e,t,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,h=(i-t)/(n-t),c=1-h;for(let e=0;e!==a;++e)r[e]=s[l+e]*c+s[o+e]*h;return r}constructor(e,t,i,n){super(e,t,i,n)}}class lS extends lx{interpolate_(e){return this.copySampleValue_(e-1)}constructor(e,t,i,n){super(e,t,i,n)}}class lb{static toJSON(e){let t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:lp(e.times,Array),values:lp(e.values,Array)};let i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new lS(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new lM(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new ly(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case tC:t=this.InterpolantFactoryMethodDiscrete;break;case tI:t=this.InterpolantFactoryMethodLinear;break;case tP:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){let t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(t);return this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return tC;case this.InterpolantFactoryMethodLinear:return tI;case this.InterpolantFactoryMethodSmooth:return tP}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let i=0,n=t.length;i!==n;++i)t[i]*=e}return this}trim(e,t){let i=this.times,n=i.length,r=0,s=n-1;for(;r!==n&&i[r]<e;)++r;for(;-1!==s&&i[s]>t;)--s;if(++s,0!==r||s!==n){r>=s&&(r=(s=Math.max(s,1))-1);let e=this.getValueSize();this.times=i.slice(r,s),this.values=this.values.slice(r*e,s*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(e=!1);let i=this.times,n=this.values,r=i.length;0===r&&(e=!1);let s=null;for(let t=0;t!==r;t++){let n=i[t];if("number"==typeof n&&isNaN(n)||null!==s&&s>n){e=!1;break}s=n}if(void 0!==n&&lf(n)){for(let t=0,i=n.length;t!==i;++t)if(isNaN(n[t])){e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=this.getInterpolation()===tP,r=e.length-1,s=1;for(let a=1;a<r;++a){let r=!1,o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(n)r=!0;else{let e=a*i,n=e-i,s=e+i;for(let a=0;a!==i;++a){let i=t[e+a];if(i!==t[n+a]||i!==t[s+a]){r=!0;break}}}if(r){if(a!==s){e[s]=e[a];let n=a*i,r=s*i;for(let e=0;e!==i;++e)t[r+e]=t[n+e]}++s}}if(r>0){e[s]=e[r];for(let e=r*i,n=s*i,a=0;a!==i;++a)t[n+a]=t[e+a];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=new this.constructor(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}constructor(e,t,i,n){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=lp(t,this.TimeBufferType),this.values=lp(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}}lb.prototype.ValueTypeName="",lb.prototype.TimeBufferType=Float32Array,lb.prototype.ValueBufferType=Float32Array,lb.prototype.DefaultInterpolation=tI;class lT extends lb{constructor(e,t,i){super(e,t,i)}}lT.prototype.ValueTypeName="bool",lT.prototype.ValueBufferType=Array,lT.prototype.DefaultInterpolation=tC,lT.prototype.InterpolantFactoryMethodLinear=void 0,lT.prototype.InterpolantFactoryMethodSmooth=void 0;class lw extends lb{constructor(e,t,i,n){super(e,t,i,n)}}lw.prototype.ValueTypeName="color";class lE extends lb{constructor(e,t,i,n){super(e,t,i,n)}}lE.prototype.ValueTypeName="number";class lA extends lx{interpolate_(e,t,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(i-t)/(n-t),l=e*a;for(let e=l+a;l!==e;l+=4)iH.slerpFlat(r,0,s,l-a,s,l,o);return r}constructor(e,t,i,n){super(e,t,i,n)}}class lR extends lb{InterpolantFactoryMethodLinear(e){return new lA(this.times,this.values,this.getValueSize(),e)}constructor(e,t,i,n){super(e,t,i,n)}}lR.prototype.ValueTypeName="quaternion",lR.prototype.InterpolantFactoryMethodSmooth=void 0;class lC extends lb{constructor(e,t,i){super(e,t,i)}}lC.prototype.ValueTypeName="string",lC.prototype.ValueBufferType=Array,lC.prototype.DefaultInterpolation=tC,lC.prototype.InterpolantFactoryMethodLinear=void 0,lC.prototype.InterpolantFactoryMethodSmooth=void 0;class lI extends lb{constructor(e,t,i,n){super(e,t,i,n)}}lI.prototype.ValueTypeName="vector";class lP{static parse(e){let t=[],i=e.tracks,n=1/(e.fps||1);for(let e=0,r=i.length;e!==r;++e)t.push((function(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return lE;
1case"vector":case"vector2":case"vector3":case"vector4":return lI;case"color":return lw;case"quaternion":return lR;case"bool":case"boolean":return lT;case"string":return lC}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){let t=[],i=[];lv(e.keys,t,i,"value"),e.times=t,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)})(i[e]).scale(n));let r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r.userData=JSON.parse(e.userData||"{}"),r}static toJSON(e){let t=[],i=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,n=i.length;e!==n;++e)t.push(lb.toJSON(i[e]));return n}static CreateFromMorphTargetSequence(e,t,i,n){let r=t.length,s=[];for(let e=0;e<r;e++){let a=[],o=[];a.push((e+r-1)%r,e,(e+1)%r),o.push(0,1,0);let l=lm(a);a=lg(a,1,l),o=lg(o,1,l),n||0!==a[0]||(a.push(r),o.push(o[0])),s.push(new lE(".morphTargetInfluences["+t[e].name+"]",a,o).scale(1/i))}return new this(e,-1,s)}static findByName(e,t){let i=e;Array.isArray(e)||(i=e.geometry&&e.geometry.animations||e.animations);for(let e=0;e<i.length;e++)if(i[e].name===t)return i[e];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let n={},r=/^([\w-]*?)([\d]+)$/;for(let t=0,i=e.length;t<i;t++){let i=e[t],s=i.name.match(r);if(s&&s.length>1){let e=s[1],t=n[e];t||(n[e]=t=[]),t.push(i)}}let s=[];for(let e in n)s.push(this.CreateFromMorphTargetSequence(e,n[e],t,i));return s}static parseAnimation(e,t){if(!e)return null;let i=function(e,t,i,n,r){if(0!==i.length){let s=[],a=[];lv(i,s,a,n),0!==s.length&&r.push(new e(t,s,a))}},n=[],r=e.name||"default",s=e.fps||30,a=e.blendMode,o=e.length||-1,l=e.hierarchy||[];for(let e=0;e<l.length;e++){let r=l[e].keys;if(r&&0!==r.length)if(r[0].morphTargets){let e,t={};for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(let i in t){let t=[],s=[];for(let n=0;n!==r[e].morphTargets.length;++n){let n=r[e];t.push(n.time),s.push(+(n.morphTarget===i))}n.push(new lE(".morphTargetInfluence["+i+"]",t,s))}o=t.length*s}else{let s=".bones["+t[e].name+"]";i(lI,s+".position",r,"pos",n),i(lR,s+".quaternion",r,"rot",n),i(lI,s+".scale",r,"scl",n)}}return 0===n.length?null:new this(r,o,n,a)}resetDuration(){let e=this.tracks,t=0;for(let i=0,n=e.length;i!==n;++i){let e=this.tracks[i];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());let t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}constructor(e="",t=-1,i=[],n=tD){this.name=e,this.tracks=i,this.duration=t,this.blendMode=n,this.uuid=iN(),this.userData={},this.duration<0&&this.resetDuration()}}let lL={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class lU{constructor(e,t,i){let n,r=this,s=!1,a=0,o=0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.abortController=new AbortController,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return n?n(e):e},this.setURLModifier=function(e){return n=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){let t=l.indexOf(e);return -1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){let i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}let lN=new lU;class lD{load(){}loadAsync(e,t){let i=this;return new Promise(function(n,r){i.load(e,n,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}constructor(e){this.manager=void 0!==e?e:lN,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}}lD.DEFAULT_MATERIAL_NAME="__DEFAULT";let lO={};
1class lF extends Error{constructor(e,t){super(e),this.response=t}}class lB extends lD{load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=lL.get("file:".concat(e));if(void 0!==r)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(void 0!==lO[e])return void lO[e].push({onLoad:t,onProgress:i,onError:n});lO[e]=[],lO[e].push({onLoad:t,onProgress:i,onError:n});let s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),a=this.mimeType,o=this.responseType;fetch(s).then(t=>{if(200===t.status||0===t.status){if(t.status,"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;let i=lO[e],n=t.body.getReader(),r=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),s=r?parseInt(r):0,a=0!==s,o=0;return new Response(new ReadableStream({start(e){!function t(){n.read().then(n=>{let{done:r,value:l}=n;if(r)e.close();else{let n=new ProgressEvent("progress",{lengthComputable:a,loaded:o+=l.byteLength,total:s});for(let e=0,t=i.length;e<t;e++){let t=i[e];t.onProgress&&t.onProgress(n)}e.enqueue(l),t()}},t=>{e.error(t)})}()}}))}throw new lF('fetch for "'.concat(t.url,'" responded with ').concat(t.status,": ").concat(t.statusText),t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>new DOMParser().parseFromString(e,a));case"json":return e.json();default:if(""===a)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(a),i=new TextDecoder(t&&t[1]?t[1].toLowerCase():void 0);return e.arrayBuffer().then(e=>i.decode(e))}}}).then(t=>{lL.add("file:".concat(e),t);let i=lO[e];delete lO[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onLoad&&n.onLoad(t)}}).catch(t=>{let i=lO[e];if(void 0===i)throw this.manager.itemError(e),t;delete lO[e];for(let e=0,n=i.length;e<n;e++){let n=i[e];n.onError&&n.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}}class lz extends lD{load(e,t,i,n){let r=this,s=new lB(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n&&n(t),r.manager.itemError(e)}},i,n)}parse(e){let t=[];for(let i=0;i<e.length;i++){let n=lP.parse(e[i]);t.push(n)}return t}constructor(e){super(e)}}class lk extends lD{load(e,t,i,n){let r=this,s=[],a=new a$,o=new lB(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(r.withCredentials);let l=0;if(Array.isArray(e))for(let h=0,c=e.length;h<c;++h)!function(h){o.load(e[h],function(e){let i=r.parse(e,!0);s[h]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(l+=1)&&(1===i.mipmapCount&&(a.minFilter=eC),a.image=s,a.format=i.format,a.needsUpdate=!0,t&&t(a))},i,n)}(h);else o.load(e,function(e){let i=r.parse(e,!0);if(i.isCubemap){let e=i.mipmaps.length/i.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<i.mipmapCount;e++)s[t].mipmaps.push(i.mipmaps[t*i.mipmapCount+e]),s[t].format=i.format,s[t].width=i.width,s[t].height=i.height}a.image=s}else a.image.width=i.width,a.image.height=i.height,a.mipmaps=i.mipmaps;1===i.mipmapCount&&(a.minFilter=eC),a.format=i.format,a.needsUpdate=!0,t&&t(a)},i,n);return a}constructor(e){super(e)}}let lV=new WeakMap;class lH extends lD{load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,s=lL.get("image:".concat(e));if(void 0!==s){if(!0===s.complete)r.manager.itemStart(e),setTimeout(function(){t&&t(s),r.manager.itemEnd(e)},0);else{let e=lV.get(s);void 0===e&&(e=[],lV.set(s,e)),e.push({onLoad:t,onError:n})}return s}let a=iJ("img");function o(){h(),t&&t(this);let i=lV.get(this)||[];for(let e=0;e<i.length;e++){let t=i[e];t.onLoad&&t.onLoad(this)}lV.delete(this),r.manager.itemEnd(e)}function l(t){h(),n&&n(t),lL.remove("image:".concat(e));let i=lV.get(this)||[];for(let e=0;e<i.length;e++){let n=i[e];n.onError&&n.onError(t)}lV.delete(this),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),lL.add("image:".concat(e),a),r.manager.itemStart(e),a.src=e,a}constructor(e){super(e)}}class lG extends lD{load(e,t,i,n){let r=new su;
1r.colorSpace=tq;let s=new lH(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let a=0;for(let i=0;i<e.length;++i)!function(i){s.load(e[i],function(e){r.images[i]=e,6==++a&&(r.needsUpdate=!0,t&&t(r))},void 0,n)}(i);return r}constructor(e){super(e)}}class lW extends lD{load(e,t,i,n){let r=this,s=new sJ,a=new lB(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(r.withCredentials),a.load(e,function(e){let i;try{i=r.parse(e)}catch(e){if(void 0===n)return;n(e)}void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:eS,s.wrapT=void 0!==i.wrapT?i.wrapT:eS,s.magFilter=void 0!==i.magFilter?i.magFilter:eC,s.minFilter=void 0!==i.minFilter?i.minFilter:eC,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.colorSpace&&(s.colorSpace=i.colorSpace),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=eL),1===i.mipmapCount&&(s.minFilter=eC),void 0!==i.generateMipmaps&&(s.generateMipmaps=i.generateMipmaps),s.needsUpdate=!0,t&&t(s,i)},i,n),s}constructor(e){super(e)}}class lj extends lD{load(e,t,i,n){let r=new nn,s=new lH(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)},i,n),r}constructor(e){super(e)}}class lX extends rt{dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(t.object.target=this.target.uuid),t}constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new ry(e),this.intensity=t}}class lq extends lX{copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}constructor(e,t,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(rt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ry(t)}}let lY=new nB,lZ=new iG,lK=new iG;class lJ{getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;lZ.setFromMatrixPosition(e.matrixWorld),t.position.copy(lZ),lK.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(lK),t.updateMatrixWorld(),lY.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(lY,t.coordinateSystem,t.reversedDepth),t.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(lY)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),(512!==this.mapSize.x||512!==this.mapSize.y)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new iV(512,512),this.mapType=eN,this.map=null,this.mapPass=null,this.matrix=new nB,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ao,this._frameExtents=new iV(1,1),this._viewportCount=1,this._viewports=[new nr(0,0,1,1)]}}class lQ extends lJ{updateMatrices(e){let t=this.camera,i=2*iU*e.angle*this.focus,n=this.mapSize.width/this.mapSize.height*this.aspect,r=e.distance||t.far;(i!==t.fov||n!==t.aspect||r!==t.far)&&(t.fov=i,t.aspect=n,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}constructor(){super(new sh(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}}class l$ extends lX{get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}constructor(e,t,i=0,n=Math.PI/3,r=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(rt.DEFAULT_UP),this.updateMatrix(),this.target=new rt,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.map=null,this.shadow=new lQ}}let l0=new nB,l1=new iG,l2=new iG;class l3 extends lJ{updateMatrices(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.camera,n=this.matrix,r=e.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),l1.setFromMatrixPosition(e.matrixWorld),i.position.copy(l1),l2.copy(i.position),l2.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(l2),i.updateMatrixWorld(),n.makeTranslation(-l1.x,-l1.y,-l1.z),l0.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(l0,i.coordinateSystem,i.reversedDepth)}constructor(){super(new sh(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new iV(4,2),this._viewportCount=6,this._viewports=[new nr(2,1,1,1),new nr(0,1,1,1),new nr(3,1,1,1),new nr(1,1,1,1),new nr(3,0,1,1),new nr(1,0,1,1)],this._cubeDirections=[new iG(1,0,0),new iG(-1,0,0),new iG(0,0,1),new iG(0,0,-1),new iG(0,1,0),new iG(0,-1,0)],this._cubeUps=[new iG(0,1,0),new iG(0,1,0),new iG(0,1,0),new iG(0,1,0),new iG(0,0,1),new iG(0,0,-1)]}}class l4 extends lX{get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}constructor(e,t,i=0,n=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new l3}}class l5 extends ss{copy(e,t){return super.copy(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(e,t,i,n,r,s){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=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,r=i-e,s=i+e,a=n+t,o=n-t;if(null!==this.view&&this.view.enabled){let e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=e*this.view.offsetX,s=r+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}
1this.projectionMatrix.makeOrthographic(r,s,a,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(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}constructor(e=-1,t=1,i=1,n=-1,r=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}}class l6 extends lJ{constructor(){super(new l5(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class l8 extends lX{dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(rt.DEFAULT_UP),this.updateMatrix(),this.target=new rt,this.shadow=new l6}}class l9 extends lX{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class l7 extends lX{get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){let t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}constructor(e,t,i=10,n=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=n}}class he{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){let i=e.x,n=e.y,r=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*n),t.addScaledVector(s[2],.488603*r),t.addScaledVector(s[3],.488603*i),t.addScaledVector(s[4],i*n*1.092548),t.addScaledVector(s[5],n*r*1.092548),t.addScaledVector(s[6],.315392*(3*r*r-1)),t.addScaledVector(s[7],i*r*1.092548),t.addScaledVector(s[8],.546274*(i*i-n*n)),t}getIrradianceAt(e,t){let i=e.x,n=e.y,r=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*n),t.addScaledVector(s[2],1.023328*r),t.addScaledVector(s[3],1.023328*i),t.addScaledVector(s[4],.858086*i*n),t.addScaledVector(s[5],.858086*n*r),t.addScaledVector(s[6],.743125*r*r-.247708),t.addScaledVector(s[7],.858086*i*r),t.addScaledVector(s[8],.429043*(i*i-n*n)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],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,i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(e,t+3*n);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,i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(e,t+3*n);return e}static getBasisAt(e,t){let i=e.x,n=e.y,r=e.z;t[0]=.282095,t[1]=.488603*n,t[2]=.488603*r,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*i*r,t[8]=.546274*(i*i-n*n)}constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new iG)}}class ht extends lX{copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){let t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}constructor(e=new he,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}}class hi extends lD{load(e,t,i,n){let r=this,s=new lB(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n&&n(t),r.manager.itemError(e)}},i,n)}parse(e){let t=this.textures;function i(e){return t[e],t[e]}let n=this.createMaterialFromType(e.type);if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&void 0!==n.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.sheen&&(n.sheen=e.sheen),void 0!==e.sheenColor&&(n.sheenColor=new ry().setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(n.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==n.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==n.specular&&n.specular.setHex(e.specular),void 0!==e.specularIntensity&&(n.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearcoat&&(n.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(n.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(n.dispersion=e.dispersion),void 0!==e.iridescence&&(n.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(n.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(n.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(n.transmission=e.transmission),void 0!==e.thickness&&(n.thickness=e.thickness),void 0!==e.attenuationDistance&&(n.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(n.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(n.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.flatShading&&(n.flatShading=e.flatShading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.combine&&(n.combine=e.combine),void 0!==e.side&&(n.side=e.side),void 0!==e.shadowSide&&(n.shadowSide=e.shadowSide),void 0!==e.opacity&&(n.op
1acity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(n.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(n.depthFunc=e.depthFunc),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(n.blendSrc=e.blendSrc),void 0!==e.blendDst&&(n.blendDst=e.blendDst),void 0!==e.blendEquation&&(n.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(n.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(n.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(n.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==n.blendColor&&n.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(n.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(n.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(n.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(n.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(n.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(n.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(n.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(n.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(n.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(n.rotation=e.rotation),void 0!==e.linewidth&&(n.linewidth=e.linewidth),void 0!==e.dashSize&&(n.dashSize=e.dashSize),void 0!==e.gapSize&&(n.gapSize=e.gapSize),void 0!==e.scale&&(n.scale=e.scale),void 0!==e.polygonOffset&&(n.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(n.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(n.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(n.dithering=e.dithering),void 0!==e.alphaToCoverage&&(n.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(n.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(n.forceSinglePass=e.forceSinglePass),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.toneMapped&&(n.toneMapped=e.toneMapped),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?n.vertexColors=e.vertexColors>0:n.vertexColors=e.vertexColors),void 0!==e.uniforms)for(let t in e.uniforms){let r=e.uniforms[t];switch(n.uniforms[t]={},r.type){case"t":n.uniforms[t].value=i(r.value);break;case"c":n.uniforms[t].value=new ry().setHex(r.value);break;case"v2":n.uniforms[t].value=new iV().fromArray(r.value);break;case"v3":n.uniforms[t].value=new iG().fromArray(r.value);break;case"v4":n.uniforms[t].value=new nr().fromArray(r.value);break;case"m3":n.uniforms[t].value=new iX().fromArray(r.value);break;
1case"m4":n.uniforms[t].value=new nB().fromArray(r.value);break;default:n.uniforms[t].value=r.value}}if(void 0!==e.defines&&(n.defines=e.defines),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(n.glslVersion=e.glslVersion),void 0!==e.extensions)for(let t in e.extensions)n.extensions[t]=e.extensions[t];if(void 0!==e.lights&&(n.lights=e.lights),void 0!==e.clipping&&(n.clipping=e.clipping),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=i(e.map)),void 0!==e.matcap&&(n.matcap=i(e.matcap)),void 0!==e.alphaMap&&(n.alphaMap=i(e.alphaMap)),void 0!==e.bumpMap&&(n.bumpMap=i(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=i(e.normalMap)),void 0!==e.normalMapType&&(n.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),n.normalScale=new iV().fromArray(t)}return void 0!==e.displacementMap&&(n.displacementMap=i(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=i(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=i(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=i(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=i(e.specularMap)),void 0!==e.specularIntensityMap&&(n.specularIntensityMap=i(e.specularIntensityMap)),void 0!==e.specularColorMap&&(n.specularColorMap=i(e.specularColorMap)),void 0!==e.envMap&&(n.envMap=i(e.envMap)),void 0!==e.envMapRotation&&n.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(n.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(n.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(n.lightMap=i(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=i(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=i(e.gradientMap)),void 0!==e.clearcoatMap&&(n.clearcoatMap=i(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(n.clearcoatNormalMap=i(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(n.clearcoatNormalScale=new iV().fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(n.iridescenceMap=i(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(n.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(n.transmissionMap=i(e.transmissionMap)),void 0!==e.thicknessMap&&(n.thicknessMap=i(e.thicknessMap)),void 0!==e.anisotropyMap&&(n.anisotropyMap=i(e.anisotropyMap)),void 0!==e.sheenColorMap&&(n.sheenColorMap=i(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(n.sheenRoughnessMap=i(e.sheenRoughnessMap)),n}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return hi.createMaterialFromType(e)}static createMaterialFromType(e){return new({ShadowMaterial:lt,SpriteMaterial:sS,RawShaderMaterial:li,ShaderMaterial:sr,PointsMaterial:aG,MeshPhysicalMaterial:lr,MeshStandardMaterial:ln,MeshPhongMaterial:ls,MeshToonMaterial:la,MeshNormalMaterial:lo,MeshLambertMaterial:ll,MeshDepthMaterial:lh,MeshDistanceMaterial:lc,MeshBasicMaterial:rT,MeshMatcapMaterial:lu,LineDashedMaterial:ld,LineBasicMaterial:aC,Material:rb})[e]}constructor(e){super(e),this.textures={}}}class hn{static extractUrlBase(e){let t=e.lastIndexOf("/");return -1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e))?e:t+e}}class hr extends rZ{copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){let e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}}class hs extends lD{load(e,t,i,n){let r=this,s=new lB(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(e,function(i){try{t(r.parse(JSON.parse(i)))}catch(t){n&&n(t),r.manager.itemError(e)}},i,n)}parse(e){let t={},i={};function n(e,n){if(void 0!==t[n])return t[n];let r=e.interleavedBuffers[n],s=function(e,t){if(void 0!==i[t])return i[t];let n=new Uint32Array(e.arrayBuffers[t]).buffer;return i[t]=n,n}(e,r.buffer),a=new sx(iK(r.type,s),r.stride);return a.uuid=r.uuid,t[n]=a,a}let r=e.isInstancedBufferGeometry?new hr:new rZ,s=e.data.index;if(void 0!==s){let e=iK(s.type,s.array);r.setIndex(new rL(e,1))}let a=e.data.attributes;for(let t in a){let i,s=a[t];if(s.isInterleavedBufferAttribute)i=new sM(n(e.data,s.data),s.itemSize,s.offset,s.normalized);else{let e=iK(s.type,s.array);i=new(s.isInstancedBufferAttribute?s1:rL)(e,s.itemSize,s.normalized)}void 0!==s.name&&(i.name=s.name),void 0!==s.usage&&i.setUsage(s.usage),r.setAttribute(t,i)}let o=e.data.morphAttributes;if(o)for(let t in o){let i=o[t],s=[];for(let t=0,r=i.length;t<r;t++){let r,a=i[t];r=a.isInterleavedBufferAttribute?new sM(n(e.data,a.data),a.itemSize,a.offset,a.normalized):new rL(iK(a.type,a.array),a.itemSize,a.normalized),void 0!==a.name&&(r.name=a.name),s.push(r)}r.morphAttributes[t]=s}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);let l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){let t=l[e];r.addGroup(t.start,t.count,t.materialIndex)}let h=e.data.boundingSphere;return void 0!==h&&(r.boundingSphere=new nC().fromJSON(h)),e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}constructor(e){super(e)}}class ha extends lD{load(e,t,i,n){let r=this,s=""===this.path?hn.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;let a=new lB(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){let s=null;try{s=JSON.parse(i)}catch(e){void 0!==n&&n(e);return}let a=s.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase()){void 0!==n&&n(Error("THREE.ObjectLoader: Can't load "+e));return}r.parse(s,t)},i,n)}async loadAsync(e,t){let i=""===this.path?hn.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||i;let n=new lB(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);let r=JSON.parse(await n.loadAsync(e,t)),s=r.metadata;if(void 0===s||void 0===s.type||"geometry"===s.type.toLowerCase())throw Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(r)}parse(e,t){let i=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=this.parseImages(e.images,function(){void 0!==t&&t(l)}),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,r,o,a,i),h=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,h),this.bindLightTargets(l),void 0!==t){let e=!1;for(let t in s)if(s[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){let t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),n=this.parseGeometries(e.geometries,i),r=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,r),a=this.parseMaterials(e.materials,s),o=this.parseObject(e.object,n,a,s,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),this.bindLightTargets(o),o}parseShapes(e){let t={};if(void 0!==e)for(let i=0,n=e.length;i<n;i++){let n=new oR().fromJSON(e[i]);t[n.uuid]=n}return t}parseSkeletons(e,t){let i={},n={};if(t.traverse(function(e){e.isBone&&(n[e.uuid]=e)}),void 0!==e)for(let t=0,r=e.length;t<r;t++){let r=new s0().fromJSON(e[t],n);i[r.uuid]=r}return i}parseGeometries(e,t){let i={};if(void 0!==e){let n=new hs;for(let r=0,s=e.length;r<s;r++){let s,a=e[r];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":s=n.parse(a);break;default:a.type in le&&(s=le[a.type].fromJSON(a,t))}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.userData&&(s.userData=a.userData),i[a.uuid]=s}}return i}parseMaterials(e,t){let i={},n={};if(void 0!==e){let r=new hi;r.setTextures(t);for(let t=0,s=e.length;t<s;t++){let s=e[t];void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n}parseAnimations(e){let t={};if(void 0!==e)for(let i=0;i<e.length;i++){let n=e[i],r=lP.parse(n);t[r.uuid]=r}return t}parseImages(e,t){let i,n=this,r={};function s(e){if("string"==typeof e){var t;return t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:n.resourcePath+e,n.manager.itemStart(t),i.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}return e.data?{data:iK(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){(i=new lH(new lU(t))).setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],n=i.url;if(Array.isArray(n)){let e=[];for(let t=0,i=n.length;t<i;t++){let i=s(n[t]);null!==i&&(i instanceof HTMLImageElement?e.push(i):e.push(new sJ(i.data,i.width,i.height)))}r[i.uuid]=new i7(e)}else{let e=s(i.url);r[i.uuid]=new i7(e)}}}return r}async parseImagesAsync(e){let t,i=this,n={};async function r(e){if("string"==typeof e){let n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e;return await t.loadAsync(n)}return e.data?{data:iK(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){(t=new lH(this.manager)).setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){let i=e[t],s=i.url;if(Array.isArray(s)){let e=[];for(let t=0,i=s.length;t<i;t++){let i=s[t],n=await r(i);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new sJ(n.data,n.width,n.height)))}n[i.uuid]=new i7(e)}else{let e=await r(i.url);n[i.uuid]=new i7(e)}}}return n}parseTextures(e,t){function i(e,t){return"number"==typeof e?e:t[e]}let n={};if(void 0!==e)for(let r=0,s=e.length;r<s;r++){let s,a=e[r];a.image,t[a.image];let o=t[a.image],l=o.data;Array.isArray(l)?(s=new su,6===l.length&&(s.needsUpdate=!0)):(s=l&&l.data?new sJ:new nn,l&&(s.needsUpdate=!0)),s.source=o,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=i(a.mapping,ho)),void 0!==a.channel&&(s.channel=a.channel),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.center&&s.center.fromArray(a.center),void 0!==a.rotation&&(s.rotation=a.rotation),void 0!==a.wrap&&(s.wrapS=i(a.wrap[0],hl),s.wrapT=i(a.wrap[1],hl)),void 0!==a.format&&(s.format=a.format),void 0!==a.internalFormat&&(s.internalFormat=a.internalFormat),void 0!==a.type&&(s.type=a.type),void 0!==a.colorSpace&&(s.colorSpace
1=a.colorSpace),void 0!==a.minFilter&&(s.minFilter=i(a.minFilter,hh)),void 0!==a.magFilter&&(s.magFilter=i(a.magFilter,hh)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),void 0!==a.generateMipmaps&&(s.generateMipmaps=a.generateMipmaps),void 0!==a.premultiplyAlpha&&(s.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(s.unpackAlignment=a.unpackAlignment),void 0!==a.compareFunction&&(s.compareFunction=a.compareFunction),void 0!==a.userData&&(s.userData=a.userData),n[a.uuid]=s}return n}parseObject(e,t,i,n,r){let s,a,o;function l(e){return t[e],t[e]}function h(e){if(void 0!==e){if(Array.isArray(e)){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];i[r],t.push(i[r])}return t}return i[e],i[e]}}function c(e){return n[e],n[e]}switch(e.type){case"Scene":s=new s_,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new ry(e.background):s.background=c(e.background)),void 0!==e.environment&&(s.environment=c(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new sv(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new sg(e.fog.color,e.fog.density)),""!==e.fog.name&&(s.fog.name=e.fog.name)),void 0!==e.backgroundBlurriness&&(s.backgroundBlurriness=e.backgroundBlurriness),void 0!==e.backgroundIntensity&&(s.backgroundIntensity=e.backgroundIntensity),void 0!==e.backgroundRotation&&s.backgroundRotation.fromArray(e.backgroundRotation),void 0!==e.environmentIntensity&&(s.environmentIntensity=e.environmentIntensity),void 0!==e.environmentRotation&&s.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":s=new sh(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new l5(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new l9(e.color,e.intensity);break;case"DirectionalLight":(s=new l8(e.color,e.intensity)).target=e.target||"";break;case"PointLight":s=new l4(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new l7(e.color,e.intensity,e.width,e.height);break;case"SpotLight":(s=new l$(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay)).target=e.target||"";break;case"HemisphereLight":s=new lq(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=new ht().fromJSON(e);break;case"SkinnedMesh":s=new sZ(a=l(e.geometry),o=h(e.material)),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":s=new r8(a=l(e.geometry),o=h(e.material));break;case"InstancedMesh":a=l(e.geometry),o=h(e.material);let u=e.count,d=e.instanceMatrix,p=e.instanceColor;(s=new s7(a,o,u)).instanceMatrix=new s1(new Float32Array(d.array),16),void 0!==p&&(s.instanceColor=new s1(new Float32Array(p.array),p.itemSize));break;case"BatchedMesh":a=l(e.geometry),o=h(e.material),(s=new aR(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,o)).geometry=a,s.perObjectFrustumCulled=e.perObjectFrustumCulled,s.sortObjects=e.sortObjects,s._drawRanges=e.drawRanges,s._reservedRanges=e.reservedRanges,s._geometryInfo=e.geometryInfo.map(e=>{let t=null,i=null;return void 0!==e.boundingBox&&(t=new nu().fromJSON(e.boundingBox)),void 0!==e.boundingSphere&&(i=new nC().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:i}}),s._instanceInfo=e.instanceInfo,s._availableInstanceIds=e._availableInstanceIds,s._availableGeometryIds=e._availableGeometryIds,s._nextIndexStart=e.nextIndexStart,s._nextVertexStart=e.nextVertexStart,s._geometryCount=e.geometryCount,s._maxInstanceCount=e.maxInstanceCount,s._maxVertexCount=e.maxVertexCount,s._maxIndexCount=e.maxIndexCount,s._geometryInitialized=e.geometryInitialized,s._matricesTexture=c(e.matricesTexture.uuid),s._indirectTexture=c(e.indirectTexture.uuid),void 0!==e.colorsTexture&&(s._c
1olorsTexture=c(e.colorsTexture.uuid)),void 0!==e.boundingSphere&&(s.boundingSphere=new nC().fromJSON(e.boundingSphere)),void 0!==e.boundingBox&&(s.boundingBox=new nu().fromJSON(e.boundingBox));break;case"LOD":s=new sz;break;case"Line":s=new aF(l(e.geometry),h(e.material));break;case"LineLoop":s=new aH(l(e.geometry),h(e.material));break;case"LineSegments":s=new aV(l(e.geometry),h(e.material));break;case"PointCloud":case"Points":s=new aY(l(e.geometry),h(e.material));break;case"Sprite":s=new sD(h(e.material));break;case"Group":s=new sp;break;case"Bone":s=new sK;break;default:s=new rt}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.up&&s.up.fromArray(e.up),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.intensity&&(s.shadow.intensity=e.shadow.intensity),void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){let a=e.children;for(let e=0;e<a.length;e++)s.add(this.parseObject(a[e],t,i,n,r))}if(void 0!==e.animations){let t=e.animations;for(let e=0;e<t.length;e++){let i=t[e];s.animations.push(r[i])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);let t=e.levels;for(let e=0;e<t.length;e++){let i=t[e],n=s.getObjectByProperty("uuid",i.object);void 0!==n&&s.addLevel(n,i.distance,i.hysteresis)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse(function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){let i=t[e.skeleton];void 0===i||e.bind(i,e.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){let i=t.target,n=e.getObjectByProperty("uuid",i);void 0!==n?t.target=n:t.target=new rt}})}constructor(e){super(e)}}let ho={UVMapping:em,CubeReflectionMapping:eg,CubeRefractionMapping:ev,EquirectangularReflectionMapping:e_,EquirectangularRefractionMapping:ex,CubeUVReflectionMapping:ey},hl={RepeatWrapping:eM,ClampToEdgeWrapping:eS,MirroredRepeatWrapping:eb},hh={NearestFilter:eT,NearestMipmapNearestFilter:ew,NearestMipmapLinearFilter:eA,LinearFilter:eC,LinearMipmapNearestFilter:eI,LinearMipmapLinearFilter:eL},hc=new WeakMap;class hu extends lD{setOptions(e){return this.options=e,this}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,s=lL.get("image-bitmap:".concat(e));if(void 0!==s)return(r.manager.itemStart(e),s.then)?void s.then(i=>{if(!0!==hc.has(s))return t&&t(i),r.manager.itemEnd(e),i;n&&n(hc.get(s)),r.manager.itemError(e),r.manager.itemEnd(e)}):(setTimeout(function(){t&&t(s),r.manager.itemEnd(e)},0),s);let a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,a.signal="function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let o=fetch(e,a).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(r.options,{colorSpaceConversion:"none"}))}).then(function(i){return lL.add("image-bitmap:".concat(e),i),t&&t(i),r.manager.itemEnd(e),i}).catch(function(t){n&&n(t),hc.set(o,t),lL.remove("image-bitmap:".concat(e)),r.manager.itemError(e),r.manager.itemEnd(e)});lL.add("image-bitmap:".concat(e),o),r.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}constructor(e){super(e),this.isImageBitmapLoader=!0,this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}}class hd{static getContext(){return void 0===s&&(s=new(window.AudioContext||window.webkitAudioContext)),s}static setContext(e){s=e}}class hp extends lD{load(e,t,i,n){let r=this,s=new lB(this.manager);function a(t){n&&n(t),r.manager.itemError(e)}s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(e){try{let i=e.slice(0);hd.getContext().decodeAudioData(i,function(e){t(e)}).catch(a)}catch(e){a(e)}},i,n)}constructor(e){super(e)}}let hf=new nB,hm=new nB,hg=new nB;class hv{update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){let i,n;t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,hg.copy(e.projectionMatrix);let r=t.eyeSep/2,s=r*t.near/t.focus,a=t.near*Math.tan(iL*t.fov*.5)/t.zoom;hm.elements[12]=-r,hf.elements[12]=r,i=-a*t.aspect+s,n=a*t.aspect+s,hg.elements[0]=2*t.near/(n-i),hg.elements[8]=(n+i)/(n-i),this.cameraL.projectionMatrix.copy(hg),i=-a*t.aspect-s,n=a*t.aspect-s,hg.elements[0]=2*t.near/(n-i),hg.elements[8]=(n+i)/(n-i),this.cameraR.projectionMatrix.copy(hg)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(hm),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(hf)}constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new sh,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new sh,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}}class h_ extends sh{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class hx{start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}}let hy=new iG,hM=new iH,hS=new iG,hb=new iG,hT=new iG;class hw extends rt{getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);let t=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(hy,hM,hS),hb.set(0,0,-1).applyQuaternion(hM),hT.set(0,1,0).applyQuaternion(hM),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(hy.x,e),t.positionY.linearRampToValueAtTime(hy.y,e),t.positionZ.linearRampToValueAtTime(hy.z,e),t.forwardX.linearRampToValueAtTime(hb.x,e),t.forwardY.linearRampToValueAtTime(hb.y,e),t.forwardZ.linearRampToValueAtTime(hb.z,e),t.upX.linearRampToValueAtTime(hT.x,e),t.upY.linearRampToValueAtTime(hT.y,e),t.upZ.linearRampToValueAtTime(hT.z,e)}else t.setPosition(hy.x,hy.y,hy.z),t.setOrientation(hb.x,hb.y,hb.z,hT.x,hT.y,hT.z)}constructor(){super(),this.type="AudioListener",this.context=hd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new hx}}class hE extends rt{getOutput(){return this.gain}
1setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying||!1===this.hasPlaybackControl)return;this._startedAt=this.context.currentTime+e;let 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}stop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!1!==this.hasPlaybackControl)return this._progress=0,null!==this.source&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(!1!==this._connected){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,!0===this.isPlaying&&void 0!==this.source.detune&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return!1!==this.hasPlaybackControl&&this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),"buffer"!==e.sourceType||(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice()),this}clone(e){return new this.constructor(this.listener).copy(this,e)}constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl
1=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}}let hA=new iG,hR=new iH,hC=new iG,hI=new iG;class hP extends hE{connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(hA,hR,hC),hI.set(0,0,1).applyQuaternion(hR);let t=this.panner;if(t.positionX){let e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(hA.x,e),t.positionY.linearRampToValueAtTime(hA.y,e),t.positionZ.linearRampToValueAtTime(hA.z,e),t.orientationX.linearRampToValueAtTime(hI.x,e),t.orientationY.linearRampToValueAtTime(hI.y,e),t.orientationZ.linearRampToValueAtTime(hI.z,e)}else t.setPosition(hA.x,hA.y,hA.z),t.setOrientation(hI.x,hI.y,hI.z)}constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}}class hL{getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0,t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}}class hU{accumulate(e,t){let i=this.buffer,n=this.valueSize,r=e*n+n,s=this.cumulativeWeight;if(0===s){for(let e=0;e!==n;++e)i[r+e]=i[e];s=t}else{s+=t;let e=t/s;this._mixBufferRegion(i,r,0,e,n)}this.cumulativeWeight=s}accumulateAdditive(e){let t=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,n,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){let t=this.valueSize,i=this.buffer,n=e*t+t,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){let e=t*this._origIndex;this._mixBufferRegion(i,n,e,1-r,t)}s>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*t,1,t);for(let e=t,r=t+t;e!==r;++e)if(i[e]!==i[e+t]){a.setValue(i,n);break}}saveOriginalState(){let e=this.binding,t=this.buffer,i=this.valueSize,n=i*this._origIndex;e.getValue(t,n);for(let e=i;e!==n;++e)t[e]=t[n+e%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)e[t+n]=e[i+n]}_slerp(e,t,i,n){iH.slerpFlat(e,t,e,t,e,i,n)}_slerpAdditive(e,t,i,n,r){let s=this._workIndex*r;iH.multiplyQuaternionsFlat(e,s,e,t,e,i),iH.slerpFlat(e,t,e,t,e,s,n)}_lerp(e,t,i,n,r){let s=1-n;for(let a=0;a!==r;++a){let r=t+a;e[r]=e[r]*s+e[i+a]*n}}_lerpAdditive(e,t,i,n,r){for(let s=0;s!==r;++s){let r=t+s;e[r]=e[r]+e[i+s]*n}}constructor(e,t,i){let n,r,s;switch(this.binding=e,this.valueSize=i,t){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}}let hN="\\[\\]\\.:\\/",hD=RegExp("["+hN+"]","g"),hO="[^"+hN+"]",hF="[^"+hN.replace("\\.","")+"]",hB=/((?:WC+[\/:])*)/.source.replace("WC",hO),hz=/(WCOD+)?/.source.replace("WCOD",hF),hk=RegExp("^"+hB+hz+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",hO)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",hO)+"$"),hV=["material","materials","bones","map"];class hH{getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}constructor(e,t,i){let n=i||hG.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}}class hG{static create(e,t,i){return e&&e.isAnimationObjectGroup?new hG.Composite(e,t,i):new hG(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(hD,"")}static parseTrackName(e){let t=hk.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){let e=i.nodeName.substring(n+1);-1!==hV.indexOf(e)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=e)}if(null===i.propertyName||0===i.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){let i=function(e){for(let n=0;n<e.length;n++){let r=e[n];if(r.name===t||r.uuid===t)return r;let s=i(r.children);if(s)return s}return null},n=i(e.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)e[t++]=i[n]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.needsUpdate=!0}
1_setValue_array_setMatrixWorldNeedsUpdate(e,t){let i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node,t=this.parsedPath,i=t.objectName,n=t.propertyName,r=t.propertyIndex;if(e||(e=hG.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return;if(i){let n=t.objectIndex;switch(i){case"materials":if(!e.material||!e.material.materials)return;e=e.material.materials;break;case"bones":if(!e.skeleton)return;e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===n){n=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material||!e.material.map)return;e=e.material.map;break;default:if(void 0===e[i])return;e=e[i]}if(void 0!==n){if(void 0===e[n])return;e=e[n]}}let s=e[n];if(void 0===s)return void t.nodeName;let a=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?a=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!e.geometry||!e.geometry.morphAttributes)return;void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(o=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}constructor(e,t,i){this.path=t,this.parsedPath=i||hG.parseTrackName(t),this.node=hG.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}hG.Composite=hH,hG.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},hG.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},hG.prototype.GetterByBindingType=[hG.prototype._getValue_direct,hG.prototype._getValue_array,hG.prototype._getValue_arrayElement,hG.prototype._getValue_toArray],hG.prototype.SetterByBindingTypeAndVersioning=[[hG.prototype._setValue_direct,hG.prototype._setValue_direct_setNeedsUpdate,hG.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[hG.prototype._setValue_array,hG.prototype._setValue_array_setNeedsUpdate,hG.prototype._setValue_array_setMatrixWorldNeedsUpdate],[hG.prototype._setValue_arrayElement,hG.prototype._setValue_arrayElement_setNeedsUpdate,hG.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[hG.prototype._setValue_fromArray,hG.prototype._setValue_fromArray_setNeedsUpdate,hG.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class hW{add(){let e=this._objects,t=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,s=r.length,a=e.length,o=this.nCachedObjects_;for(let l=0,h=arguments.length;l!==h;++l){let h=arguments[l],c=h.uuid,u=t[c];if(void 0===u){u=a++,t[c]=u,e.push(h);for(let e=0;e!==s;++e)r[e].push(new hG(h,i[e],n[e]))}else if(u<o){e[u];let a=--o,l=e[a];t[l.uuid]=u,e[u]=l,t[c]=a,e[a]=h;for(let e=0;e!==s;++e){let t=r[e],s=t[a],o=t[u];t[u]=s,void 0===o&&(o=new hG(h,i[e],n[e])),t[a]=o}}else e[u]}this.nCachedObjects_=o}remove(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_;for(let s=0,a=arguments.length;s!==a;++s){let a=arguments[s],o=a.uuid,l=t[o];if(void 0!==l&&l>=r){let s=r++,h=e[s];t[h.uuid]=l,e[l]=h,t[o]=s,e[s]=a;for(let e=0;e!==n;++e){let t=i[e],n=t[s],r=t[l];t[l]=n,t[s]=r}}}this.nCachedObjects_=r}uncache(){let e=this._objects,t=this._indicesByUUID,i=this._bindings,n=i.length,r=this.nCachedObjects_,s=e.length;for(let a=0,o=arguments.length;a!==o;++a){let o=arguments[a],l=o.uuid,h=t[l];if(void 0!==h)if(delete t[l],h<r){let a=--r,o=e[a],l=--s,c=e[l];t[o.uuid]=h,e[h]=o,t[c.uuid]=a,e[a]=c,e.pop();for(let e=0;e!==n;++e){let t=i[e],n=t[a],r=t[l];t[h]=n,t[a]=r,t.pop()}}else{let r=--s,a=e[r];r>0&&(t[a.uuid]=h),e[h]=a,e.pop();for(let e=0;e!==n;++e){let t=i[e];t[h]=t[r],t.pop()}}}this.nCachedObjects_=r}subscribe_(e,t){let i=this._bindingsIndicesByPath,n=i[e],r=this._bindings;if(void 0!==n)return r[n];let s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,h=this.nCachedObjects_,c=Array(l);n=r.length,i[e]=n,s.push(e),a.push(t),r.push(c);for(let i=h,n=o.length;i!==n;++i){let n=o[i];c[i]=new hG(n,e,t)}return c}unsubscribe_(e){let t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){let n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];t[e[a]]=i,s[i]=o,s.pop(),r[i]=r[a],r.pop(),n[i]=n[a],n.pop()}}constructor(){this.isAnimationObjectGroup=!0,this.uuid=iN(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;let e={};this._indicesByUUID=e;for(let t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};let t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}}class hj{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}
vendor: 19,479 bytes, line 1
1fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e.fadeOut(t),this.fadeIn(t),!0===i){let i=this._clip.duration,n=e._clip.duration;e.warp(1,n/i,t),this.warp(i/n,1,t)}return this}crossFadeTo(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.crossFadeFrom(this,t,i)}stopFading(){let 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,i){let n=this._mixer,r=n.time,s=this.timeScale,a=this._timeScaleInterpolant;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);let o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+i,l[0]=e/s,l[1]=t/s,this}stopWarping(){let 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,i,n){if(!this.enabled)return void this._updateWeight(e);let r=this._startTime;if(null!==r){let n=(e-r)*i;n<0||0===i?t=0:(this._startTime=null,t=i*n)}t*=this._updateTimeScale(e);let s=this._updateTime(t),a=this._updateWeight(e);if(a>0){let e=this._interpolants,t=this._propertyBindings;if(this.blendMode===tO)for(let i=0,n=e.length;i!==n;++i)e[i].evaluate(s),t[i].accumulateAdditive(a);else for(let i=0,r=e.length;i!==r;++i)e[i].evaluate(s),t[i].accumulate(n,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let i=this._weightInterpolant;if(null!==i){let n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let i=this._timeScaleInterpolant;null!==i&&(t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,i=this.loop,n=this.time+e,r=this._loopCount,s=i===tR;if(0===e)return -1===r?n:s&&(1&r)==1?t-n:n;if(i===tE){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));r:{if(n>=t)n=t;else if(n<0)n=0;else{this.time=n;break r}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=t||n<0){let i=Math.floor(n/t);n-=t*i,r+=Math.abs(i);let a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=e>0?t:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){let t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&(1&r)==1)return t-n}return n}_setEndings(e,t,i){let n=this._interpolantSettings;i?(n.endingStart=tU,n.endingEnd=tU):(e?n.endingStart=this.zeroSlopeAtStart?tU:tL:n.endingStart=tN,t?n.endingEnd=this.zeroSlopeAtEnd?tU:tL:n.endingEnd=tN)}_scheduleFading(e,t,i){let n=this._mixer,r=n.time,s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);let a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=t,a[1]=r+e,o[1]=i,this}constructor(e,t,i=null,n=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=n;let r=t.tracks,s=r.length,a=Array(s),o={endingStart:tL,endingEnd:tL};for(let e=0;e!==s;++e){let t=r[e].createInterpolant(null);a[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=tA,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}}let hX=new Float32Array(1);class hq extends iC{_bindAction(e,t){let i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,s=e._propertyBindings,a=e._interpolants,o=i.uuid,l=this._bindingsByRootAndName,h=l[o];void 0===h&&(h={},l[o]=h);for(let e=0;e!==r;++e){let r=n[e],l=r.name,c=h[l];if(void 0!==c)++c.referenceCount,s[e]=c;else{if(void 0!==(c=s[e])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}let n=t&&t._propertyBindings[e].binding.parsedPath;c=new hU(hG.create(i,l,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),s[e]=c}a[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){let t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let 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(e){let t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,i){let n=this._actions,r=this._actionsByClip,s=r[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=s;else{let t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=n.length,n.push(e),s.actionByRoot[i]=e}_removeInactiveAction(e){let t=this._actions,i=t[t.length-1],n=e._cacheIndex;i._cacheIndex=n,t[n]=i,t.pop(),e._cacheIndex=null;let r=e._clip.uuid,s=this._actionsByClip,a=s[r],o=a.knownActions,l=o[o.length-1],h=e._byClipCacheIndex;l._byClipCacheIndex=h,o[h]=l,o.pop(),e._byClipCacheIndex=null;let c=a.actionByRoot,u=(e._localRoot||this._root).uuid;delete c[u],0===o.length&&delete s[r],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){let t=e._propertyBindings;for(let e=0,i=t.length;e!==i;++e){let i=t[e];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(e){let t=this._actions,i=e._cacheIndex,n=this._nActiveActions++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackAction(e){let t=this._actions,i=e._cacheIndex,n=--this._nActiveActions,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_addInactiveBinding(e,t,i){let n=this._bindingsByRootAndName,r=this._bindings,s=n[t];void 0===s&&(s={},n[t]=s),s[i]=e,e._cacheIndex=r.length,r.push(e)}_removeInactiveBinding(e){let t=this._bindings,i=e.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,a=s[n],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete a[r],0===Object.keys(a).length&&delete s[n]}_lendBinding(e){let t=this._bindings,i=e._cacheIndex,n=this._nActiveBindings++,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_takeBackBinding(e){let t=this._bindings,i=e._cacheIndex,n=--this._nActiveBindings,r=t[n];e._cacheIndex=n,t[n]=e,r._cacheIndex=i,t[i]=r}_lendControlInterpolant(){let e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&((i=new lM(new Float32Array(2),new Float32Array(2),1,hX)).__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){let t=this._controlInterpolants,i=e.__cacheIndex,n=--this._nActiveControlInterpolants,r=t[n];e.__cacheIndex=n,t[n]=e,r.__cacheIndex=i,t[i]=r}clipAction(e,t,i){let n=t||this._root,r=n.uuid,s="string"==typeof e?lP.findByName(n,e):e,a=null!==s?s.uuid:e,o=this._actionsByClip[a],l=null;if(void 0===i&&(i=null!==s?s.blendMode:tD),void 0!==o){let e=o.actionByRoot[r];if(void 0!==e&&e.blendMode===i)return e;l=o.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;let h=new hj(this,s,t,i);return this._bindAction(h,l),this._addInactiveAction(h,a,r),h}existingAction(e,t){let i=t||this._root,n=i.uuid,r="string"==typeof e?lP.findByName(i,e):e,s=r?r.uuid:e,a=this._actionsByClip[s];return void 0!==a&&a.actionByRoot[n]||null}stopAllAction(){let e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;let t=this._actions,i=this._nActiveActions,n=this.time+=e,r=Math.sign(e),s=this._accuIndex^=1;for(let a=0;a!==i;++a)t[a]._update(n,e,r,s);let a=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)a[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){let t=this._actions,i=e.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){let e=r.knownActions;for(let i=0,n=e.length;i!==n;++i){let n=e[i];this._deactivateAction(n);let r=n._cacheIndex,s=t[t.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,t[r]=s,t.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(e){let t=e.uuid,i=this._actionsByClip;for(let e in i){let n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}let n=this._bindingsByRootAndName[t];if(void 0!==n)for(let e in n){let t=n[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){let i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}}class hY extends ns{constructor(e=1,t=1,i=1,n={}){super(e,t,n),this.isRenderTarget3D=!0,this.depth=i,this.texture=new nh(null,e,t,i),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}}class hZ{clone(){return new hZ(void 0===this.value.clone?this.value:this.value.clone())}constructor(e){this.value=e}}let hK=0;class hJ extends iC{add(e){return this.uniforms.push(e),this}remove(e){let t=this.uniforms.indexOf(e);return -1!==t&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;let t=e.uniforms;this.uniforms.length=0;for(let e=0,i=t.length;e<i;e++){let i=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0;e<i.length;e++)this.uniforms.push(i[e].clone())}return this}clone(){return new this.constructor().copy(this)}constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:hK++}),this.name="",this.usage=id,this.uniforms=[]}}class hQ extends sx{copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){let t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){let t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}constructor(e,t,i=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}}class h${set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}constructor(e,t,i,n,r,s=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=n,this.count=r,this.normalized=s,this.version=0}}let h0=new nB;class h1{set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera&&(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t)}setFromXRController(e){return h0.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(h0),this}intersectObject(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return h3(e,this,i,t),i.sort(h2),i}intersectObjects(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n=0,r=e.length;n<r;n++)h3(e[n],this,i,t);return i.sort(h2),i}constructor(e,t,i=0,n=1/0){this.ray=new nF(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new nZ,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}}function h2(e,t){return e.distance-t.distance}function h3(e,t,i,n){let r=!0;if(e.layers.test(t.layers)&&!1===e.raycast(t,i)&&(r=!1),!0===r&&!0===n){let n=e.children;for(let e=0,r=n.length;e<r;e++)h3(n[e],t,i,!0)}}class h4{connect(e){this._document=e,void 0!==e.hidden&&(this._pageVisibilityHandler=h5.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){null!==this._pageVisibilityHandler&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return null!==this._pageVisibilityHandler&&!0===this._document.hidden?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(void 0!==e?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}}function h5(){!1===this._document.hidden&&this.reset()}class h6{set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=iD(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(iD(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}constructor(e=1,t=0,i=0){this.radius=e,this.phi=t,this.theta=i}}class h8{set(e,t,i){return this.radius=e,this.theta=t,this.y=i,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,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}constructor(e=1,t=0,i=0){this.radius=e,this.theta=t,this.y=i}}class h9{identity(){return this.set(1,0,0,1),this}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,n){let r=this.elements;return r[0]=e,r[2]=t,r[1]=i,r[3]=n,this}constructor(e,t,i,n){h9.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,i,n)}}let h7=new iV;class ce{set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=h7.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=Infinity,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.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 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.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,h7).distanceTo(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}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)}constructor(e=new iV(Infinity,Infinity),t=new iV(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}}let ct=new iG,ci=new iG,cn=new iG,cr=new iG,cs=new iG,ca=new iG,co=new iG;class cl{set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ct.subVectors(e,this.start),ci.subVectors(this.end,this.start);let i=ci.dot(ci),n=ci.dot(ct)/i;return t&&(n=iD(n,0,1)),n}closestPointToPoint(e,t,i){let n=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(n).add(this.start)}distanceSqToLine3(e){let t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ca,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:co,s=1e-8*1e-8,a=this.start,o=e.start,l=this.end,h=e.end;cn.subVectors(l,a),cr.subVectors(h,o),cs.subVectors(a,o);let c=cn.dot(cn),u=cr.dot(cr),d=cr.dot(cs);if(c<=s&&u<=s)return n.copy(a),r.copy(o),n.sub(r),n.dot(n);if(c<=s)t=0,i=iD(i=d/u,0,1);else{let e=cn.dot(cs);if(u<=s)i=0,t=iD(-e/c,0,1);else{let n=cn.dot(cr),r=c*u-n*n;t=0!==r?iD((n*d-e*u)/r,0,1):0,(i=(n*t+d)/u)<0?(i=0,t=iD(-e/c,0,1)):i>1&&(i=1,t=iD((n-e)/c,0,1))}}return n.copy(a).add(cn.multiplyScalar(t)),r.copy(o).add(cr.multiplyScalar(i)),n.sub(r),n.dot(n)}
1applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}constructor(e=new iG,t=new iG){this.start=e,this.end=t}}let ch=new iG;class cc extends rt{dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ch.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ch),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";let i=new rZ,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let i=e/32*Math.PI*2,r=t/32*Math.PI*2;n.push(Math.cos(i),Math.sin(i),1,Math.cos(r),Math.sin(r),1)}i.setAttribute("position",new rV(n,3));let r=new aC({fog:!1,toneMapped:!1});this.cone=new aV(i,r),this.add(this.cone),this.update()}}let cu=new iG,cd=new nB,cp=new nB;class cf extends aV{updateMatrixWorld(e){let t=this.bones,i=this.geometry,n=i.getAttribute("position");cp.copy(this.root.matrixWorld).invert();for(let e=0,i=0;e<t.length;e++){let r=t[e];r.parent&&r.parent.isBone&&(cd.multiplyMatrices(cp,r.matrixWorld),cu.setFromMatrixPosition(cd),n.setXYZ(i,cu.x,cu.y,cu.z),cd.multiplyMatrices(cp,r.parent.matrixWorld),cu.setFromMatrixPosition(cd),n.setXYZ(i+1,cu.x,cu.y,cu.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){let i=this.geometry.getAttribute("color");for(let n=0;n<i.count;n+=2)i.setXYZ(n,e.r,e.g,e.b),i.setXYZ(n+1,t.r,t.g,t.b);return i.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e){let t=function e(t){let i=[];!0===t.isBone&&i.push(t);for(let n=0;n<t.children.length;n++)i.push(...e(t.children[n]));return i}(e),i=new rZ,n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(0,0,0),r.push(0,0,0))}i.setAttribute("position",new rV(n,3)),i.setAttribute("color",new rV(r,3)),super(i,new aC({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;let s=new ry(255),a=new ry(65280);this.setColors(s,a)}}class cm extends r8{dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}constructor(e,t,i){super(new o3(t,4,2),new rT({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}}let cg=new iG,cv=new ry,c_=new ry;class cx extends rt{dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){let e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{let t=e.geometry.getAttribute("color");cv.copy(this.light.color),c_.copy(this.light.groundColor);for(let e=0,i=t.count;e<i;e++){let n=e<i/2?cv:c_;t.setXYZ(e,n.r,n.g,n.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(cg.setFromMatrixPosition(this.light.matrixWorld).negate())}constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";let n=new o$(t);n.rotateY(.5*Math.PI),this.material=new rT({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);let r=new Float32Array(3*n.getAttribute("position").count);n.setAttribute("color",new rL(r,3)),this.add(new r8(n,this.material)),this.update()}}class cy extends aV{dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e=10,t=10,i=4473924,n=8947848){i=new ry(i),n=new ry(n);let r=t/2,s=e/t,a=e/2,o=[],l=[];for(let e=0,h=0,c=-a;e<=t;e++,c+=s){o.push(-a,0,c,a,0,c),o.push(c,0,-a,c,0,a);let t=e===r?i:n;t.toArray(l,h),h+=3,t.toArray(l,h),h+=3,t.toArray(l,h),h+=3,t.toArray(l,h),h+=3}let h=new rZ;h.setAttribute("position",new rV(o,3)),h.setAttribute("color",new rV(l,3)),super(h,new aC({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class cM extends aV{dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e=10,t=16,i=8,n=64,r=4473924,s=8947848){r=new ry(r),s=new ry(s);let a=[],o=[];if(t>1)for(let i=0;i<t;i++){let n=i/t*(2*Math.PI),l=Math.sin(n)*e,h=Math.cos(n)*e;a.push(0,0,0),a.push(l,0,h);let c=1&i?r:s;o.push(c.r,c.g,c.b),o.push(c.r,c.g,c.b)}for(let t=0;t<i;t++){let l=1&t?r:s,h=e-e/i*t;for(let e=0;e<n;e++){let t=e/n*(2*Math.PI),i=Math.sin(t)*h,r=Math.cos(t)*h;a.push(i,0,r),o.push(l.r,l.g,l.b),i=Math.sin(t=(e+1)/n*(2*Math.PI))*h,r=Math.cos(t)*h,a.push(i,0,r),o.push(l.r,l.g,l.b)}}let l=new rZ;l.setAttribute("position",new rV(a,3)),l.setAttribute("color",new rV(o,3)),super(l,new aC({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}let cS=new iG,cb=new iG,cT=new iG;class cw extends rt{dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),cS.setFromMatrixPosition(this.light.matrixWorld),cb.setFromMatrixPosition(this.light.target.matrixWorld),cT.subVectors(cb,cS),this.lightPlane.lookAt(cb),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(cb),this.targetLine.scale.z
1=cT.length()}constructor(e,t,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",void 0===t&&(t=1);let n=new rZ;n.setAttribute("position",new rV([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));let r=new aC({fog:!1,toneMapped:!1});this.lightPlane=new aF(n,r),this.add(this.lightPlane),(n=new rZ).setAttribute("position",new rV([0,0,0,0,0,1],3)),this.targetLine=new aF(n,r),this.add(this.targetLine),this.update()}}let cE=new iG,cA=new ss;class cR extends aV{setColors(e,t,i,n,r){let s=this.geometry.getAttribute("color");return s.setXYZ(0,e.r,e.g,e.b),s.setXYZ(1,e.r,e.g,e.b),s.setXYZ(2,e.r,e.g,e.b),s.setXYZ(3,e.r,e.g,e.b),s.setXYZ(4,e.r,e.g,e.b),s.setXYZ(5,e.r,e.g,e.b),s.setXYZ(6,e.r,e.g,e.b),s.setXYZ(7,e.r,e.g,e.b),s.setXYZ(8,e.r,e.g,e.b),s.setXYZ(9,e.r,e.g,e.b),s.setXYZ(10,e.r,e.g,e.b),s.setXYZ(11,e.r,e.g,e.b),s.setXYZ(12,e.r,e.g,e.b),s.setXYZ(13,e.r,e.g,e.b),s.setXYZ(14,e.r,e.g,e.b),s.setXYZ(15,e.r,e.g,e.b),s.setXYZ(16,e.r,e.g,e.b),s.setXYZ(17,e.r,e.g,e.b),s.setXYZ(18,e.r,e.g,e.b),s.setXYZ(19,e.r,e.g,e.b),s.setXYZ(20,e.r,e.g,e.b),s.setXYZ(21,e.r,e.g,e.b),s.setXYZ(22,e.r,e.g,e.b),s.setXYZ(23,e.r,e.g,e.b),s.setXYZ(24,t.r,t.g,t.b),s.setXYZ(25,t.r,t.g,t.b),s.setXYZ(26,t.r,t.g,t.b),s.setXYZ(27,t.r,t.g,t.b),s.setXYZ(28,t.r,t.g,t.b),s.setXYZ(29,t.r,t.g,t.b),s.setXYZ(30,t.r,t.g,t.b),s.setXYZ(31,t.r,t.g,t.b),s.setXYZ(32,i.r,i.g,i.b),s.setXYZ(33,i.r,i.g,i.b),s.setXYZ(34,i.r,i.g,i.b),s.setXYZ(35,i.r,i.g,i.b),s.setXYZ(36,i.r,i.g,i.b),s.setXYZ(37,i.r,i.g,i.b),s.setXYZ(38,n.r,n.g,n.b),s.setXYZ(39,n.r,n.g,n.b),s.setXYZ(40,r.r,r.g,r.b),s.setXYZ(41,r.r,r.g,r.b),s.setXYZ(42,r.r,r.g,r.b),s.setXYZ(43,r.r,r.g,r.b),s.setXYZ(44,r.r,r.g,r.b),s.setXYZ(45,r.r,r.g,r.b),s.setXYZ(46,r.r,r.g,r.b),s.setXYZ(47,r.r,r.g,r.b),s.setXYZ(48,r.r,r.g,r.b),s.setXYZ(49,r.r,r.g,r.b),s.needsUpdate=!0,this}update(){let e,t,i=this.geometry,n=this.pointMap;if(cA.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),!0===this.camera.reversedDepth)e=1,t=0;else if(this.camera.coordinateSystem===iT)e=-1,t=1;else if(this.camera.coordinateSystem===iw)e=0,t=1;else throw Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);cC("c",n,i,cA,0,0,e),cC("t",n,i,cA,0,0,t),cC("n1",n,i,cA,-1,-1,e),cC("n2",n,i,cA,1,-1,e),cC("n3",n,i,cA,-1,1,e),cC("n4",n,i,cA,1,1,e),cC("f1",n,i,cA,-1,-1,t),cC("f2",n,i,cA,1,-1,t),cC("f3",n,i,cA,-1,1,t),cC("f4",n,i,cA,1,1,t),cC("u1",n,i,cA,.7,1.1,e),cC("u2",n,i,cA,-.7,1.1,e),cC("u3",n,i,cA,0,2,e),cC("cf1",n,i,cA,-1,0,t),cC("cf2",n,i,cA,1,0,t),cC("cf3",n,i,cA,0,-1,t),cC("cf4",n,i,cA,0,1,t),cC("cn1",n,i,cA,-1,0,e),cC("cn2",n,i,cA,1,0,e),cC("cn3",n,i,cA,0,-1,e),cC("cn4",n,i,cA,0,1,e),i.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e){let t=new rZ,i=new aC({color:0xffffff,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={};function a(e,t){o(e),o(t)}function o(e){n.push(0,0,0),r.push(0,0,0),void 0===s[e]&&(s[e]=[]),s[e].push(n.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),t.setAttribute("position",new rV(n,3)),t.setAttribute("color",new rV(r,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();let l=new ry(0xffaa00),h=new ry(0xff0000),c=new ry(43775),u=new ry(0xffffff),d=new ry(3355443);this.setColors(l,h,c,u,d)}}function cC(e,t,i,n,r,s,a){cE.set(r,s,a).unproject(n);let o=t[e];if(void 0!==o){let e=i.getAttribute("position");for(let t=0,i=o.length;t<i;t++)e.setXYZ(o[t],cE.x,cE.y,cE.z)}}let cI=new nu;class cP extends aV{update(){if(void 0!==this.object&&cI.setFromObject(this.object),cI.isEmpty())return;let e=cI.min,t=cI.max,i=this.geometry.attributes.position,n=i.array;n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=e.x,n[4]=t.y,n[5]=t.z,n[6]=e.x,n[7]=e.y,n[8]=t.z,n[9]=t.x,n[10]=e.y,n[11]=t.z,n[12]=t.x,n[13]=t.y,n[14]=e.z,n[15]=e.x,n[16]=t.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=t.x,n[22]=e.y,n[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e,t=0xffff00){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new rZ;r.setIndex(new rL(i,1)),r.setAttribute("position",new rL(n,3)),super(r,new aC({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}}class cL extends aV{updateMatrixWorld(e){let t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e,t=0xffff00){let i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new rZ;n.setIndex(new rL(i,1)),n.setAttribute("position",new rV([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(n,new aC({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}}class cU extends aF{updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}constructor(e,t=1,i=0xffff00){let n=new rZ;n.setAttribute("position",new rV([1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere(),super(n,new aC({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;let r=new rZ;r.setAttribute("position",new rV([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new r8(r,new rT({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}}let cN=new iG;class cD extends rt{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{cN.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(cN,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i
1),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}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}constructor(e=new iG(0,0,1),t=new iG(0,0,0),i=1,n=0xffff00,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===a&&((a=new rZ).setAttribute("position",new rV([0,0,0,0,1,0],3)),(o=new a9(.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new aF(a,new aC({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new r8(o,new rT({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,r,s)}}class cO extends aV{setColors(e,t,i){let n=new ry,r=this.geometry.attributes.color.array;return n.set(e),n.toArray(r,0),n.toArray(r,3),n.set(t),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}constructor(e=1){let t=new rZ;t.setAttribute("position",new rV([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],3)),t.setAttribute("color",new rV([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(t,new aC({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}class cF{moveTo(e,t){return this.currentPath=new oA,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,n){return this.currentPath.quadraticCurveTo(e,t,i,n),this}bezierCurveTo(e,t,i,n,r,s){return this.currentPath.bezierCurveTo(e,t,i,n,r,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){let t,i,n,r,s,a=oX.isClockWise,o=this.subPaths;if(0===o.length)return[];let l=[];if(1===o.length)return i=o[0],(n=new oR).curves=i.curves,l.push(n),l;let h=!a(o[0].getPoints());h=e?!h:h;let c=[],u=[],d=[],p=0;u[0]=void 0,d[p]=[];for(let n=0,s=o.length;n<s;n++)t=a(r=(i=o[n]).getPoints()),(t=e?!t:t)?(!h&&u[p]&&p++,u[p]={s:new oR,p:r},u[p].s.curves=i.curves,h&&p++,d[p]=[]):d[p].push({h:i,p:r[0]});if(!u[0])return function(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i],r=new oR;r.curves=n.curves,t.push(r)}return t}(o);if(u.length>1){let e=!1,t=0;for(let e=0,t=u.length;e<t;e++)c[e]=[];for(let i=0,n=u.length;i<n;i++){let n=d[i];for(let r=0;r<n.length;r++){let s=n[r],a=!0;for(let n=0;n<u.length;n++)(function(e,t){let i=t.length,n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=t[r],a=t[s],o=a.x-i.x,l=a.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=t[s],o=-o,a=t[r],l=-l),e.y<i.y||e.y>a.y)continue;if(e.y===i.y){if(e.x===i.x)return!0}else{let t=l*(e.x-i.x)-o*(e.y-i.y);if(0===t)return!0;if(t<0)continue;n=!n}}else{if(e.y!==i.y)continue;if(a.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=a.x)return!0}}return n})(s.p,u[n].p)&&(i!==n&&t++,a?(a=!1,c[n].push(s)):e=!0);a&&c[i].push(s)}}t>0&&!1===e&&(d=c)}for(let e=0,t=u.length;e<t;e++){n=u[e].s,l.push(n),s=d[e];for(let e=0,t=s.length;e<t;e++)n.holes.push(s[e].h)}return l}constructor(){this.type="ShapePath",this.color=new ry,this.subPaths=[],this.currentPath=null}}class cB extends iC{connect(e){void 0!==e&&(null!==this.domElement&&this.disconnect(),this.domElement=e)}disconnect(){}dispose(){}update(){}constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}}function cz(e,t,i,n){let r=function(e){switch(e){case eN:case eD:return{byteLength:1,components:1};case eF:case eO:case eV:return{byteLength:2,components:1};case eH:case eG:return{byteLength:2,components:4};case ez:case eB:case ek:return{byteLength:4,components:1};case ej:case eX:return{byteLength:4,components:3}}throw Error("Unknown texture type ".concat(e,"."))}(n);switch(i){case eq:return e*t;case eQ:case e$:return e*t/r.components*r.byteLength;case e0:case e1:return e*t*2/r.components*r.byteLength;case eY:return e*t*3/r.components*r.byteLength;case eZ:case e3:return e*t*4/r.components*r.byteLength;case e4:case e5:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case e6:case e8:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case e7:case tt:return Math.max(e,16)*Math.max(t,8)/4;case e9:case te:return Math.max(e,8)*Math.max(t,8)/2;case ti:case tn:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case tr:case ts:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case ta:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case to:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case tl:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case th:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case tc:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case tu:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case td:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case tp:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case tf:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case tm:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case tg:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case tv:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case t_:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case tx:case ty:case tM:return Math.ceil(e/4)*Math.ceil(t/4)*16;case tS:case tb:return Math.ceil(e/4)*Math.ceil(t/4)*8;case tT:case tw:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error("Unable to determine texture byte length for ".concat(i," format."))}class ck{static contain(e,t){let i=e.image&&e.image.width?e.image.width/e.image.height:1;return i>t?(e.repeat.x=1,e.repeat.y=i/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/i,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}static cover(e,t){let i=e.image&&e.image.width?e.image.width/e.image.height:1;return i>t?(e.repeat.x=t/i,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=i/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}static fill(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}static getByteLength(e,t,i,n){return cz(e,t,i,n)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:l}})),"undefined"!=typeof window&&(window.__THREE__||(window.__THREE__=l))},32559:(e,t,i)=>{function n(e){let t=new Map,i=new Map,n=e.clone();return function e(t,i,n){n(t,i);for(let r=0;r<t.children.length;r++)e(t.children[r],i.children[r],n)}(e,n,function(e,n){t.set(n,e),i.set(e,n)}),n.traverse(function(e){if(!e.isSkinnedMesh)return;let n=t.get(e),r=n.skeleton.bones;e.skeleton=n.skeleton.clone(),e.bindMatrix.copy(n.bindMatrix),e.skeleton.bones=r.map(function(e){return i.get(e)}),e.bind(e.skeleton,e.bindMatrix)}),n}i.d(t,{o8:()=>n})},34308:(e,t,i)=>{i.d(t,{B:()=>s});var n=i(27072);function r(e,t){if(t===n.RJ4||t!==n.rYR&&t!==n.O49)return e;{let i=e.getIndex();if(null===i){let t=[],n=e.getAttribute("position");if(void 0===n)return e;for(let e=0;e<n.count;e++)t.push(e);e.setIndex(t),i=e.getIndex()}let r=i.count-2,s=[];if(t===n.rYR)for(let e=1;e<=r;e++)s.push(i.getX(0)),s.push(i.getX(e)),s.push(i.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(s.push(i.getX(e)),s.push(i.getX(e+1)),s.push(i.getX(e+2))):(s.push(i.getX(e+2)),s.push(i.getX(e+1)),s.push(i.getX(e)));s.length;let a=e.clone();return a.setIndex(s),a.clearGroups(),a}}class s extends n.aHM{load(e,t,i,r){let s,a=this;if(""!==this.resourcePath)s=this.resourcePath;else if(""!==this.path){let t=n.r6x.extractUrlBase(e);s=n.r6x.resolveURL(t,this.path)}else s=n.r6x.extractUrlBase(e);this.manager.itemStart(e);let o=function(t){r&&r(t),a.manager.itemError(e),a.manager.itemEnd(e)},l=new n.Y9S(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(i){try{a.parse(i,s,function(i){t(i),a.manager.itemEnd(e)},o)}catch(e){o(e)}},i,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,n){let r,s={},a={},l=new TextDecoder;if("string"==typeof e)r=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===E){try{s[o.KHR_BINARY_GLTF]=new R(e)}catch(e){n&&n(e);return}r=JSON.parse(s[o.KHR_BINARY_GLTF].content)}else r=JSON.parse(l.decode(e));else r=e;if(void 0===r.asset||r.asset.version[0]<2){n&&n(Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new Z(r,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){let t=this.pluginCallbacks[e](c);t.name,a[t.name]=t,s[t.name]=!0}if(r.extensionsUsed)for(let e=0;e<r.extensionsUsed.length;++e){let t=r.extensionsUsed[e],i=r.extensionsRequired||[];switch(t){case o.KHR_MATERIALS_UNLIT:s[t]=new h;break;case o.KHR_DRACO_MESH_COMPRESSION:s[t]=new C(r,this.dracoLoader);break;case o.KHR_TEXTURE_TRANSFORM:s[t]=new I;break;
1case o.KHR_MESH_QUANTIZATION:s[t]=new P;break;default:i.indexOf(t)>=0&&a[t]}}c.setExtensions(s),c.setPlugins(a),c.parse(i,n)}parseAsync(e,t){let i=this;return new Promise(function(n,r){i.parse(e,t,n,r)})}constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new u(e)}),this.register(function(e){return new d(e)}),this.register(function(e){return new M(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new f(e)}),this.register(function(e){return new m(e)}),this.register(function(e){return new g(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new c(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new p(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new l(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new w(e)})}}function a(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let o={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class l{_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,n=t.length;i<n;i++){let n=t[i];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){let t,i=this.parser,r="light:"+e,s=i.cache.get(r);if(s)return s;let a=i.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],l=new n.Q1f(0xffffff);void 0!==o.color&&l.setRGB(o.color[0],o.color[1],o.color[2],n.Zr2);let h=void 0!==o.range?o.range:0;switch(o.type){case"directional":(t=new n.ZyN(l)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new n.HiM(l)).distance=h;break;case"spot":(t=new n.nCl(l)).distance=h,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,t.angle=o.spot.outerConeAngle,t.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return t.position.set(0,0,0),j(t,o),void 0!==o.intensity&&(t.intensity=o.intensity),t.name=i.createUniqueName(o.name||"light_"+e),s=Promise.resolve(t),i.cache.add(r,s),s}getDependency(e,t){if("light"===e)return this._loadLight(t)}createNodeAttachment(e){let t=this,i=this.parser,n=i.json.nodes[e],r=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===r?null:this._loadLight(r).then(function(e){return i._getNodeRef(t.cache,r,e)})}constructor(e){this.parser=e,this.name=o.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}}class h{getMaterialType(){return n.V9B}extendParams(e,t,i){let r=[];e.color=new n.Q1f(1,1,1),e.opacity=1;let s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){let t=s.baseColorFactor;e.color.setRGB(t[0],t[1],t[2],n.Zr2),e.opacity=t[3]}void 0!==s.baseColorTexture&&r.push(i.assignTexture(e,"map",s.baseColorTexture,n.er$))}return Promise.all(r)}constructor(){this.name=o.KHR_MATERIALS_UNLIT}}class c{extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=i.extensions[this.name].emissiveStrength;return void 0!==n&&(t.emissiveIntensity=n),Promise.resolve()}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_EMISSIVE_STRENGTH}}class u{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=[],a=r.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&s.push(i.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&s.push(i.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(s.push(i.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){let e=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new n.I9Y(e,e)}return Promise.all(s)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_CLEARCOAT}}class d{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=i.extensions[this.name];return t.dispersion=void 0!==n.dispersion?n.dispersion:0,Promise.resolve()}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_DISPERSION}}class p{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,n=i.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=[],s=n.extensions[this.name];return void 0!==s.iridescenceFactor&&(t.iridescence=s.iridescenceFactor),void 0!==s.iridescenceTexture&&r.push(i.assignTexture(t,"iridescenceMap",s.iridescenceTexture)),void 0!==s.iridescenceIor&&(t.iridescenceIOR=s.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==s.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=s.iridescenceThicknessMinimum),void 0!==s.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=s.iridescenceThicknessMaximum),void 0!==s.iridescenceThicknessTexture&&r.push(i.assignTexture(t,"iridescenceThicknessMap",s.iridescenceThicknessTexture)),Promise.all(r)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IRIDESCENCE}}class f{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=[];t.sheenColor=new n.Q1f(0,0,0),t.sheenRoughness=0,t.sheen=1;let a=r.extensions[this.name];if(void 0!==a.sheenColorFactor){let e=a.sheenColorFactor;t.sheenColor.setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==a.sheenRoughnessFactor&&(t.sheenRoughness=a.sheenRoughnessFactor),void 0!==a.sheenColorTexture&&s.push(i.assignTexture(t,"sheenColorMap",a.sheenColorTexture,n.er$)),void 0!==a.sheenRoughnessTexture&&s.push(i.assignTexture(t,"sheenRoughnessMap",a.sheenRoughnessTexture)),Promise.all(s)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SHEEN}}class m{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,n=i.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=[],s=n.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&r.push(i.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(r)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_TRANSMISSION}}class g{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=[],a=r.extensions[this.name];t.thickness=void 0!==a.thicknessFactor?a.thicknessFactor:0,void 0!==a.thicknessTexture&&s.push(i.assignTexture(t,"thicknessMap",a.thicknessTexture)),t.attenuationDistance=a.attenuationDistance||1/0;let o=a.attenuationColor||[1,1,1];return t.attenuationColor=new n.Q1f().setRGB(o[0],o[1],o[2],n.Zr2),Promise.all(s)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_VOLUME}}class v{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let n=i.extensions[this.name];return t.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_IOR}}class _{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let s=[],a=r.extensions[this.name];t.specularIntensity=void 0!==a.specularFactor?a.specularFactor:1,void 0!==a.specularTexture&&s.push(i.assignTexture(t,"specularIntensityMap",a.specularTexture));let o=a.specularColorFactor||[1,1,1];return t.specularColor=new n.Q1f().setRGB(o[0],o[1],o[2],n.Zr2),void 0!==a.specularColorTexture&&s.push(i.assignTexture(t,"specularColorMap",a.specularColorTexture,n.er$)),Promise.all(s)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_SPECULAR}}class x{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,n=i.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=[],s=n.extensions[this.name];return t.bumpScale=void 0!==s.bumpFactor?s.bumpFactor:1,void 0!==s.bumpTexture&&r.push(i.assignTexture(t,"bumpMap",s.bumpTexture)),Promise.all(r)}constructor(e){this.parser=e,this.name=o.EXT_MATERIALS_BUMP}}class y{getMaterialType(e){let t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?n.uSd:null}extendMaterialParams(e,t){let i=this.parser,n=i.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let r=[],s=n.extensions[this.name];return void 0!==s.anisotropyStrength&&(t.anisotropy=s.anisotropyStrength),void 0!==s.anisotropyRotation&&(t.anisotropyRotation=s.anisotropyRotation),void 0!==s.anisotropyTexture&&r.push(i.assignTexture(t,"anisotropyMap",s.anisotropyTexture)),Promise.all(r)}constructor(e){this.parser=e,this.name=o.KHR_MATERIALS_ANISOTROPY}}class M{loadTexture(e){let t=this.parser,i=t.json,n=i.textures[e];if(!n.extensions||!n.extensions[this.name])return null;let r=n.extensions[this.name],s=t.options.ktx2Loader;if(!s)if(!(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,r.source,s)}constructor(e){this.parser=e,this.name=o.KHR_TEXTURE_BASISU}}class S{loadTexture(e){let t=this.name,i=this.parser,n=i.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;let s=r.extensions[t],a=n.images[s.source],o=i.textureLoader;if(a.uri){let e=i.options.manager.getHandler(a.uri);null!==e&&(o=e)}return i.loadTextureImage(e,s.source,o)}constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_WEBP}}class b{loadTexture(e){let t=this.name,i=this.parser,n=i.json,r=n.textures[e];if(!r.extensions||!r.extensions[t])return null;let s=r.extensions[t],a=n.images[s.source],o=i.textureLoader;if(a.uri){let e=i.options.manager.getHandler(a.uri);null!==e&&(o=e)}return i.loadTextureImage(e,s.source,o)}constructor(e){this.parser=e,this.name=o.EXT_TEXTURE_AVIF}}class T{loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(!i.extensions||!i.extensions[this.name])return null;{let e=i.extensions[this.name],n=this.parser.getDependency("buffer",e.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return n.then(function(t){let i=e.byteOffset||0,n=e.byteLength||0,s=e.count,a=e.byteStride,o=new Uint8Array(t,i,n);return r.decodeGltfBufferAsync?r.decodeGltfBufferAsync(s,a,o,e.mode,e.filter).then(function(e){return e.buffer}):r.ready.then(function(){let t=new ArrayBuffer(s*a);return r.decodeGltfBuffer(new Uint8Array(t),s,a,o,e.mode,e.filter),t})})}}constructor(e){this.name=o.EXT_MESHOPT_COMPRESSION,this.parser=e}}class w{createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||void 0===i.mesh)return null;for(let e of t.meshes[i.mesh].primitives)if(e.mode!==D.TRIANGLES&&e.mode!==D.TRIANGLE_STRIP&&e.mode!==D.TRIANGLE_FAN&&void 0!==e.mode)return null;let r=i.extensions[this.name].attributes,s=[],a={};for(let e in r)s.push(this.parser.getDependency("accessor",r[e]).then(t=>(a[e]=t,a[e])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(e=>{let t=e.pop(),i=t.isGroup?t.children:[t],r=e[0].count,s=[];for(let e of i){let t=new n.kn4,i=new n.Pq0,o=new n.PTz,l=new n.Pq0(1,1,1),h=new n.ZLX(e.geometry,e.material,r);for(let e=0;e<r;e++)a.TRANSLATION&&i.fromBufferAttribute(a.TRANSLATION,e),a.ROTATION&&o.fromBufferAttribute(a.ROTATION,e),a.SCALE&&l.fromBufferAttribute(a.SCALE,e),h.setMatrixAt(e,t.compose(i,o,l));for(let t in a)if("_COLOR_0"===t){let e=a[t];h.instanceColor=new n.uWO(e.array,e.itemSize,e.normalized)}else"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,a[t]);n.B69.prototype.copy.call(h,e),this.parser.assignFinalMaterial(h),s.push(h)}return t.isGroup?(t.clear(),t.add(...s),t):s[0]}))}constructor(e){this.name=o.EXT_MESH_GPU_INSTANCING,this.parser=e}}let E="glTF",A={JSON:0x4e4f534a,BIN:5130562};class R{constructor(e){this.name=o.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,12),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==E)throw Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-12,r=new DataView(e,12),s=0;for(;s<n;){let t=r.getUint32(s,!0);s+=4;let n=r.getUint32(s,!0);if(s+=4,n===A.JSON){let n=new Uint8Array(e,12+s,t);this.content=i.decode(n)}
1else if(n===A.BIN){let i=12+s;this.body=e.slice(i,i+t)}s+=t}if(null===this.content)throw Error("THREE.GLTFLoader: JSON content not found.")}}class C{decodePrimitive(e,t){let i=this.json,r=this.dracoLoader,s=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},l={},h={};for(let e in a)o[k[e]||e.toLowerCase()]=a[e];for(let t in e.attributes){let n=k[t]||t.toLowerCase();if(void 0!==a[t]){let r=i.accessors[e.attributes[t]],s=O[r.componentType];h[n]=s.name,l[n]=!0===r.normalized}}return t.getDependency("bufferView",s).then(function(e){return new Promise(function(t,i){r.decodeDracoFile(e,function(e){for(let t in e.attributes){let i=e.attributes[t],n=l[t];void 0!==n&&(i.normalized=n)}t(e)},o,h,n.Zr2,i)})})}constructor(e,t){if(!t)throw Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=o.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}}class I{extendTexture(e,t){return(void 0===t.texCoord||t.texCoord===e.channel)&&void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}constructor(){this.name=o.KHR_TEXTURE_TRANSFORM}}class P{constructor(){this.name=o.KHR_MESH_QUANTIZATION}}class L extends n.lGw{copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=e*n*3+n;for(let e=0;e!==n;e++)t[e]=i[r+e];return t}interpolate_(e,t,i,n){let r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,h=n-t,c=(i-t)/h,u=c*c,d=u*c,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,v=1-m,_=g-u+c;for(let e=0;e!==a;e++){let t=s[f+e+a],i=s[f+e+o]*h,n=s[p+e+a],l=s[p+e]*h;r[e]=v*t+_*i+m*n+g*l}return r}constructor(e,t,i,n){super(e,t,i,n)}}let U=new n.PTz;class N extends L{interpolate_(e,t,i,n){let r=super.interpolate_(e,t,i,n);return U.fromArray(r).normalize().toArray(r),r}}let D={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},F={9728:n.hxR,9729:n.k6q,9984:n.pHI,9985:n.kRr,9986:n.Cfg,9987:n.$_I},B={33071:n.ghU,33648:n.kTW,10497:n.GJx},z={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},k={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},V={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},H={CUBICSPLINE:void 0,LINEAR:n.PJ3,STEP:n.ljd},G={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function W(e,t,i){for(let n in i.extensions)void 0===e[n]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[n]=i.extensions[n])}function j(e,t){void 0!==t.extras&&"object"==typeof t.extras&&Object.assign(e.userData,t.extras)}function X(e){let t="",i=Object.keys(e).sort();for(let n=0,r=i.length;n<r;n++)t+=i[n]+":"+e[i[n]]+";";return t}function q(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}let Y=new n.kn4;class Z{setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(t){let s={scene:t[0][n.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:n.asset,parser:i,userData:{}};return W(r,s,n),j(s,n),Promise.all(i._invokeAll(function(e){return e.afterRoot&&e.afterRoot(s)})).then(function(){for(let e of s.scenes)e.updateMatrixWorld();e(s)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let i=0,n=t.length;i<n;i++){let n=t[i].joints;for(let t=0,i=n.length;t<i;t++)e[n[t]].isBone=!0}for(let t=0,n=e.length;t<n;t++){let n=e[t];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(i[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;let n=i.clone(),r=(e,t)=>{let i=this.associations.get(e);for(let[n,s]of(null!=i&&this.associations.set(t,i),e.children.entries()))r(s,t.children[n])};return r(i,n),n.name+="_instance_"+e.uses[t]++,n}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let n=e(t[i]);if(n)return n}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let n=0;n<t.length;n++){let r=e(t[n]);r&&i.push(r)}return i}getDependency(e,t){let i=e+":"+t,n=this.cache.get(i);if(!n){switch(e){case"scene":n=this.loadScene(t);break;case"node":n=this._invokeOne(function(e){return e.loadNode&&e.loadNode(t)});break;case"mesh":n=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":n=this.loadAccessor(t);break;case"bufferView":n=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":n=this.loadBuffer(t);break;case"material":n=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":n=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":n=this.loadSkin(t);break;case"animation":n=this._invokeOne(function(e){return e.loadAnimation&&e.loadAnimation(t)});break;case"camera":n=this.loadCamera(t);break;default:if(!(n=this._invokeOne(function(i){return i!=this&&i.getDependency&&i.getDependency(e,t)})))throw Error("Unknown type: "+e)}this.cache.add(i,n)}return n}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this;t=Promise.all((this.json[e+("mesh"===e?"es":"s")]||[]).map(function(t,n){return i.getDependency(e,n)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");
1if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[o.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(e,s){i.load(n.r6x.resolveURL(t.uri,r.path),e,void 0,function(){s(Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){let i=t.byteLength||0,n=t.byteOffset||0;return e.slice(n,n+i)})}loadAccessor(e){let t=this,i=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){let e=z[r.type],t=O[r.componentType],i=!0===r.normalized,s=new t(r.count*e);return Promise.resolve(new n.THS(s,e,i))}let s=[];return void 0!==r.bufferView?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),void 0!==r.sparse&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(e){let s,a,o=e[0],l=z[r.type],h=O[r.componentType],c=h.BYTES_PER_ELEMENT,u=c*l,d=r.byteOffset||0,p=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,f=!0===r.normalized;if(p&&p!==u){let e=Math.floor(d/p),i="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count,u=t.cache.get(i);u||(s=new h(o,e*p,r.count*p/c),u=new n.eB$(s,p/c),t.cache.add(i,u)),a=new n.eHs(u,l,d%p/c,f)}else s=null===o?new h(r.count*l):new h(o,d,r.count*l),a=new n.THS(s,l,f);if(void 0!==r.sparse){let t=z.SCALAR,i=O[r.sparse.indices.componentType],s=r.sparse.indices.byteOffset||0,c=r.sparse.values.byteOffset||0,u=new i(e[1],s,r.sparse.count*t),d=new h(e[2],c,r.sparse.count*l);null!==o&&(a=new n.THS(a.array.slice(),a.itemSize,a.normalized)),a.normalized=!1;for(let e=0,t=u.length;e<t;e++){let t=u[e];if(a.setX(t,d[e*l]),l>=2&&a.setY(t,d[e*l+1]),l>=3&&a.setZ(t,d[e*l+2]),l>=4&&a.setW(t,d[e*l+3]),l>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}a.normalized=f}return a})}loadTexture(e){let t=this.json,i=this.options,n=t.textures[e].source,r=t.images[n],s=this.textureLoader;if(r.uri){let e=i.manager.getHandler(r.uri);null!==e&&(s=e)}return this.loadTextureImage(e,n,s)}loadTextureImage(e,t,i){let r=this,s=this.json,a=s.textures[e],o=s.images[t],l=(o.uri||o.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];let h=this.loadImageSource(t,i).then(function(t){t.flipY=!1,t.name=a.name||o.name||"",""===t.name&&"string"==typeof o.uri&&!1===o.uri.startsWith("data:image/")&&(t.name=o.uri);let i=(s.samplers||{})[a.sampler]||{};return t.magFilter=F[i.magFilter]||n.k6q,t.minFilter=F[i.minFilter]||n.$_I,t.wrapS=B[i.wrapS]||n.GJx,t.wrapT=B[i.wrapT]||n.GJx,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==n.hxR&&t.minFilter!==n.k6q,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[l]=h,h}loadImageSource(e,t){let i=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let s=i.images[e],a=self.URL||self.webkitURL,o=s.uri||"",l=!1;if(void 0!==s.bufferView)o=this.getDependency("bufferView",s.bufferView).then(function(e){l=!0;let t=new Blob([e],{type:s.mimeType});return o=a.createObjectURL(t)});else if(void 0===s.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let h=Promise.resolve(o).then(function(e){return new Promise(function(i,s){let a=i;!0===t.isImageBitmapLoader&&(a=function(e){let t=new n.gPd(e);t.needsUpdate=!0,i(t)}),t.load(n.r6x.resolveURL(e,r.path),a,void 0,s)})}).then(function(e){var t;return!0===l&&a.revokeObjectURL(o),j(e,s),e.userData.mimeType=s.mimeType||((t=s.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":t.search(/\.ktx2($|\?)/i)>0||0===t.search(/^data\:image\/ktx2/)?"image/ktx2":"image/png"),e}).catch(function(e){throw e});return this.sourceCache[e]=h,h}assignTexture(e,t,i,n){let r=this;return this.getDependency("texture",i.index).then(function(s){if(!s)return null;if(void 0!==i.texCoord&&i.texCoord>0&&((s=s.clone()).channel=i.texCoord),r.extensions[o.KHR_TEXTURE_TRANSFORM]){let e=void 0!==i.extensions?i.extensions[o.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=r.associations.get(s);s=r.extensions[o.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),r.associations.set(s,t)}}
1return void 0!==n&&(s.colorSpace=n),e[t]=s,s})}assignFinalMaterial(e){let t=e.geometry,i=e.material,r=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,a=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new n.BH$,n.imn.prototype.copy.call(t,i),t.color.copy(i.color),t.map=i.map,t.sizeAttenuation=!1,this.cache.add(e,t)),i=t}else if(e.isLine){let e="LineBasicMaterial:"+i.uuid,t=this.cache.get(e);t||(t=new n.mrM,n.imn.prototype.copy.call(t,i),t.color.copy(i.color),t.map=i.map,this.cache.add(e,t)),i=t}if(r||s||a){let e="ClonedMaterial:"+i.uuid+":";r&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),a&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=i.clone(),s&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(i))),i=t}e.material=i}getMaterialType(){return n._4j}loadMaterial(e){let t,i=this,r=this.json,s=this.extensions,a=r.materials[e],l={},h=a.extensions||{},c=[];if(h[o.KHR_MATERIALS_UNLIT]){let e=s[o.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),c.push(e.extendParams(l,a,i))}else{let r=a.pbrMetallicRoughness||{};if(l.color=new n.Q1f(1,1,1),l.opacity=1,Array.isArray(r.baseColorFactor)){let e=r.baseColorFactor;l.color.setRGB(e[0],e[1],e[2],n.Zr2),l.opacity=e[3]}void 0!==r.baseColorTexture&&c.push(i.assignTexture(l,"map",r.baseColorTexture,n.er$)),l.metalness=void 0!==r.metallicFactor?r.metallicFactor:1,l.roughness=void 0!==r.roughnessFactor?r.roughnessFactor:1,void 0!==r.metallicRoughnessTexture&&(c.push(i.assignTexture(l,"metalnessMap",r.metallicRoughnessTexture)),c.push(i.assignTexture(l,"roughnessMap",r.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,l)})))}!0===a.doubleSided&&(l.side=n.$EB);let u=a.alphaMode||G.OPAQUE;if(u===G.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,u===G.MASK&&(l.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==n.V9B&&(c.push(i.assignTexture(l,"normalMap",a.normalTexture)),l.normalScale=new n.I9Y(1,1),void 0!==a.normalTexture.scale)){let e=a.normalTexture.scale;l.normalScale.set(e,e)}if(void 0!==a.occlusionTexture&&t!==n.V9B&&(c.push(i.assignTexture(l,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(l.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==n.V9B){let e=a.emissiveFactor;l.emissive=new n.Q1f().setRGB(e[0],e[1],e[2],n.Zr2)}return void 0!==a.emissiveTexture&&t!==n.V9B&&c.push(i.assignTexture(l,"emissiveMap",a.emissiveTexture,n.er$)),Promise.all(c).then(function(){let n=new t(l);return a.name&&(n.name=a.name),j(n,a),i.associations.set(n,{materials:e}),a.extensions&&W(s,n,a),n})}createUniqueName(e){let t=n.Nwf.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,i=this.extensions,r=this.primitiveCache,s=[];for(let a=0,l=e.length;a<l;a++){let l=e[a],h=function(e){let t,i=e.extensions&&e.extensions[o.KHR_DRACO_MESH_COMPRESSION];if(t=i?"draco:"+i.bufferView+":"+i.indices+":"+X(i.attributes):e.indices+":"+X(e.attributes)+":"+e.mode,void 0!==e.targets)for(let i=0,n=e.targets.length;i<n;i++)t+=":"+X(e.targets[i]);return t}(l),c=r[h];if(c)s.push(c.promise);else{let e;e=l.extensions&&l.extensions[o.KHR_DRACO_MESH_COMPRESSION]?function(e){return i[o.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(i){return K(i,e,t)})}(l):K(new n.LoY,l,t),r[h]={primitive:l,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){let t=this,i=this.json,s=this.extensions,a=i.meshes[e],o=a.primitives,l=[];for(let e=0,t=o.length;e<t;e++){var h;let t=void 0===o[e].material?(void 0===(h=this.cache).DefaultMaterial&&(h.DefaultMaterial=new n._4j({color:0xffffff,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.hB5})),h.DefaultMaterial):this.getDependency("material",o[e].material);l.push(t)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(i){let l=i.slice(0,i.length-1),h=i[i.length-1],c=[];for(let i=0,u=h.length;i<u;i++){let u,d=h[i],p=o[i],f=l[i];if(p.mode===D.TRIANGLES||p.mode===D.TRIANGLE_STRIP||p.mode===D.TRIANGLE_FAN||void 0===p.mode)!0===(u=!0===a.isSkinnedMesh?new n.I46(d,f):new n.eaF(d,f)).isSkinnedMesh&&u.normalizeSkinWeights(),p.mode===D.TRIANGLE_STRIP?u.geometry=r(u.geometry,n.O49):p.mode===D.TRIANGLE_FAN&&(u.geometry=r(u.geometry,n.rYR));else if(p.mode===D.LINES)u=new n.DXC(d,f);else if(p.mode===D.LINE_STRIP)u=new n.N1A(d,f);else if(p.mode===D.LINE_LOOP)u=new n.FCc(d,f);else if(p.mode===D.POINTS)u=new n.ONl(d,f);else throw Error("THREE.GLTFLoader: Primitive mode unsupported: "+p.mode);Object.keys(u.geometry.morphAttributes).length>0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let i=0,n=t.weights.length;i<n;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(let t=0,n=i.length;t<n;t++)e.morphTargetDictionary[i[t]]=t}}}(u,a),u.name=t.createUniqueName(a.name||"mesh_"+e),j(u,a),p.extensions&&W(s,u,p),t.assignFinalMaterial(u),c.push(u)}for(let i=0,n=c.length;i<n;i++)t.associations.set(c[i],{meshes:e,primitives:i});if(1===c.length)return a.extensions&&W(s,c[0],a),c[0];let u=new n.YJl;a.extensions&&W(s,u,a),t.associations.set(u,{meshes:e});for(let e=0,t=c.length;e<t;e++)u.add(c[e]);return u})}loadCamera(e){let t,i=this.json.cameras[e],r=i[i.type];if(r)return"perspective"===i.type?t=new n.ubm(n.cj9.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.t
1ype&&(t=new n.qUd(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),j(t,i),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],i=[];for(let e=0,n=t.joints.length;e<n;e++)i.push(this._loadNodeShallow(t.joints[e]));return void 0!==t.inverseBindMatrices?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(e){let t=e.pop(),i=[],r=[];for(let s=0,a=e.length;s<a;s++){let a=e[s];if(a){i.push(a);let e=new n.kn4;null!==t&&e.fromArray(t.array,16*s),r.push(e)}}return new n.EAD(i,r)})}loadAnimation(e){let t=this.json,i=this,r=t.animations[e],s=r.name?r.name:"animation_"+e,a=[],o=[],l=[],h=[],c=[];for(let e=0,t=r.channels.length;e<t;e++){let t=r.channels[e],i=r.samplers[t.sampler],n=t.target,s=n.node,u=void 0!==r.parameters?r.parameters[i.input]:i.input,d=void 0!==r.parameters?r.parameters[i.output]:i.output;void 0!==n.node&&(a.push(this.getDependency("node",s)),o.push(this.getDependency("accessor",u)),l.push(this.getDependency("accessor",d)),h.push(i),c.push(n))}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l),Promise.all(h),Promise.all(c)]).then(function(e){let t=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=[];for(let e=0,n=t.length;e<n;e++){let n=t[e],r=a[e],s=o[e],u=l[e],d=h[e];if(void 0===n)continue;n.updateMatrix&&n.updateMatrix();let p=i._createAnimationTracks(n,r,s,u,d);if(p)for(let e=0;e<p.length;e++)c.push(p[e])}let u=new n.tz3(s,void 0,c);return j(u,r),u})}createNodeMesh(e){let t=this.json,i=this,n=t.nodes[e];return void 0===n.mesh?null:i.getDependency("mesh",n.mesh).then(function(e){let t=i._getNodeRef(i.meshCache,n.mesh,e);return void 0!==n.weights&&t.traverse(function(e){if(e.isMesh)for(let t=0,i=n.weights.length;t<i;t++)e.morphTargetInfluences[t]=n.weights[t]}),t})}loadNode(e){let t=this.json.nodes[e],i=this._loadNodeShallow(e),n=[],r=t.children||[];for(let e=0,t=r.length;e<t;e++)n.push(this.getDependency("node",r[e]));let s=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([i,Promise.all(n),s]).then(function(e){let t=e[0],i=e[1],n=e[2];null!==n&&t.traverse(function(e){e.isSkinnedMesh&&e.bind(n,Y)});for(let e=0,n=i.length;e<n;e++)t.add(i[e]);return t})}_loadNodeShallow(e){let t=this.json,i=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];let s=t.nodes[e],a=s.name?r.createUniqueName(s.name):"",o=[],l=r._invokeOne(function(t){return t.createNodeMesh&&t.createNodeMesh(e)});return l&&o.push(l),void 0!==s.camera&&o.push(r.getDependency("camera",s.camera).then(function(e){return r._getNodeRef(r.cameraCache,s.camera,e)})),r._invokeAll(function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)}).forEach(function(e){o.push(e)}),this.nodeCache[e]=Promise.all(o).then(function(t){let o;if((o=!0===s.isBone?new n.$Kf:t.length>1?new n.YJl:1===t.length?t[0]:new n.B69)!==t[0])for(let e=0,i=t.length;e<i;e++)o.add(t[e]);if(s.name&&(o.userData.name=s.name,o.name=a),j(o,s),s.extensions&&W(i,o,s),void 0!==s.matrix){let e=new n.kn4;e.fromArray(s.matrix),o.applyMatrix4(e)}else void 0!==s.translation&&o.position.fromArray(s.translation),void 0!==s.rotation&&o.quaternion.fromArray(s.rotation),void 0!==s.scale&&o.scale.fromArray(s.scale);if(r.associations.has(o)){if(void 0!==s.mesh&&r.meshCache.refs[s.mesh]>1){let e=r.associations.get(o);r.associations.set(o,{...e})}}else r.associations.set(o,{});return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,i=this.json.scenes[e],r=this,s=new n.YJl;i.name&&(s.name=r.createUniqueName(i.name)),j(s,i),i.extensions&&W(t,s,i);let a=i.nodes||[],o=[];for(let e=0,t=a.length;e<t;e++)o.push(r.getDependency("node",a[e]));return Promise.all(o).then(function(e){for(let t=0,i=e.length;t<i;t++)s.add(e[t]);return r.associations=(e=>{let t=new Map;for(let[e,i]of r.associations)(e instanceof n.imn||e instanceof n.gPd)&&t.set(e,i);return e.traverse(e=>{let i=r.associations.get(e);null!=i&&t.set(e,i)}),t})(s),s})}_createAnimationTracks(e,t,i,r,s){let a,o=[],l=e.name?e.name:e.uuid,h=[];switch(V[s.path]===V.weights?e.traverse(function(e){e.morphTargetInfluences&&h.push(e.name?e.name:e.uuid)}):h.push(l),V[s.path]){case V.weights:a=n.Hit;break;case V.rotation:a=n.MBL;break;case V.translation:case V.scale:a=n.RiT;break;default:a=1===i.itemSize?n.Hit:n.RiT}let c=void 0!==r.interpolation?H[r.interpolation]:n.PJ3,u=this._getArrayFromAccessor(i);for(let e=0,i=h.length;e<i;e++){let i=new a(h[e]+"."+V[s.path],t.array,u,c);
1"CUBICSPLINE"===r.interpolation&&this._createCubicSplineTrackInterpolant(i),o.push(i)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let e=q(t.constructor),i=new Float32Array(t.length);for(let n=0,r=t.length;n<r;n++)i[n]=t[n]*e;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(e){return new(this instanceof n.MBL?N:L)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new a,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=-1,s=!1,o=-1;if("undefined"!=typeof navigator){let e=navigator.userAgent;i=!0===/^((?!chrome|android).)*safari/i.test(e);let t=e.match(/Version\/(\d+)/);r=i&&t?parseInt(t[1],10):-1,o=(s=e.indexOf("Firefox")>-1)?e.match(/Firefox\/([0-9]+)\./)[1]:-1}"undefined"==typeof createImageBitmap||i&&r<17||s&&o<98?this.textureLoader=new n.Tap(this.options.manager):this.textureLoader=new n.Kzg(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.Y9S(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}}function K(e,t,i){let r=t.attributes,s=[];for(let t in r){let n=k[t]||t.toLowerCase();n in e.attributes||s.push(function(t,n){return i.getDependency("accessor",t).then(function(t){e.setAttribute(n,t)})}(r[t],n))}if(void 0!==t.indices&&!e.index){let n=i.getDependency("accessor",t.indices).then(function(t){e.setIndex(t)});s.push(n)}return n.ppV.workingColorSpace!==n.Zr2&&"COLOR_0"in r,j(e,t),!function(e,t,i){let r=t.attributes,s=new n.NRn;if(void 0===r.POSITION)return;{let e=i.json.accessors[r.POSITION],t=e.min,a=e.max;if(void 0===t||void 0===a)return;if(s.set(new n.Pq0(t[0],t[1],t[2]),new n.Pq0(a[0],a[1],a[2])),e.normalized){let t=q(O[e.componentType]);s.min.multiplyScalar(t),s.max.multiplyScalar(t)}}let a=t.targets;if(void 0!==a){let e=new n.Pq0,t=new n.Pq0;for(let n=0,r=a.length;n<r;n++){let r=a[n];if(void 0!==r.POSITION){let n=i.json.accessors[r.POSITION],s=n.min,a=n.max;if(void 0!==s&&void 0!==a){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(a[2]))),n.normalized){let e=q(O[n.componentType]);t.multiplyScalar(e)}e.max(t)}}}s.expandByVector(e)}e.boundingBox=s;let o=new n.iyt;s.getCenter(o.center),o.radius=s.min.distanceTo(s.max)/2,e.boundingSphere=o}(e,t,i),Promise.all(s).then(function(){return void 0!==t.targets?function(e,t,i){let n=!1,r=!1,s=!1;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(void 0!==i.POSITION&&(n=!0),void 0!==i.NORMAL&&(r=!0),void 0!==i.COLOR_0&&(s=!0),n&&r&&s)break}if(!n&&!r&&!s)return Promise.resolve(e);let a=[],o=[],l=[];for(let h=0,c=t.length;h<c;h++){let c=t[h];if(n){let t=void 0!==c.POSITION?i.getDependency("accessor",c.POSITION):e.attributes.position;a.push(t)}if(r){let t=void 0!==c.NORMAL?i.getDependency("accessor",c.NORMAL):e.attributes.normal;o.push(t)}if(s){let t=void 0!==c.COLOR_0?i.getDependency("accessor",c.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then(function(t){let i=t[0],a=t[1],o=t[2];return n&&(e.morphAttributes.position=i),r&&(e.morphAttributes.normal=a),s&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e})}(e,t.targets,i):e})}},35060:(e,t,i)=>{i.r(t),i.d(t,{OBJLoader:()=>g});var n=i(27072);let r=/^[og]\s*(.+)?/,s=/^mtllib /,a=/^usemtl /,o=/^usemap /,l=/\s+/,h=new n.Pq0,c=new n.Pq0,u=new n.Pq0,d=new n.Pq0,p=new n.Pq0,f=new n.Q1f;function m(){let e={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&!1===this.object.fromDeclaration){this.object.name=e,this.object.fromDeclaration=!1!==t;return}let i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:!1!==t,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(e,t){let i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);let n={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){let t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){let t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let e=this.materials.length-1;e>=0;e--)this.materials[e].groupCount<=0&&this.materials.splice(e,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}}
1,i&&i.name&&"function"==typeof i.clone){let e=i.clone(0);e.inherited=!0,this.object.materials.push(e)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseNormalIndex:function(e,t){let i=parseInt(e,10);return(i>=0?i-1:i+t/3)*3},parseUVIndex:function(e,t){let i=parseInt(e,10);return(i>=0?i-1:i+t/2)*2},addVertex:function(e,t,i){let n=this.vertices,r=this.object.geometry.vertices;r.push(n[e+0],n[e+1],n[e+2]),r.push(n[t+0],n[t+1],n[t+2]),r.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,i){let n=this.normals,r=this.object.geometry.normals;r.push(n[e+0],n[e+1],n[e+2]),r.push(n[t+0],n[t+1],n[t+2]),r.push(n[i+0],n[i+1],n[i+2])},addFaceNormal:function(e,t,i){let n=this.vertices,r=this.object.geometry.normals;h.fromArray(n,e),c.fromArray(n,t),u.fromArray(n,i),p.subVectors(u,c),d.subVectors(h,c),p.cross(d),p.normalize(),r.push(p.x,p.y,p.z),r.push(p.x,p.y,p.z),r.push(p.x,p.y,p.z)},addColor:function(e,t,i){let n=this.colors,r=this.object.geometry.colors;void 0!==n[e]&&r.push(n[e+0],n[e+1],n[e+2]),void 0!==n[t]&&r.push(n[t+0],n[t+1],n[t+2]),void 0!==n[i]&&r.push(n[i+0],n[i+1],n[i+2])},addUV:function(e,t,i){let n=this.uvs,r=this.object.geometry.uvs;r.push(n[e+0],n[e+1]),r.push(n[t+0],n[t+1]),r.push(n[i+0],n[i+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,i,n,r,s,a,o,l){let h=this.vertices.length,c=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(i,h);if(this.addVertex(c,u,d),this.addColor(c,u,d),void 0!==a&&""!==a){let e=this.normals.length;c=this.parseNormalIndex(a,e),u=this.parseNormalIndex(o,e),d=this.parseNormalIndex(l,e),this.addNormal(c,u,d)}else this.addFaceNormal(c,u,d);if(void 0!==n&&""!==n){let e=this.uvs.length;c=this.parseUVIndex(n,e),u=this.parseUVIndex(r,e),d=this.parseUVIndex(s,e),this.addUV(c,u,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let i=0,n=e.length;i<n;i++){let n=this.parseVertexIndex(e[i],t);this.addVertexPoint(n),this.addColor(n)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let i=this.vertices.length,n=this.uvs.length;for(let t=0,n=e.length;t<n;t++)this.addVertexLine(this.parseVertexIndex(e[t],i));for(let e=0,i=t.length;e<i;e++)this.addUVLine(this.parseUVIndex(t[e],n))}};return e.startObject("",!1),e}class g extends n.aHM{load(e,t,i,r){let s=this,a=new n.Y9S(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){try{t(s.parse(i))}catch(t){r&&r(t),s.manager.itemError(e)}},i,r)}setMaterials(e){return this.materials=e,this}parse(e){let t=new m;-1!==e.indexOf("\r\n")&&(e=e.replace(/\r\n/g,"\n")),-1!==e.indexOf("\\\n")&&(e=e.replace(/\\\n/g,""));let i=e.split("\n"),h=[];for(let e=0,c=i.length;e<c;e++){let c=i[e].trimStart();if(0===c.length)continue;let u=c.charAt(0);if("#"!==u){if("v"===u){let e=c.split(l);switch(e[0]){case"v":t.vertices.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])),e.length>=7?(f.setRGB(parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),n.er$),t.colors.push(f.r,f.g,f.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]));break;case"vt":t.uvs.push(parseFloat(e[1]),parseFloat(e[2]))}}else if("f"===u){let e=c.slice(1).trim().split(l),i=[];for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n.length>0){let e=n.split("/");i.push(e)}}let n=i[0];for(let e=1,r=i.length-1;e<r;e++){let r=i[e],s=i[e+1];t.addFace(n[0],r[0],s[0],n[1],r[1],s[1],n[2],r[2],s[2])}}else if("l"===u){let e=c.substring(1).trim().split(" "),i=[],n=[];if(-1===c.indexOf("/"))i=e;else for(let t=0,r=e.length;t<r;t++){let r=e[t].split("/");""!==r[0]&&i.push(r[0]),""!==r[1]&&n.push(r[1])}t.addLineGeometry(i,n)}else if("p"===u){let e=c.slice(1).trim().split(" ");t.addPointGeometry(e)}else if(null!==(h=r.exec(c))){let e=(" "+h[0].slice(1).trim()).slice(1);t.startObject(e)}else if(a.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(s.test(c))t.materialLibraries.push(c.substring(7).trim());else if(o.test(c));else if("s"===u){if((h=c.split(" ")).length>1){let e=h[1].trim().toLowerCase();t.object.smooth="0"!==e&&"off"!==e}else t.object.smooth=!0;let e=t.object.currentMaterial();e&&(e.smooth=t.object.smooth)}else if("\0"===c)continue}}t.finalize();let c=new n.YJl;if(c.materialLibraries=[].concat(t.materialLibraries),!0==(1!==t.objects.length||0!==t.objects[0].geometry.vertices.length))for(let e=0,i=t.objects.length;e<i;e++){let i,r=t.objects[e],s=r.geometry,a=r.materials,o="Line"===s.type,l="Points"===s.type,h=!1;if(0===s.vertices.length)continue;let u=new n.LoY;u.setAttribute("position",new n.qtW(s.vertices,3)),s.normals.length>0&&u.setAttribute("normal",new n.qtW(s.normals,3)),s.colors.length>0&&(h=!0,u.setAttribute("color",new n.qtW(s.colors,3))),!0===s.hasUVIndices&&u.setAttribute("uv",new n.qtW(s.uvs,2));let d=[];for(let e=0,i=a.length;e<i;e++){let i=a[e],r=i.name+"_"+i.smooth+"_"+h,s=t.materials[r];if(null!==this.materials)if(s=this.materials.create(i.name),!o||!s||s instanceof n.mrM){if(l&&s&&!(s instanceof n.BH$)){let e=new n.BH$({size:10,sizeAttenuation:!1});n.imn.prototype.copy.call(e,s),e.color.copy(s.color),e.map=s.map,s=e}}else{let e=new n.mrM;n.imn.prototype.copy.call(e,s),e.color.copy(s.color),s=e}void 0===s&&((s=o?new n.mrM:l?new n.BH$({size:1,sizeAttenuation:!1}):new n.tXL).name=i.name,s.flatShading=!i.smooth,s.vertexColors=h,t.materials[r]=s),d.push(s)}if(d.length>1){for(let e=0,t=a.length;e<t;e++){let t=a[e];u.addGroup(t.groupStart,t.groupCount,e)}i=o?new n.DXC(u,d):l?new n.ONl(u,d):new n.eaF(u,d)}else i=o?new n.DXC(u,d[0]):l?new n.ONl(u,d[0]):new n.eaF(u,d[0]);i.name=r.name,c.add(i)}else if(t.vertices.length>0){let e=new n.BH$({size:1,sizeAttenuation:!1}),i=new n.LoY;i.setAttribute("position",new n.qtW(t.vertices,3)),t.colors.length>0&&void 0!==t.colors[0]&&(i.setAttribute("color",new n.qtW(t.colors,3)),e.vertexColors=!0);let r=new n.ONl(i,e);c.add(r)}return c}constructor(e){super(e),this.materials=null}}},49016:(e,t,i)=>{i.d(t,{r:()=>s});var n=i(27072);let r={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class s{register(e){return -1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return -1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}setTextureUtils(e){return this.textureUtils=e,this}parse(e,t,i,n){let r=new m,s=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)s.push(this.pluginCallbacks[e](r));r.setPlugins(s),r.setTextureUtils(this.textureUtils),r.writeAsync(e,t,n).catch(i)}parseAsync(e,t){let i=this;return new Promise(function(n,r){i.parse(e,n,r,t)})}constructor(){this.textureUtils=null,this.pluginCallbacks=[],this.register(function(e){return new g(e)}),this.register(function(e){return new v(e)}),this.register(function(e){return new M(e)}),this.register(function(e){return new S(e)}),this.register(function(e){return new b(e)}),this.register(function(e){return new T(e)}),this.register(function(e){return new _(e)}),this.register(function(e){return new x(e)}),this.register(function(e){return new y(e)}),this.register(function(e){return new w(e)}),this.register(function(e){return new E(e)}),this.register(function(e){return new A(e)}),this.register(function(e){return new R(e)}),this.register(function(e){return new C(e)})}}let a={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,
1UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},o="KHR_mesh_quantization",l={};l[n.hxR]=a.NEAREST,l[n.pHI]=a.NEAREST_MIPMAP_NEAREST,l[n.Cfg]=a.NEAREST_MIPMAP_LINEAR,l[n.k6q]=a.LINEAR,l[n.kRr]=a.LINEAR_MIPMAP_NEAREST,l[n.$_I]=a.LINEAR_MIPMAP_LINEAR,l[n.ghU]=a.CLAMP_TO_EDGE,l[n.GJx]=a.REPEAT,l[n.kTW]=a.MIRRORED_REPEAT;let h={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},c=new n.Q1f;function u(e,t){return e.length===t.length&&e.every(function(e,i){return e===t[i]})}function d(e){return 4*Math.ceil(e/4)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=d(e.byteLength);if(i!==e.byteLength){let n=new Uint8Array(i);if(n.set(new Uint8Array(e)),0!==t)for(let r=e.byteLength;r<i;r++)n[r]=t;return n.buffer}return e}function f(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}class m{setPlugins(e){this.plugins=e}setTextureUtils(e){this.textureUtils=e}async writeAsync(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},i),this.options.animations.length>0&&(this.options.trs=!0),await this.processInputAsync(e),await Promise.all(this.pending);let n=this.buffers,r=this.json;i=this.options;let s=this.extensionsUsed,a=this.extensionsRequired,o=new Blob(n,{type:"application/octet-stream"}),l=Object.keys(s),h=Object.keys(a);if(l.length>0&&(r.extensionsUsed=l),h.length>0&&(r.extensionsRequired=h),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=o.size),!0===i.binary){let e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){var i;let n=p(e.result),s=new DataView(new ArrayBuffer(8));s.setUint32(0,n.byteLength,!0),s.setUint32(4,5130562,!0);let a=p((i=JSON.stringify(r),new TextEncoder().encode(i).buffer),32),o=new DataView(new ArrayBuffer(8));o.setUint32(0,a.byteLength,!0),o.setUint32(4,0x4e4f534a,!0);let l=new ArrayBuffer(12),h=new DataView(l);h.setUint32(0,0x46546c67,!0),h.setUint32(4,2,!0);let c=12+o.byteLength+a.byteLength+s.byteLength+n.byteLength;h.setUint32(8,c,!0);let u=new Blob([l,o,a,s,n],{type:"application/octet-stream"}),d=new FileReader;d.readAsArrayBuffer(u),d.onloadend=function(){t(d.result)}}}else if(r.buffers&&r.buffers.length>0){let e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){let i=e.result;r.buffers[0].uri=i,t(r)}}else t(r)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;let i=this.options,n=this.extensionsUsed;try{let r=JSON.parse(JSON.stringify(e.userData));if(i.includeCustomExtensions&&r.gltfExtensions){for(let e in void 0===t.extensions&&(t.extensions={}),r.gltfExtensions)t.extensions[e]=r.gltfExtensions[e],n[e]=!0;delete r.gltfExtensions}Object.keys(r).length>0&&(t.extras=r)}catch(e){}}getUID(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===this.uids.has(e)){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new n.Pq0;for(let i=0,n=e.count;i<n;i++)if(Math.abs(t.fromBufferAttribute(e,i).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let i=e.clone(),r=new n.Pq0;for(let e=0,t=i.count;e<t;e++)r.fromBufferAttribute(i,e),0===r.x&&0===r.y&&0===r.z?r.setX(1):r.normalize(),i.setXYZ(e,r.x,r.y,r.z);return t.attributesNormalized.set(e,i),i}applyTextureTransform(e,t){let i=!1,n={};(0!==t.offset.x||0!==t.offset.y)&&(n.offset=t.offset.toArray(),i=!0),0!==t.rotation&&(n.rotation=t.rotation,i=!0),(1!==t.repeat.x||1!==t.repeat.y)&&(n.scale=t.repeat.toArray(),i=!0),i&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=n,this.extensionsUsed.KHR_texture_transform=!0)}async buildMetalRoughTextureAsync(e,t){if(e===t)return e;
1function i(e){return e.colorSpace===n.er$?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}e instanceof n.FvD&&(e=await this.decompressTextureAsync(e)),t instanceof n.FvD&&(t=await this.decompressTextureAsync(t));let r=e?e.image:null,s=t?t.image:null,a=Math.max(r?r.width:0,s?s.width:0),o=Math.max(r?r.height:0,s?s.height:0),l=f();l.width=a,l.height=o;let h=l.getContext("2d",{willReadFrequently:!0});h.fillStyle="#00ffff",h.fillRect(0,0,a,o);let c=h.getImageData(0,0,a,o);if(r){h.drawImage(r,0,0,a,o);let t=i(e),n=h.getImageData(0,0,a,o).data;for(let e=2;e<n.length;e+=4)c.data[e]=256*t(n[e]/256)}if(s){h.drawImage(s,0,0,a,o);let e=i(t),n=h.getImageData(0,0,a,o).data;for(let t=1;t<n.length;t+=4)c.data[t]=256*e(n[t]/256)}h.putImageData(c,0,0);let u=(e||t).clone();return u.source=new n.kLi(l),u.colorSpace=n.jf0,u.channel=(e||t).channel,e&&t&&e.channel!==t.channel,u}async decompressTextureAsync(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;if(null===this.textureUtils)throw Error("THREE.GLTFExporter: setTextureUtils() must be called to process compressed textures.");return await this.textureUtils.decompress(e,t)}processBuffer(e){let t=this.json,i=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),i.push(e),0}processBufferView(e,t,i,r,s){let o,l=this.json;switch(!l.bufferViews&&(l.bufferViews=[]),t){case a.BYTE:case a.UNSIGNED_BYTE:o=1;break;case a.SHORT:case a.UNSIGNED_SHORT:o=2;break;default:o=4}let h=e.itemSize*o;s===a.ARRAY_BUFFER&&(h=4*Math.ceil(h/4));let c=d(r*h),u=new DataView(new ArrayBuffer(c)),p=0;for(let s=i;s<i+r;s++){for(let i=0;i<e.itemSize;i++){let r;e.itemSize>4?r=e.array[s*e.itemSize+i]:(0===i?r=e.getX(s):1===i?r=e.getY(s):2===i?r=e.getZ(s):3===i&&(r=e.getW(s)),!0===e.normalized&&(r=n.cj9.normalize(r,e.array))),t===a.FLOAT?u.setFloat32(p,r,!0):t===a.INT?u.setInt32(p,r,!0):t===a.UNSIGNED_INT?u.setUint32(p,r,!0):t===a.SHORT?u.setInt16(p,r,!0):t===a.UNSIGNED_SHORT?u.setUint16(p,r,!0):t===a.BYTE?u.setInt8(p,r):t===a.UNSIGNED_BYTE&&u.setUint8(p,r),p+=o}p%h!=0&&(p+=h-p%h)}let f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:c};return void 0!==s&&(f.target=s),s===a.ARRAY_BUFFER&&(f.byteStride=h),this.byteOffset+=c,l.bufferViews.push(f),{id:l.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,i=t.json;return i.bufferViews||(i.bufferViews=[]),new Promise(function(n){let r=new FileReader;r.readAsArrayBuffer(e),r.onloadend=function(){let e=p(r.result),s={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,n(i.bufferViews.push(s)-1)}})}processAccessor(e,t,i,r){let s,o,l=this.json;if(e.array.constructor===Float32Array)s=a.FLOAT;else if(e.array.constructor===Int32Array)s=a.INT;else if(e.array.constructor===Uint32Array)s=a.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=a.SHORT;else if(e.array.constructor===Uint16Array)s=a.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=a.BYTE;else if(e.array.constructor===Uint8Array)s=a.UNSIGNED_BYTE;else throw Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(void 0===i&&(i=0),(void 0===r||r===1/0)&&(r=e.count),0===r)return null;let h=function(e,t,i){let r={min:Array(e.itemSize).fill(1/0),max:Array(e.itemSize).fill(-1/0)};for(let s=t;s<t+i;s++)for(let t=0;t<e.itemSize;t++){let i;e.itemSize>4?i=e.array[s*e.itemSize+t]:(0===t?i=e.getX(s):1===t?i=e.getY(s):2===t?i=e.getZ(s):3===t&&(i=e.getW(s)),!0===e.normalized&&(i=n.cj9.normalize(i,e.array))),r.min[t]=Math.min(r.min[t],i),r.max[t]=Math.max(r.max[t],i)}return r}(e,i,r);void 0!==t&&(o=e===t.index?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER);let c=this.processBufferView(e,s,i,r,o),u={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:r,max:h.max,min:h.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(u.normalized=!0),l.accessors||(l.accessors=[]),l.accessors.push(u)-1}processImage(e,t,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(null!==e){let t=this,s=t.cache,a=t.json,o=t.options,l=t.pending;s.images.has(e)||s.images.set(e,{});let h=s.images.get(e),c=r+":flipY/"+i.toString();if(void 0!==h[c])return h[c];a.images||(a.images=[]);let u={mimeType:r},d=f();d.width=Math.min(e.width,o.maxTextureSize),d.height=Math.min(e.height,o.maxTextureSize);let p=d.getContext("2d",{willReadFrequently:!0});if(!0===i&&(p.translate(0,d.height),p.scale(1,-1)),void 0!==e.data){n.GWd,e.width>o.maxTextureSize||(e.height,o.maxTextureSize);
1let t=new Uint8ClampedArray(e.height*e.width*4);for(let i=0;i<t.length;i+=4)t[i+0]=e.data[i+0],t[i+1]=e.data[i+1],t[i+2]=e.data[i+2],t[i+3]=e.data[i+3];p.putImageData(new ImageData(t,e.width,e.height),0,0)}else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)p.drawImage(e,0,0,d.width,d.height);else throw Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");!0===o.binary?l.push((function(e,t){if(!("undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas))return new Promise(i=>e.toBlob(i,t));{let i;return"image/jpeg"===t?i=.92:"image/webp"===t&&(i=.8),e.convertToBlob({type:t,quality:i})}})(d,r).then(e=>t.processBufferViewImage(e)).then(e=>{u.bufferView=e})):u.uri=n.HgN.getDataURL(d,r);let m=a.images.push(u)-1;return h[c]=m,m}throw Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let t=this.json;t.samplers||(t.samplers=[]);let i={magFilter:l[e.magFilter],minFilter:l[e.minFilter],wrapS:l[e.wrapS],wrapT:l[e.wrapT]};return t.samplers.push(i)-1}async processTextureAsync(e){let t=this.options,i=this.cache,r=this.json;if(i.textures.has(e))return i.textures.get(e);r.textures||(r.textures=[]),e instanceof n.FvD&&(e=await this.decompressTextureAsync(e,t.maxTextureSize));let s=e.userData.mimeType;"image/webp"===s&&(s="image/png");let a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,s)};e.name&&(a.name=e.name),await this._invokeAllAsync(async function(t){t.writeTexture&&await t.writeTexture(e,a)});let o=r.textures.push(a)-1;return i.textures.set(e,o),o}async processMaterialAsync(e){let t=this.cache,i=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return null;i.materials||(i.materials=[]);let r={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&e.isMeshBasicMaterial;let s=e.color.toArray().concat([e.opacity]);if(u(s,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=s),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=0,r.pbrMetallicRoughness.roughnessFactor=1),e.metalnessMap||e.roughnessMap){let t=await this.buildMetalRoughTextureAsync(e.metalnessMap,e.roughnessMap),i={index:await this.processTextureAsync(t),texCoord:t.channel};this.applyTextureTransform(i,t),r.pbrMetallicRoughness.metallicRoughnessTexture=i}if(e.map){let t={index:await this.processTextureAsync(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:await this.processTextureAsync(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:await this.processTextureAsync(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:await this.processTextureAsync(e.aoMap),texCoord:e.aoMap.channel};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode="BLEND":e.alphaTest>0&&(r.alphaMode="MASK",r.alphaCutoff=e.alphaTest),e.side===n.$EB&&(r.doubleSided=!0),""!==e.name&&(r.name=e.name),this.serializeUserData(e,r),await this._invokeAllAsync(async function(t){t.writeMaterialAsync&&await t.writeMaterialAsync(e,r)});let a=i.materials.push(r)-1;return t.materials.set(e,a),a}async processMeshAsync(e){let t,i=this.cache,r=this.json,o=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,i=e.material.length;t<i;t++)o.push(e.material[t].uuid);else o.push(e.material.uuid);let l=o.join(":");if(i.meshes.has(l))return i.meshes.get(l);let h=e.geometry;t=e.isLineSegments?a.LINES:e.isLineLoop?a.LINE_LOOP:e.isLine?a.LINE_STRIP:e.isPoints?a.POINTS:e.material.wireframe?a.LINES:a.TRIANGLES;let c={},u={},d=[],p=[],f={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},m=h.getAttribute("normal");void 0===m||this.isNormalizedNormalAttribute(m)||h.setAttribute("normal",this.createNormalizedNormalAttribute(m));let g=null;
1for(let e in h.attributes){if("morph"===e.slice(0,5))continue;let t=h.attributes[e];if(e=f[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),i.attributes.has(this.getUID(t))){u[e]=i.attributes.get(this.getUID(t));continue}g=null;let r=t.array;"JOINTS_0"!==e||r instanceof Uint16Array||r instanceof Uint8Array?(r instanceof Uint32Array||r instanceof Int32Array)&&!e.startsWith("_")&&(g=s.Utils.toFloat32BufferAttribute(t)):g=new n.THS(new Uint16Array(r),t.itemSize,t.normalized);let a=this.processAccessor(g||t,h);null!==a&&(e.startsWith("_")||this.detectMeshQuantization(e,t),u[e]=a,i.attributes.set(this.getUID(t),a))}if(void 0!==m&&h.setAttribute("normal",m),0===Object.keys(u).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){let t=[],n=[],r={};if(void 0!==e.morphTargetDictionary)for(let t in e.morphTargetDictionary)r[e.morphTargetDictionary[t]]=t;for(let s=0;s<e.morphTargetInfluences.length;++s){let a={},o=!1;for(let e in h.morphAttributes){if("position"!==e&&"normal"!==e){o||(o=!0);continue}let t=h.morphAttributes[e][s],n=e.toUpperCase(),r=h.attributes[e];if(i.attributes.has(this.getUID(t,!0))){a[n]=i.attributes.get(this.getUID(t,!0));continue}let l=t.clone();if(!h.morphTargetsRelative)for(let e=0,i=t.count;e<i;e++)for(let i=0;i<t.itemSize;i++)0===i&&l.setX(e,t.getX(e)-r.getX(e)),1===i&&l.setY(e,t.getY(e)-r.getY(e)),2===i&&l.setZ(e,t.getZ(e)-r.getZ(e)),3===i&&l.setW(e,t.getW(e)-r.getW(e));a[n]=this.processAccessor(l,h),i.attributes.set(this.getUID(r,!0),a[n])}p.push(a),t.push(e.morphTargetInfluences[s]),void 0!==e.morphTargetDictionary&&n.push(r[s])}c.weights=t,n.length>0&&(c.extras={},c.extras.targetNames=n)}let v=Array.isArray(e.material);if(v&&0===h.groups.length)return null;let _=!1;if(v&&null===h.index){let e=[];for(let t=0,i=h.attributes.position.count;t<i;t++)e[t]=t;h.setIndex(e),_=!0}let x=v?e.material:[e.material],y=v?h.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=y.length;e<n;e++){let n={mode:t,attributes:u};if(this.serializeUserData(h,n),p.length>0&&(n.targets=p),null!==h.index){let t=this.getUID(h.index);(void 0!==y[e].start||void 0!==y[e].count)&&(t+=":"+y[e].start+":"+y[e].count),i.attributes.has(t)?n.indices=i.attributes.get(t):(n.indices=this.processAccessor(h.index,h,y[e].start,y[e].count),i.attributes.set(t,n.indices)),null===n.indices&&delete n.indices}let r=await this.processMaterialAsync(x[y[e].materialIndex]);null!==r&&(n.material=r),d.push(n)}!0===_&&h.setIndex(null),c.primitives=d,r.meshes||(r.meshes=[]),await this._invokeAllAsync(function(t){t.writeMesh&&t.writeMesh(e,c)});let M=r.meshes.push(c)-1;return i.meshes.set(l,M),M}detectMeshQuantization(e,t){let i;if(this.extensionsUsed[o])return;switch(t.array.constructor){case Int8Array:i="byte";break;case Uint8Array:i="unsigned byte";break;case Int16Array:i="short";break;case Uint16Array:i="unsigned short";break;default:return}t.normalized&&(i+=" normalized");let n=e.split("_",1)[0];r[n]&&r[n].includes(i)&&(this.extensionsUsed[o]=!0,this.extensionsRequired[o]=!0)}processCamera(e){let t=this.json;t.cameras||(t.cameras=[]);let i=e.isOrthographicCamera,r={type:i?"orthographic":"perspective"};return i?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:n.cj9.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let i=this.json,r=this.nodeMap;i.animations||(i.animations=[]);let a=(e=s.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,o=[],l=[];for(let e=0;e<a.length;++e){let i,s=a[e],c=n.Nwf.parseTrackName(s.name),u=n.Nwf.findNode(t,c.nodeName),d=h[c.propertyName];if("bones"===c.objectName&&(u=!0===u.isSkinnedMesh?u.skeleton.getBoneByName(c.objectIndex):void 0),!u||!d)continue;let p=s.values.length/s.times.length;d===h.morphTargetInfluences&&(p/=u.morphTargetInfluences.length),!0===s.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(i="CUBICSPLINE",p/=3):i=s.getInterpolation()===n.ljd?"STEP":"LINEAR",l.push({input:this.processAccessor(new n.THS(s.times,1)),output:this.processAccessor(new n.THS(s.values,p)),interpolation:i}),o.push({sampler:l.length-1,target:{node:r.get(u),path:d}})}let c={name:e.name||"clip_"+i.animations.length,samplers:l,channels:o};return this.serializeUserData(e,c),i.animations.push(c),i.animations.length-1}
1processSkin(e){let t=this.json,i=this.nodeMap,r=t.nodes[i.get(e)],s=e.skeleton;if(void 0===s)return null;let a=e.skeleton.bones[0];if(void 0===a)return null;let o=[],l=new Float32Array(16*s.bones.length),h=new n.kn4;for(let t=0;t<s.bones.length;++t)o.push(i.get(s.bones[t])),h.copy(s.boneInverses[t]),h.multiply(e.bindMatrix).toArray(l,16*t);return void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new n.THS(l,16)),joints:o,skeleton:i.get(a)}),r.skin=t.skins.length-1}async processNodeAsync(e){let t=this.json,i=this.options,n=this.nodeMap;t.nodes||(t.nodes=[]);let r={};if(i.trs){let t=e.quaternion.toArray(),i=e.position.toArray(),n=e.scale.toArray();u(t,[0,0,0,1])||(r.rotation=t),u(i,[0,0,0])||(r.translation=i),u(n,[1,1,1])||(r.scale=n)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===u(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(r.matrix=e.matrix.elements);if(""!==e.name&&(r.name=String(e.name)),this.serializeUserData(e,r),e.isMesh||e.isLine||e.isPoints){let t=await this.processMeshAsync(e);null!==t&&(r.mesh=t)}else e.isCamera&&(r.camera=this.processCamera(e));e.isSkinnedMesh&&this.skins.push(e);let s=t.nodes.push(r)-1;if(n.set(e,s),e.children.length>0){let t=[];for(let n=0,r=e.children.length;n<r;n++){let r=e.children[n];if(r.visible||!1===i.onlyVisible){let e=await this.processNodeAsync(r);null!==e&&t.push(e)}}t.length>0&&(r.children=t)}return await this._invokeAllAsync(function(t){t.writeNode&&t.writeNode(e,r)}),s}async processSceneAsync(e){let t=this.json,i=this.options;t.scenes||(t.scenes=[],t.scene=0);let n={};""!==e.name&&(n.name=e.name),t.scenes.push(n);let r=[];for(let t=0,n=e.children.length;t<n;t++){let n=e.children[t];if(n.visible||!1===i.onlyVisible){let e=await this.processNodeAsync(n);null!==e&&r.push(e)}}r.length>0&&(n.nodes=r),this.serializeUserData(e,n)}async processObjectsAsync(e){let t=new n.Z58;t.name="AuxScene";for(let i=0;i<e.length;i++)t.children.push(e[i]);await this.processSceneAsync(t)}async processInputAsync(e){let t=this.options;e=e instanceof Array?e:[e],await this._invokeAllAsync(function(t){t.beforeParse&&t.beforeParse(e)});let i=[];for(let t=0;t<e.length;t++)e[t]instanceof n.Z58?await this.processSceneAsync(e[t]):i.push(e[t]);i.length>0&&await this.processObjectsAsync(i);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let i=0;i<t.animations.length;++i)this.processAnimation(t.animations[i],e[0]);await this._invokeAllAsync(function(t){t.afterParse&&t.afterParse(e)})}async _invokeAllAsync(e){for(let t=0,i=this.plugins.length;t<i;t++)await e(this.plugins[t])}constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter r"+n.sPf}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map},this.textureUtils=null}}class g{writeNode(e,t){if(!e.isLight||!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return;let i=this.writer,n=i.json,r=i.extensionsUsed,s={};e.name&&(s.name=e.name),s.color=e.color.toArray(),s.intensity=e.intensity,e.isDirectionalLight?s.type="directional":e.isPointLight?(s.type="point",e.distance>0&&(s.range=e.distance)):e.isSpotLight&&(s.type="spot",e.distance>0&&(s.range=e.distance),s.spot={},s.spot.innerConeAngle=(1-e.penumbra)*e.angle,s.spot.outerConeAngle=e.angle),void 0!==e.decay&&e.decay,e.target&&(e.target.parent!==e||0!==e.target.position.x||0!==e.target.position.y||e.target.position.z),r[this.name]||(n.extensions=n.extensions||{},n.extensions[this.name]={lights:[]},r[this.name]=!0);let a=n.extensions[this.name].lights;a.push(s),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}constructor(e){this.writer=e,this.name="KHR_lights_punctual"}}class v{async writeMaterialAsync(e,t){if(!e.isMeshBasicMaterial)return;let i=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},i[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}constructor(e){this.writer=e,this.name="KHR_materials_unlit"}}class _{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.clearcoat)return;let i=this.writer,n=i.extensionsUsed,r={};if(r.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:await i.processTextureAsync(e.clearcoatMap),texCoord:e.clearcoatMap.channel};i.applyTextureTransform(t,e.clearcoatMap),r.clearcoatTexture=t}if(r.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:await i.processTextureAsync(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};i.applyTextureTransform(t,e.clearcoatRoughnessMap),r.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:await i.processTextureAsync(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};1!==e.clearcoatNormalScale.x&&(t.scale=e.clearcoatNormalScale.x),i.applyTextureTransform(t,e.clearcoatNormalMap),r.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}}class x{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.dispersion)return;let i=this.writer.extensionsUsed,n={};n.dispersion=e.dispersion,t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_dispersion"}}class y{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.iridescence)return;let i=this.writer,n=i.extensionsUsed,r={};if(r.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:await i.processTextureAsync(e.iridescenceMap),texCoord:e.iridescenceMap.channel};i.applyTextureTransform(t,e.iridescenceMap),r.iridescenceTexture=t}if(r.iridescenceIor=e.iridescenceIOR,r.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],r.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:await i.processTextureAsync(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};i.applyTextureTransform(t,e.iridescenceThicknessMap),r.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}}class M{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,n=i.extensionsUsed,r={};if(r.transmissionFactor=e.transmission,e.transmissionMap){let t={index:await i.processTextureAsync(e.transmissionMap),texCoord:e.transmissionMap.channel};i.applyTextureTransform(t,e.transmissionMap),r.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_transmission"}}class S{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;let i=this.writer,n=i.extensionsUsed,r={};if(r.thicknessFactor=e.thickness,e.thicknessMap){let t={index:await i.processTextureAsync(e.thicknessMap),texCoord:e.thicknessMap.channel};i.applyTextureTransform(t,e.thicknessMap),r.thicknessTexture=t}e.attenuationDistance!==1/0&&(r.attenuationDistance=e.attenuationDistance),r.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_volume"}}class b{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||1.5===e.ior)return;let i=this.writer.extensionsUsed,n={};n.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_ior"}}class T{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||1===e.specularIntensity&&e.specularColor.equals(c)&&!e.specularIntensityMap&&!e.specularColorMap)return;let i=this.writer,n=i.extensionsUsed,r={};if(e.specularIntensityMap){let t={index:await i.processTextureAsync(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};i.applyTextureTransform(t,e.specularIntensityMap),r.specularTexture=t}if(e.specularColorMap){let t={index:await i.processTextureAsync(e.specularColorMap),texCoord:e.specularColorMap.channel};i.applyTextureTransform(t,e.specularColorMap),r.specularColorTexture=t}r.specularFactor=e.specularIntensity,r.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_specular"}}class w{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0==e.sheen)return;let i=this.writer,n=i.extensionsUsed,r={};if(e.sheenRoughnessMap){let t={index:await i.processTextureAsync(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};i.applyTextureTransform(t,e.sheenRoughnessMap),r.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:await i.processTextureAsync(e.sheenColorMap),texCoord:e.sheenColorMap.channel};i.applyTextureTransform(t,e.sheenColorMap),r.sheenColorTexture=t}r.sheenRoughnessFactor=e.sheenRoughness,r.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_sheen"}}class E{async writeMaterialAsync(e,t){if(!e.isMeshPhysicalMaterial||0==e.anisotropy)return;let i=this.writer,n=i.extensionsUsed,r={};if(e.anisotropyMap){let t={index:await i.processTextureAsync(e.anisotropyMap)};i.applyTextureTransform(t,e.anisotropyMap),r.anisotropyTexture=t}r.anisotropyStrength=e.anisotropy,r.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}}class A{async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||1===e.emissiveIntensity)return;let i=this.writer.extensionsUsed,n={};n.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=n,i[this.name]=!0}constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}}class R{async writeMaterialAsync(e,t){if(!e.isMeshStandardMaterial||1===e.bumpScale&&!e.bumpMap)return;let i=this.writer,n=i.extensionsUsed,r={};if(e.bumpMap){let t={index:await i.processTextureAsync(e.bumpMap),texCoord:e.bumpMap.channel};i.applyTextureTransform(t,e.bumpMap),r.bumpTexture=t}r.bumpFactor=e.bumpScale,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}constructor(e){this.writer=e,this.name="EXT_materials_bump"}}class C{writeNode(e,t){if(!e.isInstancedMesh)return;let i=this.writer,r=new Float32Array(3*e.count),s=new Float32Array(4*e.count),a=new Float32Array(3*e.count),o=new n.kn4,l=new n.Pq0,h=new n.PTz,c=new n.Pq0;for(let t=0;t<e.count;t++)e.getMatrixAt(t,o),o.decompose(l,h,c),l.toArray(r,3*t),h.toArray(s,4*t),c.toArray(a,3*t);let u={TRANSLATION:i.processAccessor(new n.THS(r,3)),ROTATION:i.processAccessor(new n.THS(s,4)),SCALE:i.processAccessor(new n.THS(a,3))};e.instanceColor&&(u._COLOR_0=i.processAccessor(e.instanceColor)),t.extensions=t.extensions||{},t.extensions[this.name]={attributes:u},i.extensionsUsed[this.name]=!0,i.extensionsRequired[this.name]=!0}constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}}s.Utils={insertKeyframe:function(e,t){let i,n=e.getValueSize(),r=new e.TimeBufferType(e.times.length+1),s=new e.ValueBufferType(e.values.length+n),a=e.createInterpolant(new e.ValueBufferType(n));if(0===e.times.length){r[0]=t;for(let e=0;e<n;e++)s[e]=0;i=0}
1else if(t<e.times[0]){if(.001>Math.abs(e.times[0]-t))return 0;r[0]=t,r.set(e.times,1),s.set(a.evaluate(t),0),s.set(e.values,n),i=0}else if(t>e.times[e.times.length-1]){if(.001>Math.abs(e.times[e.times.length-1]-t))return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),s.set(e.values,0),s.set(a.evaluate(t),e.values.length),i=r.length-1}else for(let o=0;o<e.times.length;o++){if(.001>Math.abs(e.times[o]-t))return o;if(e.times[o]<t&&e.times[o+1]>t){r.set(e.times.slice(0,o+1),0),r[o+1]=t,r.set(e.times.slice(o+1),o+2),s.set(e.values.slice(0,(o+1)*n),0),s.set(a.evaluate(t),(o+1)*n),s.set(e.values.slice((o+1)*n),(o+2)*n),i=o+1;break}}return e.times=r,e.values=s,i},mergeMorphTargetTracks:function(e,t){let i=[],r={},s=e.tracks;for(let e=0;e<s.length;++e){let a,o=s[e],l=n.Nwf.parseTrackName(o.name),h=n.Nwf.findNode(t,l.nodeName);if("morphTargetInfluences"!==l.propertyName||void 0===l.propertyIndex){i.push(o);continue}if(o.createInterpolant!==o.InterpolantFactoryMethodDiscrete&&o.createInterpolant!==o.InterpolantFactoryMethodLinear){if(o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");(o=o.clone()).setInterpolation(n.PJ3)}let c=h.morphTargetInfluences.length,u=h.morphTargetDictionary[l.propertyIndex];if(void 0===u)throw Error("THREE.GLTFExporter: Morph target name not found: "+l.propertyIndex);if(void 0===r[h.uuid]){let e=new(a=o.clone()).ValueBufferType(c*a.times.length);for(let t=0;t<a.times.length;t++)e[t*c+u]=a.values[t];a.name=(l.nodeName||"")+".morphTargetInfluences",a.values=e,r[h.uuid]=a,i.push(a);continue}let d=o.createInterpolant(new o.ValueBufferType(1));a=r[h.uuid];for(let e=0;e<a.times.length;e++)a.values[e*c+u]=d.evaluate(a.times[e]);for(let e=0;e<o.times.length;e++){let t=this.insertKeyframe(a,o.times[e]);a.values[t*c+u]=o.values[e]}}return e.tracks=i,e},toFloat32BufferAttribute:function(e){let t=new n.THS(new Float32Array(e.count*e.itemSize),e.itemSize,!1);if(!e.normalized&&!e.isInterleavedBufferAttribute)return t.array.set(e.array),t;for(let i=0,n=e.count;i<n;i++)for(let n=0;n<e.itemSize;n++)t.setComponent(i,n,e.getComponent(i,n));return t}}},53675:(e,t,i)=>{i.d(t,{OH:()=>E});var n=i(17246),r=i(93154),s=i(10892),a=i(27072),o=i(24325),l=i(58256),h=i(85398),c=i(95269);let u={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},d="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",p=e=>Array.isArray(e),f=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"];function m(){let{files:e=f,path:t="",preset:i,colorSpace:n,extensions:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i&&(_(i),e=u[i],t=d);let l=p(e),{extension:h,isCubemap:c}=x(e),m=y(h);if(!m)throw Error("useEnvironment: Unrecognized file extension: "+e);let g=(0,s.C)(e=>e.gl);(0,r.useLayoutEffect)(()=>{("webp"===h||"jpg"===h||"jpeg"===h)&&g.domElement.addEventListener("webglcontextlost",function(){s.G.clear(m,l?[e]:e)},{once:!0})},[e,g.domElement]);let v=(0,s.G)(m,l?[e]:e,e=>{("webp"===h||"jpg"===h||"jpeg"===h)&&e.setRenderer(g),null==e.setPath||e.setPath(t),o&&o(e)}),M=l?v[0]:v;if("jpg"===h||"jpeg"===h||"webp"===h){var S;M=null==(S=M.renderTarget)?void 0:S.texture}return M.mapping=c?a.hy7:a.wfO,M.colorSpace=null!=n?n:c?"srgb":"srgb-linear",M}let g={files:f,path:"",preset:void 0,extensions:void 0};m.preload=e=>{let t={...g,...e},{files:i,path:n=""}=t,{preset:r,extensions:a}=t;r&&(_(r),i=u[r],n=d);let{extension:o}=x(i);if("webp"===o||"jpg"===o||"jpeg"===o)throw Error("useEnvironment: Preloading gainmaps is not supported");let l=y(o);if(!l)throw Error("useEnvironment: Unrecognized file extension: "+i);s.G.preload(l,p(i)?[i]:i,e=>{null==e.setPath||e.setPath(n),a&&a(e)})};let v={files:f,preset:void 0};function _(e){if(!(e in u))throw Error("Preset must be one of: "+Object.keys(u).join(", "))}function x(e){var t;let i=p(e)&&6===e.length,n=p(e)&&3===e.length&&e.some(e=>e.endsWith("json")),r=p(e)?e[0]:e;return{extension:i?"cube":n?"webp":r.startsWith("data:application/exr")?"exr":r.startsWith("data:application/hdr")?"hdr":r.startsWith("data:image/jpeg")?"jpg":null==(t=r.split(".").pop())||null==(t=t.split("?"))||null==(t=t.shift())?void 0:t.toLowerCase(),isCubemap:i,isGainmap:n}}function y(e){return"cube"===e?a.ScU:"hdr"===e?l.Y:"exr"===e?h.H:"jpg"===e||"jpeg"===e?c.pb:"webp"===e?c.j:null}function M(e,t,i,n){var r,a,o,l;let h,c,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};u={backgroundBlurriness:0,backgroundIntensity:1,backgroundRotation:[0,0,0],environmentIntensity:1,environmentRotation:[0,0,0],...u};let d=(c=h=t||i).current&&c.current.isScene?h.current:h,p=d.background,f=d.environment,m={backgroundBlurriness:d.backgroundBlurriness,backgroundIntensity:d.backgroundIntensity,backgroundRotation:null!=(r=null==(a=d.backgroundRotation)||null==a.clone?void 0:a.clone())?r:[0,0,0],environmentIntensity:d.environmentIntensity,environmentRotation:null!=(o=null==(l=d.environmentRotation)||null==l.clone?void 0:l.clone())?o:[0,0,0]};return"only"!==e&&(d.environment=n),e&&(d.background=n),(0,s.s)(d,u),()=>{"only"!==e&&(d.environment=f),e&&(d.background=p),(0,s.s)(d,m)}}function S(e){let{scene:t,background:i=!1,map:n,...a}=e,o=(0,s.C)(e=>e.scene);return r.useLayoutEffect(()=>{if(n)return M(i,t,o,n,a)}),null}function b(e){let{background:t=!1,scene:i,blur:n,backgroundBlurriness:a,backgroundIntensity:o,backgroundRotation:l,environmentIntensity:h,environmentRotation:c,...u}=e,d=m(u),p=(0,s.C)(e=>e.scene);return r.useLayoutEffect(()=>M(t,i,p,d,{backgroundBlurriness:null!=n?n:a,backgroundIntensity:o,backgroundRotation:l,environmentIntensity:h,environmentRotation:c})),r.useEffect(()=>()=>{d.dispose()},[d]),null}function T(e){let{children:t,near:i=.1,far:n=1e3,resolution:o=256,frames:l=1,map:h,background:c=!1,blur:u,backgroundBlurriness:d,backgroundIntensity:p,backgroundRotation:f,environmentIntensity:m,environmentRotation:g,scene:v,files:_,path:x,preset:y,extensions:T}=e,w=(0,s.C)(e=>e.gl),E=(0,s.C)(e=>e.scene),A=r.useRef(null),[R]=r.useState(()=>new a.Z58),C=r.useMemo(()=>{let e=new a.o6l(o);return e.texture.type=a.ix0,e},[o]);r.useEffect(()=>()=>{C.dispose()},[C]),r.useLayoutEffect(()=>{if(1===l){let e=w.autoClear;w.autoClear=!0,A.current.update(w,R),w.autoClear=e}return M(c,v,E,C.texture,{backgroundBlurriness:null!=u?u:d,backgroundIntensity:p,backgroundRotation:f,environmentIntensity:m,environmentRotation:g})},[t,R,C.texture,v,E,c,l,w]);let I=1;return(0,s.D)(()=>
1{if(l===1/0||I<l){let e=w.autoClear;w.autoClear=!0,A.current.update(w,R),w.autoClear=e,I++}}),r.createElement(r.Fragment,null,(0,s.o)(r.createElement(r.Fragment,null,t,r.createElement("cubeCamera",{ref:A,args:[i,n,C]}),_||y?r.createElement(b,{background:!0,files:_,preset:y,path:x,extensions:T}):h?r.createElement(S,{background:!0,map:h,extensions:T}):null),R))}function w(e){var t,i,a,l;let h=m(e),c=e.map||h;r.useMemo(()=>(0,s.e)({GroundProjectedEnvImpl:o.L}),[]),r.useEffect(()=>()=>{h.dispose()},[h]);let u=r.useMemo(()=>[c],[c]),d=null==(t=e.ground)?void 0:t.height,p=null==(i=e.ground)?void 0:i.radius,f=null!=(a=null==(l=e.ground)?void 0:l.scale)?a:1e3;return r.createElement(r.Fragment,null,r.createElement(S,(0,n.A)({},e,{map:c})),r.createElement("groundProjectedEnvImpl",{args:u,scale:f,height:d,radius:p}))}function E(e){return e.ground?r.createElement(w,e):e.map?r.createElement(S,e):e.children?r.createElement(T,e):r.createElement(b,e)}m.clear=e=>{let t={...v,...e},{files:i}=t,{preset:n}=t;n&&(_(n),i=u[n]);let{extension:r}=x(i),a=y(r);if(!a)throw Error("useEnvironment: Unrecognized file extension: "+i);s.G.clear(a,p(i)?[i]:i)}},53930:(e,t,i)=>{i.d(t,{Z:()=>s});var n=i(27072);let r=new n.Q1f;class s extends n.aHM{load(e,t,i,r){let s=this,a=new n.Y9S(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(i){try{t(s.parse(i))}catch(t){r&&r(t),s.manager.itemError(e)}},i,r)}setPropertyNameMapping(e){this.propertyNameMapping=e}setCustomPropertyNameMapping(e){this.customPropertyMapping=e}parse(e){let t;function i(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="",r=/^ply([\s\S]*)end_header(\r\n|\r|\n)/.exec(e);null!==r&&(n=r[1]);let s={comments:[],elements:[],headerLength:i,objInfo:""},a=n.split(/\r\n|\r|\n/);for(let e=0;e<a.length;e++){let i=a[e];if(""===(i=i.trim()))continue;let n=i.split(/\s+/),r=n.shift();switch(i=n.join(" "),r){case"format":s.format=n[0],s.version=n[1];break;case"comment":s.comments.push(i);break;case"element":void 0!==t&&s.elements.push(t),(t={}).name=n[0],t.count=parseInt(n[1]),t.properties=[];break;case"property":t.properties.push(function(e,t){let i={type:e[0]};return"list"===i.type?(i.name=e[3],i.countType=e[1],i.itemType=e[2]):i.name=e[1],i.name in t&&(i.name=t[i.name]),i}(n,d.propertyNameMapping));break;case"obj_info":s.objInfo=i}}return void 0!==t&&s.elements.push(t),s}function s(e,t){switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(e);case"float":case"double":case"float32":case"float64":return parseFloat(e)}}function o(){let e={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[],faceVertexColors:[]};for(let t of Object.keys(d.customPropertyMapping))e[t]=[];return e}function l(e){let t=e.map(e=>e.name);function i(e){for(let i=0,n=e.length;i<n;i++){let n=e[i];if(t.includes(n))return n}return null}return{attrX:i(["x","px","posx"])||"x",attrY:i(["y","py","posy"])||"y",attrZ:i(["z","pz","posz"])||"z",attrNX:i(["nx","normalx"]),attrNY:i(["ny","normaly"]),attrNZ:i(["nz","normalz"]),attrS:i(["s","u","texture_u","tx"]),attrT:i(["t","v","texture_v","ty"]),attrR:i(["red","diffuse_red","r","diffuse_r"]),attrG:i(["green","diffuse_green","g","diffuse_g"]),attrB:i(["blue","diffuse_blue","b","diffuse_b"])}}function h(e,t){let i,n=o(),r=new a(null!==(i=/end_header\s+(\S[\s\S]*\S|\S)\s*$/.exec(e))?i[1].split(/\s+/):[]);s:for(let e=0;e<t.elements.length;e++){let i=t.elements[e],a=l(i.properties);for(let e=0;e<i.count;e++){let e=function(e,t){let i={};for(let n=0;n<e.length;n++){if(t.empty())return null;if("list"===e[n].type){let r=[],a=s(t.next(),e[n].countType);for(let i=0;i<a;i++){if(t.empty())return null;r.push(s(t.next(),e[n].itemType))}i[e[n].name]=r}else i[e[n].name]=s(t.next(),e[n].type)}return i}(i.properties,r);if(!e)break s;u(n,i.name,e,a)}}return c(n)}function c(e){let t=new n.LoY;for(let i of(e.indices.length>0&&t.setIndex(e.indices),t.setAttribute("position",new n.qtW(e.vertices,3)),e.normals.length>0&&t.setAttribute("normal",new n.qtW(e.normals,3)),e.uvs.length>0&&t.setAttribute("uv",new n.qtW(e.uvs,2)),e.colors.length>0&&t.setAttribute("color",new n.qtW(e.colors,3)),(e.faceVertexUvs.length>0||e.faceVertexColors.length>0)&&(t=t.toNonIndexed(),e.faceVertexUvs.length>0&&t.setAttribute("uv",new n.qtW(e.faceVertexUvs,2)),e.faceVertexColors.length>0&&t.setAttribute("color",new n.qtW(e.faceVertexColors,3))),Object.keys(d.customPropertyMapping)))e[i].length>0&&t.setAttribute(i,new n.qtW(e[i],d.customPropertyMapping[i].length));return t.computeBoundingSphere(),t}function u(e,t,i,s){if("vertex"===t)for(let t of(e.vertices.push(i[s.attrX],i[s.attrY],i[s.attrZ]),null!==s.attrNX&&null!==s.attrNY&&null!==s.attrNZ&&e.normals.push(i[s.attrNX],i[s.attrNY],i[s.attrNZ]),null!==s.attrS&&null!==s.attrT&&e.uvs.push(i[s.attrS],i[s.attrT]),null!==s.attrR&&null!==s.attrG&&null!==s.attrB&&(r.setRGB(i[s.attrR]/255,i[s.attrG]/255,i[s.attrB]/255,n.er$),e.colors.push(r.r,r.g,r.b)),Ob
1ject.keys(d.customPropertyMapping)))for(let n of d.customPropertyMapping[t])e[t].push(i[n]);else if("face"===t){let t=i.vertex_indices||i.vertex_index,a=i.texcoord;3===t.length?(e.indices.push(t[0],t[1],t[2]),a&&6===a.length&&(e.faceVertexUvs.push(a[0],a[1]),e.faceVertexUvs.push(a[2],a[3]),e.faceVertexUvs.push(a[4],a[5]))):4===t.length&&(e.indices.push(t[0],t[1],t[3]),e.indices.push(t[1],t[2],t[3])),null!==s.attrR&&null!==s.attrG&&null!==s.attrB&&(r.setRGB(i[s.attrR]/255,i[s.attrG]/255,i[s.attrB]/255,n.er$),e.faceVertexColors.push(r.r,r.g,r.b),e.faceVertexColors.push(r.r,r.g,r.b),e.faceVertexColors.push(r.r,r.g,r.b))}}let d=this;if(e instanceof ArrayBuffer){let n=new Uint8Array(e),{headerText:r,headerLength:s}=function(e){let t=0,i=!0,n="",r=[],s=new TextDecoder().decode(e.subarray(0,5)),a=/^ply\r\n/.test(s);do{let s=String.fromCharCode(e[t++]);"\n"!==s&&"\r"!==s?n+=s:("end_header"===n&&(i=!1),""!==n&&(r.push(n),n=""))}while(i&&t<e.length);return!0===a&&t++,{headerText:r.join("\r")+"\r",headerLength:t}}(n),a=i(r,s);t="ascii"===a.format?h(new TextDecoder().decode(n),a):function(e,t){let i=o(),n="binary_little_endian"===t.format,r=new DataView(e,t.headerLength),s,a=0;for(let e=0;e<t.elements.length;e++){let o=t.elements[e],c=o.properties,d=l(c);function h(e,t,i){switch(t){case"int8":case"char":return{read:t=>e.getInt8(t),size:1};case"uint8":case"uchar":return{read:t=>e.getUint8(t),size:1};case"int16":case"short":return{read:t=>e.getInt16(t,i),size:2};case"uint16":case"ushort":return{read:t=>e.getUint16(t,i),size:2};case"int32":case"int":return{read:t=>e.getInt32(t,i),size:4};case"uint32":case"uint":return{read:t=>e.getUint32(t,i),size:4};case"float32":case"float":return{read:t=>e.getFloat32(t,i),size:4};case"float64":case"double":return{read:t=>e.getFloat64(t,i),size:8}}}for(let e=0,t=c.length;e<t;e++){let t=c[e];"list"===t.type?(t.countReader=h(r,t.countType,n),t.valueReader=h(r,t.itemType,n)):t.valueReader=h(r,t.type,n)}for(let e=0;e<o.count;e++){s=function(e,t){let i={},n=0;for(let r=0;r<t.length;r++){let s=t[r],a=s.valueReader;if("list"===s.type){let t=[],r=s.countReader.read(e+n);n+=s.countReader.size;for(let i=0;i<r;i++)t.push(a.read(e+n)),n+=a.size;i[s.name]=t}else i[s.name]=a.read(e+n),n+=a.size}return[i,n]}(a,c),a+=s[1];let e=s[0];u(i,o.name,e,d)}}return c(i)}(e,a)}else t=h(e,i(e));return t}constructor(e){super(e),this.propertyNameMapping={},this.customPropertyMapping={}}}class a{empty(){return this.i>=this.arr.length}next(){return this.arr[this.i++]}constructor(e){this.arr=e,this.i=0}}},62342:(e,t,i)=>{i.d(t,{Z:()=>s});var n=i(27072);let r=new WeakMap;class s extends n.aHM{setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){let s=new n.Y9S(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,e=>{this.parse(e,t,r)},i,r)}parse(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};this.decodeDracoFile(e,t,null,null,n.er$,i).catch(i)}decodeDracoFile(e,t,i,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.Zr2,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:()=>{},o={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i,vertexColorSpace:s};return this.decodeGeometry(e,o).then(t).catch(a)}decodeGeometry(e,t){let i,n=JSON.stringify(t);if(r.has(e)){let t=r.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s=this.workerNextTaskID++,a=e.byteLength,o=this._getWorker(s,a).then(n=>(i=n,new Promise((n,r)=>{i._callbacks[s]={resolve:n,reject:r},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return o.catch(()=>!0).then(()=>{i&&s&&this._releaseTask(i,s)}),r.set(e,{key:n,promise:o}),o}_createGeometry(e){let t=new n.LoY;e.index&&t.setIndex(new n.THS(e.index.array,1));for(let i=0;i<e.attributes.length;i++){let r=e.attributes[i],s=r.name,a=r.array,o=r.itemSize,l=new n.THS(a,o);"color"===s&&(this._assignVertexColorSpace(l,r.vertexColorSpace),l.normalized=a instanceof Float32Array==!1),t.setAttribute(s,l)}return t}_assignVertexColorSpace(e,t){if(t!==n.er$)return;let i=new n.Q1f;for(let t=0,r=e.count;t<r;t++)i.fromBufferAttribute(e,t),n.ppV.colorSpaceToWorking(i,n.er$),e.setXYZ(t,i.r,i.g,i.b)}_loadLibrary(e,t){let i=new n.Y9S(this.manager);return i.setPath(this.decoderPath),i.setResponseType(t),i.setWithCredentials(this.withCredentials),new Promise((t,n)=>{i.load(e,t,void 0,n)})}preload(){return this._initDecoder(),this}
1_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let i=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let n=a.toString(),r=["/* draco decoder */",i,"\n/* worker */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([r]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){let i=t.data;switch(i.type){case"decode":e._callbacks[i.id].resolve(i);break;case"error":e._callbacks[i.id].reject(i)}},this.workerPool.push(e)}else this.workerPool.sort(function(e,t){return e._taskLoad>t._taskLoad?-1:1});let i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}}function a(){let e,t;onmessage=function(i){let n=i.data;switch(n.type){case"init":e=n.decoderConfig,t=new Promise(function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)});break;case"decode":let r=n.buffer,s=n.taskConfig;t.then(e=>{let t=e.draco,i=new t.Decoder;try{let e=function(e,t,i,n){let r,s,a=n.attributeIDs,o=n.attributeTypes,l=t.GetEncodedGeometryType(i);if(l===e.TRIANGULAR_MESH)r=new e.Mesh,s=t.DecodeArrayToMesh(i,i.byteLength,r);else if(l===e.POINT_CLOUD)r=new e.PointCloud,s=t.DecodeArrayToPointCloud(i,i.byteLength,r);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!s.ok()||0===r.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());let h={index:null,attributes:[]};for(let i in a){let s,l,c=self[o[i]];if(n.useUniqueIDs)l=a[i],s=t.GetAttributeByUniqueId(r,l);else{if(-1===(l=t.GetAttributeId(r,e[a[i]])))continue;s=t.GetAttribute(r,l)}let u=function(e,t,i,n,r,s){let a=s.num_components(),o=i.num_points()*a,l=o*r.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,r),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(i,s,h,l,c);let u=new r(e.HEAPF32.buffer,c,o).slice();return e._free(c),{name:n,array:u,itemSize:a}}(e,t,r,i,c,s);"color"===i&&(u.vertexColorSpace=n.vertexColorSpace),h.attributes.push(u)}return l===e.TRIANGULAR_MESH&&(h.index=function(e,t,i){let n=3*i.num_faces(),r=4*n,s=e._malloc(r);t.GetTrianglesUInt32Array(i,r,s);let a=new Uint32Array(e.HEAPF32.buffer,s,n).slice();return e._free(s),{array:a,itemSize:1}}(e,t,r)),e.destroy(r),h}(t,i,new Int8Array(r),s),a=e.attributes.map(e=>e.array.buffer);e.index&&a.push(e.index.array.buffer),self.postMessage({type:"decode",id:n.id,geometry:e},a)}catch(e){self.postMessage({type:"error",id:n.id,error:e.message})}finally{t.destroy(i)}})}}}},64143:(e,t,i)=>{i.d(t,{f:()=>a});var n=i(93154),r=i(27072),s=i(10892);function a(e,t){let i=n.useRef(null),[a]=n.useState(()=>t?t instanceof r.B69?{current:t}:t:i),[o]=n.useState(()=>new r.Iw4(void 0));n.useLayoutEffect(()=>{t&&(a.current=t instanceof r.B69?t:t.current),o._root=a.current});let l=n.useRef({}),h=n.useMemo(()=>{let t={};
1return e.forEach(e=>Object.defineProperty(t,e.name,{enumerable:!0,get(){if(a.current)return l.current[e.name]||(l.current[e.name]=o.clipAction(e,a.current))},configurable:!0})),{ref:a,clips:e,actions:t,names:e.map(e=>e.name),mixer:o}},[e]);return(0,s.D)((e,t)=>o.update(t)),n.useEffect(()=>{let e=a.current;return()=>{l.current={},o.stopAllAction(),Object.values(h.actions).forEach(t=>{e&&o.uncacheAction(t,e)})}},[e]),h}},78999:(e,t,i)=>{i.r(t),i.d(t,{ACESFilmicToneMapping:()=>n.FV,AddEquation:()=>n.gO9,AddOperation:()=>n.XrR,AdditiveAnimationBlendMode:()=>n.DAe,AdditiveBlending:()=>n.EZo,AgXToneMapping:()=>n.LAk,AlphaFormat:()=>n.wrO,AlwaysCompare:()=>n.FFZ,AlwaysDepth:()=>n.lGu,AlwaysStencilFunc:()=>n.sKt,AmbientLight:()=>n.$p8,AnimationAction:()=>n.pPE,AnimationClip:()=>n.tz3,AnimationLoader:()=>n.kEx,AnimationMixer:()=>n.Iw4,AnimationObjectGroup:()=>n.P5j,AnimationUtils:()=>n.AKb,ArcCurve:()=>n.ibB,ArrayCamera:()=>n.nZQ,ArrowHelper:()=>n.E0M,AttachedBindMode:()=>n.BER,Audio:()=>n.fP5,AudioAnalyser:()=>n.CwR,AudioContext:()=>n.UtX,AudioListener:()=>n.Pf$,AudioLoader:()=>n.Am1,AxesHelper:()=>n.IzY,BackSide:()=>n.hsX,BasicDepthPacking:()=>n.Rkk,BasicShadowMap:()=>n.bTm,BatchedMesh:()=>n.$Ed,Bone:()=>n.$Kf,BooleanKeyframeTrack:()=>n.YOZ,Box2:()=>n.UtB,Box3:()=>n.NRn,Box3Helper:()=>n.BND,BoxGeometry:()=>n.iNn,BoxHelper:()=>n.IWo,BufferAttribute:()=>n.THS,BufferGeometry:()=>n.LoY,BufferGeometryLoader:()=>n.SUR,ByteType:()=>n.tJf,Cache:()=>n.l2R,Camera:()=>n.i7d,CameraHelper:()=>n.WTh,CanvasTexture:()=>n.GOR,CapsuleGeometry:()=>n.qU7,CatmullRomCurve3:()=>n.B6O,CineonToneMapping:()=>n.nNL,CircleGeometry:()=>n.tcD,ClampToEdgeWrapping:()=>n.ghU,Clock:()=>n.zD7,Color:()=>n.Q1f,ColorKeyframeTrack:()=>n.T6I,ColorManagement:()=>n.ppV,CompressedArrayTexture:()=>n.iOZ,CompressedCubeTexture:()=>n.c5h,CompressedTexture:()=>n.FvD,CompressedTextureLoader:()=>n.YRT,ConeGeometry:()=>n.qFE,ConstantAlphaFactor:()=>n.e0p,ConstantColorFactor:()=>n.RrE,Controls:()=>n.H2z,CubeCamera:()=>n.F1T,CubeReflectionMapping:()=>n.hy7,CubeRefractionMapping:()=>n.xFO,CubeTexture:()=>n.b4q,CubeTextureLoader:()=>n.ScU,CubeUVReflectionMapping:()=>n.Om,CubicBezierCurve:()=>n.Z0B,CubicBezierCurve3:()=>n.s0K,CubicInterpolant:()=>n.Pdi,CullFaceBack:()=>n.Vb5,CullFaceFront:()=>n.Jnc,CullFaceFrontBack:()=>n.ywQ,CullFaceNone:()=>n.WNZ,Curve:()=>n.Ipv,CurvePath:()=>n.jGm,CustomBlending:()=>n.bCz,CustomToneMapping:()=>n.g7M,CylinderGeometry:()=>n.Ho_,Cylindrical:()=>n.hjs,Data3DTexture:()=>n.dYF,DataArrayTexture:()=>n.rFo,DataTexture:()=>n.GYF,DataTextureLoader:()=>n.BRH,DataUtils:()=>n.GxU,DecrementStencilOp:()=>n.ROr,DecrementWrapStencilOp:()=>n.fJr,DefaultLoadingManager:()=>n.h_9,DepthFormat:()=>n.zdS,DepthStencilFormat:()=>n.dcC,DepthTexture:()=>n.VCu,DetachedBindMode:()=>n.Fvi,DirectionalLight:()=>n.ZyN,DirectionalLightHelper:()=>n.PFK,DiscreteInterpolant:()=>n.Yhb,DodecahedronGeometry:()=>n.nEu,DoubleSide:()=>n.$EB,DstAlphaFactor:()=>n.hdd,DstColorFactor:()=>n.wn6,DynamicCopyUsage:()=>n.MOq,DynamicDrawUsage:()=>n.Vnu,DynamicReadUsage:()=>n.hIf,EdgesGeometry:()=>n.TDQ,EllipseCurve:()=>n.S20,EqualCompare:()=>n.kO0,EqualDepth:()=>n.U3G,EqualStencilFunc:()=>n.jsO,EquirectangularReflectionMapping:()=>n.wfO,EquirectangularRefractionMapping:()=>n.uV5,Euler:()=>n.O9p,EventDispatcher:()=>n.Qev,ExternalTexture:()=>n.rjZ,ExtrudeGeometry:()=>n.QCA,FileLoader:()=>n.Y9S,Float16BufferAttribute:()=>n.Oax,Float32BufferAttribute:()=>n.qtW,FloatType:()=>n.RQf,Fog:()=>n.jUj,FogExp2:()=>n.cRK,FramebufferTexture:()=>n.Pem,FrontSide:()=>n.hB5,Frustum:()=>n.PPD,FrustumArray:()=>n.uf3,GLBufferAttribute:()=>n.oh6,GLSL1:()=>n.Wyr,GLSL3:()=>n.Wdf,GreaterCompare:()=>n.eoi,GreaterDepth:()=>n.K52,GreaterEqualCompare:()=>n.gWB,GreaterEqualDepth:()=>n.Gwm,GreaterEqualStencilFunc:()=>n.TMh,GreaterStencilFunc:()=>n.RcT,GridHelper:()=>n.fTw,Group:()=>n.YJl,HalfFloatType:()=>n.ix0,HemisphereLight:()=>n.dth,HemisphereLightHelper:()=>n.R1W,IcosahedronGeometry:()=>n.WBB,ImageBitmapLoader:()=>n.Kzg,ImageLoader:()=>n.$NF,ImageUtils:()=>n.HgN,IncrementStencilOp:()=>n.HLH,IncrementWrapStencilOp:()=>n.Ru$,InstancedBufferAttribute:()=>n.uWO,InstancedBufferGeometry:()=>n.CmU,InstancedInterleavedBuffer:()=>n.LuO,InstancedMesh:()=>n.ZLX,Int16BufferAttribute:()=>n.Hrb,Int32BufferAttribute:()=>n.vmz,Int8BufferAttribute:()=>n.wvS,IntType:()=>n.Yuy,InterleavedBuffer:()=>n.eB$,InterleavedBufferAttribute:()=>n.eHs,Interpolant:()=>n.lGw,InterpolateDiscrete:()=>n.ljd,InterpolateLinear:()=>n.PJ3,InterpolateSmooth:()=>n.EQC,InterpolationSamplingMode:()=>n.TM5,InterpolationSamplingType:()=>n.G4u,InvertStencilOp:()=>n.oVO,KeepStencilOp:()=>n.VVr,KeyframeTrack:()=>n.UJ6,LOD:()=>n.UpK,LatheGeometry:()=>n.nzx,Layers:()=>n.zgK,LessCompare:()=>n.vim,LessDepth:()=>n.brA,LessEqualCompare:()=>n.TiK,LessEqualDepth:()=>n.xSv,LessEqualStencilFunc:()=>n.CR7,LessStencilFunc:()=>n.kYr,Light:()=>n.veJ,LightProbe:()=>n.FZo,Line:()=>n.N1A,Line3:()=>n.cZY,LineBasicMaterial:()=>n.mrM,LineCurve:()=>n.GZZ,LineCurve3:()=>n.VnP,LineDashedMaterial:()=>n.Fvt,LineLoop:()=>n.FCc,LineSegments:()=>n.DXC,LinearFilter:()=>n.k6q,LinearInterpolant:()=>n.ezk,LinearMipMapLinearFilter:()=>n.NZq,LinearMipMapNearestFilter:()=>n.iUH,LinearMipmapLinearFilter:()=>n.$_I,LinearMipmapNearestFilter:()=>n.kRr,LinearSRGBColorSpace:()=>n.Zr2,LinearToneMapping:()=>n.kyO,LinearTransfer:()=>n.VxR,Loader:()=>
1n.aHM,LoaderUtils:()=>n.r6x,LoadingManager:()=>n.KPJ,LoopOnce:()=>n.G3T,LoopPingPong:()=>n.lc7,LoopRepeat:()=>n.aMy,MOUSE:()=>n.kBv,Material:()=>n.imn,MaterialLoader:()=>n.jut,MathUtils:()=>n.cj9,Matrix2:()=>n.k_V,Matrix3:()=>n.dwI,Matrix4:()=>n.kn4,MaxEquation:()=>n.$ei,Mesh:()=>n.eaF,MeshBasicMaterial:()=>n.V9B,MeshDepthMaterial:()=>n.CSG,MeshDistanceMaterial:()=>n.aVO,MeshLambertMaterial:()=>n.G_z,MeshMatcapMaterial:()=>n.FNr,MeshNormalMaterial:()=>n.qBx,MeshPhongMaterial:()=>n.tXL,MeshPhysicalMaterial:()=>n.uSd,MeshStandardMaterial:()=>n._4j,MeshToonMaterial:()=>n.Df,MinEquation:()=>n.znC,MirroredRepeatWrapping:()=>n.kTW,MixOperation:()=>n.KRh,MultiplyBlending:()=>n.EdD,MultiplyOperation:()=>n.caT,NearestFilter:()=>n.hxR,NearestMipMapLinearFilter:()=>n.a$r,NearestMipMapNearestFilter:()=>n.$O9,NearestMipmapLinearFilter:()=>n.Cfg,NearestMipmapNearestFilter:()=>n.pHI,NeutralToneMapping:()=>n.aJ8,NeverCompare:()=>n.amv,NeverDepth:()=>n.eHc,NeverStencilFunc:()=>n.HPb,NoBlending:()=>n.XIg,NoColorSpace:()=>n.jf0,NoToneMapping:()=>n.y_p,NormalAnimationBlendMode:()=>n.Ke9,NormalBlending:()=>n.NTi,NotEqualCompare:()=>n.jzd,NotEqualDepth:()=>n.bw0,NotEqualStencilFunc:()=>n.klZ,NumberKeyframeTrack:()=>n.Hit,Object3D:()=>n.B69,ObjectLoader:()=>n.XTe,ObjectSpaceNormalMap:()=>n.vyJ,OctahedronGeometry:()=>n.Ufg,OneFactor:()=>n.qad,OneMinusConstantAlphaFactor:()=>n.ov9,OneMinusConstantColorFactor:()=>n.$Yl,OneMinusDstAlphaFactor:()=>n.Nt7,OneMinusDstColorFactor:()=>n.aEY,OneMinusSrcAlphaFactor:()=>n.OuU,OneMinusSrcColorFactor:()=>
1n.LiQ,OrthographicCamera:()=>n.qUd,PCFShadowMap:()=>n.QP0,PCFSoftShadowMap:()=>n.Wk7,PMREMGenerator:()=>C,Path:()=>n.wAk,PerspectiveCamera:()=>n.ubm,Plane:()=>n.Zcv,PlaneGeometry:()=>n.bdM,PlaneHelper:()=>n.ZM4,PointLight:()=>n.HiM,PointLightHelper:()=>n.F1l,Points:()=>n.ONl,PointsMaterial:()=>n.BH$,PolarGridHelper:()=>n.hzE,PolyhedronGeometry:()=>n.pFK,PositionalAudio:()=>n.xZx,PropertyBinding:()=>n.Nwf,PropertyMixer:()=>n.N2s,QuadraticBezierCurve:()=>n.dAo,QuadraticBezierCurve3:()=>n.CV9,Quaternion:()=>n.PTz,QuaternionKeyframeTrack:()=>n.MBL,QuaternionLinearInterpolant:()=>n.GBG,RED_GREEN_RGTC2_Format:()=>n.HO_,RED_RGTC1_Format:()=>n.Kef,REVISION:()=>n.sPf,RGBADepthPacking:()=>n.N5j,RGBAFormat:()=>n.GWd,RGBAIntegerFormat:()=>n.c90,RGBA_ASTC_10x10_Format:()=>n.y3Z,RGBA_ASTC_10x5_Format:()=>n.uB5,RGBA_ASTC_10x6_Format:()=>n.lyL,RGBA_ASTC_10x8_Format:()=>n.bC7,RGBA_ASTC_12x10_Format:()=>n.ojs,RGBA_ASTC_12x12_Format:()=>n.S$4,RGBA_ASTC_4x4_Format:()=>n.qa3,RGBA_ASTC_5x4_Format:()=>n.B_h,RGBA_ASTC_5x5_Format:()=>n.czI,RGBA_ASTC_6x5_Format:()=>n.rSH,RGBA_ASTC_6x6_Format:()=>n.Qrf,RGBA_ASTC_8x5_Format:()=>n.psI,RGBA_ASTC_8x6_Format:()=>n.a5J,RGBA_ASTC_8x8_Format:()=>n._QJ,RGBA_BPTC_Format:()=>n.Fn,RGBA_ETC2_EAC_Format:()=>n.KDk,RGBA_PVRTC_2BPPV1_Format:()=>n.pBf,RGBA_PVRTC_4BPPV1_Format:()=>n.HXV,RGBA_S3TC_DXT1_Format:()=>n.Nz6,RGBA_S3TC_DXT3_Format:()=>n.jR7,RGBA_S3TC_DXT5_Format:()=>n.BXX,RGBDepthPacking:()=>n.wTz,RGBFormat:()=>n.HIg,RGBIntegerFormat:()=>n.VGF,RGB_BPTC_SIGNED_Format:()=>n.H23,RGB_BPTC_UNSIGNED_Format:()=>n.W9U,RGB_ETC1_Format:()=>n.CVz,RGB_ETC2_Format:()=>n.Riy,RGB_PVRTC_2BPPV1_Format:()=>n.kTp,RGB_PVRTC_4BPPV1_Format:()=>n.k6Q,RGB_S3TC_DXT1_Format:()=>n.IE4,RGDepthPacking:()=>n.k8v,RGFormat:()=>n.paN,RGIntegerFormat:()=>n.TkQ,RawShaderMaterial:()=>n.D$Q,Ray:()=>n.RlV,Raycaster:()=>n.tBo,RectAreaLight:()=>n.ure,RedFormat:()=>n.VT0,RedIntegerFormat:()=>n.ZQM,ReinhardToneMapping:()=>n.Mjd,RenderTarget:()=>n.O0B,RenderTarget3D:()=>n.XMJ,RepeatWrapping:()=>n.GJx,ReplaceStencilOp:()=>n.kG0,ReverseSubtractEquation:()=>n.nST,RingGeometry:()=>n.rKP,SIGNED_RED_GREEN_RGTC2_Format:()=>n.CWW,SIGNED_RED_RGTC1_Format:()=>n.XG_,SRGBColorSpace:()=>n.er$,SRGBTransfer:()=>n.KLL,Scene:()=>n.Z58,ShaderChunk:()=>a,ShaderLib:()=>l,ShaderMaterial:()=>n.BKk,ShadowMaterial:()=>n.q2,Shape:()=>n.ypk,ShapeGeometry:()=>n.MSw,ShapePath:()=>n.Ld9,ShapeUtils:()=>n.xJ6,ShortType:()=>n.fBL,Skeleton:()=>n.EAD,SkeletonHelper:()=>n._xc,SkinnedMesh:()=>n.I46,Source:()=>n.kLi,Sphere:()=>n.iyt,SphereGeometry:()=>n.Gu$,Spherical:()=>n.YHV,SphericalHarmonics3:()=>n.xOk,SplineCurve:()=>n.xfg,SpotLight:()=>n.nCl,SpotLightHelper:()=>n.Fpm,Sprite:()=>n.kxk,SpriteMaterial:()=>n.RoJ,SrcAlphaFactor:()=>n.ie2,SrcAlphaSaturateFactor:()=>n.hgQ,SrcColorFactor:()=>n.f4X,StaticCopyUsage:()=>n.Hrq,StaticDrawUsage:()=>n.agE,StaticReadUsage:()=>n.uXQ,StereoCamera:()=>n.keZ,StreamCopyUsage:()=>n.rOG,StreamDrawUsage:()=>n.Ktl,StreamReadUsage:()=>n.uov,StringKeyframeTrack:()=>n.hZF,SubtractEquation:()=>n.FXf,SubtractiveBlending:()=>n.Kwu,TOUCH:()=>n.wtR,TangentSpaceNormalMap:()=>n.bI3,TetrahedronGeometry:()=>n.Zpd,Texture:()=>n.gPd,TextureLoader:()=>n.Tap,TextureUtils:()=>n.Vwu,Timer:()=>n.M4G,TimestampQuery:()=>n.v9J,TorusGeometry:()=>n.O3Y,TorusKnotGeometry:()=>n.UPV,Triangle:()=>n.lMl,TriangleFanDrawMode:()=>n.rYR,TriangleStripDrawMode:()=>n.O49,TrianglesDrawMode:()=>n.RJ4,TubeGeometry:()=>n.j6,UVMapping:()=>n.UTZ,Uint16BufferAttribute:()=>n.A$4,Uint32BufferAttribute:()=>n.MW4,Uint8BufferAttribute:()=>n.baL,Uint8ClampedBufferAttribute:()=>n.fc6,Uniform:()=>n.nc$,UniformsGroup:()=>n.dzP,UniformsLib:()=>o,UniformsUtils:()=>n.LlO,UnsignedByteType:()=>n.OUM,UnsignedInt101111Type:()=>n.yT7,UnsignedInt248Type:()=>n.V3x,UnsignedInt5999Type:()=>n.Dmk,UnsignedIntType:()=>n.bkx,UnsignedShort4444Type:()=>n.Wew,UnsignedShort5551Type:()=>n.gJ2,UnsignedShortType:()=>n.cHt,VSMShadowMap:()=>n.RyA,Vector2:()=>n.I9Y,Vector3:()=>n.Pq0,Vector4:()=>n.IUQ,VectorKeyframeTrack:()=>n.RiT,VideoFrameTexture:()=>n.SYV,VideoTexture:()=>n.Nv2,WebGL3DRenderTarget:()=>n.ALV,WebGLArrayRenderTarget:()=>n.y9J,WebGLCoordinateSystem:()=>
1n.TdN,WebGLCubeRenderTarget:()=>n.o6l,WebGLRenderTarget:()=>n.nWS,WebGLRenderer:()=>tw,WebGLUtils:()=>t_,WebGPUCoordinateSystem:()=>n.i7u,WebXRController:()=>n.R3r,WireframeGeometry:()=>n.XJ7,WrapAroundEnding:()=>n.dhZ,ZeroCurvatureEnding:()=>n.rQf,ZeroFactor:()=>n.ojh,ZeroSlopeEnding:()=>n.h2z,ZeroStencilOp:()=>n.kqe,createCanvasElement:()=>n.lPF});var n=i(27072);function r(){let e=null,t=!1,i=null,n=null;function r(t,s){i(t,s),n=e.requestAnimationFrame(r)}return{start:function(){!0!==t&&null!==i&&(n=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(e){i=e},setContext:function(t){e=t}}}function s(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);let n=t.get(i);n&&(e.deleteBuffer(n.buffer),t.delete(i))},update:function(i,n){if(i.isInterleavedBufferAttribute&&(i=i.data),i.isGLBufferAttribute){let e=t.get(i);(!e||e.version<i.version)&&t.set(i,{buffer:i.buffer,type:i.type,bytesPerElement:i.elementSize,version:i.version});return}let r=t.get(i);if(void 0===r)t.set(i,function(t,i){let n,r=t.array,s=t.usage,a=r.byteLength,o=e.createBuffer();if(e.bindBuffer(i,o),e.bufferData(i,r,s),t.onUploadCallback(),r instanceof Float32Array)n=e.FLOAT;else if("undefined"!=typeof Float16Array&&r instanceof Float16Array)n=e.HALF_FLOAT;else if(r instanceof Uint16Array)n=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)n=e.SHORT;else if(r instanceof Uint32Array)n=e.UNSIGNED_INT;else if(r instanceof Int32Array)n=e.INT;else if(r instanceof Int8Array)n=e.BYTE;else if(r instanceof Uint8Array)n=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)n=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);return{buffer:o,type:n,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}(i,n));else if(r.version<i.version){if(r.size!==i.array.byteLength)throw Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,i,n){let r=i.array,s=i.updateRanges;if(e.bindBuffer(n,t),0===s.length)e.bufferSubData(n,0,r);else{s.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<s.length;e++){let i=s[t],n=s[e];n.start<=i.start+i.count+1?i.count=Math.max(i.count,n.start+n.count-i.start):s[++t]=n}s.length=t+1;for(let t=0,i=s.length;t<i;t++){let i=s[t];e.bufferSubData(n,i.start*r.BYTES_PER_ELEMENT,r,i.start,i.count)}i.clearUpdateRanges()}i.onUploadCallback()}(r.buffer,i,n),r.version=i.version}}}}let a={alphahash_fragment:"#ifdef USE_ALPHAHASH\n if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n const float ALPHA_HASH_SCALE = 0.05;\n float hash2D( vec2 value ) {\n return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n }\n float hash3D( vec3 value ) {\n return hash2D( vec2( hash2D( value.xy ), value.z ) );\n }\n float getAlphaHashThreshold( vec3 position ) {\n float maxDeriv = max(\n length( dFdx( position.xyz ) ),\n length( dFdy( position.xyz ) )\n );\n float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n vec2 pixScales = vec2(\n exp2( floor( log2( pixScale ) ) ),\n exp2( ceil( log2( pixScale ) ) )\n );\n vec2 alpha = vec2(\n hash3D( floor( pixScales.x * position.xyz ) ),\n hash3D( floor( pixScales.y * position.xyz ) )\n );\n float lerpFactor = fract( log2( pixScale ) );\n float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n float a = min( lerpFactor, 1.0 - lerpFactor );\n vec3 cases = vec3(\n x * x / ( 2.0 * a * ( 1.0 - a ) ),\n ( x - 0.5 * a ) / ( 1.0 - a ),\n 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n );\n float threshold = ( x < ( 1.0 - a ) )\n ? ( ( x < a ) ? cases.x : cases.y )\n : cases.z;\n return clamp( threshold , 1.0e-6, 1.0 );\n }\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n #ifdef ALPHA_TO_COVERAGE\n diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n if ( diffuseColor.a < alphaTest ) discard;\n #endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n uniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_CLEARCOAT ) \n clearcoatSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_SHEEN ) \n sheenSpecularIndirect *= ambientOcclusion;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n float dotNV = saturate( dot
1( geometryNormal, geometryViewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n #endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n #if ! defined( GL_ANGLE_multi_draw )\n #define gl_DrawID _gl_DrawID\n uniform int _gl_DrawID;\n #endif\n uniform highp sampler2D batchingTexture;\n uniform highp usampler2D batchingIdTexture;\n mat4 getBatchingMatrix( const in float i ) {\n int size = textureSize( batchingTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n float getIndirectIndex( const in int i ) {\n int size = textureSize( batchingIdTexture, 0 ).x;\n int x = i % size;\n int y = i / size;\n return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n }\n#endif\n#ifdef USE_BATCHING_COLOR\n uniform sampler2D batchingColorTexture;\n vec3 getBatchingColor( const in float i ) {\n int size = textureSize( batchingColorTexture, 0 ).x;\n int j = int( i );\n int x = j % size;\n int y = j / size;\n return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n }\n#endif",batching_vertex:"#ifdef USE_BATCHING\n mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n vPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n vec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( specularColor, 1.0, dotVH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n const mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n );\n vec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n }\n vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n }\n float IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n }\n vec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n }\n vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
1\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++ m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n }\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vBumpMapUv );\n vec2 dSTdy = dFdy( vBumpMapUv );\n float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 ) * faceDirection;\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n vec4 plane;\n #ifdef ALPHA_TO_COVERAGE\n float distanceToPlane, distanceGradient;\n float clipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n if ( clipOpacity == 0.0 ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n float unionClipOpacity = 1.0;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n distanceGradient = fwidth( distanceToPlane ) / 2.0;\n unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n }\n #pragma unroll_loop_end\n clipOpacity *= 1.0 - unionClipOpacity;\n #endif\n diffuseColor.a *= clipOpacity;\n if ( diffuseColor.a == 0.0 ) discard;\n #else\n #pragma unroll_loop_start\n for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n }\n #pragma unroll_loop_end\n #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n bool clipped = true;\n #pragma unroll_loop_start\n for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n plane = clippingPlanes[ i ];\n clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n }\n #pragma unroll_loop_end\n if ( clipped ) discard;\n #endif\n #endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n varying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n vClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n diffuseColor *= vColor;\n#elif defined( USE_COLOR )\n diffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR )\n varying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n varying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n varying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n vColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n vColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n vColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n vColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n vColor.xyz *= batchingColor.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; }\nvec3 pow2( const in vec3 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 max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n float precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n float precisionSafeLength( vec3 v ) {\n float maxComponent = max3( abs( v ) );\n return length( v / maxComponent ) * maxComponent;\n }\n#endif\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n varying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n mat3 tmp;\n tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n return tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n #define cubeUV_minTileSize 16.0\n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z );\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x );\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y );\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z );\n }\n return 0.5 * ( uv + 1.0 );\n }\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n float face = getFace( direction );\n float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n mipInt = max( mipInt, cubeUV_minMipLevel );\n float faceSize = exp2( mipInt );\n highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n if ( face > 2.0 ) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n uv.x += filterInt * 3.0 * cubeUV_minTileSize;\n uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n uv.x *= CUBEUV_TEXEL_WIDTH;\n uv.y *= CUBEUV_TEXEL_HEIGHT;\n #ifdef texture2DGradEXT\n return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n #else\n return texture2D( envMap, uv ).rgb;\n #endif\n }\n #define cubeUV_r0 1.0\n #define cubeUV_m0 - 2.0\n #define cubeUV_r1 0.8\n #define cubeUV_m1 - 1.0\n #define cubeUV_r4 0.4\n #define cubeUV_m4 2.0\n #define cubeUV_r5 0.305\n #define cubeUV_m5 3.0\n #define cubeUV_r6 0.21\n #define cubeUV_m6 4.0\n float roughnessToMip( float roughness ) {\n float mip = 0.0;\n if ( roughness >= cubeUV_r1 ) {\n mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n } else if ( roughness >= cubeUV_r4 ) {\n mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n } else if ( roughness >= cubeUV_r5 ) {\n mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n } else if ( roughness >= cubeUV_r6 ) {\n mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n } else {\n mip = - 2.0 * log2( 1.16 * roughness ); }\n return mip;\n }\n vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n float mipF = fract( mip );\n float mipInt = floor( mip );\n vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n if ( mipF == 0.0 ) {\n return vec4( color0, 1.0 );\n } else {\n vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n return vec4( mix( color0, color1, mipF ), 1.0 );\n }\n }\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n vec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n mat3 bm = mat3( batchingMatrix );
1\n transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n transformedNormal = bm * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = bm * transformedTangent;\n #endif\n#endif\n#ifdef USE_INSTANCING\n mat3 im = mat3( instanceMatrix );\n transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n transformedNormal = im * transformedNormal;\n #ifdef USE_TANGENT\n transformedTangent = im * transformedTangent;\n #endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n transformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n #ifdef FLIP_SIDED\n transformedTangent = - transformedTangent;\n #endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n emissiveColor = sRGBTransferEOTF( emissiveColor );\n #endif\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n return value;\n}\nvec4 sRGBTransferEOTF( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vec3 cameraToFrag;\n if ( isOrthographic ) {\n cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n } else {\n cameraToFrag = normalize( vWorldPosition - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToFrag, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #else\n vec4 envColor = vec4( 0.0 );\n #endif\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n uniform float envMapIntensity;\n uniform float flipEnvMap;\n uniform mat3 envMapRotation;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n \n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n uniform float reflectivity;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n varying vec3 vWorldPosition;\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n #define ENV_WORLDPOS\n #endif\n #ifdef ENV_WORLDPOS\n \n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n vec3 getIBLIrradiance( const in vec3 normal ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n return PI * envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n return envMapColor.rgb * envMapIntensity;\n #else\n return vec3( 0.0 );\n #endif\n }\n #ifdef USE_ANISOTROPY\n vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n #ifdef ENVMAP_TYPE_CUBE_UV\n vec3 bentNormal = cross( bitangent, viewDir );\n bentNormal = normalize( cross( bentNormal, bitangent ) );\n bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n return getIBLRadiance( viewDir, bentNormal, roughness );\n #else\n return vec3( 0.0 );\n #endif\n }\n #endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n #ifdef ENV_WORLDPOS\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex;\n if ( isOrthographic ) {\n cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n }
1 else {\n cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n }\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif",fog_vertex:"#ifdef USE_FOG\n vFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n #ifdef FOG_EXP2\n float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n uniform vec3 fogColor;\n varying float vFogDepth;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n uniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n float dotNL = dot( normal, lightDirection );\n vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n #ifdef USE_GRADIENTMAP\n return vec3( texture2D( gradientMap, coord ).r );\n #else\n vec2 fw = fwidth( coord ) * 0.5;\n return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n #endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n vec3 diffuseColor;\n float specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Lambert\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n uniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n float x = normal.x, y = normal.y, z = normal.z;\n vec3 result = shCoefficients[ 0 ] * 0.886227;\n result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n return result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n return irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n return irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n if ( cutoffDistance > 0.0 ) {\n distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n }\n return distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n return smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n light.color = directionalLight.color;\n light.direction = directionalLight.direction;\n light.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = pointLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float lightDistance = length( lVector );\n light.color = pointLight.color;\n light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n }
1\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n vec3 lVector = spotLight.position - geometryPosition;\n light.direction = normalize( lVector );\n float angleCos = dot( light.direction, spotLight.direction );\n float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n if ( spotAttenuation > 0.0 ) {\n float lightDistance = length( lVector );\n light.color = spotLight.color * spotAttenuation;\n light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n light.visible = ( light.color != vec3( 0.0 ) );\n } else {\n light.color = vec3( 0.0 );\n light.visible = false;\n }\n }\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n struct RectAreaLight {\n vec3 color;\n vec3 position;\n vec3 halfWidth;\n vec3 halfHeight;\n };\n uniform sampler2D ltc_1; uniform sampler2D ltc_2;\n uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n float dotNL = dot( normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n }\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n vec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_Toon\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon",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;\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n material.ior = ior;\n #ifdef USE_SPECULAR\n float specularIntensityFactor = specularIntensity;\n vec3 specularColorFactor = specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n #endif\n material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n #else\n float specularIntensityFactor = 1.0;\n vec3 specularColorFactor = vec3( 1.0 );\n material.specularF90 = 1.0;\n #endif\n material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;
1\n material.clearcoatRoughness = clearcoatRoughness;\n material.clearcoatF0 = vec3( 0.04 );\n material.clearcoatF90 = 1.0;\n #ifdef USE_CLEARCOATMAP\n material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n #endif\n #ifdef USE_CLEARCOAT_ROUGHNESSMAP\n material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n #endif\n material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n material.clearcoatRoughness += geometryRoughness;\n material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n material.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n material.iridescence = iridescence;\n material.iridescenceIOR = iridescenceIOR;\n #ifdef USE_IRIDESCENCEMAP\n material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n #endif\n #ifdef USE_IRIDESCENCE_THICKNESSMAP\n material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n #else\n material.iridescenceThickness = iridescenceThicknessMaximum;\n #endif\n#endif\n#ifdef USE_SHEEN\n material.sheenColor = sheenColor;\n #ifdef USE_SHEEN_COLORMAP\n material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n #endif\n material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n #ifdef USE_SHEEN_ROUGHNESSMAP\n material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n #ifdef USE_ANISOTROPYMAP\n mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n #else\n vec2 anisotropyV = anisotropyVector;\n #endif\n material.anisotropy = length( anisotropyV );\n if( material.anisotropy == 0.0 ) {\n anisotropyV = vec2( 1.0, 0.0 );\n } else {\n anisotropyV /= material.anisotropy;\n material.anisotropy = saturate( material.anisotropy );\n }\n material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float specularF90;\n float dispersion;\n #ifdef USE_CLEARCOAT\n float clearcoat;\n float clearcoatRoughness;\n vec3 clearcoatF0;\n float clearcoatF90;\n #endif\n #ifdef USE_IRIDESCENCE\n float iridescence;\n float iridescenceIOR;\n float iridescenceThickness;\n vec3 iridescenceFresnel;\n vec3 iridescenceF0;\n #endif\n #ifdef USE_SHEEN\n vec3 sheenColor;\n float sheenRoughness;\n #endif\n #ifdef IOR\n float ior;\n #endif\n #ifdef USE_TRANSMISSION\n float transmission;\n float transmissionAlpha;\n float thickness;\n float attenuationDistance;\n vec3 attenuationColor;\n #endif\n #ifdef USE_ANISOTROPY\n float anisotropy;\n float alphaT;\n vec3 anisotropyT;\n vec3 anisotropyB;\n #endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n float gv = dotNL * length( vec3( alphaT * dotTV, alph
1aB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return saturate(v);\n }\n float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n float a2 = alphaT * alphaB;\n highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n highp float v2 = dot( v, v );\n float w2 = a2 / v2;\n return RECIPROCAL_PI * a2 * pow2 ( w2 );\n }\n#endif\n#ifdef USE_CLEARCOAT\n vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n vec3 f0 = material.clearcoatF0;\n float f90 = material.clearcoatF90;\n float roughness = material.clearcoatRoughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( V * D );\n }\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 f0 = material.specularColor;\n float f90 = material.specularF90;\n float roughness = material.roughness;\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n #ifdef USE_IRIDESCENCE\n F = mix( F, material.iridescenceFresnel, material.iridescence );\n #endif\n #ifdef USE_ANISOTROPY\n float dotTL = dot( material.anisotropyT, lightDir );\n float dotTV = dot( material.anisotropyT, viewDir );\n float dotTH = dot( material.anisotropyT, halfDir );\n float dotBL = dot( material.anisotropyB, lightDir );\n float dotBV = dot( material.anisotropyB, viewDir );\n float dotBH = dot( material.anisotropyB, halfDir );\n float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n #else\n float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n #endif\n return F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n const float LUT_SIZE = 64.0;\n const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n const float LUT_BIAS = 0.5 / LUT_SIZE;\n float dotNV = saturate( dot( N, V ) );\n vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n uv = uv * LUT_SCALE + LUT_BIAS;\n return uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n float l = length( f );\n return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n float x = dot( v1, v2 );\n float y = abs( x );\n float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n float b = 3.4175940 + ( 4.1616724 + y ) * y;\n float v = a / b;\n float theta_sintheta = ( x >
1 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n return 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 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n vec3 lightNormal = cross( v1, v2 );\n if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n vec3 T1, T2;\n T1 = normalize( V - N * dot( V, N ) );\n T2 = - cross( N, T1 );\n mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n vec3 coords[ 4 ];\n coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n coords[ 0 ] = normalize( coords[ 0 ] );\n coords[ 1 ] = normalize( coords[ 1 ] );\n coords[ 2 ] = normalize( coords[ 2 ] );\n coords[ 3 ] = normalize( coords[ 3 ] );\n vec3 vectorFormFactor = vec3( 0.0 );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n float result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n return vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n float alpha = pow2( roughness );\n float invAlpha = 1.0 / alpha;\n float cos2h = dotNH * dotNH;\n float sin2h = max( 1.0 - cos2h, 0.0078125 );\n return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n float dotNH = saturate( dot( normal, halfDir ) );\n float D = D_Charlie( sheenRoughness, dotNH );\n float V = V_Neubelt( dotNV, dotNL );\n return sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n float r2 = roughness * roughness;\n float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n return saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n return specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n vec2 fab = DFGApprox( normal, viewDir, roughness );
1\n #ifdef USE_IRIDESCENCE\n vec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n #else\n vec3 Fr = specularColor;\n #endif\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 normal = geometryNormal;\n vec3 viewDir = geometryViewDir;\n vec3 position = geometryPosition;\n vec3 lightPos = rectAreaLight.position;\n vec3 halfWidth = rectAreaLight.halfWidth;\n vec3 halfHeight = rectAreaLight.halfHeight;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.roughness;\n vec3 rectCoords[ 4 ];\n rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n vec2 uv = LTC_Uv( normal, viewDir, roughness );\n vec4 t1 = texture2D( ltc_1, uv );\n vec4 t2 = texture2D( ltc_2, uv );\n mat3 mInv = mat3(\n vec3( t1.x, 0, t1.y ),\n vec3( 0, 1, 0 ),\n vec3( t1.z, 0, t1.w )\n );\n vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifdef USE_CLEARCOAT\n float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n vec3 ccIrradiance = dotNLcc * directLight.color;\n clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n #ifdef USE_CLEARCOAT\n clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n #endif\n #ifdef USE_SHEEN\n sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n #endif\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n #endif\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_Direct_RectArea RE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n geometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n float dotNVi = saturate( dot( normal, geometryViewDir ) );\n if ( material.iridescenceThickness == 0.0 ) {\n material.iridescence = 0.0;\n } else {\n material.iridescence = saturate( material.iridescence );\n }\n if ( material.iridescence > 0.0 ) {\n material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n }\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointLightInfo( pointLight, geometryPosition, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n pointLightShadow = pointLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n vec4 spotColor;\n vec3 spotLightCoord;\n bool inSpotLightMap;\n #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotLightInfo( spotLight, geometryPosition, directLight );\n #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n #else\n #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n #endif\n #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n #endif\n #undef SPOT_LIGHT_MAP_INDEX\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_L
1IGHT_SHADOWS )\n spotLightShadow = spotLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalLightInfo( directionalLight, directLight );\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n RectAreaLight rectAreaLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n rectAreaLight = rectAreaLights[ i ];\n RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n }\n #pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 iblIrradiance = vec3( 0.0 );\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #if defined( USE_LIGHT_PROBES )\n irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if defined( RE_IndirectSpecular )\n vec3 radiance = vec3( 0.0 );\n vec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n irradiance += lightMapIrradiance;\n #endif\n #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n iblIrradiance += getIBLIrradiance( geometryNormal );\n #endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n #ifdef USE_ANISOTROPY\n radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n #else\n radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n #endif\n #ifdef USE_CLEARCOAT\n clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n #endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )\n uniform float logDepthBufFC;\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n varying float vFragDepth;\n varying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGARITHMIC_DEPTH_BUFFER\n vFragDepth = 1.0 + gl_Position.w;\n vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n vec4 sampledDiffuseColor = texture2D( map, vMapUv );\n #ifdef DECODE_VIDEO_TEXTURE\n sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n #endif\n diffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n uniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n #if defined( USE_POINTS_UV )\n vec2 uv = vUv;\n #else\n vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n #endif\n#endif\n#ifdef USE_MAP\n diffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n varying vec2 vUv;\n#else\n #if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n uniform mat3 uvTransform;\n #endif\n#endif\n#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n metalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n }\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n vColor *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n #if defined( USE_COLOR_ALPHA )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n #elif defined( USE_COLOR )\n if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n #endif\n }\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n objectNormal *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n #ifndef USE_INSTANCING_MORPH\n uniform float morphTargetBaseInfluence;\n uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n #endif\n uniform sampler2DArray morphTargetsTexture;\n uniform ivec2 morphTargetsTextureSize;\n vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n int y = texelIndex / morphTargetsTextureSize.x;\n int x = texelIndex - y * morphTargetsTextureSize.x;\n ivec3 morphUV = ivec3( x, y, morphTargetIndex );\n return texelFetch( morphTargetsTexture, morphUV, 0 );\n }\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n transformed *= morphTargetBaseInfluence;\n for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n }\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal *= faceDirection;\n #endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n #ifdef USE_TANGENT\n mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn = getTangentFrame( - vViewPosition, normal,\n #if defined( USE_NORMALMAP )\n vNormalMapUv\n #elif defined( USE_CLEARCOAT_NORMALMAP )\n vClearcoatNormalMapUv\n #else\n vUv\n #endif\n );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn[0] *= faceDirection;\n tbn[1] *= faceDirection;\n #endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n #ifdef USE_TANGENT\n mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n #else\n mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n #endif\n #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n tbn2[0] *= faceDirection;\n tbn2[1] *= faceDirection;\n #endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n #ifdef FLIP_SIDED\n normal = - normal;\n #endif\n #ifdef DOUBLE_SIDED\n normal = normal * faceDirection;\n #endif\n normal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n mapN.xy *= normalScale;\n normal = normalize( tbn * mapN );
1\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n varying vec3 vNormal;\n #ifdef USE_TANGENT\n varying vec3 vTangent;\n varying vec3 vBitangent;\n #endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n #ifdef USE_TANGENT\n vTangent = normalize( transformedTangent );\n vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n #endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n uniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n vec3 N = surf_norm;\n vec3 q1perp = cross( q1, N );\n vec3 q0perp = cross( N, q0 );\n vec3 T = q1perp * st0.x + q0perp * st1.x;\n vec3 B = q1perp * st0.y + q0perp * st1.y;\n float det = max( dot( T, T ), dot( B, B ) );\n float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n return mat3( T * scale, B * scale, N );\n }\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n vec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n clearcoatMapN.xy *= clearcoatNormalScale;\n clearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n uniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform sampler2D clearcoatNormalMap;\n uniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n uniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n if( v <= 0.0 )\n return vec4( 0., 0., 0., 0. );\n if( v >= 1.0 )\n return vec4( 1., 1., 1., 1. );\n float vuf;\n float af = modf( v * PackFactors.a, vuf );\n float bf = modf( vuf * ShiftRight8, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n if( v <= 0.0 )\n return vec3( 0., 0., 0. );\n if( v >= 1.0 )\n return vec3( 1., 1., 1. );\n float vuf;\n float bf = modf( v * PackFactors.b, vuf );\n float gf = modf( vuf * ShiftRight8, vuf );\n return vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n if( v <= 0.0 )\n return vec2( 0., 0. );\n if( v >= 1.0 )\n return vec2( 1., 1. );\n float vuf;\n float gf = modf( v * 256., vuf );\n return vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n return dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n return dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n vec4 r = vec4( v.x, fract( v.x * 25
15.0 ), v.y, fract( v.y * 255.0 ) );\n return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n return 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 return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n mvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n vec3 dithering( vec3 color ) {\n float grid_position = rand( gl_FragCoord.xy );\n vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n return color + dither_shift_RGB;\n }\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n roughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n float depth = unpackRGBAToDepth( texture2D( depths, uv ) );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n return step( depth, compare );\n #else\n return step( compare, depth );\n #endif\n }\n vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n return unpackRGBATo2Half( texture2D( shadow, uv ) );\n }\n float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {\n float occlusion = 1.0;\n vec2 distribution = texture2DDistribution( shadow, uv );\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( distribution.x, compare );\n #else\n float hard_shadow = step( compare, distribution.x );\n #endif\n if ( hard_shadow != 1.0 ) {\n float distance = compare - distribution.x;\n float variance = max( 0.00000, distribution.y * distribution.y );\n float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n }\n return occlusion;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n float shadow = 1.0;\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n float dx2 = dx0 / 2.0;\n float dy2 = dy0 / 2.0;\n float dx3 = dx1 / 2.0;\n float dy3 = dy1 / 2.0;\n shadow = (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 17.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx = texelSize.x;\n float dy = texelSize.y;\n vec2 uv = shadowCoord.xy;
1\n vec2 f = fract( uv * shadowMapSize + 0.5 );\n uv -= f * texelSize;\n shadow = (\n texture2DCompare( shadowMap, uv, shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n f.x ) +\n mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n f.y ) +\n mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n f.x ),\n mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n f.x ),\n f.y )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_VSM )\n shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n #else\n shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n float shadow = 1.0;\n vec3 lightToPosition = shadowCoord.xyz;\n \n float lightToPositionLength = length( lightToPosition );\n if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;\n vec3 bd3D = normalize( lightToPosition );\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n shadow = (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }
1\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n struct DirectionalLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n struct SpotLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n struct PointLightShadow {\n float shadowIntensity;\n float shadowBias;\n float shadowNormalBias;\n float shadowRadius;\n vec2 shadowMapSize;\n float shadowCameraNear;\n float shadowCameraFar;\n };\n uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n vec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n #if NUM_DIR_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n #endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n shadowWorldPosition = worldPosition;\n #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n #endif\n vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n }\n #pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n directionalLight = directionalLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_SPOT_LIGHT_SHADOWS > 0\n SpotLightShadow spotLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n spotLight = spotLightShadows[ i ];\n shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n PointLightShadow pointLight;\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n pointLight = pointLightShadows[ i ];\n shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n }\n #pragma unroll_loop_end\n #endif\n #endif\n return shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n uniform highp sampler2D boneTexture;\n mat4 getBoneMatrix( const in float i ) {\n int size = textureSize( boneTexture, 0 ).x;\n int j = int( i ) * 4;\n int x = j % size;\n int y = j / size;\n vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n return mat4( v1, v2, v3, v4 );\n }\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n transformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n #ifdef USE_TANGENT\n objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n #endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_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;
1\nvec3 LinearToneMapping( vec3 color ) {\n return saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n vec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n return a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n const mat3 ACESInputMat = mat3(\n vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),\n vec3( 0.04823, 0.01566, 0.83777 )\n );\n const mat3 ACESOutputMat = mat3(\n vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),\n vec3( -0.07367, -0.00605, 1.07602 )\n );\n color *= toneMappingExposure / 0.6;\n color = ACESInputMat * color;\n color = RRTAndODTFit( color );\n color = ACESOutputMat * color;\n return saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n vec3( 1.6605, - 0.1246, - 0.0182 ),\n vec3( - 0.5876, 1.1329, - 0.1006 ),\n vec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n vec3( 0.6274, 0.0691, 0.0164 ),\n vec3( 0.3293, 0.9195, 0.0880 ),\n vec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n vec3 x2 = x * x;\n vec3 x4 = x2 * x2;\n return + 15.5 * x4 * x2\n - 40.14 * x4 * x\n + 31.96 * x4\n - 6.868 * x2 * x\n + 0.4298 * x2\n + 0.1191 * x\n - 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n const mat3 AgXInsetMatrix = mat3(\n vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n );
1\n const mat3 AgXOutsetMatrix = mat3(\n vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n );\n const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;\n color *= toneMappingExposure;\n color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n color = AgXInsetMatrix * color;\n color = max( color, 1e-10 ); color = log2( color );\n color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n color = clamp( color, 0.0, 1.0 );\n color = agxDefaultContrastApprox( color );\n color = AgXOutsetMatrix * color;\n color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n color = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n color = clamp( color, 0.0, 1.0 );\n return color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n const float StartCompression = 0.8 - 0.04;\n const float Desaturation = 0.15;\n color *= toneMappingExposure;\n float x = min( color.r, min( color.g, color.b ) );\n float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n color -= offset;\n float peak = max( color.r, max( color.g, color.b ) );\n if ( peak < StartCompression ) return color;\n float d = 1. - StartCompression;\n float newPeak = 1. - d * d / ( peak + d - StartCompression );\n color *= newPeak / peak;\n float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n return mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n material.transmission = transmission;\n material.transmissionAlpha = 1.0;\n material.thickness = thickness;\n material.attenuationDistance = attenuationDistance;\n material.attenuationColor = attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n #endif\n #ifdef USE_THICKNESSMAP\n material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n #endif\n vec3 pos = vWorldPosition;\n vec3 v = normalize( cameraPosition - pos );\n vec3 n = inverseTransformDirection( normal, viewMatrix );\n vec4 transmitted = getIBLVolumeRefraction(\n n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n material.attenuationColor, material.attenuationDistance );\n material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n uniform float transmission;\n uniform float thickness;\n uniform float attenuationDistance;\n uniform vec3 attenuationColor;\n #ifdef USE_TRANSMISSIONMAP\n uniform sampler2D transmissionMap;\n #endif\n #ifdef USE_THICKNESSMAP\n uniform sampler2D thicknessMap;\n #endif\n uniform vec2 transmissionSamplerSize;\n uniform sampler2D transmissionSamplerMap;\n uniform mat4 modelMatrix;\n uniform mat4 projectionMatrix;\n varying vec3 vWorldPosition;\n float w0( float a ) {\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n }\n float w1( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n }\n float w2( float a ){\n return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n }\n float w3( float a ) {\n return ( 1.0 / 6.0 ) * ( a * a * a );\n }\n float g0( float a ) {\n return w0( a ) + w1( a );\n }\n float g1( float a ) {\n return w2( a ) + w3( a );\n }\n float h0( float a ) {\n return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n }\n float h1( float a ) {\n return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n }\n vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n uv = uv * texelSize.zw + 0.5;\n vec2 iuv = floor( uv );\n vec2 fuv = fract( uv );\n float g0x = g0( fuv.x );\n float g1x = g1( fuv.x );\n float h0x = h0( fuv.x );\n float h1x = h1( fuv.x );\n float h0y = h0( fuv.y );\n float h1y = h1( fuv.y );\n vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n }\n vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n vec2 fLodSizeInv = 1.0 / fLodSize;\n vec2 cLodSizeInv = 1.0 / cLodSize;\n vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n return mix( fSample, cSample, fract( lod ) );\n }\n vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n vec3 modelScale;\n modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n return normalize( refractionVector ) * thickness * modelScale;\n }\n float applyIorToRoughness( const in float roughness, const in float ior ) {\n return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n }\n vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n }\n vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n if ( isinf( attenuationDistance ) ) {\n return vec3( 1.0 );\n } else {\n vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;\n }\n }\n vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n const in vec3 attenuationColor, const in float attenuationDistance ) {\n vec4 transmittedLight;\n vec3 transmittance;\n #ifdef USE_DISPERSION\n float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n for ( int i = 0; i < 3; i ++ ) {\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n transmittedLight[ i ] = transmissionSample[ i ];\n transmittedLight.a += transmissionSample.a;\n transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n }\n transmittedLight.a /= 3.0;\n #else\n vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n vec3 refractedRayExit = position + transmissionRay;\n vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n vec2 refractionCoords = ndcPos.xy / ndcPos.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n #endif\n vec3 attenuatedColor = transmittance * transmittedLight.rgb;\n vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n }\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n varying vec2 vMapUv;
1\n#endif\n#ifdef USE_ALPHAMAP\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n varying vec2 vUv;\n#endif\n#ifdef USE_MAP\n uniform mat3 mapTransform;\n varying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n uniform mat3 alphaMapTransform;\n varying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n uniform mat3 lightMapTransform;\n varying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n uniform mat3 aoMapTransform;\n varying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n uniform mat3 bumpMapTransform;\n varying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n uniform mat3 normalMapTransform;\n varying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n uniform mat3 displacementMapTransform;\n varying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n uniform mat3 emissiveMapTransform;\n varying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n uniform mat3 metalnessMapTransform;\n varying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n uniform mat3 roughnessMapTransform;\n varying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n uniform mat3 anisotropyMapTransform;\n varying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n uniform mat3 clearcoatMapTransform;\n varying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n uniform mat3 clearcoatNormalMapTransform;\n varying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n uniform mat3 clearcoatRoughnessMapTransform;\n varying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n uniform mat3 sheenColorMapTransform;\n varying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n uniform mat3 sheenRoughnessMapTransform;\n varying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n uniform mat3 iridescenceMapTransform;\n varying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n uniform mat3 iridescenceThicknessMapTransform;\n varying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n uniform mat3 specularMapTransform;\n varying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n uniform mat3 specularColorMapTransform;\n varying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n uniform mat3 specularIntensityMapTransform;\n varying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n uniform mat3 transmissionMapTransform;\n varying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n uniform mat3 thicknessMapTransform;\n varying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n vUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
1\n#endif\n#ifdef USE_IRIDESCENCEMAP\n vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n vec4 worldPosition = vec4( transformed, 1.0 );\n #ifdef USE_BATCHING\n worldPosition = batchingMatrix * worldPosition;\n #endif\n #ifdef USE_INSTANCING\n worldPosition = instanceMatrix * worldPosition;\n #endif\n worldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n gl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n vec4 texColor = texture2D( t2D, vUv );\n #ifdef DECODE_VIDEO_TEXTURE\n texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n uniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n #ifdef ENVMAP_TYPE_CUBE\n vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n #else\n vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n #endif\n texColor.rgb *= backgroundIntensity;\n gl_FragColor = texColor;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n gl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n gl_FragColor = texColor;\n gl_FragColor.a *= opacity;\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <logdepthbuf_fragment>\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];\n #else\n float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;\n #endif\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( fragCoordZ );\n #elif DEPTH_PACKING == 3202\n gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n #elif DEPTH_PACKING == 3203\n gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n #endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <skinbase_vertex>\n #include <morphinstance_vertex>\n #ifdef USE_DISPLACEMENTMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n vec4 diffuseColor = vec4( 1.0 );\n #include <clipping_planes_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n float dist = length( vWorldPosition - referencePosition );\n dist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n dist = saturate( dist );\n gl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vWorldDirection = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vLineDistance = scale * lineDistance;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n #ifdef USE_LIGHTMAP\n vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n #else\n reflectedLight.indirectDiffuse += vec3( 1.0 );\n #endif\n #include <aomap_fragment>\n reflectedLight.indirectDiffuse *= diffuseColor.rgb;\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #inclu
1de <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n vViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n vec3 viewDir = normalize( vViewPosition );\n vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n vec3 y = cross( viewDir, x );\n vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n #ifdef USE_MATCAP\n vec4 matcapColor = texture2D( matcap, uv );\n #else\n vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n #endif\n vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n vViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n varying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n #include <clipping_planes_fragment>\n #include <logdepthbuf_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n #ifdef OPAQUE\n gl_FragColor.a = 1.0;\n #endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n varying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n#ifdef USE_TRANSMISSION\n vWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n #define IOR\n #define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n uniform float ior;\n#endif\n#ifdef USE_SPECULAR\n uniform float specularIntensity;\n uniform vec3 specularColor;\n #ifdef USE_SPECULAR_COLORMAP\n uniform sampler2D specularColorMap;\n #endif\n #ifdef USE_SPECULAR_INTENSITYMAP\n uniform sampler2D specularIntensityMap;\n #endif\n#endif\n#ifdef USE_CLEARCOAT\n uniform float clearcoat;
1\n uniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n uniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n uniform float iridescence;\n uniform float iridescenceIOR;\n uniform float iridescenceThicknessMinimum;\n uniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n uniform vec3 sheenColor;\n uniform float sheenRoughness;\n #ifdef USE_SHEEN_COLORMAP\n uniform sampler2D sheenColorMap;\n #endif\n #ifdef USE_SHEEN_ROUGHNESSMAP\n uniform sampler2D sheenRoughnessMap;\n #endif\n#endif\n#ifdef USE_ANISOTROPY\n uniform vec2 anisotropyVector;\n #ifdef USE_ANISOTROPYMAP\n uniform sampler2D anisotropyMap;\n #endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <clearcoat_normal_fragment_begin>\n #include <clearcoat_normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n #include <transmission_fragment>\n vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n #ifdef USE_SHEEN\n float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n #endif\n #ifdef USE_CLEARCOAT\n float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
1\n #endif\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_toon_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n varying vec2 vUv;\n uniform mat3 uvTransform;\n#endif\nvoid main() {\n #ifdef USE_POINTS_UV\n vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n #endif\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n gl_PointSize = size;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphinstance_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n vec4 mvPosition = modelViewMatrix[ 3 ];\n vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\n #ifndef USE_SIZEATTENUATION\n bool isPerspective = isPerspectiveMatrix( projectionMatrix );\n if ( isPerspective ) scale *= - mvPosition.z;\n #endif\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n mvPosition.xy += rotatedPosition;\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n outgoingLight = diffuseColor.rgb;\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n}"},o={common:{diffuse:{value:new n.Q1f(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new n.dwI},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new n.dwI}},envmap:{envMap:{value:null},envMapRotation:{value:new n.dwI},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new n.dwI}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new n.dwI}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new n.dwI},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new n.dwI},normalScale:{value:new n.I9Y(1,1)}}
vendor: 7,928 bytes, line 1
1,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new n.dwI},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new n.dwI}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new n.dwI}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new n.dwI}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new n.Q1f(0xffffff)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 n.Q1f(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0},uvTransform:{value:new n.dwI}},sprite:{diffuse:{value:new n.Q1f(0xffffff)},opacity:{value:1},center:{value:new n.I9Y(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new n.dwI},alphaMap:{value:null},alphaMapTransform:{value:new n.dwI},alphaTest:{value:0}}},l={basic:{uniforms:(0,n.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.fog]),vertexShader:a.meshbasic_vert,fragmentShader:a.meshbasic_frag},lambert:{uniforms:(0,n.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.fog,o.lights,{emissive:{value:new n.Q1f(0)}}]),vertexShader:a.meshlambert_vert,fragmentShader:a.meshlambert_frag},phong:{uniforms:(0,n.Iit)([o.common,o.specularmap,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.fog,o.lights,{emissive:{value:new n.Q1f(0)},specular:{value:new n.Q1f(1118481)},shininess:{value:30}}]),vertexShader:a.meshphong_vert,fragmentShader:a.meshphong_frag},standard:{uniforms:(0,n.Iit)([o.common,o.envmap,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.roughnessmap,o.metalnessmap,o.fog,o.lights,{emissive:{value:new n.Q1f(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:a.meshphysical_vert,fragmentShader:a.meshphysical_frag},toon:{uniforms:(0,n.Iit)([o.common,o.aomap,o.lightmap,o.emissivemap,o.bumpmap,o.normalmap,o.displacementmap,o.gradientmap,o.fog,o.lights,{emissive:{value:new n.Q1f(0)}}]),vertexShader:a.meshtoon_vert,fragmentShader:a.meshtoon_frag},matcap:{uniforms:(0,n.Iit)([o.common,o.bumpmap,o.normalmap,o.displacementmap,o.fog,{matcap:{value:null}}]),vertexShader:a.meshmatcap_vert,fragmentShader:a.meshmatcap_frag},points:{uniforms:(0,n.Iit)([o.points,o.fog]),vertexShader:a.points_vert,fragmentShader:a.points_frag},dashed:{uniforms:(0,n.Iit)([o.common,o.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:a.linedashed_vert,fragmentShader:a.linedashed_frag},depth:{uniforms:(0,n.Iit)([o.common,o.displacementmap]),vertexShader:a.depth_vert,fragmentShader:a.depth_frag},normal:{uniforms:(0,n.Iit)([o.common,o.bumpmap,o.normalmap,o.displacementmap,{opacity:{value:1}}]),vertexShader:a.meshnormal_vert,fragmentShader:a.meshnormal_frag},sprite:{uniforms:(0,n.Iit)([o.sprite,o.fog]),vertexShader:a.sprite_vert,fragmentShader:a.sprite_frag},background:{uniforms:{uvTransform:{value:new n.dwI},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:a.background_vert,fragmentShader:a.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new n.dwI}},vertexShader:a.backgroundCube_vert,fragmentShader:a.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:a.cube_vert,fragmentShader:a.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:a.equirect_vert,fragmentShader:a.equirect_frag},distanceRGBA:{uniforms:(0,n.Iit)([o.common,o.displacementmap,{referencePosition:{value:new n.Pq0},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:a.distanceRGBA_vert,fragmentShader:a.distanceRGBA_frag},shadow:{uniforms:(0,n.Iit)([o.lights,o.fog,{color:{value:new n.Q1f(0)},opacity:{value:1}}]),vertexShader:a.shadow_vert,fragmentShader:a.shadow_frag}};l.physical={uniforms:(0,n.Iit)([l.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new n.dwI},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new n.dwI},clearcoatNormalScale:{value:new n.I9Y(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new n.dwI},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new n.dwI},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new n.dwI},sheen:{value:0},sheenColor:{value:new n.Q1f(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new n.dwI},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new n.dwI},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new n.dwI},transmissionSamplerSize:{value:new n.I9Y},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new n.dwI},attenuationDistance:{value:0},attenuationColor:{value:new n.Q1f(0)},specularColor:{value:new n.Q1f(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new n.dwI},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new n.dwI},anisotropyVector:{value:new n.I9Y},anisotropyMap:{value:null},anisotropyMapTransform:{value:new n.dwI}}]),vertexShader:a.meshphysical_vert,fragmentShader:a.meshphysical_frag};let h={r:0,b:0,g:0},c=new n.O9p,u=new n.kn4;function d(e,t,i,r,s,a,o){let d,p,f=new n.Q1f(0),m=+(!0!==a),g=null,v=0,_=null;function x(e){let n=!0===e.isScene?e.background:null;return n&&n.isTexture&&(n=(e.backgroundBlurriness>0?i:t).get(n)),n}function y(t,i){t.getRGB(h,(0,n._Ut)(e)),r.buffers.color.setClear(h.r,h.g,h.b,i,o)}return{getClearColor:function(){return f},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;f.set(e),y(f,m=t)},getClearAlpha:function(){return m},setClearAlpha:function(e){y(f,m=e)},render:function(t){let i=!1,n=x(t);null===n?y(f,m):n&&n.isColor&&(y(n,1),i=!0);let s=e.xr.getEnvironmentBlendMode();"additive"===s?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===s&&r.buffers.color.setClear(0,0,0,0,o),(e.autoClear||i)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,i){let r=x(i);r&&(r.isCubeTexture||r.mapping===n.Om)?(void 0===p&&((p=new n.eaF(new n.iNn(1,1,1),new n.BKk({name:"Backgroun
1dCubeMaterial",uniforms:(0,n.lxW)(l.backgroundCube.uniforms),vertexShader:l.backgroundCube.vertexShader,fragmentShader:l.backgroundCube.fragmentShader,side:n.hsX,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(e,t,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(p)),c.copy(i.backgroundRotation),c.x*=-1,c.y*=-1,c.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(c.y*=-1,c.z*=-1),p.material.uniforms.envMap.value=r,p.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,p.material.uniforms.backgroundBlurriness.value=i.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=i.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(u.makeRotationFromEuler(c)),p.material.toneMapped=n.ppV.getTransfer(r.colorSpace)!==n.KLL,(g!==r||v!==r.version||_!==e.toneMapping)&&(p.material.needsUpdate=!0,g=r,v=r.version,_=e.toneMapping),p.layers.enableAll(),t.unshift(p,p.geometry,p.material,0,0,null)):r&&r.isTexture&&(void 0===d&&((d=new n.eaF(new n.bdM(2,2),new n.BKk({name:"BackgroundMaterial",uniforms:(0,n.lxW)(l.background.uniforms),vertexShader:l.background.vertexShader,fragmentShader:l.background.fragmentShader,side:n.hB5,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(d)),d.material.uniforms.t2D.value=r,d.material.uniforms.backgroundIntensity.value=i.backgroundIntensity,d.material.toneMapped=n.ppV.getTransfer(r.colorSpace)!==n.KLL,!0===r.matrixAutoUpdate&&r.updateMatrix(),d.material.uniforms.uvTransform.value.copy(r.matrix),(g!==r||v!==r.version||_!==e.toneMapping)&&(d.material.needsUpdate=!0,g=r,v=r.version,_=e.toneMapping),d.layers.enableAll(),t.unshift(d,d.geometry,d.material,0,0,null))},dispose:function(){void 0!==p&&(p.geometry.dispose(),p.material.dispose(),p=void 0),void 0!==d&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}}}function p(e,t){let i=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},s=c(null),a=s,o=!1;function l(t){return e.bindVertexArray(t)}function h(t){return e.deleteVertexArray(t)}function c(e){let t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function u(){let e=a.newAttributes;for(let t=0,i=e.length;t<i;t++)e[t]=0}function d(e){p(e,0)}function p(t,i){let n=a.newAttributes,r=a.enabledAttributes,s=a.attributeDivisors;n[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),s[t]!==i&&(e.vertexAttribDivisor(t,i),s[t]=i)}function f(){let t=a.newAttributes,i=a.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==t[n]&&(e.disableVertexAttribArray(n),i[n]=0)}function m(t,i,n,r,s,a,o){!0===o?e.vertexAttribIPointer(t,i,n,s,a):e.vertexAttribPointer(t,i,n,r,s,a)}function g(){v(),o=!0,a!==s&&l((a=s).object)}function v(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:function(i,s,h,g,v){let _=!1,x=function(t,i,n){let s=!0===n.wireframe,a=r[t.id];void 0===a&&(a={},r[t.id]=a);let o=a[i.id];void 0===o&&(o={},a[i.id]=o);let l=o[s];return void 0===l&&(l=c(e.createVertexArray()),o[s]=l),l}(g,h,s);a!==x&&l((a=x).object),(_=function(e,t,i,n){let r=a.attributes,s=t.attributes,o=0,l=i.getAttributes();for(let t in l)if(l[t].location>=0){let i=r[t],n=s[t];if(void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor)),void 0===i||i.attribute!==n||n&&i.data!==n.data)return!0;o++}return a.attributesNum!==o||a.index!==n}(i,g,h,v))&&function(e,t,i,n){let r={},s=t.attributes,o=0,l=i.getAttributes();for(let t in l)if(l[t].location>=0){let i=s[t];void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor));let n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[t]=n,o++}a.attributes=r,a.attributesNum=o,a.index=n}(i,g,h,v),null!==v&&t.update(v,e.ELEMENT_ARRAY_BUFFER),(_||o)&&(o=!1,function(i,r,s,a){u();let o=a.attributes,l=s.getAttributes(),h=r.defaultAttributeValues;for(let r in l){let s=l[r];if(s.location>=0){let l=o[r];if(void 0===l&&("instanceMatrix"===r&&i.instanceMatrix&&(l=i.instanceMatrix),"instanceColor"===r&&i.instanceColor&&(l=i.instanceColor)),void 0!==l){let r=l.normalized,o=l.itemSize,h=t.get(l);if(void 0===h)continue;let c=h.buffer,u=h.type,f=h.bytesPerElement,g=u===e.INT||u===e.UNSIGNED_INT||l.gpuType===n.Yuy;if(l.isInterleavedBufferAttribute){let t=l.data,n=t.stride,h=l.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<s.locationSize;e++)p(s.location+e,t.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<s.locationSize;e++)d(s.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<s.locationSize;e++)m(s.location+e,o/s.locationSize,u,r,n*f,(h+o/s.locationSize*e)*f,g)}else{if(l.isInstancedBufferAttribute){for(let e=0;e<s.locationSize;e++)p(s.location+e,l.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=l.meshPerAttribute*l.count)}else for(let e=0;e<s.locationSize;e++)d(s.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<s.locationSize;e++)m(s.location+e,o/s.locationSize,u,r,o*f,o/s.locationSize*e*f,g)}}else if(void 0!==h){let t=h[r];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(s.location,t);break;case 3:e.vertexAttrib3fv(s.location,t);break;case 4:e.vertexAttrib4fv(s.location,t);break;default:e.vertexAttrib1fv(s.location,t)}}}}f()}(i,s,h,g),null!==v&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(v).buffer))},reset:g,resetDefaultState:v,dispose:function(){for(let e in g(),r){let t=r[e];for(let e in t){let i=t[e];for(let e in i)h(i[e].object),delete i[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;let t=r[e.id];for(let e in t){let i=t[e];for(let e in i)h(i[e].object),delete i[e];delete t[e]}delete r[e.id]},releaseStatesOfProgram:function(e){for(let t in r){let i=r[t];if(void 0===i[e.id])continue;let n=i[e.id];for(let e in n)h(n[e].object),delete n[e];delete i[e.id]}},initAttributes:u,enableAttribute:d,disableUnusedAttributes:f}}function f(e,t,i){let n;function r(t,r,s){0!==s&&(e.drawArraysInstanced(n,t,r,s),i.update(r,n,s))}this.setMode=function(e){n=e},this.render=function(t,r){e.drawArrays(n,t,r),i.update(r,n,1)},this.renderInstances=r,this.renderMultiDraw=function(e,r,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,e,0,r,0,s);let a=0;for(let e=0;e<s;e++)a+=r[e];i.update(a,n,1)},this.renderMultiDrawInstances=function(e,s,a,o){if(0===a)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)r(e[t],s[t],o[t]);
1else{l.multiDrawArraysInstancedWEBGL(n,e,0,s,0,o,0,a);let t=0;for(let e=0;e<a;e++)t+=s[e]*o[e];i.update(t,n,1)}}}function m(e,t,i,r){let s;function a(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=void 0!==i.precision?i.precision:"highp",l=a(o);l!==o&&(o=l);let h=!0===i.logarithmicDepthBuffer,c=!0===i.reversedDepthBuffer&&t.has("EXT_clip_control"),u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),d=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),p=e.getParameter(e.MAX_TEXTURE_SIZE),f=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),m=e.getParameter(e.MAX_VERTEX_ATTRIBS),g=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),v=e.getParameter(e.MAX_VARYING_VECTORS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==s)return s;if(!0===t.has("EXT_texture_filter_anisotropic")){let i=t.get("EXT_texture_filter_anisotropic");s=e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s},getMaxPrecision:a,textureFormatReadable:function(t){return t===n.GWd||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(i){let s=i===n.ix0&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return i===n.OUM||r.convert(i)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||i===n.RQf||!!s},precision:o,logarithmicDepthBuffer:h,reversedDepthBuffer:c,maxTextures:u,maxVertexTextures:d,maxTextureSize:p,maxCubemapSize:f,maxAttributes:m,maxVertexUniforms:g,maxVaryings:v,maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:d>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function g(e){let t=this,i=null,r=0,s=!1,a=!1,o=new n.Zcv,l=new n.dwI,h={value:null,needsUpdate:!1};function c(e,i,n,r){let s=null!==e?e.length:0,a=null;if(0!==s){if(a=h.value,!0!==r||null===a){let t=n+4*s,r=i.matrixWorldInverse;l.getNormalMatrix(r),(null===a||a.length<t)&&(a=new Float32Array(t));for(let t=0,i=n;t!==s;++t,i+=4)o.copy(e[t]).applyMatrix4(r,l),o.normal.toArray(a,i),a[i+3]=o.constant}h.value=a,h.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,a}this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let i=0!==e.length||t||0!==r||s;return s=t,r=e.length,i},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){i=c(e,t,0)},this.setState=function(n,o,l){let u=n.clippingPlanes,d=n.clipIntersection,p=n.clipShadows,f=e.get(n);if(s&&null!==u&&0!==u.length&&(!a||p)){let e=a?0:r,t=4*e,n=f.clippingState||null;h.value=n,n=c(u,o,t,l);for(let e=0;e!==t;++e)n[e]=i[e];f.clippingState=n,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else a?c(null):(h.value!==i&&(h.value=i,h.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0)}}function v(e){let t=new WeakMap;function i(e,t){return t===n.wfO?e.mapping=n.hy7:t===n.uV5&&(e.mapping=n.xFO),e}function r(e){let i=e.target;i.removeEventListener("dispose",r);let n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function(s){if(s&&s.isTexture){let a=s.mapping;if(a===n.wfO||a===n.uV5)if(t.has(s))return i(t.get(s).texture,s.mapping);else{let a=s.image;if(!a||!(a.height>0))return null;{let o=new n.o6l(a.height);return o.fromEquirectangularTexture(e,s),t.set(s,o),s.addEventListener("dispose",r),i(o.texture,s.mapping)}}}return s},dispose:function(){t=new WeakMap}}}let _=[.125,.215,.35,.446,.526,.582],x=new n.qUd,y=new n.Q1f,M=null,S=0,b=0,T=!1,w=(1+Math.sqrt(5))/2,E=1/w,A=[new n.Pq0(-w,E,0),new n.Pq0(w,E,0),new n.Pq0(-E,0,w),new n.Pq0(E,0,w),new n.Pq0(0,w,-E),new n.Pq0(0,w,E),new n.Pq0(-1,1,-1),new n.Pq0(1,1,-1),new n.Pq0(-1,1,1),new n.Pq0(1,1,1)],R=new n.Pq0;class C{fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},{size:s=256,position:a=R}=r;M=this._renderer.getRenderTarget(),S=this._renderer.getActiveCubeFace(),b=this._renderer.getActiveMipmapLevel(),T=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,i,n,o,a),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=U(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=L(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(M,S,b),this._renderer.xr.enabled=T,e.scissorTest=!1,P(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===n.hy7||e.mapping===n.xFO?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),M=this._renderer.getRenderTarget(),S=this._renderer.getActiveCubeFace(),b=this._renderer.getActiveMipmapLevel(),T=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:n.k6q,minFilter:n.k6q,generateMipmaps:!1,type:n.ix0,format:n.GWd,colorSpace:n.Zr2,depthBuffer:!1},r=I(e,t,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=I(e,t,i);let{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}
1=function(e){let t=[],i=[],r=[],s=e,a=e-4+1+_.length;for(let o=0;o<a;o++){let a=Math.pow(2,s);i.push(a);let l=1/a;o>e-4?l=_[o-e+4-1]:0===o&&(l=0),r.push(l);let h=1/(a-2),c=-h,u=1+h,d=[c,c,u,c,u,u,c,c,u,u,c,u],p=new Float32Array(108),f=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,i=e>2?0:-1,n=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];p.set(n,18*e),f.set(d,12*e);let r=[e,e,e,e,e,e];m.set(r,6*e)}let g=new n.LoY;g.setAttribute("position",new n.THS(p,3)),g.setAttribute("uv",new n.THS(f,2)),g.setAttribute("faceIndex",new n.THS(m,1)),t.push(g),s>4&&s--}return{lodPlanes:t,sizeLods:i,sigmas:r}}(r)),this._blurMaterial=function(e,t,i){let r=new Float32Array(20),s=new n.Pq0(0,1,0);return new n.BKk({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:"".concat(e,".0")},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:N(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n #define ENVMAP_TYPE_CUBE_UV\n #include <cube_uv_reflection_fragment>\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n\n }\n ",blending:n.XIg,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){let t=new n.eaF(this._lodPlanes[0],e);this._renderer.compile(t,x)}_sceneToCubeUV(e,t,i,r,s){let a=new n.ubm(90,1,t,i),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,c=h.autoClear,u=h.toneMapping;h.getClearColor(y),h.toneMapping=n.y_p,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(r),h.clearDepth(),h.setRenderTarget(null));
1let d=new n.V9B({name:"PMREM.Background",side:n.hsX,depthWrite:!1,depthTest:!1}),p=new n.eaF(new n.iNn,d),f=!1,m=e.background;m?m.isColor&&(d.color.copy(m),e.background=null,f=!0):(d.color.copy(y),f=!0);for(let t=0;t<6;t++){let i=t%3;0===i?(a.up.set(0,o[t],0),a.position.set(s.x,s.y,s.z),a.lookAt(s.x+l[t],s.y,s.z)):1===i?(a.up.set(0,0,o[t]),a.position.set(s.x,s.y,s.z),a.lookAt(s.x,s.y+l[t],s.z)):(a.up.set(0,o[t],0),a.position.set(s.x,s.y,s.z),a.lookAt(s.x,s.y,s.z+l[t]));let n=this._cubeSize;P(r,i*n,t>2?n:0,n,n),h.setRenderTarget(r),f&&h.render(p,a),h.render(e,a)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=u,h.autoClear=c,e.background=m}_textureToCubeUV(e,t){let i=this._renderer,r=e.mapping===n.hy7||e.mapping===n.xFO;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=U()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=L());let s=r?this._cubemapMaterial:this._equirectMaterial,a=new n.eaF(this._lodPlanes[0],s);s.uniforms.envMap.value=e;let o=this._cubeSize;P(t,0,0,3*o,2*o),i.setRenderTarget(t),i.render(a,x)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;let n=this._lodPlanes.length;for(let t=1;t<n;t++){let i=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=A[(n-t-1)%A.length];this._blur(e,t-1,t,i,r)}t.autoClear=i}_blur(e,t,i,n,r){let s=this._pingPongRenderTarget;this._halfBlur(e,s,t,i,n,"latitudinal",r),this._halfBlur(s,e,i,i,n,"longitudinal",r)}_halfBlur(e,t,i,r,s,a,o){let l=this._renderer,h=this._blurMaterial,c=new n.eaF(this._lodPlanes[r],h),u=h.uniforms,d=this._sizeLods[i]-1,p=isFinite(s)?Math.PI/(2*d):2*Math.PI/39,f=s/p,m=isFinite(s)?1+Math.floor(3*f):20,g=[],v=0;for(let e=0;e<20;++e){let t=e/f,i=Math.exp(-t*t/2);g.push(i),0===e?v+=i:e<m&&(v+=2*i)}for(let e=0;e<g.length;e++)g[e]=g[e]/v;u.envMap.value=e.texture,u.samples.value=m,u.weights.value=g,u.latitudinal.value="latitudinal"===a,o&&(u.poleAxis.value=o);let{_lodMax:_}=this;u.dTheta.value=p,u.mipInt.value=_-i;let y=this._sizeLods[r],M=4*(this._cubeSize-y);P(t,3*y*(r>_-4?r-_+4:0),M,3*y,2*y),l.setRenderTarget(t),l.render(c,x)}constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}}function I(e,t,i){let r=new n.nWS(e,t,i);return r.texture.mapping=n.Om,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function P(e,t,i,n,r){e.viewport.set(t,i,n,r),e.scissor.set(t,i,n,r)}function L(){return new n.BKk({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:N(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #include <common>\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n ",blending:n.XIg,depthTest:!1,depthWrite:!1})}function U(){return new n.BKk({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:N(),fragmentShader:"\n\n precision mediump float;\n precision mediump int;\n\n uniform float flipEnvMap;\n\n varying vec3 vOutputDirection;\n\n uniform samplerCube envMap;\n\n void main() {\n\n gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n }\n ",blending:n.XIg,depthTest:!1,depthWrite:!1})}function N(){return"\n\n precision mediump float;\n precision mediump int;\n\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position, 1.0 );\n\n }\n "}function D(e){let t=new WeakMap,i=null;function r(e){let i=e.target;i.removeEventListener("dispose",r);let n=t.get(i);void 0!==n&&(t.delete(i),n.dispose())}return{get:function(s){if(s&&s.isTexture){let a=s.mapping,o=a===n.wfO||a===n.uV5,l=a===n.hy7||a===n.xFO;if(o||l){let n=t.get(s),a=void 0!==n?n.texture.pmremVersion:0;if(s.isRenderTargetTexture&&s.pmremVersion!==a)return null===i&&(i=new C(e)),(n=o?i.fromEquirectangular(s,n):i.fromCubemap(s,n)).texture.pmremVersion=s.pmremVersion,t.set(s,n),n.texture;{if(void 0!==n)return n.texture;let a=s.image;return o&&a&&a.height>0||l&&a&&function(e){let t=0;for(let i=0;i<6;i++)void 0!==e[i]&&t++;return 6===t}(a)?(null===i&&(i=new C(e)),(n=o?i.fromEquirectangular(s):i.fromCubemap(s)).texture.pmremVersion=s.pmremVersion,t.set(s,n),s.addEventListener("dispose",r),n.texture):null}}}return s},dispose:function(){t=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function O(e){let t={};function i(i){let n;if(void 0!==t[i])return t[i];switch(i){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return t[i]=n,n}return{has:function(e){return null!==i(e)},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(e){let t=i(e);return null===t&&(0,n.mcG)("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function F(e,t,i,r){let s={},a=new WeakMap;function o(e){let n=e.target;for(let e in null!==n.index&&t.remove(n.index),n.attributes)t.remove(n.attributes[e]);n.removeEventListener("dispose",o),delete s[n.id];let l=a.get(n);l&&(t.remove(l),a.delete(n)),r.releaseStatesOfGeometry(n),!0===n.isInstancedBufferGeometry&&delete n._maxInstanceCount,i.memory.geometries--}function l(e){let i=[],r=e.index,s=e.attributes.position,o=0;if(null!==r){let e=r.array;o=r.version;for(let t=0,n=e.length;t<n;t+=3){let n=e[t+0],r=e[t+1],s=e[t+2];i.push(n,r,r,s,s,n)}}else{if(void 0===s)return;let e=s.array;o=s.version;for(let t=0,n=e.length/3-1;t<n;t+=3){let e=t+0,n=t+1,r=t+2;i.push(e,n,n,r,r,e)}}let l=new((0,n.AQS)(i)?n.MW4:n.A$4)(i,1);l.version=o;let h=a.get(e);h&&t.remove(h),a.set(e,l)}return{get:function(e,t){return!0===s[t.id]||(t.addEventListener("dispose",o),s[t.id]=!0,i.memory.geometries++),t},update:function(i){let n=i.attributes;for(let i in n)t.update(n[i],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){let t=a.get(e);if(t){let i=e.index;null!==i&&t.version<i.version&&l(e)}else l(e);return a.get(e)}}}function B(e,t,i){let n,r,s;function a(t,a,o){0!==o&&(e.drawElementsInstanced(n,a,r,t*s,o),i.update(a,n,o))}this.setMode=function(e){n=e},this.setIndex=function(e){r=e.type,s=e.bytesPerElement},this.render=function(t,a){e.drawElements(n,a,r,t*s),i.update(a,n,1)},this.renderInstances=a,this.renderMultiDraw=function(e,s,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,s,0,r,e,0,a);let o=0;for(let e=0;e<a;e++)o+=s[e];i.update(o,n,1)},this.renderMultiDrawInstances=function(e,o,l,h){if(0===l)return;let c=t.get("WEBGL_multi_draw");if(null===c)for(let t=0;t<e.length;t++)a(e[t]/s,o[t],h[t]);
vendor: 9,791 bytes, line 1
1else{c.multiDrawElementsInstancedWEBGL(n,o,0,r,e,0,h,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*h[e];i.update(t,n,1)}}}function z(e){let t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(i,n,r){switch(t.calls++,n){case e.TRIANGLES:t.triangles+=i/3*r;break;case e.LINES:t.lines+=i/2*r;break;case e.LINE_STRIP:t.lines+=r*(i-1);break;case e.LINE_LOOP:t.lines+=r*i;break;case e.POINTS:t.points+=r*i}}}}function k(e,t,i){let r=new WeakMap,s=new n.IUQ;return{update:function(a,o,l){let h=a.morphTargetInfluences,c=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,u=void 0!==c?c.length:0,d=r.get(o);if(void 0===d||d.count!==u){void 0!==d&&d.texture.dispose();let e=void 0!==o.morphAttributes.position,i=void 0!==o.morphAttributes.normal,a=void 0!==o.morphAttributes.color,l=o.morphAttributes.position||[],h=o.morphAttributes.normal||[],c=o.morphAttributes.color||[],p=0;!0===e&&(p=1),!0===i&&(p=2),!0===a&&(p=3);let f=o.attributes.position.count*p,m=1;f>t.maxTextureSize&&(m=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let g=new Float32Array(f*m*4*u),v=new n.rFo(g,f,m,u);v.type=n.RQf,v.needsUpdate=!0;let _=4*p;for(let t=0;t<u;t++){let n=l[t],r=h[t],o=c[t],u=f*m*4*t;for(let t=0;t<n.count;t++){let l=t*_;!0===e&&(s.fromBufferAttribute(n,t),g[u+l+0]=s.x,g[u+l+1]=s.y,g[u+l+2]=s.z,g[u+l+3]=0),!0===i&&(s.fromBufferAttribute(r,t),g[u+l+4]=s.x,g[u+l+5]=s.y,g[u+l+6]=s.z,g[u+l+7]=0),!0===a&&(s.fromBufferAttribute(o,t),g[u+l+8]=s.x,g[u+l+9]=s.y,g[u+l+10]=s.z,g[u+l+11]=4===o.itemSize?s.w:1)}}d={count:u,texture:v,size:new n.I9Y(f,m)},r.set(o,d),o.addEventListener("dispose",function e(){v.dispose(),r.delete(o),o.removeEventListener("dispose",e)})}if(!0===a.isInstancedMesh&&null!==a.morphTexture)l.getUniforms().setValue(e,"morphTexture",a.morphTexture,i);else{let t=0;for(let e=0;e<h.length;e++)t+=h[e];let i=o.morphTargetsRelative?1:1-t;l.getUniforms().setValue(e,"morphTargetBaseInfluence",i),l.getUniforms().setValue(e,"morphTargetInfluences",h)}l.getUniforms().setValue(e,"morphTargetsTexture",d.texture,i),l.getUniforms().setValue(e,"morphTargetsTextureSize",d.size)}}}function V(e,t,i,n){let r=new WeakMap;function s(e){let t=e.target;t.removeEventListener("dispose",s),i.remove(t.instanceMatrix),null!==t.instanceColor&&i.remove(t.instanceColor)}return{update:function(a){let o=n.render.frame,l=a.geometry,h=t.get(a,l);if(r.get(h)!==o&&(t.update(h),r.set(h,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),r.get(a)!==o&&(i.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&i.update(a.instanceColor,e.ARRAY_BUFFER),r.set(a,o))),a.isSkinnedMesh){let e=a.skeleton;r.get(e)!==o&&(e.update(),r.set(e,o))}return h},dispose:function(){r=new WeakMap}}}let H=new n.gPd,G=new n.VCu(1,1),W=new n.rFo,j=new n.dYF,X=new n.b4q,q=[],Y=[],Z=new Float32Array(16),K=new Float32Array(9),J=new Float32Array(4);function Q(e,t,i){let n=e[0];if(n<=0||n>0)return e;let r=t*i,s=q[r];if(void 0===s&&(s=new Float32Array(r),q[r]=s),0!==t){n.toArray(s,0);for(let n=1,r=0;n!==t;++n)r+=i,e[n].toArray(s,r)}return s}function $(e,t){if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(e[i]!==t[i])return!1;return!0}function ee(e,t){for(let i=0,n=t.length;i<n;i++)e[i]=t[i]}function et(e,t){let i=Y[t];void 0===i&&(i=new Int32Array(t),Y[t]=i);for(let n=0;n!==t;++n)i[n]=e.allocateTextureUnit();return i}function ei(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function en(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if($(i,t))return;e.uniform2fv(this.addr,t),ee(i,t)}}function er(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(void 0!==t.r)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if($(i,t))return;e.uniform3fv(this.addr,t),ee(i,t)}}function es(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if($(i,t))return;e.uniform4fv(this.addr,t),ee(i,t)}}function ea(e,t){let i=this.cache,n=t.elements;if(void 0===n){if($(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),ee(i,t)}else{if($(i,n))return;J.set(n),e.uniformMatrix2fv(this.addr,!1,J),ee(i,n)}}function eo(e,t){let i=this.cache,n=t.elements;if(void 0===n){if($(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),ee(i,t)}else{if($(i,n))return;K.set(n),e.uniformMatrix3fv(this.addr,!1,K),ee(i,n)}}function el(e,t){let i=this.cache,n=t.elements;if(void 0===n){if($(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),ee(i,t)}else{if($(i,n))return;Z.set(n),e.uniformMatrix4fv(this.addr,!1,Z),ee(i,n)}}function eh(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function ec(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if($(i,t))return;e.uniform2iv(this.addr,t),ee(i,t)}}function eu(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if($(i,t))return;e.uniform3iv(this.addr,t),ee(i,t)}}function ed(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if($(i,t))return;e.uniform4iv(this.addr,t),ee(i,t)}}function ep(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function ef(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if($(i,t))return;e.uniform2uiv(this.addr,t),ee(i,t)}}function em(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if($(i,t))return;e.uniform3uiv(this.addr,t),ee(i,t)}}function eg(e,t){let i=this.cache;if(void 0!==t.x)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if($(i,t))return;e.uniform4uiv(this.addr,t),ee(i,t)}}function ev(e,t,i){let r,s=this.cache,a=i.allocateTextureUnit();s[0]!==a&&(e.uniform1i(this.addr,a),s[0]=a),this.type===e.SAMPLER_2D_SHADOW?(G.compareFunction=n.TiK,r=G):r=H,i.setTexture2D(t||r,a)}function e_(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(t||j,r)}function ex(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(t||X,r)}function ey(e,t,i){let n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(e.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(t||W,r)}function eM(e,t){e.uniform1fv(this.addr,t)}function eS(e,t){let i=Q(t,this.size,2);e.uniform2fv(this.addr,i)}function eb(e,t){let i=Q(t,this.size,3);e.uniform3fv(this.addr,i)}function eT(e,t){let i=Q(t,this.size,4);e.uniform4fv(this.addr,i)}function ew(e,t){let i=Q(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function eE(e,t){let i=Q(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function eA(e,t){let i=Q(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function eR(e,t){e.uniform1iv(this.addr,t)}function eC(e,t){e.uniform2iv(this.addr,t)}function eI(e,t){e.uniform3iv(this.addr,t)}function eP(e,t){e.uniform4iv(this.addr,t)}function eL(e,t){e.uniform1uiv(this.addr,t)}function eU(e,t){e.uniform2uiv(this.addr,t)}function eN(e,t){e.uniform3uiv(this.addr,t)}function eD(e,t){e.uniform4uiv(this.addr,t)}function eO(e,t,i){let n=this.cache,r=t.length,s=et(i,r);$(n,s)||(e.uniform1iv(this.addr,s),ee(n,s));for(let e=0;e!==r;++e)i.setTexture2D(t[e]||H,s[e])}function eF(e,t,i){let n=this.cache,r=t.length,s=et(i,r);$(n,s)||(e.uniform1iv(this.addr,s),ee(n,s));for(let e=0;e!==r;++e)i.setTexture3D(t[e]||j,s[e])}function eB(e,t,i){let n=this.cache,r=t.length,s=et(i,r);$(n,s)||(e.uniform1iv(this.addr,s),ee(n,s));for(let e=0;e!==r;++e)i.setTextureCube(t[e]||X,s[e])}function ez(e,t,i){let n=this.cache,r=t.length,s=et(i,r);$(n,s)||(e.uniform1iv(this.addr,s),ee(n,s));for(let e=0;e!==r;++e)i.setTexture2DArray(t[e]||W,s[e])}class ek{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return ei;case 35664:return en;case 35665:return er;case 35666:return es;case 35674:return ea;case 35675:return eo;case 35676:return el;case 5124:case 35670:return eh;case 35667:case 35671:return ec;case 35668:case 35672:return eu;case 35669:case 35673:return ed;case 5125:return ep;case 36294:return ef;case 36295:return em;case 36296:return eg;case 35678:case 36198:case 36298:case 36306:case 35682:return ev;case 35679:case 36299:case 36307:return e_;case 35680:case 36300:case 36308:case 36293:return ex;case 36289:case 36303:case 36311:case 36292:return ey}}(t.type)}}class eV{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return eM;case 35664:return eS;case 35665:return eb;case 35666:return eT;case 35674:return ew;case 35675:return eE;case 35676:return eA;case 5124:case 35670:return eR;case 35667:case 35671:return eC;case 35668:case 35672:return eI;case 35669:case 35673:return eP;case 5125:return eL;case 36294:return eU;case 36295:return eN;case 36296:return eD;case 35678:case 36198:case 36298:case 36306:case 35682:return eO;case 35679:case 36299:case 36307:return eF;case 35680:case 36300:case 36308:case 36293:return eB;case 36289:case 36303:case 36311:case 36292:return ez}}
1(t.type)}}class eH{setValue(e,t,i){let n=this.seq;for(let r=0,s=n.length;r!==s;++r){let s=n[r];s.setValue(e,t[s.id],i)}}constructor(e){this.id=e,this.seq=[],this.map={}}}let eG=/(\w+)(\])?(\[|\.)?/g;function eW(e,t){e.seq.push(t),e.map[t.id]=t}class ej{setValue(e,t,i,n){let r=this.map[t];void 0!==r&&r.setValue(e,i,n)}setOptional(e,t,i){let n=t[i];void 0!==n&&this.setValue(e,i,n)}static upload(e,t,i,n){for(let r=0,s=t.length;r!==s;++r){let s=t[r],a=i[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,n)}}static seqWithValue(e,t){let i=[];for(let n=0,r=e.length;n!==r;++n){let r=e[n];r.id in t&&i.push(r)}return i}constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let n=0;n<i;++n){let i=e.getActiveUniform(t,n),r=e.getUniformLocation(t,i.name);!function(e,t,i){let n=e.name,r=n.length;for(eG.lastIndex=0;;){let s=eG.exec(n),a=eG.lastIndex,o=s[1],l="]"===s[2],h=s[3];if(l&&(o|=0),void 0===h||"["===h&&a+2===r){eW(i,void 0===h?new ek(o,e,t):new eV(o,e,t));break}{let e=i.map[o];void 0===e&&eW(i,e=new eH(o)),i=e}}}(i,r,this)}}}function eX(e,t,i){let n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),n}let eq=0,eY=new n.dwI;function eZ(e,t,i){let n=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(n&&""===r)return"";let s=/ERROR: 0:(\d+)/.exec(r);if(!s)return r;{let n=parseInt(s[1]);return i.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let i=e.split("\n"),n=[],r=Math.max(t-6,0),s=Math.min(t+6,i.length);for(let e=r;e<s;e++){let r=e+1;n.push("".concat(r===t?">":" "," ").concat(r,": ").concat(i[e]))}return n.join("\n")}(e.getShaderSource(t),n)}}let eK=new n.Pq0;function eJ(e){return""!==e}function eQ(e,t){let i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function e$(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let e0=/^[ \t]*#include +<([\w\d./]+)>/gm;function e1(e){return e.replace(e0,e3)}let e2=new Map;function e3(e,t){let i=a[t];if(void 0===i){let e=e2.get(t);if(void 0!==e)i=a[e];else throw Error("Can not resolve #include <"+t+">")}return e1(i)}let e4=/#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 e5(e){return e.replace(e4,e6)}function e6(e,t,i,n){let r="";for(let e=parseInt(t);e<parseInt(i);e++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function e8(e){let t="precision ".concat(e.precision," float;\n precision ").concat(e.precision," int;\n precision ").concat(e.precision," sampler2D;\n precision ").concat(e.precision," samplerCube;\n precision ").concat(e.precision," sampler3D;\n precision ").concat(e.precision," sampler2DArray;\n precision ").concat(e.precision," sampler2DShadow;\n precision ").concat(e.precision," samplerCubeShadow;\n precision ").concat(e.precision," sampler2DArrayShadow;\n precision ").concat(e.precision," isampler2D;\n precision ").concat(e.precision," isampler3D;\n precision ").concat(e.precision," isamplerCube;\n precision ").concat(e.precision," isampler2DArray;\n precision ").concat(e.precision," usampler2D;\n precision ").concat(e.precision," usampler3D;\n precision ").concat(e.precision," usamplerCube;\n precision ").concat(e.precision," usampler2DArray;\n ");return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function e9(e,t,i,r){let s,o,l,h,c,u,d=e.getContext(),p=i.defines,f=i.vertexShader,m=i.fragmentShader,g=(c="SHADOWMAP_TYPE_BASIC",i.shadowMapType===n.QP0?c="SHADOWMAP_TYPE_PCF":i.shadowMapType===n.Wk7?c="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===n.RyA&&(c="SHADOWMAP_TYPE_VSM"),c),v=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case n.hy7:case n.xFO:t="ENVMAP_TYPE_CUBE";break;case n.Om:t="ENVMAP_TYPE_CUBE_UV"}return t}(i),_=(u="ENVMAP_MODE_REFLECTION",i.envMap&&i.envMapMode===n.xFO&&(u="ENVMAP_MODE_REFRACTION"),u),x=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case n.caT:t="ENVMAP_BLENDING_MULTIPLY";break;case n.KRh:t="ENVMAP_BLENDING_MIX";break;case n.XrR:t="ENVMAP_BLENDING_ADD"}return t}(i),y=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let i=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:1/t,maxMip:i}}
vendor: 6,170 bytes, line 1
1(i),M=[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(eJ).join("\n"),S=function(e){let t=[];for(let i in e){let n=e[i];!1!==n&&t.push("#define "+i+" "+n)}return t.join("\n")}(p),b=d.createProgram(),T=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?((s=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,S].filter(eJ).join("\n")).length>0&&(s+="\n"),(o=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,S].filter(eJ).join("\n")).length>0&&(o+="\n")):(s=[e8(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,S,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.batchingColor?"#define USE_BATCHING_COLOR":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+_:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&!1===i.flatShading?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+g:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(eJ).join("\n"),o=[e8(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,S,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alph
1aToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+v:"",i.envMap?"#define "+_:"",i.envMap?"#define "+x:"",y?"#define CUBEUV_TEXEL_WIDTH "+y.texelWidth:"",y?"#define CUBEUV_TEXEL_HEIGHT "+y.texelHeight:"",y?"#define CUBEUV_MAX_MIP "+y.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.dispersion?"#define USE_DISPERSION":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&!1===i.flatShading?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor||i.batchingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+g:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",i.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",i.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==n.y_p?"#define TONE_MAPPING":"",i.toneMapping!==n.y_p?a.tonemapping_pars_fragment:"",i.toneMapping!==n.y_p?function(e,t){let i;switch(t){case n.kyO:i="Linear";break;case n.Mjd:i="Reinhard";break;case n.nNL:i="Cineon";break;case n.FV:i="ACESFilmic";break;case n.LAk:i="AgX";break;case n.aJ8:i="Neutral";break;case n.g7M:i="Custom";break;default:i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",a.colorspace_pars_fragment,function(e,t){let i=function(e){n.ppV._getMatrix(eY,n.ppV.workingColorSpace,e);let t="mat3( ".concat(eY.elements.map(e=>e.toFixed(4))," )");switch(n.ppV.getTransfer(e)){case n.VxR:return[t,"LinearTransferOETF"];case n.KLL:return[t,"sRGBTransferOETF"];default:return[t,"LinearTransferOETF"]}}(t);return["vec4 ".concat(e,"( vec4 value ) {")," return ".concat(i[1],"( vec4( value.rgb * ").concat(i[0],", value.a ) );"),"}"].join("\n")}("linearToOutputTexel",i.outputColorSpace),function(){n.ppV.getLuminanceCoefficients(eK);let e=eK.x.toFixed(4),t=eK.y.toFixed(4),i=eK.z.toFixed(4);return["float luminance( const in vec3 rgb ) {"," const vec3 weights = vec3( ".concat(e,", ").concat(t,", ").concat(i," );")," return dot( weights, rgb );\n}"].join("\n")}(),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(eJ).join("\n")),f=e$(f=eQ(f=e1(f),i),i),m=e$(m=eQ(m=e1(m),i),i),f=e5(f),m=e5(m),
1!0!==i.isRawShaderMaterial&&(T="#version 300 es\n",s=[M,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",i.glslVersion===n.Wdf?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===n.Wdf?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+o);let w=T+s+f,E=T+o+m,A=eX(d,d.VERTEX_SHADER,w),R=eX(d,d.FRAGMENT_SHADER,E);function C(t){if(e.debug.checkShaderErrors){let i=d.getProgramInfoLog(b)||"",n=d.getShaderInfoLog(A)||"",r=d.getShaderInfoLog(R)||"",a=i.trim(),l=n.trim(),h=r.trim(),c=!0,u=!0;!1===d.getProgramParameter(b,d.LINK_STATUS)?(c=!1,"function"==typeof e.debug.onShaderError?e.debug.onShaderError(d,b,A,R):(eZ(d,A,"vertex"),eZ(d,R,"fragment"))):""!==a||(""===l||""===h)&&(u=!1),u&&(t.diagnostics={runnable:c,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:h,prefix:o}})}d.deleteShader(A),d.deleteShader(R),l=new ej(d,b),h=function(e,t){let i={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){let n=e.getActiveAttrib(t,r),s=n.name,a=1;n.type===e.FLOAT_MAT2&&(a=2),n.type===e.FLOAT_MAT3&&(a=3),n.type===e.FLOAT_MAT4&&(a=4),i[s]={type:n.type,location:e.getAttribLocation(t,s),locationSize:a}}return i}(d,b)}d.attachShader(b,A),d.attachShader(b,R),void 0!==i.index0AttributeName?d.bindAttribLocation(b,0,i.index0AttributeName):!0===i.morphTargets&&d.bindAttribLocation(b,0,"position"),d.linkProgram(b),this.getUniforms=function(){return void 0===l&&C(this),l},this.getAttributes=function(){return void 0===h&&C(this),h};let I=!1===i.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===I&&(I=d.getProgramParameter(b,37297)),I},this.destroy=function(){r.releaseStatesOfProgram(this),d.deleteProgram(b),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=eq++,this.cacheKey=t,this.usedTimes=1,this.program=b,this.vertexShader=A,this.fragmentShader=R,this}let e7=0;class te{update(e){let t=e.vertexShader,i=e.fragmentShader,n=this._getShaderStage(t),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(e);return!1===s.has(n)&&(s.add(n),n.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(e){for(let t of this.materialCache.get(e))t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return void 0===i&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return void 0===i&&(i=new tt(e),t.set(e,i)),i}constructor(){this.shaderCache=new Map,this.materialCache=new Map}}class tt{constructor(e){this.id=e7++,this.code=e,this.usedTimes=0}}function ti(e,t,i,r,s,a,o){let h=new n.zgK,c=new te,u=new Set,d=[],p=s.logarithmicDepthBuffer,f=s.vertexTextures,m=s.precision,g={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function v(e){return(u.add(e),0===e)?"uv":"uv".concat(e)}return{getParameters:function(a,h,d,_,x){let y,M,S,b,T=_.fog,w=x.geometry,E=a.isMeshStandardMaterial?_.environment:null,A=(a.isMeshStandardMaterial?i:t).get(a.envMap||E),R=A&&A.mapping===n.Om?A.image.height:null,C=g[a.type];null!==a.precision&&(m=s.getMaxPrecision(a.precision),a.precision);let I=w.morphAttributes.position||w.morphAttributes.normal||w.morphAttributes.color,P=void 0!==I?I.length:0,L=0;if(void 0!==w.morphAttributes.position&&(L=1),void 0!==w.morphAttributes.normal&&(L=2),void 0!==w.morphAttributes.color&&(L=3),C){let e=l[C];y=e.vertexShader,M=e.fragmentShader}else y=a.vertexShader,M=a.fragmentShader,c.update(a),S=c.getVertexShaderID(a),b=c.getFragmentShaderID(a);let U=e.getRenderTarget(),N=e.state.buffers.depth.getReversed(),D=!0===x.isInstancedMesh,O=!0===x.isBatchedMesh,F=!!a.map,B=!!a.matcap,z=!!A,k=!!a.aoMap,V=!!a.lightMap,H=!!a.bumpMap,G=!!a.normalMap,W=!!a.displacementMap,j=!!a.emissiveMap,X=!!a.metalnessMap,q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,K=a.dispersion>0,J=a.iridescence>0,Q=a.sheen>0,$=a.transmission>0,ee=Y&&!!a.anisotropyMap,et=Z&&!!a.clearcoatMap,ei=Z&&!!a.clearcoatNormalMap,en=Z&&!!a.clearcoatRoughnessMap,er=J&&!!a.iridescenceMap,es=J&&!!a.iridescenceThicknessMap,ea=Q&&!!a.sheenColorMap,eo=Q&&!!a.sheenRoughnessMap,el=!!a.specularMap,eh=!!a.specularColorMap,ec=!!a.specularIntensityMap,eu=$&&!!a.transmissionMap,ed=$&&!!a.thicknessMap,ep=!!a.gradientMap,ef=!!a.alphaMap,em=a.alph
vendor: 2,104 bytes, line 1
1aTest>0,eg=!!a.alphaHash,ev=!!a.extensions,e_=n.y_p;a.toneMapped&&(null===U||!0===U.isXRRenderTarget)&&(e_=e.toneMapping);let ex={shaderID:C,shaderType:a.type,shaderName:a.name,vertexShader:y,fragmentShader:M,defines:a.defines,customVertexShaderID:S,customFragmentShaderID:b,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:m,batching:O,batchingColor:O&&null!==x._colorsTexture,instancing:D,instancingColor:D&&null!==x.instanceColor,instancingMorph:D&&null!==x.morphTexture,supportsVertexTextures:f,outputColorSpace:null===U?e.outputColorSpace:!0===U.isXRRenderTarget?U.texture.colorSpace:n.Zr2,alphaToCoverage:!!a.alphaToCoverage,map:F,matcap:B,envMap:z,envMapMode:z&&A.mapping,envMapCubeUVHeight:R,aoMap:k,lightMap:V,bumpMap:H,normalMap:G,displacementMap:f&&W,emissiveMap:j,normalMapObjectSpace:G&&a.normalMapType===n.vyJ,normalMapTangentSpace:G&&a.normalMapType===n.bI3,metalnessMap:X,roughnessMap:q,anisotropy:Y,anisotropyMap:ee,clearcoat:Z,clearcoatMap:et,clearcoatNormalMap:ei,clearcoatRoughnessMap:en,dispersion:K,iridescence:J,iridescenceMap:er,iridescenceThicknessMap:es,sheen:Q,sheenColorMap:ea,sheenRoughnessMap:eo,specularMap:el,specularColorMap:eh,specularIntensityMap:ec,transmission:$,transmissionMap:eu,thicknessMap:ed,gradientMap:ep,opaque:!1===a.transparent&&a.blending===n.NTi&&!1===a.alphaToCoverage,alphaMap:ef,alphaTest:em,alphaHash:eg,combine:a.combine,mapUv:F&&v(a.map.channel),aoMapUv:k&&v(a.aoMap.channel),lightMapUv:V&&v(a.lightMap.channel),bumpMapUv:H&&v(a.bumpMap.channel),normalMapUv:G&&v(a.normalMap.channel),displacementMapUv:W&&v(a.displacementMap.channel),emissiveMapUv:j&&v(a.emissiveMap.channel),metalnessMapUv:X&&v(a.metalnessMap.channel),roughnessMapUv:q&&v(a.roughnessMap.channel),anisotropyMapUv:ee&&v(a.anisotropyMap.channel),clearcoatMapUv:et&&v(a.clearcoatMap.channel),clearcoatNormalMapUv:ei&&v(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:en&&v(a.clearcoatRoughnessMap.channel),iridescenceMapUv:er&&v(a.iridescenceMap.channel),iridescenceThicknessMapUv:es&&v(a.iridescenceThicknessMap.channel),sheenColorMapUv:ea&&v(
vendor: 6,530 bytes, line 1
1a.sheenColorMap.channel),sheenRoughnessMapUv:eo&&v(a.sheenRoughnessMap.channel),specularMapUv:el&&v(a.specularMap.channel),specularColorMapUv:eh&&v(a.specularColorMap.channel),specularIntensityMapUv:ec&&v(a.specularIntensityMap.channel),transmissionMapUv:eu&&v(a.transmissionMap.channel),thicknessMapUv:ed&&v(a.thicknessMap.channel),alphaMapUv:ef&&v(a.alphaMap.channel),vertexTangents:!!w.attributes.tangent&&(G||Y),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!w.attributes.color&&4===w.attributes.color.itemSize,pointsUvs:!0===x.isPoints&&!!w.attributes.uv&&(F||ef),fog:!!T,useFog:!0===a.fog,fogExp2:!!T&&T.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:p,reversedDepthBuffer:N,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==w.morphAttributes.position,morphNormals:void 0!==w.morphAttributes.normal,morphColors:void 0!==w.morphAttributes.color,morphTargetsCount:P,morphTextureStride:L,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numSpotLightMaps:h.spotLightMap.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numSpotLightShadowsWithMaps:h.numSpotLightShadowsWithMaps,numLightProbes:h.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:e_,decodeVideoTexture:F&&!0===a.map.isVideoTexture&&n.ppV.getTransfer(a.map.colorSpace)===n.KLL,decodeVideoTextureEmissive:j&&!0===a.emissiveMap.isVideoTexture&&n.ppV.getTransfer(a.emissiveMap.colorSpace)===n.KLL,premultipliedAlpha:a.premultipliedAlpha,doubleSided:a.side===n.$EB,flipSided:a.side===n.hsX,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:ev&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ev&&!0===a.extensions.multiDraw||O)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ex.vertexUv1s=u.has(1),ex.vertexUv2s=u.has(2),ex.vertexUv3s=u.has(3),u.clear(),ex},getProgramCacheKey:function(t){var i,n,r,s;let a=[];if(t.shaderID?a.push(t.shaderID):(a.push(t.customVertexShaderID),a.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)a.push(e),a.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(i=a,n=t,i.push(n.precision),i.push(n.outputColorSpace),i.push(n.envMapMode),i.push(n.envMapCubeUVHeight),i.push(n.mapUv),i.push(n.alphaMapUv),i.push(n.lightMapUv),i.push(n.aoMapUv),i.push(n.bumpMapUv),i.push(n.normalMapUv),i.push(n.displacementMapUv),i.push(n.emissiveMapUv),i.push(n.metalnessMapUv),i.push(n.roughnessMapUv),i.push(n.anisotropyMapUv),i.push(n.clearcoatMapUv),i.push(n.clearcoatNormalMapUv),i.push(n.clearcoatRoughnessMapUv),i.push(n.iridescenceMapUv),i.push(n.iridescenceThicknessMapUv),i.push(n.sheenColorMapUv),i.push(n.sheenRoughnessMapUv),i.push(n.specularMapUv),i.push(n.specularColorMapUv),i.push(n.specularIntensityMapUv),i.push(n.transmissionMapUv),i.push(n.thicknessMapUv),i.push(n.combine),i.push(n.fogExp2),i.push(n.sizeAttenuation),i.push(n.morphTargetsCount),i.push(n.morphAttributeCount),i.push(n.numDirLights),i.push(n.numPointLights),i.push(n.numSpotLights),i.push(n.numSpotLightMaps),i.push(n.numHemiLights),i.push(n.numRectAreaLights),i.push(n.numDirLightShadows),i.push(n.numPointLightShadows),i.push(n.numSpotLightShadows),i.push(n.numSpotLightShadowsWithMaps),i.push(n.numLightProbes),i.push(n.shadowMapType),i.push(n.toneMapping),i.push(n.numClippingPlanes),i.push(n.numClipIntersection),i.push(n.depthPacking),r=a,s=t,h.disableAll(),s.supportsVertexTextures&&h.enable(0),s.instancing&&h.enable(1),s.instancingColor&&h.enable(2),s.instancingMorph&&h.enable(3),s.matcap&&h.enable(4),s.envMap&&h.enable(5),s.normalMapObjectSpace&&h.enable(6),s.normalMapTangentSpace&&h.enable(7),s.clearcoat&&h.enable(8),s.iridescence&&h.enable(9),s.alphaTest&&h.enable(10),s.vertexColors&&h.enable(11),s.vertexAlphas&&h.enable(12),s.vertexUv1s&&h.enable(13),s.vertexUv2s&&h.enable(14),s.vertexUv3s&&h.enable(15),s.vertexTangents&&h.enable(16),s.anisotropy&&h.enable(17),s.alphaHash&&h.enable(18),s.batching&&h.enable(19),s.dispersion&&h.enable(20),s.batchingColor&&h.enable(21),s.gradientMap&&h.enable(22),r.push(h.mask),h.disableAll(),s.fog&&h.enable(0),s.useFog&&h.enable(1),s.flatShading&&h.enable(2),s.logarithmicDepthBuffer&&h.enable(3),s.reversedDepthBuffer&&h.enable(4),s.skinning&&h.enable(5),s.morphTargets&&h.enable(6),s.morphNormals&&h.enable(7),s.morphColors&&h.enable(8),s.premultipliedAlpha&&h.enable(9),s.shadowMapEnabled&&h.enable(10),s.doubleSided&&h.enable(11),s.flipSided&&h.enable(12),s.useDepthPacking&&h.enable(13),s.dithering&&h.enable(14),s.transmission&&h.enable(15),s.sheen&&h.enable(16),s.opaque&&h.enable(17),s.pointsUvs&&h.enable(18),s.decodeVideoTexture&&h.enable(19),s.decodeVideoTextureEmissive&&h.enable(20),s.alphaToCoverage&&h.enable(21),r.push(h.mask),a.push(e.outputColorSpace)),a.push(t.customProgramCacheKey),a.join()},getUniforms:function(e){let t,i=g[e.type];if(i){let e=l[i];t=n.LlO.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,i){let n;for(let e=0,t=d.length;e<t;e++){let t=d[e];if(t.cacheKey===i){n=t,++n.usedTimes;break}}return void 0===n&&(n=new e9(e,i,t,a),d.push(n)),n},releaseProgram:function(e){if(0==--e.usedTimes){let t=d.indexOf(e);d[t]=d[d.length-1],d.pop(),e.destroy()}},releaseShaderCache:function(e){c.remove(e)},programs:d,dispose:function(){c.dispose()}}}function tn(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let i=e.get(t);return void 0===i&&(i={},e.set(t,i)),i},remove:function(t){e.delete(t)},update:function(t,i,n){e.get(t)[i]=n},dispose:function(){e=new WeakMap}}}function tr(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function ts(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function ta(){let e=[],t=0,i=[],n=[],r=[];function s(i,n,r,s,a,o){let l=e[t];
1return void 0===l?(l={id:i.id,object:i,geometry:n,material:r,groupOrder:s,renderOrder:i.renderOrder,z:a,group:o},e[t]=l):(l.id=i.id,l.object=i,l.geometry=n,l.material=r,l.groupOrder=s,l.renderOrder=i.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:i,transmissive:n,transparent:r,init:function(){t=0,i.length=0,n.length=0,r.length=0},push:function(e,t,a,o,l,h){let c=s(e,t,a,o,l,h);a.transmission>0?n.push(c):!0===a.transparent?r.push(c):i.push(c)},unshift:function(e,t,a,o,l,h){let c=s(e,t,a,o,l,h);a.transmission>0?n.unshift(c):!0===a.transparent?r.unshift(c):i.unshift(c)},finish:function(){for(let i=t,n=e.length;i<n;i++){let t=e[i];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){i.length>1&&i.sort(e||tr),n.length>1&&n.sort(t||ts),r.length>1&&r.sort(t||ts)}}}function to(){let e=new WeakMap;return{get:function(t,i){let n,r=e.get(t);return void 0===r?(n=new ta,e.set(t,[n])):i>=r.length?(n=new ta,r.push(n)):n=r[i],n},dispose:function(){e=new WeakMap}}}function tl(){let e={};return{get:function(t){let i;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":i={direction:new n.Pq0,color:new n.Q1f};break;case"SpotLight":i={position:new n.Pq0,direction:new n.Pq0,color:new n.Q1f,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new n.Pq0,color:new n.Q1f,distance:0,decay:0};break;case"HemisphereLight":i={direction:new n.Pq0,skyColor:new n.Q1f,groundColor:new n.Q1f};break;case"RectAreaLight":i={color:new n.Q1f,position:new n.Pq0,halfWidth:new n.Pq0,halfHeight:new n.Pq0}}return e[t.id]=i,i}}}let th=0;function tc(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function tu(e){let t=new tl,i=function(){let e={};return{get:function(t){let i;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":case"SpotLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n.I9Y};break;case"PointLight":i={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n.I9Y,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new n.Pq0);let s=new n.Pq0,a=new n.kn4,l=new n.kn4;return{setup:function(n){let s=0,a=0,l=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let h=0,c=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0,_=0,x=0;n.sort(tc);for(let e=0,o=n.length;e<o;e++){let o=n[e],y=o.color,M=o.intensity,S=o.distance,b=o.shadow&&o.shadow.map?o.shadow.map.texture:null;if(o.isAmbientLight)s+=y.r*M,a+=y.g*M,l+=y.b*M;else if(o.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(o.sh.coefficients[e],M);x++}else if(o.isDirectionalLight){let e=t.get(o);if(e.color.copy(o.color).multiplyScalar(o.intensity),o.castShadow){let e=o.shadow,t=i.get(o);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[h]=t,r.directionalShadowMap[h]=b,r.directionalShadowMatrix[h]=o.shadow.matrix,f++}r.directional[h]=e,h++}else if(o.isSpotLight){let e=t.get(o);e.position.setFromMatrixPosition(o.matrixWorld),e.color.copy(y).multiplyScalar(M),e.distance=S,e.coneCos=Math.cos(o.angle),e.penumbraCos=Math.cos(o.angle*(1-o.penumbra)),e.decay=o.decay,r.spot[u]=e;let n=o.shadow;if(o.map&&(r.spotLightMap[v]=o.map,v++,n.updateMatrices(o),o.castShadow&&_++),r.spotLightMatrix[u]=n.matrix,o.castShadow){let e=i.get(o);e.shadowIntensity=n.intensity,e.shadowBias=n.bias,e.shadowNormalBias=n.normalBias,e.shadowRadius=n.radius,e.shadowMapSize=n.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=b,g++}u++}else if(o.isRectAreaLight){let e=t.get(o);e.color.copy(y).multiplyScalar(M),e.halfWidth.set(.5*o.width,0,0),e.halfHeight.set(0,.5*o.height,0),r.rectArea[d]=e,d++}else if(o.isPointLight){let e=t.get(o);
1if(e.color.copy(o.color).multiplyScalar(o.intensity),e.distance=o.distance,e.decay=o.decay,o.castShadow){let e=o.shadow,t=i.get(o);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[c]=t,r.pointShadowMap[c]=b,r.pointShadowMatrix[c]=o.shadow.matrix,m++}r.point[c]=e,c++}else if(o.isHemisphereLight){let e=t.get(o);e.skyColor.copy(o.color).multiplyScalar(M),e.groundColor.copy(o.groundColor).multiplyScalar(M),r.hemi[p]=e,p++}}d>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=o.LTC_FLOAT_1,r.rectAreaLTC2=o.LTC_FLOAT_2):(r.rectAreaLTC1=o.LTC_HALF_1,r.rectAreaLTC2=o.LTC_HALF_2)),r.ambient[0]=s,r.ambient[1]=a,r.ambient[2]=l;let y=r.hash;(y.directionalLength!==h||y.pointLength!==c||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==p||y.numDirectionalShadows!==f||y.numPointShadows!==m||y.numSpotShadows!==g||y.numSpotMaps!==v||y.numLightProbes!==x)&&(r.directional.length=h,r.spot.length=u,r.rectArea.length=d,r.point.length=c,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=g+v-_,r.spotLightMap.length=v,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=x,y.directionalLength=h,y.pointLength=c,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=p,y.numDirectionalShadows=f,y.numPointShadows=m,y.numSpotShadows=g,y.numSpotMaps=v,y.numLightProbes=x,r.version=th++)},setupView:function(e,t){let i=0,n=0,o=0,h=0,c=0,u=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=r.directional[i];e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),i++}else if(d.isSpotLight){let e=r.spot[o];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),o++}else if(d.isRectAreaLight){let e=r.rectArea[h];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),l.identity(),a.copy(d.matrixWorld),a.premultiply(u),l.extractRotation(a),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(l),e.halfHeight.applyMatrix4(l),h++}else if(d.isPointLight){let e=r.point[n];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),n++}else if(d.isHemisphereLight){let e=r.hemi[c];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(u),c++}}},state:r}}function td(e){let t=new tu(e),i=[],n=[],r={lightsArray:i,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){r.camera=e,i.length=0,n.length=0},state:r,setupLights:function(){t.setup(i)},setupLightsView:function(e){t.setupView(i,e)},pushLight:function(e){i.push(e)},pushShadow:function(e){n.push(e)}}}function tp(e){let t=new WeakMap;return{get:function(i){let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=t.get(i);return void 0===s?(n=new td(e),t.set(i,[n])):r>=s.length?(n=new td(e),s.push(n)):n=s[r],n},dispose:function(){t=new WeakMap}}}function tf(e,t,i){let r=new n.PPD,s=new n.I9Y,a=new n.I9Y,o=new n.IUQ,l=new n.CSG({depthPacking:n.N5j}),h=new n.aVO,c={},u=i.maxTextureSize,d={[n.hB5]:n.hsX,[n.hsX]:n.hB5,[n.$EB]:n.$EB},p=new n.BKk({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new n.I9Y},radius:{value:4}},vertexShader:"void main() {\n gl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n const float samples = float( VSM_SAMPLES );\n float mean = 0.0;\n float squared_mean = 0.0;\n float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n float uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n for ( float i = 0.0; i < samples; i ++ ) {\n float uvOffset = uvStart + i * uvStride;\n #ifdef HORIZONTAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean / samples;\n squared_mean = squared_mean / samples;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),f=p.clone();f.defines.HORIZONTAL_PASS=1;let m=new n.LoY;m.setAttribute("position",new n.THS(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new n.eaF(m,p),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=n.QP0;let _=this.type;function x(t,i,r,s){let a=null,o=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?h:l,e.localClippingEnabled&&!0===i.clipShadows&&Array.isArray(i.clippingPlanes)&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0||i.map&&i.alphaTest>0||!0===i.alphaToCoverage){let e=a.uuid,t=i.uuid,n=c[e];void 0===n&&(n={},c[e]=n);let r=n[t];void 0===r&&(r=a.clone(),n[t]=r,i.addEventListener("dispose",y)),a=r}return a.visible=i.visible,a.wireframe=i.wireframe,s===n.RyA?a.side=null!==i.shadowSide?i.shadowSide:i.side:a.side=null!==i.shadowSide?i.shadowSide:d[i.side],a.alphaMap=i.alphaMap,a.alphaTest=!0===i.alphaToCoverage?.5:i.alphaTest,a.map=i.map,a.clipShadows=i.clipShadows,a.clippingPlanes=i.clippingPlanes,a.clipIntersection=i.clipIntersection,a.displacementMap=i.displacementMap,a.displacementScale=i.displacementScale,a.displacementBias=i.displacementBias,a.wireframeLinewidth=i.wireframeLinewidth,a.linewidth=i.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=r),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),c){let i=c[t],n=e.target.uuid;n in i&&(i[n].dispose(),delete i[n])}}this.render=function(i,l,h){if(!1===v.enabled||!1===v.autoUpdate&&!1===v.needsUpdate||0===i.length)return;let c=e.getRenderTarget(),d=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),y=e.state;y.setBlending(n.XIg),!0===y.buffers.depth.getReversed()?y.buffers.color.setClear(0,0,0,0):y.buffers.color.setClear(1,1,1,1),y.buffers.depth.setTest(!0),y.setScissorTest(!1);let M=_!==n.RyA&&this.type===n.RyA,S=_===n.RyA&&this.type!==n.RyA;for(let c=0,d=i.length;c<d;c++){let d=i[c],m=d.shadow;if(void 0===m||!1===m.autoUpdate&&!1===m.needsUpdate)continue;s.copy(m.mapSize);let v=m.getFrameExtents();if(s.multiply(v),a.copy(m.mapSize),(s.x>u||s.y>u)&&(s.x>u&&(a.x=Math.floor(u/v.x),s.x=a.x*v.x,m.mapSize.x=a.x),s.y>u&&(a.y=Math.floor(u/v.y),s.y=a.y*v.y,m.mapSize.y=a.y)),null===m.map||!0===M||!0===S){let e=this.type!==n.RyA?{minFilter:n.hxR,magFilter:n.hxR}:{};null!==m.map&&m.map.dispose(),m.map=new n.nWS(s.x,s.y,e),m.map.texture.name=d.name+".shadowMap",m.camera.updateProjectionMatrix()}e.setRenderTarget(m.map),e.clear();let _=m.getViewportCount();for(let i=0;i<_;i++){let s=m.getViewport(i);o.set(a.x*s.x,a.y*s.y,a.x*s.z,a.y*s.w),y.viewport(o),m.updateMatrices(d,i),r=m.getFrustum(),function i(s,a,o,l,h){if(!1===s.visible)return;if(s.layers.test(a.layers)&&(s.isMesh||s.isLine||s.isPoints)&&(s.castShadow||s.receiveShadow&&h===n.RyA)&&(!s.frustumCulled||r.intersectsObject(s))){s.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,s.matrixWorld);let i=t.update(s),n=s.material;if(Array.isArray(n)){let t=i.groups;for(let r=0,c=t.length;r<c;r++){let c=t[r],u=n[c.materialIndex];if(u&&u.visible){let t=x(s,u,l,h);s.onBeforeShadow(e,s,a,o,i,t,c),e.renderBufferDirect(o,null,i,t,s,c),s.onAfterShadow(e,s,a,o,i,t,c)}}}else if(n.visible){let t=x(s,n,l,h);s.onBeforeShadow(e,s,a,o,i,t,null),e.renderBufferDirect(o,null,i,t,s,null),s.onAfterShadow(e,s,a,o,i,t,null)}}let c=s.children;for(let e=0,t=c.length;e<t;e++)i(c[e],a,o,l,h)}(l,h,m.camera,d,this.type)}!0!==m.isPointLightShadow&&this.type===n.RyA&&function(i,r){let a=t.update(g);p.defines.VSM_SAMPLES!==i.blurSamples&&(p.defines.VSM_SAMPLES=i.blurSamples,f.defines.VSM_SAMPLES=i.blurSamples,p.needsUpdate=!0,f.needsUpdate=!0),null===i.mapPass&&(i.mapPass=new n.nWS(s.x,s.y)),p.uniforms.shadow_pass.value=i.map.texture,p.uniforms.resolution.value=i.mapSize,p.uniforms.radius.value=i.radius,e.setRenderTarget(i.mapPass),e.clear(),e.renderBufferDirect(r,null,a,p,g,null),f.uniforms.shadow_pass.value=i.mapPass.texture,f.uniforms.resolution.value=i.mapSize,f.uniforms.radius.value=i.radius,e.setRenderTarget(i.map),e.clear(),e.renderBufferDirect(r,null,a,f,g,null)}(m,h),m.needsUpdate=!1}
1_=this.type,v.needsUpdate=!1,e.setRenderTarget(c,d,m)}}let tm={[n.eHc]:n.lGu,[n.brA]:n.K52,[n.U3G]:n.bw0,[n.xSv]:n.Gwm,[n.lGu]:n.eHc,[n.K52]:n.brA,[n.bw0]:n.U3G,[n.Gwm]:n.xSv};function tg(e,t){let i=new function(){let t=!1,i=new n.IUQ,r=null,s=new n.IUQ(0,0,0,0);return{setMask:function(i){r===i||t||(e.colorMask(i,i,i,i),r=i)},setLocked:function(e){t=e},setClear:function(t,n,r,a,o){!0===o&&(t*=a,n*=a,r*=a),i.set(t,n,r,a),!1===s.equals(i)&&(e.clearColor(t,n,r,a),s.copy(i))},reset:function(){t=!1,r=null,s.set(-1,0,0,0)}}},r=new function(){let i=!1,r=!1,s=null,a=null,o=null;return{setReversed:function(e){if(r!==e){let i=t.get("EXT_clip_control");e?i.clipControlEXT(i.LOWER_LEFT_EXT,i.ZERO_TO_ONE_EXT):i.clipControlEXT(i.LOWER_LEFT_EXT,i.NEGATIVE_ONE_TO_ONE_EXT),r=e;let n=o;o=null,this.setClear(n)}},getReversed:function(){return r},setTest:function(t){t?k(e.DEPTH_TEST):V(e.DEPTH_TEST)},setMask:function(t){s===t||i||(e.depthMask(t),s=t)},setFunc:function(t){if(r&&(t=tm[t]),a!==t){switch(t){case n.eHc:e.depthFunc(e.NEVER);break;case n.lGu:e.depthFunc(e.ALWAYS);break;case n.brA:e.depthFunc(e.LESS);break;case n.xSv:e.depthFunc(e.LEQUAL);break;case n.U3G:e.depthFunc(e.EQUAL);break;case n.Gwm:e.depthFunc(e.GEQUAL);break;case n.K52:e.depthFunc(e.GREATER);break;case n.bw0:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}a=t}},setLocked:function(e){i=e},setClear:function(t){o!==t&&(r&&(t=1-t),e.clearDepth(t),o=t)},reset:function(){i=!1,s=null,a=null,o=null,r=!1}}},s=new function(){let t=!1,i=null,n=null,r=null,s=null,a=null,o=null,l=null,h=null;return{setTest:function(i){t||(i?k(e.STENCIL_TEST):V(e.STENCIL_TEST))},setMask:function(n){i===n||t||(e.stencilMask(n),i=n)},setFunc:function(t,i,a){(n!==t||r!==i||s!==a)&&(e.stencilFunc(t,i,a),n=t,r=i,s=a)},setOp:function(t,i,n){(a!==t||o!==i||l!==n)&&(e.stencilOp(t,i,n),a=t,o=i,l=n)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,i=null,n=null,r=null,s=null,a=null,o=null,l=null,h=null}}},a=new WeakMap,o=new WeakMap,l={},h={},c=new WeakMap,u=[],d=null,p=!1,f=null,m=null,g=null,v=null,_=null,x=null,y=null,M=new n.Q1f(0,0,0),S=0,b=!1,T=null,w=null,E=null,A=null,R=null,C=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),I=!1,P=e.getParameter(e.VERSION);-1!==P.indexOf("WebGL")?I=parseFloat(/^WebGL (\d)/.exec(P)[1])>=1:-1!==P.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(P)[1])>=2);let L=null,U={},N=e.getParameter(e.SCISSOR_BOX),D=e.getParameter(e.VIEWPORT),O=new n.IUQ().fromArray(N),F=new n.IUQ().fromArray(D);function B(t,i,n,r){let s=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a<n;a++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(i,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(i+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s);return a}let z={};function k(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function V(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}z[e.TEXTURE_2D]=B(e.TEXTURE_2D,e.TEXTURE_2D,1),z[e.TEXTURE_CUBE_MAP]=B(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),z[e.TEXTURE_2D_ARRAY]=B(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),z[e.TEXTURE_3D]=B(e.TEXTURE_3D,e.TEXTURE_3D,1,1),i.setClear(0,0,0,1),r.setClear(1),s.setClear(0),k(e.DEPTH_TEST),r.setFunc(n.xSv),j(!1),X(n.Vb5),k(e.CULL_FACE),W(n.XIg);let H={[n.gO9]:e.FUNC_ADD,[n.FXf]:e.FUNC_SUBTRACT,[n.nST]:e.FUNC_REVERSE_SUBTRACT};H[n.znC]=e.MIN,H[n.$ei]=e.MAX;let G={[n.ojh]:e.ZERO,[n.qad]:e.ONE,[n.f4X]:e.SRC_COLOR,[n.ie2]:e.SRC_ALPHA,[n.hgQ]:e.SRC_ALPHA_SATURATE,[n.wn6]:e.DST_COLOR,[n.hdd]:e.DST_ALPHA,[n.LiQ]:e.ONE_MINUS_SRC_COLOR,[n.OuU]:e.ONE_MINUS_SRC_ALPHA,[n.aEY]:e.ONE_MINUS_DST_COLOR,[n.Nt7]:e.ONE_MINUS_DST_ALPHA,[n.RrE]:e.CONSTANT_COLOR,[n.$Yl]:e.ONE_MINUS_CONSTANT_COLOR,[n.e0p]:e.CONSTANT_ALPHA,[n.ov9]:e.ONE_MINUS_CONSTANT_ALPHA};
1function W(t,i,r,s,a,o,l,h,c,u){if(t===n.XIg){!0===p&&(V(e.BLEND),p=!1);return}if(!1===p&&(k(e.BLEND),p=!0),t!==n.bCz){if(t!==f||u!==b){if((m!==n.gO9||_!==n.gO9)&&(e.blendEquation(e.FUNC_ADD),m=n.gO9,_=n.gO9),u)switch(t){case n.NTi:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.EZo:e.blendFunc(e.ONE,e.ONE);break;case n.Kwu:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case n.EdD:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE)}else switch(t){case n.NTi:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.EZo:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);case n.Kwu:case n.EdD:}g=null,v=null,x=null,y=null,M.set(0,0,0),S=0,f=t,b=u}return}a=a||i,o=o||r,l=l||s,(i!==m||a!==_)&&(e.blendEquationSeparate(H[i],H[a]),m=i,_=a),(r!==g||s!==v||o!==x||l!==y)&&(e.blendFuncSeparate(G[r],G[s],G[o],G[l]),g=r,v=s,x=o,y=l),(!1===h.equals(M)||c!==S)&&(e.blendColor(h.r,h.g,h.b,c),M.copy(h),S=c),f=t,b=!1}function j(t){T!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),T=t)}function X(t){t!==n.WNZ?(k(e.CULL_FACE),t!==w&&(t===n.Vb5?e.cullFace(e.BACK):t===n.Jnc?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):V(e.CULL_FACE),w=t}function q(t,i,n){t?(k(e.POLYGON_OFFSET_FILL),(A!==i||R!==n)&&(e.polygonOffset(i,n),A=i,R=n)):V(e.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:r,stencil:s},enable:k,disable:V,bindFramebuffer:function(t,i){return h[t]!==i&&(e.bindFramebuffer(t,i),h[t]=i,t===e.DRAW_FRAMEBUFFER&&(h[e.FRAMEBUFFER]=i),t===e.FRAMEBUFFER&&(h[e.DRAW_FRAMEBUFFER]=i),!0)},drawBuffers:function(t,i){let n=u,r=!1;if(t){void 0===(n=c.get(i))&&(n=[],c.set(i,n));let s=t.textures;if(n.length!==s.length||n[0]!==e.COLOR_ATTACHMENT0){for(let t=0,i=s.length;t<i;t++)n[t]=e.COLOR_ATTACHMENT0+t;n.length=s.length,r=!0}}else n[0]!==e.BACK&&(n[0]=e.BACK,r=!0);r&&e.drawBuffers(n)},useProgram:function(t){return d!==t&&(e.useProgram(t),d=t,!0)},setBlending:W,setMaterial:function(t,a){t.side===n.$EB?V(e.CULL_FACE):k(e.CULL_FACE);let o=t.side===n.hsX;a&&(o=!o),j(o),t.blending===n.NTi&&!1===t.transparent?W(n.XIg):W(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),i.setMask(t.colorWrite);let l=t.stencilWrite;s.setTest(l),l&&(s.setMask(t.stencilWriteMask),s.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),s.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),q(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?k(e.SAMPLE_ALPHA_TO_COVERAGE):V(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:j,setCullFace:X,setLineWidth:function(t){t!==E&&(I&&e.lineWidth(t),E=t)},setPolygonOffset:q,setScissorTest:function(t){t?k(e.SCISSOR_TEST):V(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+C-1),L!==t&&(e.activeTexture(t),L=t)},bindTexture:function(t,i,n){void 0===n&&(n=null===L?e.TEXTURE0+C-1:L);let r=U[n];void 0===r&&(r={type:void 0,texture:void 0},U[n]=r),(r.type!==t||r.texture!==i)&&(L!==n&&(e.activeTexture(n),L=n),e.bindTexture(t,i||z[t]),r.type=t,r.texture=i)},unbindTexture:function(){let t=U[L];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D(...arguments)}catch(e){}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(e){}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(e){}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(e){}},updateUBOMapping:function(t,i){let n=o.get(i);void 0===n&&(n=new WeakMap,o.set(i,n));let r=n.get(t);void 0===r&&(r=e.getUniformBlockIndex(i,t.name),n.set(t,r))},uniformBlockBinding:function(t,i){let n=o.get(i).get(t);a.get(i)!==n&&(e.uniformBlockBinding(i,n,t.__bindingPointIndex),a.set(i,n))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(e){}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(e){}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(e){}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(e){}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(e){}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(e){}},scissor:function(t){!1===O.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),O.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor
1(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(0xffffffff),e.stencilFunc(e.ALWAYS,0,0xffffffff),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},L=null,U={},h={},c=new WeakMap,u=[],d=null,p=!1,f=null,m=null,g=null,v=null,_=null,x=null,y=null,M=new n.Q1f(0,0,0),S=0,b=!1,T=null,w=null,E=null,A=null,R=null,O.set(0,0,e.canvas.width,e.canvas.height),F.set(0,0,e.canvas.width,e.canvas.height),i.reset(),r.reset(),s.reset()}}}function tv(e,t,i,r,s,a,o){let l,h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,c="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new n.I9Y,d=new WeakMap,p=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function m(e,t){return f?new OffscreenCanvas(e,t):(0,n.qq$)("canvas")}function g(e,t,i){let n=1,r=G(e);if((r.width>i||r.height>i)&&(n=i/Math.max(r.width,r.height)),n<1&&("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame)){let i=Math.floor(n*r.width),s=Math.floor(n*r.height);void 0===l&&(l=m(i,s));let a=t?m(i,s):l;return a.width=i,a.height=s,a.getContext("2d").drawImage(e,0,0,i,s),a}return e}function v(e){return e.generateMipmaps}function _(t){e.generateMipmap(t)}function x(i,r,s,a){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(null!==i&&void 0!==e[i])return e[i];let l=r;if(r===e.RED&&(s===e.FLOAT&&(l=e.R32F),s===e.HALF_FLOAT&&(l=e.R16F),s===e.UNSIGNED_BYTE&&(l=e.R8)),r===e.RED_INTEGER&&(s===e.UNSIGNED_BYTE&&(l=e.R8UI),s===e.UNSIGNED_SHORT&&(l=e.R16UI),s===e.UNSIGNED_INT&&(l=e.R32UI),s===e.BYTE&&(l=e.R8I),s===e.SHORT&&(l=e.R16I),s===e.INT&&(l=e.R32I)),r===e.RG&&(s===e.FLOAT&&(l=e.RG32F),s===e.HALF_FLOAT&&(l=e.RG16F),s===e.UNSIGNED_BYTE&&(l=e.RG8)),r===e.RG_INTEGER&&(s===e.UNSIGNED_BYTE&&(l=e.RG8UI),s===e.UNSIGNED_SHORT&&(l=e.RG16UI),s===e.UNSIGNED_INT&&(l=e.RG32UI),s===e.BYTE&&(l=e.RG8I),s===e.SHORT&&(l=e.RG16I),s===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(s===e.UNSIGNED_BYTE&&(l=e.RGB8UI),s===e.UNSIGNED_SHORT&&(l=e.RGB16UI),s===e.UNSIGNED_INT&&(l=e.RGB32UI),s===e.BYTE&&(l=e.RGB8I),s===e.SHORT&&(l=e.RGB16I),s===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(s===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),s===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),s===e.UNSIGNED_INT&&(l=e.RGBA32UI),s===e.BYTE&&(l=e.RGBA8I),s===e.SHORT&&(l=e.RGBA16I),s===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(s===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),s===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=o?n.VxR:n.ppV.getTransfer(a);s===e.FLOAT&&(l=e.RGBA32F),s===e.HALF_FLOAT&&(l=e.RGBA16F),s===e.UNSIGNED_BYTE&&(l=t===n.KLL?e.SRGB8_ALPHA8:e.RGBA8),s===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),s===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get("EXT_color_buffer_float"),l}function y(t,i){let r;return t?null===i||i===n.bkx||i===n.V3x?r=e.DEPTH24_STENCIL8:i===n.RQf?r=e.DEPTH32F_STENCIL8:i===n.cHt&&(r=e.DEPTH24_STENCIL8):null===i||i===n.bkx||i===n.V3x?r=e.DEPTH_COMPONENT24:i===n.RQf?r=e.DEPTH_COMPONENT32F:i===n.cHt&&(r=e.DEPTH_COMPONENT16),r}function M(e,t){return!0===v(e)||e.isFramebufferTexture&&e.minFilter!==n.hxR&&e.minFilter!==n.k6q?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function S(e){let t=e.target;t.removeEventListener("dispose",S),function(e){let t=r.get(e);if(void 0===t.__webglInit)return;let i=e.source,n=p.get(i);if(n){let r=n[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&T(e),0===Object.keys(n).length&&p.delete(i)}r.remove(e)}(t),t.isVideoTexture&&d.delete(t)}function b(t){let i=t.target;i.removeEventListener("dispose",b),function(t){let i=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRen
1derTarget)for(let t=0;t<6;t++){if(Array.isArray(i.__webglFramebuffer[t]))for(let n=0;n<i.__webglFramebuffer[t].length;n++)e.deleteFramebuffer(i.__webglFramebuffer[t][n]);else e.deleteFramebuffer(i.__webglFramebuffer[t]);i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t])}else{if(Array.isArray(i.__webglFramebuffer))for(let t=0;t<i.__webglFramebuffer.length;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer);if(i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let t=0;t<i.__webglColorRenderbuffer.length;t++)i.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(i.__webglColorRenderbuffer[t]);i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer)}let n=t.textures;for(let t=0,i=n.length;t<i;t++){let i=r.get(n[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),o.memory.textures--),r.remove(n[t])}r.remove(t)}(i)}function T(t){let i=r.get(t);e.deleteTexture(i.__webglTexture);let n=t.source,s=p.get(n);delete s[i.__cacheKey],o.memory.textures--}let w=0;function E(t,n){let s=r.get(t);if(t.isVideoTexture&&function(e){let t=o.render.frame;d.get(e)!==t&&(d.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&s.__version!==t.version){let e=t.image;if(null===e);else if(!1!==e.complete)return void U(s,t,n)}else t.isExternalTexture&&(s.__webglTexture=t.sourceTexture?t.sourceTexture:null);i.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+n)}let A={[n.GJx]:e.REPEAT,[n.ghU]:e.CLAMP_TO_EDGE,[n.kTW]:e.MIRRORED_REPEAT},R={[n.hxR]:e.NEAREST,[n.pHI]:e.NEAREST_MIPMAP_NEAREST,[n.Cfg]:e.NEAREST_MIPMAP_LINEAR,[n.k6q]:e.LINEAR,[n.kRr]:e.LINEAR_MIPMAP_NEAREST,[n.$_I]:e.LINEAR_MIPMAP_LINEAR},C={[n.amv]:e.NEVER,[n.FFZ]:e.ALWAYS,[n.vim]:e.LESS,[n.TiK]:e.LEQUAL,[n.kO0]:e.EQUAL,[n.gWB]:e.GEQUAL,[n.eoi]:e.GREATER,[n.jzd]:e.NOTEQUAL};function I(i,a){if((a.type===n.RQf&&!1===t.has("OES_texture_float_linear")&&(a.magFilter===n.k6q||a.magFilter===n.kRr||a.magFilter===n.Cfg||a.magFilter===n.$_I||a.minFilter===n.k6q||a.minFilter===n.kRr||a.minFilter===n.Cfg||a.minFilter===n.$_I),e.texParameteri(i,e.TEXTURE_WRAP_S,A[a.wrapS]),e.texParameteri(i,e.TEXTURE_WRAP_T,A[a.wrapT]),(i===e.TEXTURE_3D||i===e.TEXTURE_2D_ARRAY)&&e.texParameteri(i,e.TEXTURE_WRAP_R,A[a.wrapR]),e.texParameteri(i,e.TEXTURE_MAG_FILTER,R[a.magFilter]),e.texParameteri(i,e.TEXTURE_MIN_FILTER,R[a.minFilter]),a.compareFunction&&(e.texParameteri(i,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(i,e.TEXTURE_COMPARE_FUNC,C[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&a.magFilter!==n.hxR&&(a.minFilter===n.Cfg||a.minFilter===n.$_I)&&(a.type!==n.RQf||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||r.get(a).__currentAnisotropy)){let n=t.get("EXT_texture_filter_anisotropic");e.texParameterf(i,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,s.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}function P(t,i){let n=!1;void 0===t.__webglInit&&(t.__webglInit=!0,i.addEventListener("dispose",S));let r=i.source,s=p.get(r);void 0===s&&(s={},p.set(r,s));let a=function(e){let t=[];
vendor: 1,056 bytes, line 1
1return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(i);if(a!==t.__cacheKey){void 0===s[a]&&(s[a]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;let r=s[t.__cacheKey];void 0!==r&&(s[t.__cacheKey].usedTimes--,0===r.usedTimes&&T(i)),t.__cacheKey=a,t.__webglTexture=s[a].texture}return n}function L(e,t,i){return Math.floor(Math.floor(e/i)/t)}function U(t,o,l){let h=e.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(h=e.TEXTURE_2D_ARRAY),o.isData3DTexture&&(h=e.TEXTURE_3D);let c=P(t,o),u=o.source;i.bindTexture(h,t.__webglTexture,e.TEXTURE0+l);let d=r.get(u);if(u.version!==d.__version||!0===c){let t;i.activeTexture(e.TEXTURE0+l);let r=n.ppV.getPrimaries(n.ppV.workingColorSpace),p=o.colorSpace===n.jf0?null:n.ppV.getPrimaries(o.colorSpace),f=o.colorSpace
vendor: 6,385 bytes, line 1
1===n.jf0||r===p?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let m=g(o.image,!1,s.maxTextureSize);m=H(o,m);let S=a.convert(o.format,o.colorSpace),b=a.convert(o.type),T=x(o.internalFormat,S,b,o.colorSpace,o.isVideoTexture);I(h,o);let w=o.mipmaps,E=!0!==o.isVideoTexture,A=void 0===d.__version||!0===c,R=u.dataReady,C=M(o,m);if(o.isDepthTexture)T=y(o.format===n.dcC,o.type),A&&(E?i.texStorage2D(e.TEXTURE_2D,1,T,m.width,m.height):i.texImage2D(e.TEXTURE_2D,0,T,m.width,m.height,0,S,b,null));else if(o.isDataTexture)if(w.length>0){E&&A&&i.texStorage2D(e.TEXTURE_2D,C,T,w[0].width,w[0].height);for(let n=0,r=w.length;n<r;n++)t=w[n],E?R&&i.texSubImage2D(e.TEXTURE_2D,n,0,0,t.width,t.height,S,b,t.data):i.texImage2D(e.TEXTURE_2D,n,T,t.width,t.height,0,S,b,t.data);o.generateMipmaps=!1}else E?(A&&i.texStorage2D(e.TEXTURE_2D,C,T,m.width,m.height),R&&function(t,n,r,s){let a=t.updateRanges;if(0===a.length)i.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,r,s,n.data);else{a.sort((e,t)=>e.start-t.start);let o=0;for(let e=1;e<a.length;e++){let t=a[o],i=a[e],r=t.start+t.count,s=L(i.start,n.width,4),l=L(t.start,n.width,4);i.start<=r+1&&s===l&&L(i.start+i.count-1,n.width,4)===s?t.count=Math.max(t.count,i.start+i.count-t.start):a[++o]=i}a.length=o+1;let l=e.getParameter(e.UNPACK_ROW_LENGTH),h=e.getParameter(e.UNPACK_SKIP_PIXELS),c=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,n.width);for(let t=0,o=a.length;t<o;t++){let o=a[t],l=Math.floor(o.start/4),h=Math.ceil(o.count/4),c=l%n.width,u=Math.floor(l/n.width);e.pixelStorei(e.UNPACK_SKIP_PIXELS,c),e.pixelStorei(e.UNPACK_SKIP_ROWS,u),i.texSubImage2D(e.TEXTURE_2D,0,c,u,h,1,r,s,n.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,l),e.pixelStorei(e.UNPACK_SKIP_PIXELS,h),e.pixelStorei(e.UNPACK_SKIP_ROWS,c)}}(o,m,S,b)):i.texImage2D(e.TEXTURE_2D,0,T,m.width,m.height,0,S,b,m.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){E&&A&&i.texStorage3D(e.TEXTURE_2D_ARRAY,C,T,w[0].width,w[0].height,m.depth);for(let r=0,s=w.length;r<s;r++)if(t=w[r],o.format!==n.GWd){if(null!==S)if(E){if(R)if(o.layerUpdates.size>0){let s=(0,n.Nex)(t.width,t.height,o.format,o.type);for(let n of o.layerUpdates){let a=t.data.subarray(n*s/t.data.BYTES_PER_ELEMENT,(n+1)*s/t.data.BYTES_PER_ELEMENT);i.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,n,t.width,t.height,1,S,a)}o.clearLayerUpdates()}else i.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,m.depth,S,t.data)}else i.compressedTexImage3D(e.TEXTURE_2D_ARRAY,r,T,t.width,t.height,m.depth,0,t.data,0,0)}else E?R&&i.texSubImage3D(e.TEXTURE_2D_ARRAY,r,0,0,0,t.width,t.height,m.depth,S,b,t.data):i.texImage3D(e.TEXTURE_2D_ARRAY,r,T,t.width,t.height,m.depth,0,S,b,t.data)}else{E&&A&&i.texStorage2D(e.TEXTURE_2D,C,T,w[0].width,w[0].height);for(let r=0,s=w.length;r<s;r++)t=w[r],o.format!==n.GWd?null!==S&&(E?R&&i.compressedTexSubImage2D(e.TEXTURE_2D,r,0,0,t.width,t.height,S,t.data):i.compressedTexImage2D(e.TEXTURE_2D,r,T,t.width,t.height,0,t.data)):E?R&&i.texSubImage2D(e.TEXTURE_2D,r,0,0,t.width,t.height,S,b,t.data):i.texImage2D(e.TEXTURE_2D,r,T,t.width,t.height,0,S,b,t.data)}else if(o.isDataArrayTexture)if(E){if(A&&i.texStorage3D(e.TEXTURE_2D_ARRAY,C,T,m.width,m.height,m.depth),R)if(o.layerUpdates.size>0){let t=(0,n.Nex)(m.width,m.height,o.format,o.type);for(let n of o.layerUpdates){let r=m.data.subarray(n*t/m.data.BYTES_PER_ELEMENT,(n+1)*t/m.data.BYTES_PER_ELEMENT);i.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,n,m.width,m.height,1,S,b,r)}o.clearLayerUpdates()}else i.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,m.width,m.height,m.depth,S,b,m.data)}else i.texImage3D(e.TEXTURE_2D_ARRAY,0,T,m.width,m.height,m.depth,0,S,b,m.data);else if(o.isData3DTexture)E?(A&&i.texStorage3D(e.TEXTURE_3D,C,T,m.width,m.height,m.depth),R&&i.texSubImage3D(e.TEXTURE_3D,0,0,0,0,m.width,m.height,m.depth,S,b,m.data)):i.texImage3D(e.TEXTURE_3D,0,T,m.width,m.height,m.depth,0,S,b,m.data);else if(o.isFramebufferTexture){if(A)if(E)i.texStorage2D(e.TEXTURE_2D,C,T,m.width,m.height);else{let t=m.width,n=m.height;for(let r=0;r<C;r++)i.texImage2D(e.TEXTURE_2D,r,T,t,n,0,S,b,null),t>>=1,n>>=1}}else if(w.length>0){if(E&&A){let t=G(w[0]);i.texStorage2D(e.TEXTURE_2D,C,T,t.width,t.height)}for(let n=0,r=w.length;n<r;n++)t=w[n],E?R&&i.texSubImage2D(e.TEXTURE_2D,n,0,0,S,b,t):i.texImage2D(e.TEXTURE_2D,n,T,S,b,t);o.generateMipmaps=!1}else if(E){if(A){let t=G(m);i.texStorage2D(e.TEXTURE_2D,C,T,t.width,t.height)}R&&i.texSubImage2D(e.TEXTURE_2D,0,0,0,S,b,m)}else i.texImage2D(e.TEXTURE_2D,0,T,S,b,m);v(o)&&_(h),d.__version=u.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}function N(t,n,s,o,l,c){let u=a.convert(s.format,s.colorSpace),d=a.convert(s.type),p=x(s.internalFormat,u,d,s.colorSpace),f=r.get(n),m=r.get(s);if(m.__renderTarget=n,!f.__hasExternalTextures){let t=Math.max(1,n.width>>c),r=Math.max(1,n.height>>c);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?i.texImage3D(l,c,p,t,r,n.depth,0,u,d,null):i.texImage2D(l,c,p,t,r,0,u,d,null)}i.bindFramebuffer(e.FRAMEBUFFER,t),V(n)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,m.__webglTexture,0,k(n)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,o,l,m.__webglTexture,c),i.bindFramebuffer(e.FRAMEBUFFER,null)}function D(t,i,n){if(e.bindRenderbuffer(e.RENDERBUFFER,t),i.depthBuffer){let r=i.depthTexture,s=r&&r.isDepthTexture?r.type:null,a=y(i.stencilBuffer,s),o=i.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,l=k(i);V(i)?h.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,l,a,i.width,i.height):n?e.renderbufferStorageMultisample(e.RENDERBUFFER,l,a,i.width,i.height):e.renderbufferStorage(e.RENDERBUFFER,a,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=i.textures;for(let r=0;r<t.length;r++){let s=t[r],o=a.convert(s.format,s.colorSpace),l=a.convert(s.type),c=x(s.internalFormat,o,l,s.colorSpace),u=k(i);n&&!1===V(i)?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,c,i.width,i.height):V(i)?h.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,c,i.width,i.height):e.renderbufferStorage(e.RENDERBUFFER,c,i.width,i.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}
1function O(t,s){if(s&&s.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(e.FRAMEBUFFER,t),!(s.depthTexture&&s.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let a=r.get(s.depthTexture);a.__renderTarget=s,a.__webglTexture&&s.depthTexture.image.width===s.width&&s.depthTexture.image.height===s.height||(s.depthTexture.image.width=s.width,s.depthTexture.image.height=s.height,s.depthTexture.needsUpdate=!0),E(s.depthTexture,0);let o=a.__webglTexture,l=k(s);if(s.depthTexture.format===n.zdS)V(s)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0);else if(s.depthTexture.format===n.dcC)V(s)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0);else throw Error("Unknown depthTexture format")}function F(t){let n=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(n.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(n.__depthDisposeCallback&&n.__depthDisposeCallback(),e){let t=()=>{delete n.__boundDepthTexture,delete n.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),n.__depthDisposeCallback=t}n.__boundDepthTexture=e}if(t.depthTexture&&!n.__autoAllocateDepthBuffer){if(s)throw Error("target.depthTexture not supported in Cube render targets");let e=t.texture.mipmaps;e&&e.length>0?O(n.__webglFramebuffer[0],t):O(n.__webglFramebuffer,t)}else if(s){n.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(i.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[r]),void 0===n.__webglDepthbuffer[r])n.__webglDepthbuffer[r]=e.createRenderbuffer(),D(n.__webglDepthbuffer[r],t,!1);else{let i=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,s=n.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,s)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?i.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[0]):i.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),void 0===n.__webglDepthbuffer)n.__webglDepthbuffer=e.createRenderbuffer(),D(n.__webglDepthbuffer,t,!1);else{let i=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=n.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,r)}}i.bindFramebuffer(e.FRAMEBUFFER,null)}let B=[],z=[];function k(e){return Math.min(s.maxSamples,e.samples)}function V(e){let i=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function H(e,t){let i=e.colorSpace,r=e.format;return e.type,!0===e.isCompressedTexture||!0===e.isVideoTexture||i!==n.Zr2&&i!==n.jf0&&n.ppV.getTransfer(i)===n.KLL&&(r!==n.GWd||n.OUM),t}function G(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){let e=w;return s.maxTextures,w+=1,e},this.resetTextureUnits=function(){w=0},this.setTexture2D=E,this.setTexture2DArray=function(t,n){let s=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version)return void U(s,t,n);i.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+n)},this.setTexture3D=function(t,n){let s=r.get(t);if(!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version)return void U(s,t,n);i.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+n)},this.setTextureCube=function(t,o){let l=r.get(t);if(t.version>0&&l.__version!==t.version)return void function(t,o,l){if(6!==o.image.length)return;let h=P(t,o),c=o.source;i.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+l);let u=r.get(c);if(c.version!==u.__version||!0===h){let t;i.activeTexture(e.TEXTURE0+l);let r=n.ppV.getPrimaries(n.ppV.workingColorSpace),d=o.colorSpace
vendor: 8,727 bytes, line 1
1===n.jf0?null:n.ppV.getPrimaries(o.colorSpace),p=o.colorSpace===n.jf0||r===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,o.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,p);let f=o.isCompressedTexture||o.image[0].isCompressedTexture,m=o.image[0]&&o.image[0].isDataTexture,y=[];for(let e=0;e<6;e++)f||m?y[e]=m?o.image[e].image:o.image[e]:y[e]=g(o.image[e],!0,s.maxCubemapSize),y[e]=H(o,y[e]);let S=y[0],b=a.convert(o.format,o.colorSpace),T=a.convert(o.type),w=x(o.internalFormat,b,T,o.colorSpace),E=!0!==o.isVideoTexture,A=void 0===u.__version||!0===h,R=c.dataReady,C=M(o,S);if(I(e.TEXTURE_CUBE_MAP,o),f){E&&A&&i.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,S.width,S.height);for(let r=0;r<6;r++){t=y[r].mipmaps;for(let s=0;s<t.length;s++){let a=t[s];o.format!==n.GWd?null!==b&&(E?R&&i.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,s,0,0,a.width,a.height,b,a.data):i.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,s,w,a.width,a.height,0,a.data)):E?R&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,s,0,0,a.width,a.height,b,T,a.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+r,s,w,a.width,a.height,0,b,T,a.data)}}}else{if(t=o.mipmaps,E&&A){t.length>0&&C++;let n=G(y[0]);i.texStorage2D(e.TEXTURE_CUBE_MAP,C,w,n.width,n.height)}for(let n=0;n<6;n++)if(m){E?R&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,0,0,y[n].width,y[n].height,b,T,y[n].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,w,y[n].width,y[n].height,0,b,T,y[n].data);for(let r=0;r<t.length;r++){let s=t[r].image[n].image;E?R&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r+1,0,0,s.width,s.height,b,T,s.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r+1,w,s.width,s.height,0,b,T,s.data)}}else{E?R&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,0,0,b,T,y[n]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,w,b,T,y[n]);for(let r=0;r<t.length;r++){let s=t[r];E?R&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r+1,0,0,b,T,s.image[n]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r+1,w,b,T,s.image[n])}}}v(o)&&_(e.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}t.__version=o.version}(l,t,o);i.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture,e.TEXTURE0+o)},this.rebindTextures=function(t,i,n){let s=r.get(t);void 0!==i&&N(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==n&&F(t)},this.setupRenderTarget=function(t){let n=t.texture,s=r.get(t),l=r.get(n);t.addEventListener("dispose",b);let h=t.textures,c=!0===t.isWebGLCubeRenderTarget,u=h.length>1;if(!u&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=n.version,o.memory.textures++),c){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(n.mipmaps&&n.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let i=0;i<n.mipmaps.length;i++)s.__webglFramebuffer[t][i]=e.createFramebuffer()}else s.__webglFramebuffer[t]=e.createFramebuffer()}else{if(n.mipmaps&&n.mipmaps.length>0){s.__webglFramebuffer=[];for(let t=0;t<n.mipmaps.length;t++)s.__webglFramebuffer[t]=e.createFramebuffer()}else s.__webglFramebuffer=e.createFramebuffer();if(u)for(let t=0,i=h.length;t<i;t++){let i=r.get(h[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),o.memory.textures++)}if(t.samples>0&&!1===V(t)){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],i.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let i=0;i<h.length;i++){let n=h[i];s.__webglColorRenderbuffer[i]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer[i]);let r=a.convert(n.format,n.colorSpace),o=a.convert(n.type),l=x(n.internalFormat,r,o,n.colorSpace,!0===t.isXRRenderTarget),c=k(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,c,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+i,e.RENDERBUFFER,s.__webglColorRenderbuffer[i])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),D(s.__webglDepthRenderbuffer,t,!0)),i.bindFramebuffer(e.FRAMEBUFFER,null)}}if(c){i.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),I(e.TEXTURE_CUBE_MAP,n);for(let i=0;i<6;i++)if(n.mipmaps&&n.mipmaps.length>0)for(let r=0;r<n.mipmaps.length;r++)N(s.__webglFramebuffer[i][r],t,n,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r);else N(s.__webglFramebuffer[i],t,n,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0);v(n)&&_(e.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(u){for(let n=0,a=h.length;n<a;n++){let a=h[n],o=r.get(a),l=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),i.bindTexture(l,o.__webglTexture),I(l,a),N(s.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+n,l,0),v(a)&&_(l)}i.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),i.bindTexture(r,l.__webglTexture),I(r,n),n.mipmaps&&n.mipmaps.length>0)for(let i=0;i<n.mipmaps.length;i++)N(s.__webglFramebuffer[i],t,n,e.COLOR_ATTACHMENT0,r,i);else N(s.__webglFramebuffer,t,n,e.COLOR_ATTACHMENT0,r,0);v(n)&&_(r),i.unbindTexture()}t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(t){let n=t.textures;for(let s=0,a=n.length;s<a;s++){let a=n[s];if(v(a)){let n=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D,s=r.get(a).__webglTexture;i.bindTexture(n,s),_(n),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0){if(!1===V(t)){let n=t.textures,s=t.width,a=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,h=r.get(t),u=n.length>1;if(u)for(let t=0;t<n.length;t++)i.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),i.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);i.bindFramebuffer(e.READ_FRAMEBUFFER,h.__webglMultisampledFramebuffer);let d=t.texture.mipmaps;d&&d.length>0?i.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglFramebuffer[0]):i.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglFramebuffer);for(let i=0;i<n.length;i++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),u){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,h.__webglColorRenderbuffer[i]);let t=r.get(n[i]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,e.NEAREST),!0===c&&(B.length=0,z.length=0,B.push(e.COLOR_ATTACHMENT0+i),t.depthBuffer&&!1===t.resolveDepthBuffer&&(B.push(l),z.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,z)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,B))}if(i.bindFramebuffer(e.READ_FRAMEBUFFER,null),i.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<n.length;t++){i.bindFramebuffer(e.FRAMEBUFFER,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,h.__webglColorRenderbuffer[t]);let s=r.get(n[t]).__webglTexture;i.bindFramebuffer(e.FRAMEBUFFER,h.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}i.bindFramebuffer(e.DRAW_FRAMEBUFFER,h.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&c){let i=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[i])}}},this.setupDepthRenderbuffer=F,this.setupFrameBufferTexture=N,this.useMultisampledRTT=V}function t_(e,t){return{convert:function(i){let r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.jf0,a=n.ppV.getTransfer(s);if(i===n.OUM)return e.UNSIGNED_BYTE;if(i===n.Wew)return e.UNSIGNED_SHORT_4_4_4_4;if(i===n.gJ2)return e.UNSIGNED_SHORT_5_5_5_1;if(i===n.Dmk)return e.UNSIGNED_INT_5_9_9_9_REV;if(i===n.yT7)return e.UNSIGNED_INT_10F_11F_11F_REV;if(i===n.tJf)return e.BYTE;if(i===n.fBL)return e.SHORT;if(i===n.cHt)return e.UNSIGNED_SHORT;if(i===n.Yuy)return e.INT;if(i===n.bkx)return e.UNSIGNED_INT;if(i===n.RQf)return e.FLOAT;if(i===n.ix0)return e.HALF_FLOAT;if(i===n.wrO)return e.ALPHA;if(i===n.HIg)return e.RGB;if(i===n.GWd)return e.RGBA;if(i===n.zdS)return e.DEPTH_COMPONENT;if(i===n.dcC)return e.DEPTH_STENCIL;if(i===n.VT0)return e.RED;if(i===n.ZQM)return e.RED_INTEGER;if(i===n.paN)return e.RG;if(i===n.TkQ)return e.RG_INTEGER;if(i===n.c90)return e.RGBA_INTEGER;
1if(i===n.IE4||i===n.Nz6||i===n.jR7||i===n.BXX)if(a===n.KLL){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(i===n.IE4)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===n.Nz6)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===n.jR7)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===n.BXX)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(i===n.IE4)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===n.Nz6)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===n.jR7)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===n.BXX)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===n.k6Q||i===n.kTp||i===n.HXV||i===n.pBf){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(i===n.k6Q)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===n.kTp)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===n.HXV)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===n.pBf)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===n.CVz||i===n.Riy||i===n.KDk){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(i===n.CVz||i===n.Riy)return a===n.KLL?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(i===n.KDk)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}if(i===n.qa3||i===n.B_h||i===n.czI||i===n.rSH||i===n.Qrf||i===n.psI||i===n.a5J||i===n._QJ||i===n.uB5||i===n.lyL||i===n.bC7||i===n.y3Z||i===n.ojs||i===n.S$4){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(i===n.qa3)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===n.B_h)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===n.czI)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===n.rSH)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===n.Qrf)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===n.psI)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===n.a5J)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===n._QJ)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===n.uB5)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===n.lyL)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===n.bC7)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===n.y3Z)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===n.ojs)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===n.S$4)return a===n.KLL?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===n.Fn||i===n.H23||i===n.W9U){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(i===n.Fn)return a===n.KLL?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===n.H23)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===n.W9U)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(i===n.Kef||i===n.XG_||i===n.HO_||i===n.CWW){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(i===n.Kef)return r.COMPRESSED_RED_RGTC1_EXT;if(i===n.XG_)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===n.HO_)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===n.CWW)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return i===n.V3x?e.UNSIGNED_INT_24_8:void 0!==e[i]?e[i]:null}}}class tx{init(e,t){if(null===this.texture){let i=new n.rjZ(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,i=new n.BKk({vertexShader:"\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n if ( coord.x >= 1.0 ) {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n } else {\n\n gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n }\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new n.eaF(new n.bdM(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}}class ty extends n.Qev{constructor(e,t){super();let i=this,s=null,a=1,o=null,l="local-floor",h=1,c=null,u=null,d=null,p=null,f=null,m=null,g="undefined"!=typeof XRWebGLBinding,v=new tx,_={},x=t.getContextAttributes(),y=null,M=null,S=[],b=[],T=new n.I9Y,w=null,E=new n.ubm;E.viewport=new n.IUQ;let A=new n.ubm;A.viewport=new n.IUQ;let R=[E,A],C=new n.nZQ,I=null,P=null;function L(e){let t=b.indexOf(e.inputSource);if(-1===t)return;let i=S[t];void 0!==i&&(i.update(e.inputSource,e.frame,c||o),i.dispatchEvent({type:e.type,data:e.inputSource}))}function U(){s.removeEventListener("select",L),s.removeEventListener("selectstart",L),s.removeEventListener("selectend",L),s.removeEventListener("squeeze",L),s.removeEventListener("squeezestart",L),s.removeEventListener("squeezeend",L),s.removeEventListener("end",U
1),s.removeEventListener("inputsourceschange",N);for(let e=0;e<S.length;e++){let t=b[e];null!==t&&(b[e]=null,S[e].disconnect(t))}for(let e in I=null,P=null,v.reset(),_)delete _[e];e.setRenderTarget(y),f=null,p=null,d=null,s=null,M=null,z.stop(),i.isPresenting=!1,e.setPixelRatio(w),e.setSize(T.width,T.height,!1),i.dispatchEvent({type:"sessionend"})}function N(e){for(let t=0;t<e.removed.length;t++){let i=e.removed[t],n=b.indexOf(i);n>=0&&(b[n]=null,S[n].disconnect(i))}for(let t=0;t<e.added.length;t++){let i=e.added[t],n=b.indexOf(i);if(-1===n){for(let e=0;e<S.length;e++)if(e>=b.length){b.push(i),n=e;break}else if(null===b[e]){b[e]=i,n=e;break}if(-1===n)break}let r=S[n];r&&r.connect(i)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getGripSpace()},this.getHand=function(e){let t=S[e];return void 0===t&&(t=new n.R3r,S[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){a=e,i.isPresenting},this.setReferenceSpaceType=function(e){l=e,i.isPresenting},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(e){c=e},this.getBaseLayer=function(){return null!==p?p:f},this.getBinding=function(){return null===d&&g&&(d=new XRWebGLBinding(s,t)),d},this.getFrame=function(){return m},this.getSession=function(){return s},this.setSession=async function(r){if(null!==(s=r)){if(y=e.getRenderTarget(),s.addEventListener("select",L),s.addEventListener("selectstart",L),s.addEventListener("selectend",L),s.addEventListener("squeeze",L),s.addEventListener("squeezestart",L),s.addEventListener("squeezeend",L),s.addEventListener("end",U),s.addEventListener("inputsourceschange",N),!0!==x.xrCompatible&&await t.makeXRCompatible(),w=e.getPixelRatio(),e.getSize(T),g&&"createProjectionLayer"in XRWebGLBinding.prototype){let i=null,r=null,o=null;x.depth&&(o=x.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,i=x.stencil?n.dcC:n.zdS,r=x.stencil?n.V3x:n.bkx);let l={colorFormat:t.RGBA8,depthFormat:o,scaleFactor:a};p=(d=this.getBinding()).createProjectionLayer(l),s.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),M=new n.nWS(p.textureWidth,p.textureHeight,{format:n.GWd,type:n.OUM,depthTexture:new n.VCu(p.textureWidth,p.textureHeight,r,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:x.stencil,colorSpace:e.outputColorSpace,samples:4*!!x.antialias,resolveDepthBuffer:!1===p.ignoreDepthValues,resolveStencilBuffer:!1===p.ignoreDepthValues})}else{let i={antialias:x.antialias,alpha:!0,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:a};f=new XRWebGLLayer(s,t,i),s.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),M=new n.nWS(f.framebufferWidth,f.framebufferHeight,{format:n.GWd,type:n.OUM,colorSpace:e.outputColorSpace,stencilBuffer:x.stencil,resolveDepthBuffer:!1===f.ignoreDepthValues,resolveStencilBuffer:!1===f.ignoreDepthValues})}M.isXRRenderTarget=!0,this.setFoveation(h),c=null,o=await s.requestReferenceSpace(l),z.setContext(s),z.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==s)return s.environmentBlendMode},this.getDepthTexture=function(){return v.getDepthTexture()};let D=new n.Pq0,O=new n.Pq0;function F(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){var t,i,r;if(null===s)return;let a=e.near,o=e.far;null!==v.texture&&(v.depthNear>0&&(a=v.depthNear),v.depthFar>0&&(o=v.depthFar)),C.near=A.near=E.near=a,C.far=A.far=E.far=o,(I!==C.near||P!==C.far)&&(s.updateRenderState({depthNear:C.near,depthFar:C.far}),I=C.near,P=C.far),C.layers.mask=6|e.layers.mask,E.layers.mask=3&C.layers.mask,A.layers.mask=5&C.layers.mask;let l=e.parent,h=C.cameras;F(C,l);for(let e=0;e<h.length;e++)F(h[e],l);2===h.length?function(e,t,i){D.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(i.matrixWorld);let n=D.distanceTo(O),r=t.projectionMatrix.elements,s=i.projectionMatrix.elements,a=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],h=(r[9]-1)/r[5],c=(r[8]-1)/r[0],u=(s[8]+1)/s[0],d=n/(-c+u),p=-(d*c);if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(d),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===r[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=a+d,i=o+d;e.projectionMatrix.makePerspective(a*c-p,a*u+(n-p),l*o/i*t,h*o/i*t,t,i),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(C,E,A):C.projectionMatrix.copy(E.projectionMatrix),t=e,i=C,null===(r=l)?t.matrix.copy(i.matrixWorld):(t.matrix.copy(r.matrixWorld),t.matrix.invert(),t.matrix.multiply(i.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(i.projectionMatrix),t.projectionMatrixInverse.copy(i.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*n.a55*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)},this.getCamera=function(){return C},this.getFoveation=function(){if(null!==p||null!==f)return h},this.setFoveation=function(e){h=e,null!==p&&(p.fixedFoveation=e),null!==f&&void 0!==f.fixedFoveation&&(f.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==v.texture},this.getDepthSensingMesh=function(){return v.getMesh(C)},this.getCameraTexture=function(e){return _[e]};let B=null,z=new r;z.setAnimationLoop(function(t,r){if(u=r.getViewerPose(c||o),m=r,null!==u){let t=u.views;null!==f&&(e.setRenderTargetFramebuffer(M,f.framebuffer),e.setRenderTarget(M));let r=!1;t.length!==C.cameras.length&&(C.cameras.length=0,r=!0);for(let i=0;i<t.length;i++){let s=t[i],a=null;if(null!==f)a=f.getViewport(s);else{let t=d.getViewSubImage(p,s);a=t.viewport,0===i&&(e.setRenderTargetTextures(M,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(M))}let o=R[i];void 0===o&&((o=new n.ubm).layers.enable(i),o.viewport=new n.IUQ,R[i]=o),o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(s.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===i&&(C.matrix.copy(o.matrix),C.matrix.decompose(C.position,C.quaternion,C.scale)),!0===r&&C.cameras.push(o)}let a=s.enabledFeatures;if(a&&a.includes("depth-sensing")&&"gpu-optimized"==s.depthUsage&&g){let e=(d=i.getBinding()).getDepthInformation(t[0]);e&&e.isValid&&e.texture&&v.init(e,s.renderState)}if(a&&a.includes("camera-access")&&g){e.state.unbindTexture(),d=i.getBinding();for(let e=0;e<t.length;e++){let i=t[e].camera;if(i){let e=_[i];e||(e=new n.rjZ,_[i]=e);let t=d.getCameraImage(i);e.sourceTexture=t}}}}for(let e=0;e<S.length;e++){let t=b[e],i=S[e];null!==t&&void 0!==i&&i.update(t,r,c||o)}B&&B(t,r),r.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:r}),m=null}),this.setAnimationLoop=function(e){B=e},this.dispose=function(){}}}let tM=new n.O9p,tS=new n.kn4;function tb(e,t){function i(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,i(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,i(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,i(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,r.side===n.hsX&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,i(r.normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),r.side===n.hsX&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,i(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,i(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,i(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);let s=t.get(r),a=s.envMap,o=s.envMapRotation;a&&(e.envMap.value=a,tM.copy(o),tM.x*=-1,tM.y*=-1,tM.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(tM.y*=-1,tM.z*=-1),e.envMapRotation.value.setFromMatrix4(tS.makeRotationFromEuler(tM)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.
1ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,i(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,i(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,i){i.color.getRGB(t.fogColor.value,(0,n._Ut)(e)),i.isFog?(t.fogNear.value=i.near,t.fogFar.value=i.far):i.isFogExp2&&(t.fogDensity.value=i.density)},refreshMaterialUniforms:function(e,s,a,o,l){var h,c,u,d,p,f,m,g,v,_,x,y,M,S,b,T,w,E,A,R,C;s.isMeshBasicMaterial||s.isMeshLambertMaterial?r(e,s):s.isMeshToonMaterial?(r(e,s),h=e,(c=s).gradientMap&&(h.gradientMap.value=c.gradientMap)):s.isMeshPhongMaterial?(r(e,s),u=e,d=s,u.specular.value.copy(d.specular),u.shininess.value=Math.max(d.shininess,1e-4)):s.isMeshStandardMaterial?(r(e,s),p=e,f=s,p.metalness.value=f.metalness,f.metalnessMap&&(p.metalnessMap.value=f.metalnessMap,i(f.metalnessMap,p.metalnessMapTransform)),p.roughness.value=f.roughness,f.roughnessMap&&(p.roughnessMap.value=f.roughnessMap,i(f.roughnessMap,p.roughnessMapTransform)),f.envMap&&(p.envMapIntensity.value=f.envMapIntensity),s.isMeshPhysicalMaterial&&(m=e,g=s,v=l,m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,i(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,i(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,i(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,i(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,i(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===n.hsX&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,i(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,i(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=v.texture,m.transmissionSamplerSize.value.set(v.width,v.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,i(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,i(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,i(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,i(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,i(g.specularIntensityMap,m.specularIntensityMapTransform)))):s.isMeshMatcapMaterial?(r(e,s),_=e,(x=s).matcap&&(_.matcap.value=x.matcap)):s.isMeshDepthMaterial?r(e,s):s.isMeshDistanceMaterial?(r(e,s),function(e,i){let n=t.get(i).light;e.referencePosition.value.setFromMatrixPosition(n.matrixWorld),e.nearDistance.value=n.shadow.camera.near,e.farDistance.value=n.shadow.camera.far}(e,s)):s.isMeshNormalMaterial?r(e,s):s.isLineBasicMaterial?(y=e,M=s,y.diffuse.value.copy(M.color),y.opacity.value=M.opacity,M.map&&(y.map.value=M.map,i(M.map,y.mapTransform)),s.isLineDashedMaterial&&(S=e,b=s,S.dashSize.value=b.dashSize,S.totalSize.value=b.dashSize
1+b.gapSize,S.scale.value=b.scale)):s.isPointsMaterial?(T=e,w=s,E=a,A=o,T.diffuse.value.copy(w.color),T.opacity.value=w.opacity,T.size.value=w.size*E,T.scale.value=.5*A,w.map&&(T.map.value=w.map,i(w.map,T.uvTransform)),w.alphaMap&&(T.alphaMap.value=w.alphaMap,i(w.alphaMap,T.alphaMapTransform)),w.alphaTest>0&&(T.alphaTest.value=w.alphaTest)):s.isSpriteMaterial?(R=e,C=s,R.diffuse.value.copy(C.color),R.opacity.value=C.opacity,R.rotation.value=C.rotation,C.map&&(R.map.value=C.map,i(C.map,R.mapTransform)),C.alphaMap&&(R.alphaMap.value=C.alphaMap,i(C.alphaMap,R.alphaMapTransform)),C.alphaTest>0&&(R.alphaTest.value=C.alphaTest)):s.isShadowMaterial?(e.color.value.copy(s.color),e.opacity.value=s.opacity):s.isShaderMaterial&&(s.uniformsNeedUpdate=!1)}}}function tT(e,t,i,n){let r={},s={},a=[],o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e){let t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture,t}function h(t){let i=t.target;i.removeEventListener("dispose",h);let n=a.indexOf(i.__bindingPointIndex);a.splice(n,1),e.deleteBuffer(r[i.id]),delete r[i.id],delete s[i.id]}return{bind:function(e,t){let i=t.program;n.uniformBlockBinding(e,i)},update:function(i,c){let u=r[i.id];void 0===u&&(function(e){let t=e.uniforms,i=0;for(let e=0,n=t.length;e<n;e++){let n=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=n.length;e<t;e++){let t=n[e],r=Array.isArray(t.value)?t.value:[t.value];for(let e=0,n=r.length;e<n;e++){let n=l(r[e]),s=i%16,a=s%n.boundary,o=s+a;i+=a,0!==o&&16-o<n.storage&&(i+=16-o),t.__data=new Float32Array(n.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=i,i+=n.storage}}}let n=i%16;n>0&&(i+=16-n),e.__size=i,e.__cache={}}(i),u=function(t){let i=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return 0}();t.__bindingPointIndex=i;let n=e.createBuffer(),r=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,n),e.bufferData(e.UNIFORM_BUFFER,r,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,i,n),n}(i),r[i.id]=u,i.addEventListener("dispose",h));let d=c.program;n.updateUBOMapping(i,d);let p=t.render.frame;s[i.id]!==p&&(function(t){let i=r[t.id],n=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,i);for(let t=0,i=n.length;t<i;t++){let i=Array.isArray(n[t])?n[t]:[n[t]];for(let n=0,r=i.length;n<r;n++){let r=i[n];if(!0===function(e,t,i,n){let r=e.value,s=t+"_"+i;if(void 0===n[s])return"number"==typeof r||"boolean"==typeof r?n[s]=r:n[s]=r.clone(),!0;{let e=n[s];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return n[s]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}(r,t,n,s)){let t=r.__offset,i=Array.isArray(r.value)?r.value:[r.value],n=0;for(let s=0;s<i.length;s++){let a=i[s],o=l(a);"number"==typeof a||"boolean"==typeof a?(r.__data[0]=a,e.bufferSubData(e.UNIFORM_BUFFER,t+n,r.__data)):a.isMatrix3?(r.__data[0]=a.elements[0],r.__data[1]=a.elements[1],r.__data[2]=a.elements[2],r.__data[3]=0,r.__data[4]=a.elements[3],r.__data[5]=a.elements[4],r.__data[6]=a.elements[5],r.__data[7]=0,r.__data[8]=a.elements[6],r.__data[9]=a.elements[7],r.__data[10]=a.elements[8],r.__data[11]=0):(a.toArray(r.__data,n),n+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(i),s[i.id]=p)},dispose:function(){for(let t in r)e.deleteBuffer(r[t]);a=[],r={},s={}}}}class tw{get coordinateSystem(){return n.TdN}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=n.ppV._getDrawingBufferColorSpace(e),t.unpackColorSpace=n.ppV._getUnpackColorSpace()}constructor(e={}){let t,i,a,o,l,h,c,u,_,x,y,M,S,b,T,w,E,A,R,C,I,P,L,U,N,{canvas:H=(0,n.lPF)(),context:G=null,depth:W=!0,stencil:j=!1,alpha:X=!1,antialias:q=!1,premultipliedAlpha:Y=!0,preserveDrawingBuffer:Z=!1,powerPreference:K="default",failIfMajorPerformanceCaveat:J=!1,reversedDepthBuffer:Q=!1}=e;
1if(this.isWebGLRenderer=!0,null!==G){if("undefined"!=typeof WebGLRenderingContext&&G instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=G.getContextAttributes().alpha}else t=X;let $=new Uint32Array(4),ee=new Int32Array(4),et=null,ei=null,en=[],er=[];this.domElement=H,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=n.y_p,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let es=this,ea=!1;this._outputColorSpace=n.er$;let eo=0,el=0,eh=null,ec=-1,eu=null,ed=new n.IUQ,ep=new n.IUQ,ef=null,em=new n.Q1f(0),eg=0,ev=H.width,e_=H.height,ex=1,ey=null,eM=null,eS=new n.IUQ(0,0,ev,e_),eb=new n.IUQ(0,0,ev,e_),eT=!1,ew=new n.PPD,eE=!1,eA=!1,eR=new n.kn4,eC=new n.Pq0,eI=new n.IUQ,eP={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},eL=!1;function eU(){return null===eh?ex:1}let eN=G;function eD(e,t){return H.getContext(e,t)}try{if("setAttribute"in H&&H.setAttribute("data-engine","three.js r".concat(n.sPf)),H.addEventListener("webglcontextlost",eB,!1),H.addEventListener("webglcontextrestored",ez,!1),H.addEventListener("webglcontextcreationerror",ek,!1),null===eN){let e="webgl2";if(eN=eD(e,{alpha:!0,depth:W,stencil:j,antialias:q,premultipliedAlpha:Y,preserveDrawingBuffer:Z,powerPreference:K,failIfMajorPerformanceCaveat:J}),null===eN)if(eD(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw e}function eO(){(i=new O(eN)).init(),L=new t_(eN,i),a=new m(eN,i,e,L),o=new tg(eN,i),a.reversedDepthBuffer&&Q&&o.buffers.depth.setReversed(!0),l=new z(eN),h=new tn,c=new tv(eN,i,o,h,a,L,l),u=new v(es),_=new D(es),x=new s(eN),U=new p(eN,x),y=new F(eN,x,l,U),M=new V(eN,y,x,l),C=new k(eN,a,c),E=new g(h),S=new ti(es,u,_,i,a,U,E),b=new tb(es,h),T=new to,w=new tp(i),R=new d(es,u,_,o,M,t,Y),A=new tf(es,M,a),N=new tT(eN,l,a,o),I=new f(eN,i,l),P=new B(eN,i,l),l.programs=S.programs,es.capabilities=a,es.extensions=i,es.properties=h,es.renderLists=T,es.shadowMap=A,es.state=o,es.info=l}eO();let eF=new ty(es,eN);function eB(e){e.preventDefault(),ea=!0}function ez(){ea=!1;let e=l.autoReset,t=A.enabled,i=A.autoUpdate,n=A.needsUpdate,r=A.type;eO(),l.autoReset=e,A.enabled=t,A.autoUpdate=i,A.needsUpdate=n,A.type=r}function ek(e){}function eV(e){var t;let i=e.target;i.removeEventListener("dispose",eV),function(e){let t=h.get(e).programs;void 0!==t&&(t.forEach(function(e){S.releaseProgram(e)}),e.isShaderMaterial&&S.releaseShaderCache(e))}(t=i),h.remove(t)}function eH(e,t,i){!0===e.transparent&&e.side===n.$EB&&!1===e.forceSinglePass?(e.side=n.hsX,e.needsUpdate=!0,e$(e,t,i),e.side=n.hB5,e.needsUpdate=!0,e$(e,t,i),e.side=n.$EB):e$(e,t,i)}this.xr=eF,this.getContext=function(){return eN},this.getContextAttributes=function(){return eN.getContextAttributes()},this.forceContextLoss=function(){let e=i.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=i.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ex},this.setPixelRatio=function(e){void 0!==e&&(ex=e,this.setSize(ev,e_,!1))},this.getSize=function(e){return e.set(ev,e_)},this.setSize=function(e,t){let i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];eF.isPresenting||(ev=e,e_=t,H.width=Math.floor(e*ex),H.height=Math.floor(t*ex),!0===i&&(H.style.width=e+"px",H.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(ev*ex,e_*ex).floor()},this.setDrawingBufferSize=function(e,t,i){ev=e,e_=t,ex=i,H.width=Math.floor(e*i),H.height=Math.floor(t*i),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return e.copy(ed)},this.getViewport=function(e){return e.copy(eS)},this.setViewport=function(e,t,i,n){e.isVector4?eS.set(e.x,e.y,e.z,e.w):eS.set(e,t,i,n),o.viewport(ed.copy(eS).multiplyScalar(ex).round())},this.getScissor=function(e){return e.copy(eb)},this.setScissor=function(e,t,i,n){e.isVector4?eb.set(e.x,e.y,e.z,e.w):eb.set(e,t,i,n),o.scissor(ep.copy(eb).multiplyScalar(ex).round())}
1,this.getScissorTest=function(){return eT},this.setScissorTest=function(e){o.setScissorTest(eT=e)},this.setOpaqueSort=function(e){ey=e},this.setTransparentSort=function(e){eM=e},this.getClearColor=function(e){return e.copy(R.getClearColor())},this.setClearColor=function(){R.setClearColor(...arguments)},this.getClearAlpha=function(){return R.getClearAlpha()},this.setClearAlpha=function(){R.setClearAlpha(...arguments)},this.clear=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=0;if(e){let e=!1;if(null!==eh){let t=eh.texture.format;e=t===n.c90||t===n.TkQ||t===n.ZQM}if(e){let e=eh.texture.type,t=e===n.OUM||e===n.bkx||e===n.cHt||e===n.V3x||e===n.Wew||e===n.gJ2,i=R.getClearColor(),r=R.getClearAlpha(),s=i.r,a=i.g,o=i.b;t?($[0]=s,$[1]=a,$[2]=o,$[3]=r,eN.clearBufferuiv(eN.COLOR,0,$)):(ee[0]=s,ee[1]=a,ee[2]=o,ee[3]=r,eN.clearBufferiv(eN.COLOR,0,ee))}else r|=eN.COLOR_BUFFER_BIT}t&&(r|=eN.DEPTH_BUFFER_BIT),i&&(r|=eN.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eN.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){H.removeEventListener("webglcontextlost",eB,!1),H.removeEventListener("webglcontextrestored",ez,!1),H.removeEventListener("webglcontextcreationerror",ek,!1),R.dispose(),T.dispose(),w.dispose(),h.dispose(),u.dispose(),_.dispose(),M.dispose(),U.dispose(),N.dispose(),S.dispose(),eF.dispose(),eF.removeEventListener("sessionstart",eW),eF.removeEventListener("sessionend",eX),eq.stop()},this.renderBufferDirect=function(e,t,r,s,l,d){let p;null===t&&(t=eP);let f=l.isMesh&&0>l.matrixWorld.determinant(),m=function(e,t,i,r,s){var l,d;!0!==t.isScene&&(t=eP),c.resetTextureUnits();let p=t.fog,f=r.isMeshStandardMaterial?t.environment:null,m=null===eh?es.outputColorSpace:!0===eh.isXRRenderTarget?eh.texture.colorSpace:n.Zr2,g=(r.isMeshStandardMaterial?_:u).get(r.envMap||f),v=!0===r.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,x=!!i.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),y=!!i.morphAttributes.position,M=!!i.morphAttributes.normal,S=!!i.morphAttributes.color,T=n.y_p;r.toneMapped&&(null===eh||!0===eh.isXRRenderTarget)&&(T=es.toneMapping);let w=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,A=void 0!==w?w.length:0,R=h.get(r),I=ei.state.lights;if(!0===eE&&(!0===eA||e!==eu)){let t=e===eu&&r.id===ec;E.setState(r,e,t)}let P=!1;r.version===R.__version?R.needsLights&&R.lightsStateVersion!==I.state.version||R.outputColorSpace!==m||s.isBatchedMesh&&!1===R.batching?P=!0:s.isBatchedMesh||!0!==R.batching?s.isBatchedMesh&&!0===R.batchingColor&&null===s.colorTexture||s.isBatchedMesh&&!1===R.batchingColor&&null!==s.colorTexture||s.isInstancedMesh&&!1===R.instancing?P=!0:s.isInstancedMesh||!0!==R.instancing?s.isSkinnedMesh&&
vendor: 5,937 bytes, line 1
1!1===R.skinning?P=!0:s.isSkinnedMesh||!0!==R.skinning?s.isInstancedMesh&&!0===R.instancingColor&&null===s.instanceColor||s.isInstancedMesh&&!1===R.instancingColor&&null!==s.instanceColor||s.isInstancedMesh&&!0===R.instancingMorph&&null===s.morphTexture||s.isInstancedMesh&&!1===R.instancingMorph&&null!==s.morphTexture||R.envMap!==g||!0===r.fog&&R.fog!==p||void 0!==R.numClippingPlanes&&(R.numClippingPlanes!==E.numPlanes||R.numIntersection!==E.numIntersection)||R.vertexAlphas!==v||R.vertexTangents!==x||R.morphTargets!==y||R.morphNormals!==M||R.morphColors!==S||R.toneMapping!==T?P=!0:R.morphTargetsCount!==A&&(P=!0):P=!0:P=!0:P=!0:(P=!0,R.__version=r.version);let L=R.currentProgram;!0===P&&(L=e$(r,t,s));let U=!1,D=!1,O=!1,F=L.getUniforms(),B=R.uniforms;if(o.useProgram(L.program)&&(U=!0,D=!0,O=!0),r.id!==ec&&(ec=r.id,D=!0),U||eu!==e){o.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eN,"projectionMatrix",e.projectionMatrix),F.setValue(eN,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eN,eC.setFromMatrixPosition(e.matrixWorld)),a.logarithmicDepthBuffer&&F.setValue(eN,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&F.setValue(eN,"isOrthographic",!0===e.isOrthographicCamera),eu!==e&&(eu=e,D=!0,O=!0)}if(s.isSkinnedMesh){F.setOptional(eN,s,"bindMatrix"),F.setOptional(eN,s,"bindMatrixInverse");let e=s.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eN,"boneTexture",e.boneTexture,c))}s.isBatchedMesh&&(F.setOptional(eN,s,"batchingTexture"),F.setValue(eN,"batchingTexture",s._matricesTexture,c),F.setOptional(eN,s,"batchingIdTexture"),F.setValue(eN,"batchingIdTexture",s._indirectTexture,c),F.setOptional(eN,s,"batchingColorTexture"),null!==s._colorsTexture&&F.setValue(eN,"batchingColorTexture",s._colorsTexture,c));let z=i.morphAttributes;if((void 0!==z.position||void 0!==z.normal||void 0!==z.color)&&C.update(s,i,L),(D||R.receiveShadow!==s.receiveShadow)&&(R.receiveShadow=s.receiveShadow,F.setValue(eN,"receiveShadow",s.receiveShadow)),r.isMeshGouraudMaterial&&null!==r.envMap&&(B.envMap.value=g,B.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1),r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(B.envMapIntensity.value=t.environmentIntensity),D&&(F.setValue(eN,"toneMappingExposure",es.toneMappingExposure),R.needsLights&&(l=B,d=O,l.ambientLightColor.needsUpdate=d,l.lightProbe.needsUpdate=d,l.directionalLights.needsUpdate=d,l.directionalLightShadows.needsUpdate=d,l.pointLights.needsUpdate=d,l.pointLightShadows.needsUpdate=d,l.spotLights.needsUpdate=d,l.spotLightShadows.needsUpdate=d,l.rectAreaLights.needsUpdate=d,l.hemisphereLights.needsUpdate=d),p&&!0===r.fog&&b.refreshFogUniforms(B,p),b.refreshMaterialUniforms(B,r,ex,e_,ei.state.transmissionRenderTarget[e.id]),ej.upload(eN,e0(R),B,c)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(ej.upload(eN,e0(R),B,c),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&F.setValue(eN,"center",s.center),F.setValue(eN,"modelViewMatrix",s.modelViewMatrix),F.setValue(eN,"normalMatrix",s.normalMatrix),F.setValue(eN,"modelMatrix",s.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){let e=r.uniformsGroups;for(let t=0,i=e.length;t<i;t++){let i=e[t];N.update(i,L),N.bind(i,L)}}return L}(e,t,r,s,l);o.setMaterial(s,f);let g=r.index,v=1;if(!0===s.wireframe){if(void 0===(g=y.getWireframeAttribute(r)))return;v=2}let M=r.drawRange,S=r.attributes.position,T=M.start*v,w=(M.start+M.count)*v;null!==d&&(T=Math.max(T,d.start*v),w=Math.min(w,(d.start+d.count)*v)),null!==g?(T=Math.max(T,0),w=Math.min(w,g.count)):null!=S&&(T=Math.max(T,0),w=Math.min(w,S.count));let A=w-T;if(A<0||A===1/0)return;U.setup(l,s,m,r,g);let R=I;if(null!==g&&(p=x.get(g),(R=P).setIndex(p)),l.isMesh)!0===s.wireframe?(o.setLineWidth(s.wireframeLinewidth*eU()),R.setMode(eN.LINES)):R.setMode(eN.TRIANGLES);else if(l.isLine){let e=s.linewidth;void 0===e&&(e=1),o.setLineWidth(e*eU()),l.isLineSegments?R.setMode(eN.LINES):l.isLineLoop?R.setMode(eN.LINE_LOOP):R.setMode(eN.LINE_STRIP)}else l.isPoints?R.setMode(eN.POINTS):l.isSprite&&R.setMode(eN.TRIANGLES);if(l.isBatchedMesh)if(null!==l._multiDrawInstances)(0,n.mcG)("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),R.renderMultiDrawInstances(l._multiDrawStarts,l._multiDrawCounts,l._multiDrawCount,l._multiDrawInstances);else if(i.get("WEBGL_multi_draw"))R.renderMultiDraw(l._multiDrawStarts,l._multiDrawCounts,l._multiDrawCount);else{let e=l._multiDrawStarts,t=l._multiDrawCounts,i=l._multiDrawCount,n=g?x.get(g).bytesPerElement:1,r=h.get(s).currentProgram.getUniforms();for(let s=0;s<i;s++)r.setValue(eN,"_gl_DrawID",s),R.render(e[s]/n,t[s])}else if(l.isInstancedMesh)R.renderInstances(T,A,l.count);else if(r.isInstancedBufferGeometry){let e=void 0!==r._maxInstanceCount?r._maxInstanceCount:1/0,t=Math.min(r.instanceCount,e);R.renderInstances(T,A,t)}else R.render(T,A)},this.compile=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null===i&&(i=e),(ei=w.get(i)).init(t),er.push(ei),i.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(ei.pushLight(e),e.castShadow&&ei.pushShadow(e))}),e!==i&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(ei.pushLight(e),e.castShadow&&ei.pushShadow(e))}),ei.setupLights();let n=new Set;return e.traverse(function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;let t=e.material;if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++){let s=t[r];eH(s,i,e),n.add(s)}else eH(t,i,e),n.add(t)}),ei=er.pop(),n},this.compileAsync=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.compile(e,t,n);return new Promise(t=>
1{function n(){if(r.forEach(function(e){h.get(e).currentProgram.isReady()&&r.delete(e)}),0===r.size)return void t(e);setTimeout(n,10)}null!==i.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)})};let eG=null;function eW(){eq.stop()}function eX(){eq.start()}let eq=new r;function eY(e,t,i,n){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)ei.pushLight(e),e.castShadow&&ei.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ew.intersectsSprite(e)){n&&eI.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eR);let t=M.update(e),r=e.material;r.visible&&et.push(e,t,r,i,eI.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ew.intersectsObject(e))){let t=M.update(e),r=e.material;if(n&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eI.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eI.copy(t.boundingSphere.center)),eI.applyMatrix4(e.matrixWorld).applyMatrix4(eR)),Array.isArray(r)){let n=t.groups;for(let s=0,a=n.length;s<a;s++){let a=n[s],o=r[a.materialIndex];o&&o.visible&&et.push(e,t,o,i,eI.z,a)}}else r.visible&&et.push(e,t,r,i,eI.z,null)}}let r=e.children;for(let e=0,s=r.length;e<s;e++)eY(r[e],t,i,n)}function eZ(e,t,i,n){let r=e.opaque,s=e.transmissive,a=e.transparent;ei.setupLightsView(i),!0===eE&&E.setGlobalState(es.clippingPlanes,i),n&&o.viewport(ed.copy(n)),r.length>0&&eJ(r,t,i),s.length>0&&eJ(s,t,i),a.length>0&&eJ(a,t,i),o.buffers.depth.setTest(!0),o.buffers.depth.setMask(!0),o.buffers.color.setMask(!0),o.setPolygonOffset(!1)}function eK(e,t,r,s){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;void 0===ei.state.transmissionRenderTarget[s.id]&&(ei.state.transmissionRenderTarget[s.id]=new n.nWS(1,1,{generateMipmaps:!0,type:i.has("EXT_color_buffer_half_float")||i.has("EXT_color_buffer_float")?n.ix0:n.OUM,minFilter:n.$_I,samples:4,stencilBuffer:j,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:n.ppV.workingColorSpace}));let a=ei.state.transmissionRenderTarget[s.id],o=s.viewport||ed;a.setSize(o.z*es.transmissionResolutionScale,o.w*es.transmissionResolutionScale);let l=es.getRenderTarget(),h=es.getActiveCubeFace(),u=es.getActiveMipmapLevel();es.setRenderTarget(a),es.getClearColor(em),(eg=es.getClearAlpha())<1&&es.setClearColor(0xffffff,.5),es.clear(),eL&&R.render(r);let d=es.toneMapping;es.toneMapping=n.y_p;let p=s.viewport;if(void 0!==s.viewport&&(s.viewport=void 0),ei.setupLightsView(s),!0===eE&&E.setGlobalState(es.clippingPlanes,s),eJ(e,r,s),c.updateMultisampleRenderTarget(a),c.updateRenderTargetMipmap(a),!1===i.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,a=t.length;i<a;i++){let a=t[i],o=a.object,l=a.geometry,h=a.material,c=a.group;if(h.side===n.$EB&&o.layers.test(s.layers)){let t=h.side;h.side=n.hsX,h.needsUpdate=!0,eQ(o,r,s,l,h,c),h.side=t,h.needsUpdate=!0,e=!0}}!0===e&&(c.updateMultisampleRenderTarget(a),c.updateRenderTargetMipmap(a))}es.setRenderTarget(l,h,u),es.setClearColor(em,eg),void 0!==p&&(s.viewport=p),es.toneMapping=d}function eJ(e,t,i){let n=!0===t.isScene?t.overrideMaterial:null;for(let r=0,s=e.length;r<s;r++){let s=e[r],a=s.object,o=s.geometry,l=s.group,h=s.material;!0===h.allowOverride&&null!==n&&(h=n),a.layers.test(i.layers)&&eQ(a,t,i,o,h,l)}}function eQ(e,t,i,r,s,a){e.onBeforeRender(es,t,i,r,s,a),e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),s.onBeforeRender(es,t,i,r,e,a),!0===s.transparent&&s.side===n.$EB&&!1===s.forceSinglePass?(s.side=n.hsX,s.needsUpdate=!0,es.renderBufferDirect(i,t,r,s,e,a),s.side=n.hB5,s.needsUpdate=!0,es.renderBufferDirect(i,t,r,s,e,a),s.side=n.$EB):es.renderBufferDirect(i,t,r,s,e,a),e.onAfterRender(es,t,i,r,s,a)}function e$(e,t,i){var n;!0!==t.isScene&&(t=eP);let r=h.get(e),s=ei.state.lights,a=ei.state.shadowsArray,o=s.state.version,l=S.getParameters(e,s.state,a,t,i),c=S.getProgramCacheKey(l),d=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?_:u).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===d&&(e.addEventListener("dispose",eV),r.programs=d=new Map);let p=d.get(c);if(void 0!==p){if(r.currentProgram===p&&r.lightsStateVersion===o)return e1(e,l),p}else l.uniforms=S.getUniforms(e),e.onBeforeCompile(l,es),p=S.acquireProgram(l,c),d.set(c,p),r.uniforms=l.uniforms;let f=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(f.clippingPlanes=E.uniform),e1(e,l),r.needsLights=(n=e).isMeshLambertMaterial||n.isMeshToonMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isShadowMaterial||n.isShaderMaterial&&!0===n.lights,r.lightsStateVersion=o,r.needsLights&&(f.ambientLightColor.value=s.state.ambient,f.lightProbe.value=s.state.probe,f.directionalLights.value=s.state.directional,f.directionalLightShadows.value=s.state.directionalShadow,f.spotLights.value=s.state.spot,f.spotLightShadows.value=s.state.spotShadow,f.rectAreaLights.value=s.state.rectArea,f.ltc_1.value=s.state.rectAreaLTC1,f.ltc_2.value=s.state.rectAreaLTC2,f.pointLights.value=s.state.point,f.pointLightShadows.value=s.state.pointShadow,f.hemisphereLights.value=s.state.hemi,f.directionalShadowMap.value=s.state.directionalShadowMap,f.directionalShadowMatrix.value=s.state.directionalShadowMatrix,f.spotShadowMap.value=s.state.spotShadowMap,f.spotLightMatrix.value=s.state.spotLightMatrix,f.spotLightMap.value=s.state.spotLightMap,f.pointShadowMap.value=s.state.pointShadowMap,f.pointShadowMatrix.value=s.state.pointShadowMatrix),r.currentProgram=p,r.uniformsList=null,p}function e0(e){if(null===e.uniformsList){let t=e.currentProgram.getUniforms();e.uniformsList=ej.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function e1(e,t){let i=h.get(e);
1i.outputColorSpace=t.outputColorSpace,i.batching=t.batching,i.batchingColor=t.batchingColor,i.instancing=t.instancing,i.instancingColor=t.instancingColor,i.instancingMorph=t.instancingMorph,i.skinning=t.skinning,i.morphTargets=t.morphTargets,i.morphNormals=t.morphNormals,i.morphColors=t.morphColors,i.morphTargetsCount=t.morphTargetsCount,i.numClippingPlanes=t.numClippingPlanes,i.numIntersection=t.numClipIntersection,i.vertexAlphas=t.vertexAlphas,i.vertexTangents=t.vertexTangents,i.toneMapping=t.toneMapping}eq.setAnimationLoop(function(e){eG&&eG(e)}),"undefined"!=typeof self&&eq.setContext(self),this.setAnimationLoop=function(e){eG=e,eF.setAnimationLoop(e),null===e?eq.stop():eq.start()},eF.addEventListener("sessionstart",eW),eF.addEventListener("sessionend",eX),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera||!0===ea)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eF.enabled&&!0===eF.isPresenting&&(!0===eF.cameraAutoUpdate&&eF.updateCamera(t),t=eF.getCamera()),!0===e.isScene&&e.onBeforeRender(es,e,t,eh),(ei=w.get(e,er.length)).init(t),er.push(ei),eR.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ew.setFromProjectionMatrix(eR,n.TdN,t.reversedDepth),eA=this.localClippingEnabled,eE=E.init(this.clippingPlanes,eA),(et=T.get(e,en.length)).init(),en.push(et),!0===eF.enabled&&!0===eF.isPresenting){let e=es.xr.getDepthSensingMesh();null!==e&&eY(e,t,-1/0,es.sortObjects)}eY(e,t,0,es.sortObjects),et.finish(),!0===es.sortObjects&&et.sort(ey,eM),(eL=!1===eF.enabled||!1===eF.isPresenting||!1===eF.hasDepthSensing())&&R.addToRenderList(et,e),this.info.render.frame++,!0===eE&&E.beginShadows();let i=ei.state.shadowsArray;A.render(i,e,t),!0===eE&&E.endShadows(),!0===this.info.autoReset&&this.info.reset();let r=et.opaque,s=et.transmissive;if(ei.setupLights(),t.isArrayCamera){let i=t.cameras;if(s.length>0)for(let t=0,n=i.length;t<n;t++)eK(r,s,e,i[t]);eL&&R.render(e);for(let t=0,n=i.length;t<n;t++){let n=i[t];eZ(et,e,n,n.viewport)}}else s.length>0&&eK(r,s,e,t),eL&&R.render(e),eZ(et,e,t);null!==eh&&0===el&&(c.updateMultisampleRenderTarget(eh),c.updateRenderTargetMipmap(eh)),!0===e.isScene&&e.onAfterRender(es,e,t),U.resetDefaultState(),ec=-1,eu=null,er.pop(),er.length>0?(ei=er[er.length-1],!0===eE&&E.setGlobalState(es.clippingPlanes,ei.state.camera)):ei=null,en.pop(),et=en.length>0?en[en.length-1]:null},this.getActiveCubeFace=function(){return eo},this.getActiveMipmapLevel=function(){return el},this.getRenderTarget=function(){return eh},this.setRenderTargetTextures=function(e,t,i){let n=h.get(e);n.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===n.__autoAllocateDepthBuffer&&(n.__useRenderToTexture=!1),h.get(e.texture).__webglTexture=t,h.get(e.depthTexture).__webglTexture=n.__autoAllocateDepthBuffer?void 0:i,n.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let i=h.get(e);i.__webglFramebuffer=t,i.__useDefaultFramebuffer=void 0===t};let e2=eN.createFramebuffer();this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;eh=e,eo=t,el=i;let n=!0,r=null,s=!1,a=!1;if(e){let l=h.get(e);if(void 0!==l.__useDefaultFramebuffer)o.bindFramebuffer(eN.FRAMEBUFFER,null),n=!1;else if(void 0===l.__webglFramebuffer)c.setupRenderTarget(e);else if(l.__hasExternalTextures)c.rebindTextures(e,h.get(e.texture).__webglTexture,h.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(l.__boundDepthTexture!==t){if(null!==t&&h.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");c.setupDepthRenderbuffer(e)}}let u=e.texture;(u.isData3DTexture||u.isDataArrayTexture||u.isCompressedArrayTexture)&&(a=!0);let d=h.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=Array.isArray(d[t])?d[t][i]:d[t],s=!0):r=e.samples>0&&!1===c.useMultisampledRTT(e)?h.get(e).__webglMultisampledFramebuffer:Array.isArray(d)?d[i]:d,ed.copy(e.viewport),ep.copy(e.scissor),ef=e.scissorTest}else ed.copy(eS).multiplyScalar(ex).floor(),ep.copy(eb).multiplyScalar(ex).floor(),ef=eT;if(0!==i&&(r=e2),o.bindFramebuffer(eN.FRAMEBUFFER,r)&&n&&o.drawBuffers(e,r),o.viewport(ed),o.scissor(ep),o.setScissorTest(ef),s){let n=h.get(e.texture);eN.framebufferTexture2D(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_CUBE_MAP_POSITIVE_X+t,n.__webglTexture,i)}else if(a)for(let n=0;n<e.textures.length;n++){let r=h.get(e.textures[n]);eN.framebufferTextureLayer(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0+n,r.__webglTexture,i,t)}else if(null!==e&&0!==i){let t=h.get(e.texture);eN.framebufferTexture2D(eN.FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,t.__webglTexture,i)}ec=-1},this.readRenderTargetPixels=function(e,t,i,n,r,s,l){let c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))return;let u=h.get(e).__webglFramebuffer;
1if(e.isWebGLCubeRenderTarget&&void 0!==l&&(u=u[l]),u){o.bindFramebuffer(eN.FRAMEBUFFER,u);try{let o=e.textures[c],l=o.format,h=o.type;if(!a.textureFormatReadable(l)||!a.textureTypeReadable(h))return;t>=0&&t<=e.width-n&&i>=0&&i<=e.height-r&&(e.textures.length>1&&eN.readBuffer(eN.COLOR_ATTACHMENT0+c),eN.readPixels(t,i,n,r,L.convert(l),L.convert(h),s))}finally{let e=null!==eh?h.get(eh).__webglFramebuffer:null;o.bindFramebuffer(eN.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,i,r,s,l,c){let u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let d=h.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==c&&(d=d[c]),d)if(t>=0&&t<=e.width-r&&i>=0&&i<=e.height-s){o.bindFramebuffer(eN.FRAMEBUFFER,d);let c=e.textures[u],p=c.format,f=c.type;if(!a.textureFormatReadable(p))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!a.textureTypeReadable(f))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let m=eN.createBuffer();eN.bindBuffer(eN.PIXEL_PACK_BUFFER,m),eN.bufferData(eN.PIXEL_PACK_BUFFER,l.byteLength,eN.STREAM_READ),e.textures.length>1&&eN.readBuffer(eN.COLOR_ATTACHMENT0+u),eN.readPixels(t,i,r,s,L.convert(p),L.convert(f),0);let g=null!==eh?h.get(eh).__webglFramebuffer:null;o.bindFramebuffer(eN.FRAMEBUFFER,g);let v=eN.fenceSync(eN.SYNC_GPU_COMMANDS_COMPLETE,0);return eN.flush(),await (0,n.jej)(eN,v,4),eN.bindBuffer(eN.PIXEL_PACK_BUFFER,m),eN.getBufferSubData(eN.PIXEL_PACK_BUFFER,0,l),eN.deleteBuffer(m),eN.deleteSync(v),l}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n),a=null!==t?t.x:0,l=null!==t?t.y:0;c.setTexture2D(e,0),eN.copyTexSubImage2D(eN.TEXTURE_2D,i,0,0,a,l,r,s),o.unbindTexture()};let e3=eN.createFramebuffer(),e4=eN.createFramebuffer();this.copyTextureToTexture=function(e,t){let i,r,s,a,l,u,d,p,f,m,g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,v=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,_=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,x=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;null===x&&(0!==_?((0,n.mcG)("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),x=_,_=0):x=0);let y=e.isCompressedTexture?e.mipmaps[x]:e.image;if(null!==g)i=g.max.x-g.min.x,r=g.max.y-g.min.y,s=g.isBox3?g.max.z-g.min.z:1,a=g.min.x,l=g.min.y,u=g.isBox3?g.min.z:0;else{let t=Math.pow(2,-_);i=Math.floor(y.width*t),r=Math.floor(y.height*t),s=e.isDataArrayTexture?y.depth:e.isData3DTexture?Math.floor(y.depth*t):1,a=0,l=0,u=0}null!==v?(d=v.x,p=v.y,f=v.z):(d=0,p=0,f=0);let M=L.convert(t.format),S=L.convert(t.type);t.isData3DTexture?(c.setTexture3D(t,0),m=eN.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(c.setTexture2DArray(t,0),m=eN.TEXTURE_2D_ARRAY):(c.setTexture2D(t,0),m=eN.TEXTURE_2D),eN.pixelStorei(eN.UNPACK_FLIP_Y_WEBGL,t.flipY),eN.pixelStorei(eN.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eN.pixelStorei(eN.UNPACK_ALIGNMENT,t.unpackAlignment);let b=eN.getParameter(eN.UNPACK_ROW_LENGTH),T=eN.getParameter(eN.UNPACK_IMAGE_HEIGHT),w=eN.getParameter(eN.UNPACK_SKIP_PIXELS),E=eN.getParameter(eN.UNPACK_SKIP_ROWS),A=eN.getParameter(eN.UNPACK_SKIP_IMAGES);eN.pixelStorei(eN.UNPACK_ROW_LENGTH,y.width),eN.pixelStorei(eN.UNPACK_IMAGE_HEIGHT,y.height),eN.pixelStorei(eN.UNPACK_SKIP_PIXELS,a),eN.pixelStorei(eN.UNPACK_SKIP_ROWS,l),eN.pixelStorei(eN.UNPACK_SKIP_IMAGES,u);let R=e.isDataArrayTexture||e.isData3DTexture,C=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=h.get(e),c=h.get(t),m=h.get(n.__renderTarget),g=h.get(c.__renderTarget);o.bindFramebuffer(eN.READ_FRAMEBUFFER,m.__webglFramebuffer),o.bindFramebuffer(eN.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n<s;n++)R&&(eN.framebufferTextureLayer(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,h.get(e).__webglTexture,_,u+n),eN.framebufferTextureLayer(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,h.get(t).__webglTexture,x,f+n)),eN.blitFramebuffer(a,l,i,r,d,p,i,r,eN.DEPTH_BUFFER_BIT,eN.NEAREST);o.bindFramebuffer(eN.READ_FRAMEBUFFER,null),o.bindFramebuffer(eN.DRAW_FRAMEBUFFER,null)}else if(0!==_||e.isRenderTargetTexture||h.has(e)){let n=h.get(e),c=h.get(t);o.bindFramebuffer(eN.READ_FRAMEBUFFER,e3),o.bindFramebuffer(eN.DRAW_FRAMEBUFFER,e4);for(let e=0;e<s;e++)R?eN.framebufferTextureLayer(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,n.__webglTexture,_,u+e):eN.framebufferTexture2D(eN.READ_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,n.__webglTexture,_),C?eN.framebufferTextureLayer(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,c.__webglTexture,x,f+e):eN.framebufferTexture2D(eN.DRAW_FRAMEBUFFER,eN.COLOR_ATTACHMENT0,eN.TEXTURE_2D,c.__webglTexture,x),0!==_?eN.blitFramebuffer(a,l,i,r,d,p,i,r,eN.COLOR_BUFFER_BIT,eN.NEAREST):C?eN.copyTexSubImage3D(m,x,d,p,f+e,a,l,i,r):eN.copyTexSubImage2D(m,x,d,p,a,l,i,r);o.bindFramebuffer(eN.READ_FRAMEBUFFER,null),o.bindFramebuffer(eN.DRAW_FRAMEBUFFER,null)}else C?e.isDataTexture||e.isData3DTexture?eN.texSubImage3D(m,x,d,p,f,i,r,s,M,S,y.data):t.isCompressedArrayTexture?eN.compressedTexSubImage3D(m,x,d,p,f,i,r,s,M,y.data):eN.texSubImage3D(m,x,d,p,f,i,r,s,M,S,y):e.isDataTexture?eN.texSubImage2D(eN.TEXTURE_2D,x,d,p,i,r,M,S,y.data):e.isCompressedTexture?eN.compressedTexSubImage2D(eN.TEXTURE_2D,x,d,p,y.width,y.height,M,y.data):eN.texSubImage2D(eN.TEXTURE_2D,x,d,p,i,r,M,S,y);eN.pixelStorei(eN.UNPACK_ROW_LENGTH,b),eN.pixelStorei(eN.UNPACK_IMAGE_HEIGHT,T),eN.pixelStorei(eN.UNPACK_SKIP_PIXELS,w),eN.pixelStorei(eN.UNPACK_SKIP_ROWS,E),eN.pixelStorei(eN.UNPACK_SKIP_IMAGES,A),0===x&&t.generateMipmaps&&eN.generateMipmap(m),o.unbindTexture()},this.initRenderTarget=function(e){void 0===h.get(e).__webglFramebuffer&&c.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?c.setTextureCube(e,0):e.isData3DTexture?c.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?c.setTexture2DArray(e,0):c.setTexture2D(e,0),o.unbindTexture()},this.resetState=function(){eo=0,el=0,eh=null,o.reset(),U.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.