1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{"use strict";function t(e,n,{checkForDefaultPrevented:i=!0}={}){return function(t){if(e?.(t),!1===i||!t.defaultPrevented)return n?.(t)}}"undefined"!=typeof window&&window.document&&window.document.createElement,e.s(["composeEventHandlers",()=>t])},820783,e=>{"use strict";var t=e.i(271645);function n(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function i(...e){return t=>{let i=!1,r=e.map(e=>{let r=n(e,t);return i||"function"!=typeof r||(i=!0),r});if(i)return()=>{for(let t=0;t<r.length;t++){let i=r[t];"function"==typeof i?i():n(e[t],null)}}}}function r(...e){return t.useCallback(i(...e),e)}e.s(["composeRefs",()=>i,"useComposedRefs",()=>r])},30030,e=>{"use strict";var t=e.i(271645),n=e.i(843476);function i(e,i){let r=t.createContext(i),a=e=>{let{children:i,...a}=e,s=t.useMemo(()=>a,Object.values(a));return(0,n.jsx)(r.Provider,{value:s,children:i})};return a.displayName=e+"Provider",[a,function(n){let a=t.useContext(r);if(a)return a;if(void 0!==i)return i;throw Error(`\`${n}\` must be used within \`${e}\``)}]}function r(e,i=[]){let a=[],s=()=>{let n=a.map(e=>t.createContext(e));return function(i){let r=i?.[e]||n;return t.useMemo(()=>({[`__scope${e}`]:{...i,[e]:r}}),[i,r])}};return s.scopeName=e,[function(i,r){let s=t.createContext(r),o=a.length;a=[...a,r];let l=i=>{let{scope:r,children:a,...l}=i,c=r?.[e]?.[o]||s,u=t.useMemo(()=>l,Object.values(l));return(0,n.jsx)(c.Provider,{value:u,children:a})};return l.displayName=i+"Provider",[l,function(n,a){let l=a?.[e]?.[o]||s,c=t.useContext(l);if(c)return c;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${i}\``)}]},function(...e){let n=e[0];if(1===e.length)return n;let i=()=>{let i=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=i.reduce((t,{useScope:n,scopeName:i})=>{let r=n(e)[`__scope${i}`];return{...t,...r}},{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:r}),[r])}};return i.scopeName=n.scopeName,i}(s,...i)]}e.s(["createContext",()=>i,"createContextScope",()=>r])},934620,e=>{"use strict";var t=e.i(271645),n=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["useLayoutEffect",()=>n])},369340,e=>{"use strict";var t=e.i(271645),n=e.i(934620);t[" useEffectEvent ".trim().toString()],t[" useInsertionEffect ".trim().toString()];var i=t[" useInsertionEffect ".trim().toString()]||n.useLayoutEffect;function r({prop:e,defaultProp:n,onChange:r=()=>{},caller:a}){let[s,o,l]=function({defaultProp:e,onChange:n}){let[r,a]=t.useState(e),s=t.useRef(r),o=t.useRef(n);return i(()=>{o.current=n},[n]),t.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,a,o]}({defaultProp:n,onChange:r}),c=void 0!==e,u=c?e:s;{let n=t.useRef(void 0!==e);t.useEffect(()=>{let e=n.current;if(e!==c){let t=c?"controlled":"uncontrolled";console.warn(`${a} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}n.current=c},[c,a])}return[u,t.useCallback(t=>{if(c){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else o(t)},[c,e,o,l])]}Symbol("RADIX:SYNC_STATE"),e.s(["useControllableState",()=>r],369340)},248425,991918,e=>{"use strict";var t=e.i(271645),n=e.i(174080),i=e.i(820783),r=e.i(843476);function a(e){var n;let a,s=(n=e,(a=t.forwardRef((e,n)=>{let{children:r,...a}=e;if(t.isValidElement(r)){var s;let e,o,l=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),c=function(e,t){let n={...t};for(let i in t){let r=e[i],a=t[i];/^on[A-Z]/.test(i)?r&&a?n[i]=(...e)=>{let t=a(...e);return r(...e),t}:r&&(n[i]=r):"style"===i?n[i]={...r,...a}:"className"===i&&(n[i]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(a,r.props);return r.type!==t.Fragment&&(c.ref=n?(0,i.composeRefs)(n,l):l),t.cloneElement(r,c)}return t.Children.count(r)>1?t.Children.only(null):null})).displayName=`${n}
1.SlotClone`,a),o=t.forwardRef((e,n)=>{let{children:i,...a}=e,o=t.Children.toArray(i),l=o.find(u);if(l){let e=l.props.children,i=o.map(n=>n!==l?n:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,r.jsx)(s,{...a,ref:n,children:t.isValidElement(e)?t.cloneElement(e,void 0,i):null})}return(0,r.jsx)(s,{...a,ref:n,children:i})});return o.displayName=`${e}.Slot`,o}var s=a("Slot"),o=Symbol("radix.slottable");function l(e){let t=({children:e})=>(0,r.jsx)(r.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=o,t}var c=l("Slottable");function u(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===o}e.s(["Root",()=>s,"Slot",()=>s,"Slottable",()=>c,"createSlot",()=>a,"createSlottable",()=>l],991918);var h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{let i=a(`Primitive.${n}`),s=t.forwardRef((e,t)=>{let{asChild:a,...s}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(a?i:n,{...s,ref:t})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function d(e,t){e&&n.flushSync(()=>e.dispatchEvent(t))}e.s(["Primitive",()=>h,"dispatchDiscreteCustomEvent",()=>d],248425)},726330,30207,e=>{"use strict";var t,n=e.i(271645),i=e.i(981140),r=e.i(248425),a=e.i(820783);function s(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}e.s(["useCallbackRef",()=>s],30207);var o=e.i(843476),l="dismissableLayer.update",c=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),u=n.forwardRef((e,u)=>{let{disableOutsidePointerEvents:f=!1,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:g,onInteractOutside:_,onDismiss:v,...x}=e,y=n.useContext(c),[M,S]=n.useState(null),E=M?.ownerDocument??globalThis?.document,[,T]=n.useState({}),b=(0,a.useComposedRefs)(u,e=>S(e)),w=Array.from(y.layers),[A]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),R=w.indexOf(A),C=M?w.indexOf(M):-1,P=y.layersWithOutsidePointerEventsDisabled.size>0,L=C>=R,D=function(e,t=globalThis?.document){let i=s(e),r=n.useRef(!1),a=n.useRef(()=>{});return n.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let n=function(){d("dismissableLayer.pointerDownOutside",i,r,{discrete:!0})},r={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);r.current=!1},n=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,i]),{onPointerDownCapture:()=>r.current=!0}}(e=>{let t=e.target,n=[...y.branches].some(e=>e.contains(t));L&&!n&&(m?.(e),_?.(e),e.defaultPrevented||v?.())},E),N=function(e,t=globalThis?.document){let i=s(e),r=n.useRef(!1);return n.useEffect(()=>{let e=e=>{e.target&&!r.current&&d("dismissableLayer.focusOutside",i,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,i]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{let t=e.target;![...y.branches].some(e=>e.contains(t))&&(g?.(e),_?.(e),e.defaultPrevented||v?.())},E);return!function(e,t=globalThis?.document){let i=s(e);n.useEffect(()=>{let e=e=>{"Escape"===e.key&&i(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[i,t])}(e=>{C===y.layers.size-1&&(p?.(e),!e.defaultPrevented&&v&&(e.preventDefault(),v()))},E),n.useEffect(()=>{if(M)return f&&(0===y.layersWithOutsidePointerEventsDisabled.size&&(t=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(M)),y.layers.add(M),h(),()=>{f&&1===y.layersWithOutsidePointerEventsDisabled.size&&(E.body.style.pointerEvents=t)}},[M,E,f,y]),n.useEffect(()=>()=>{M&&(y.layers.delete(M),y.layersWithOutsidePointerEventsDisabled.delete(M),h())},[M,y]),n.useEffect(()=>{let e=()=>T({});return document.addEventListener(l,e),()=>document.removeEventListener(l,e)},[]),(0,o.jsx)(r.Primitive.div,{...x,ref:b,style:{pointerEvents:P?L?"auto":"none":void 0,...e.style},onFocusCapture:(0,i.composeEventHandlers)(e.onFocusCapture,N.onFocusCapture),onBlurCapture:(0,i.composeEventHandlers)(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:(0,i.composeEventHandlers)(e.onPointerDownCapture,D.onPointerDownCapture)})});function h(){let e=new CustomEvent(l);document.dispatchEvent(e)}function d(e,t,n,{discrete:i}){let a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),i?(0,r.dispatchDiscreteCustomEvent)(a,s):a.dispatchEvent(s)}
1u.displayName="DismissableLayer",n.forwardRef((e,t)=>{let i=n.useContext(c),s=n.useRef(null),l=(0,a.useComposedRefs)(t,s);return n.useEffect(()=>{let e=s.current;if(e)return i.branches.add(e),()=>{i.branches.delete(e)}},[i.branches]),(0,o.jsx)(r.Primitive.div,{...e,ref:l})}).displayName="DismissableLayerBranch",e.s(["DismissableLayer",()=>u],726330)},303536,e=>{"use strict";var t=e.i(271645),n=0;function i(){t.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??r()),document.body.insertAdjacentElement("beforeend",e[1]??r()),n++,()=>{1===n&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),n--}},[])}function r(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}e.s(["useFocusGuards",()=>i])},765491,e=>{"use strict";let t;var n=e.i(271645),i=e.i(820783),r=e.i(248425),a=e.i(30207),s=e.i(843476),o="focusScope.autoFocusOnMount",l="focusScope.autoFocusOnUnmount",c={bubbles:!1,cancelable:!0},u=n.forwardRef((e,t)=>{let{loop:u=!1,trapped:m=!1,onMountAutoFocus:g,onUnmountAutoFocus:_,...v}=e,[x,y]=n.useState(null),M=(0,a.useCallbackRef)(g),S=(0,a.useCallbackRef)(_),E=n.useRef(null),T=(0,i.useComposedRefs)(t,e=>y(e)),b=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect(()=>{if(m){let e=function(e){if(b.paused||!x)return;let t=e.target;x.contains(t)?E.current=t:f(E.current,{select:!0})},t=function(e){if(b.paused||!x)return;let t=e.relatedTarget;null!==t&&(x.contains(t)||f(E.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&f(x)});return x&&n.observe(x,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[m,x,b.paused]),n.useEffect(()=>{if(x){p.add(b);let e=document.activeElement;if(!x.contains(e)){let t=new CustomEvent(o,c);x.addEventListener(o,M),x.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let i of e)if(f(i,{select:t}),document.activeElement!==n)return}(h(x).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&f(x))}return()=>{x.removeEventListener(o,M),setTimeout(()=>{let t=new CustomEvent(l,c);x.addEventListener(l,S),x.dispatchEvent(t),t.defaultPrevented||f(e??document.body,{select:!0}),x.removeEventListener(l,S),p.remove(b)},0)}}},[x,M,S,b]);let w=n.useCallback(e=>{if(!u&&!m||b.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){var i;let t,r=e.currentTarget,[a,s]=[d(t=h(i=r),i),d(t.reverse(),i)];a&&s?e.shiftKey||n!==s?e.shiftKey&&n===a&&(e.preventDefault(),u&&f(s,{select:!0})):(e.preventDefault(),u&&f(a,{select:!0})):n===r&&e.preventDefault()}},[u,m,b.paused]);return(0,s.jsx)(r.Primitive.div,{tabIndex:-1,...v,ref:T,onKeyDown:w})});function h(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function d(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function f(e,{select:t=!1}={}){if(e&&e.focus){var n;let i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}u.displayName="FocusScope";var p=(t=[],{add(e){let n=t[0];e!==n&&n?.pause(),(t=m(t,e)).unshift(e)},remove(e){t=m(t,e),t[0]?.resume()}});function m(e,t){let n=[...e],i=n.indexOf(t);return -1!==i&&n.splice(i,1),n}e.s(["FocusScope",()=>u])},853660,e=>{"use strict";var t=e.i(271645);let n=["top","right","bottom","left"],i=Math.min,r=Math.max,a=Math.round,s=Math.floor,o=e=>({x:e,y:e}
1),l={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function u(e,t){return"function"==typeof e?e(t):e}function h(e){return e.split("-")[0]}function d(e){return e.split("-")[1]}function f(e){return"x"===e?"y":"x"}function p(e){return"y"===e?"height":"width"}let m=new Set(["top","bottom"]);function g(e){return m.has(h(e))?"y":"x"}function _(e){return e.replace(/start|end/g,e=>c[e])}let v=["left","right"],x=["right","left"],y=["top","bottom"],M=["bottom","top"];function S(e){return e.replace(/left|right|bottom|top/g,e=>l[e])}function E(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function T(e){let{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function b(e,t,n){let i,{reference:r,floating:a}=e,s=g(t),o=f(g(t)),l=p(o),c=h(t),u="y"===s,m=r.x+r.width/2-a.width/2,_=r.y+r.height/2-a.height/2,v=r[l]/2-a[l]/2;switch(c){case"top":i={x:m,y:r.y-a.height};break;case"bottom":i={x:m,y:r.y+r.height};break;case"right":i={x:r.x+r.width,y:_};break;case"left":i={x:r.x-a.width,y:_};break;default:i={x:r.x,y:r.y}}switch(d(t)){case"start":i[o]-=v*(n&&u?-1:1);break;case"end":i[o]+=v*(n&&u?-1:1)}return i}async function w(e,t){var n;void 0===t&&(t={});let{x:i,y:r,platform:a,rects:s,elements:o,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=u(t,e),m=E(p),g=o[f?"floating"===d?"reference":"floating":d],_=T(await a.getClippingRect({element:null==(n=await (null==a.isElement?void 0:a.isElement(g)))||n?g:g.contextElement||await (null==a.getDocumentElement?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===d?{x:i,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await (null==a.getOffsetParent?void 0:a.getOffsetParent(o.floating)),y=await (null==a.isElement?void 0:a.isElement(x))&&await (null==a.getScale?void 0:a.getScale(x))||{x:1,y:1},M=T(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:l}):v);return{top:(_.top-M.top+m.top)/y.y,bottom:(M.bottom-_.bottom+m.bottom)/y.y,left:(_.left-M.left+m.left)/y.x,right:(M.right-_.right+m.right)/y.x}}let A=async(e,t,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,o=a.filter(Boolean),l=await (null==s.isRTL?void 0:s.isRTL(t)),c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:h}=b(c,i,l),d=i,f={},p=0;for(let n=0;n<o.length;n++){var m;let{name:a,fn:g}=o[n],{x:_,y:v,data:x,reset:y}=await g({x:u,y:h,initialPlacement:i,placement:d,strategy:r,middlewareData:f,re
1cts:c,platform:{...s,detectOverflow:null!=(m=s.detectOverflow)?m:w},elements:{reference:e,floating:t}});u=null!=_?_:u,h=null!=v?v:h,f={...f,[a]:{...f[a],...x}},y&&p<=50&&(p++,"object"==typeof y&&(y.placement&&(d=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:r}):y.rects),{x:u,y:h}=b(c,d,l)),n=-1)}return{x:u,y:h,placement:d,strategy:r,middlewareData:f}};function R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function C(e){return n.some(t=>e[t]>=0)}let P=new Set(["left","top"]);async function L(e,t){let{placement:n,platform:i,elements:r}=e,a=await (null==i.isRTL?void 0:i.isRTL(r.floating)),s=h(n),o=d(n),l="y"===g(n),c=P.has(s)?-1:1,f=a&&l?-1:1,p=u(t,e),{mainAxis:m,crossAxis:_,alignmentAxis:v}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&"number"==typeof v&&(_="end"===o?-1*v:v),l?{x:_*f,y:m*c}:{x:m*c,y:_*f}}function D(){return"undefined"!=typeof window}function N(e){return O(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function U(e){var t;return null==(t=(O(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function O(e){return!!D()&&(e instanceof Node||e instanceof I(e).Node)}function F(e){return!!D()&&(e instanceof Element||e instanceof I(e).Element)}function B(e){return!!D()&&(e instanceof HTMLElement||e instanceof I(e).HTMLElement)}function z(e){return!!D()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof I(e).ShadowRoot)}let V=new Set(["inline","contents"]);function k(e){let{overflow:t,overflowX:n,overflowY:i,display:r}=$(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!V.has(r)}let G=new Set(["table","td","th"]),H=[":popover-open",":modal"];function W(e){return H.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let X=["transform","translate","scale","rotate","perspective"],j=["transform","translate","scale","rotate","perspective","filter"],q=["paint","layout","strict","content"];function Y(e){let t=K(),n=F(e)?$(e):e;return X.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||j.some(e=>(n.willChange||"").includes(e))||q.some(e=>(n.contain||"").includes(e))}function K(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let Z=new Set(["html","body","#document"]);function J(e){return Z.has(N(e))}function $(e){return I(e).getComputedStyle(e)}function Q(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ee(e){if("html"===N(e))return e;let t=e.assignedSlot||e.parentNode||z(e)&&e.host||U(e);return z(t)?t.host:t}function et(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);let r=function e(t){let n=ee(t);return J(n)?t.ownerDocument?t.ownerDocument.body:t.body:B(n)&&k(n)?n:e(n)}(e),a=r===(null==(i=e.ownerDocument)?void 0:i.body),s=I(r);if(a){let e=en(s);return t.concat(s,s.visualViewport||[],k(r)?r:[],e&&n?et(e):[])}return t.concat(r,et(r,[],n))}function en(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ei(e){let t=$(e),n=parseFloat(t.width)||0,i=parseFloat(t.height)||0,r=B(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:i,l=a(n)!==s||a(i)!==o;return l&&(n=s,i=o),{width:n,height:i,$:l}}function er(e){return F(e)?e:e.contextElement}function ea(e){let t=er(e);if(!B(t))return o(1);let n=t.getBoundingClientRect(),{width:i,height:r,$:s}=ei(t),l=(s?a(n.width):n.width)/i,c=(s?a(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}let es=o(0);function eo(e){let t=I(e);return K()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:es}function el(e,t,n,i){var r;void 0===t&&(t=!1),void 0===n&&(n=!1);let a=e.getBoundingClientRect(),s=er(e),l=o(1);t&&(i?F(i)&&(l=ea(i)):l=ea(e));let c=(void 0===(r=n)&&(r=!1),i&&(!r||i===I(s))&&r)?eo(s):o(0),u=(a.left+c.x)/l.x,h=(a.top+c.y)/l.y,d=a.width/l.x,f=a.height/l.y;if(s){let e=I(s),t=i&&F(i)?I(i):i,n=e,r=en(n);for(;r&&i&&t!==n;){let e=ea(r),t=r.getBoundingClientRect(),i=$(r),a=t.left+(r.clientLeft+parseFloat(i.paddingLeft))*e.x,s=t.top+(r.clientTop+parseFloat(i.paddingTop))*e.y;u*=e.x,h*=e.y,d*=e.x,f*=e.y,u+=a,h+=s,r=en(n=I(r))}}return T({width:d,height:f,x:u,y:h})}function ec(e,t){let n=Q(e).scrollLeft;return t?t.left+n:el(U(e)).left+n}function eu(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ec(e,n),y:n.top+t.scrollTop}}let eh=new Set(["absolute","fixed"]);function ed(e,t,n){var i;let a;if("viewport"===t)a=function(e,t){let n=I(e),i=U(e),r=n.visualVie
1wport,a=i.clientWidth,s=i.clientHeight,o=0,l=0;if(r){a=r.width,s=r.height;let e=K();(!e||e&&"fixed"===t)&&(o=r.offsetLeft,l=r.offsetTop)}let c=ec(i);if(c<=0){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(i.clientWidth-t.clientWidth-r);s<=25&&(a-=s)}else c<=25&&(a+=c);return{width:a,height:s,x:o,y:l}}(e,n);else if("document"===t){let t,n,s,o,l,c,u;i=U(e),t=U(i),n=Q(i),s=i.ownerDocument.body,o=r(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),l=r(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight),c=-n.scrollLeft+ec(i),u=-n.scrollTop,"rtl"===$(s).direction&&(c+=r(t.clientWidth,s.clientWidth)-o),a={width:o,height:l,x:c,y:u}}else if(F(t)){let e,i,r,s,l,c;i=(e=el(t,!0,"fixed"===n)).top+t.clientTop,r=e.left+t.clientLeft,s=B(t)?ea(t):o(1),l=t.clientWidth*s.x,c=t.clientHeight*s.y,a={width:l,height:c,x:r*s.x,y:i*s.y}}else{let n=eo(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return T(a)}function ef(e){return"static"===$(e).position}function ep(e,t){if(!B(e)||"fixed"===$(e).position)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function em(e,t){var n;let i=I(e);if(W(e))return i;if(!B(e)){let t=ee(e);for(;t&&!J(t);){if(F(t)&&!ef(t))return t;t=ee(t)}return i}let r=ep(e,t);for(;r&&(n=r,G.has(N(n)))&&ef(r);)r=ep(r,t);return r&&J(r)&&ef(r)&&!Y(r)?i:r||function(e){let t=ee(e);for(;B(t)&&!J(t);){if(Y(t))return t;if(W(t))break;t=ee(t)}return null}(e)||i}let eg=async function(e){let t=this.getOffsetParent||em,n=this.getDimensions,i=await n(e.floating);return{reference:function(e,t,n){let i=B(t),r=U(t),a="fixed"===n,s=el(e,!0,a,t),l={scrollLeft:0,scrollTop:0},c=o(0);if(i||!i&&!a)if(("body"!==N(t)||k(r))&&(l=Q(t)),i){let e=el(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=ec(r));a&&!i&&r&&(c.x=ec(r));let u=!r||i||a?o(0):eu(r,l);return{x:s.left+l.scrollLeft-c.x-u.x,y:s.top+l.scrollTop-c.y-u.y,width:s.width,height:s.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},e_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e,a="fixed"===r,s=U(i),l=!!t&&W(t.floating);if(i===s||l&&a)return n;let c={scrollLeft:0,scrollTop:0},u=o(1),h=o(0),d=B(i);if((d||!d&&!a)&&(("body"!==N(i)||k(s))&&(c=Q(i)),B(i))){let e=el(i);u=ea(i),h.x=e.x+i.clientLeft,h.y=e.y+i.clientTop}let f=!s||d||a?o(0):eu(s,c);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+h.x+f.x,y:n.y*u.y-c.scrollTop*u.y+h.y+f.y}},getDocumentElement:U,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:a,strategy:s}=e,o=[..."clippingAncestors"===n?W(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let i=et(e,[],!1).filter(e=>F(e)&&"body"!==N(e)),r=null,a="fixed"===$(e).position,s=a?ee(e):e;for(;F(s)&&!J(s);){let t=$(s),n=Y(s);n||"fixed"!==t.position||(r=null),(a?!n&&!r:!n&&"static"===t.position&&!!r&&eh.has(r.position)||k(s)&&!n&&function e(t,n){let i=ee(t);return!(i===n||!F(i)||J(i))&&("fixed"===$(i).position||e(i,n))}(e,s))?i=i.filter(e=>e!==s):r=t,s=ee(s)}return t.set(e,i),i}(t,this._c):[].concat(n),a],l=o[0],c=o.reduce((e,n)=>{let a=ed(t,n,s);return e.top=r(a.top,e.top),e.right=i(a.right,e.right),e.bottom=i(a.bottom,e.bottom),e.left=r(a.left,e.left),e},ed(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:em,getElementRects:eg,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=ei(e);return{width:t,height:n}},getScale:ea,isElement:F,isRTL:function(e){return"rtl"===$(e).direction}};function ev(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let ex=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:a,placement:s,rects:o,platform:l,elements:c,middlewareData:h}=t,{element:m,padding:_=0}=u(e,t)||{};if(null==m)return{};let v=E(_),x={x:n,y:a},y=f(g(s)),M=p(y),S=await l.getDimensions(m),T="y"===y,b=T?"clientHeight":"clientWidth",w=o.reference[M]+o.reference[y]-x[y]-o.floating[M],A=x[y]-o.reference[y],R=await (null==l.getOffsetParent?void 0:l.getOffsetParent(m)),C=R?R[b]:0;C&&await (null==l.isElement?void 0:l.isElement(R))||(C=c.floating[b]||o.floating[M]);let P=C/2-S[M]/2-1,L=i(v[T?"top":"left"],P),D=i(v[T?"bottom":"right"],P),N=C-S[M]-D,I=C/2-S[M]/2+(w/2-A/2),U=r(L,i(I,N)),O=!h.arrow&&null!=d(s)&&I!==U&&o.reference[M]/2-(I<L?L:D)-S[M]/2<0,F=O?I<L?I-L:I-N:0;return{[y]:x[y]+F,data:{[y]:U,centerOffset:I-U-F,...O&&{alignmentOffset:F}},reset:O}}});var ey=e.i(174080),eM="undefined"!=typeof document?t.useLayoutEffect:function(){};function eS(e,t){let n,i,r;if(e===t)return!0;
1if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(i=n;0!=i--;)if(!eS(e[i],t[i]))return!1;return!0}if((n=(r=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(i=n;0!=i--;)if(!({}).hasOwnProperty.call(t,r[i]))return!1;for(i=n;0!=i--;){let n=r[i];if(("_owner"!==n||!e.$$typeof)&&!eS(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eE(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eT(e,t){let n=eE(e);return Math.round(t*n)/n}function eb(e){let n=t.useRef(e);return eM(()=>{n.current=e}),n}var ew=e.i(248425),eA=e.i(843476),eR=t.forwardRef((e,t)=>{let{children:n,width:i=10,height:r=5,...a}=e;return(0,eA.jsx)(ew.Primitive.svg,{...a,ref:t,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,eA.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eR.displayName="Arrow";var eC=e.i(820783),eP=e.i(30030),eL=e.i(30207),eD=e.i(934620),eN="Popper",[eI,eU]=(0,eP.createContextScope)(eN),[eO,eF]=eI(eN),eB=e=>{let{__scopePopper:n,children:i}=e,[r,a]=t.useState(null);return(0,eA.jsx)(eO,{scope:n,anchor:r,onAnchorChange:a,children:i})};eB.displayName=eN;var ez="PopperAnchor",eV=t.forwardRef((e,n)=>{let{__scopePopper:i,virtualRef:r,...a}=e,s=eF(ez,i),o=t.useRef(null),l=(0,eC.useComposedRefs)(n,o),c=t.useRef(null);return t.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&s.onAnchorChange(c.current)}),r?null:(0,eA.jsx)(ew.Primitive.div,{...a,ref:l})});eV.displayName=ez;var ek="PopperContent",[eG,eH]=eI(ek),eW=t.forwardRef((e,n)=>{var a,o,l,c,m,E,T,b,w,D,N,I,O,F,B,z,V,k,G,H,W;let{__scopePopper:X,side:j="bottom",sideOffset:q=0,align:Y="center",alignOffset:K=0,arrowPadding:Z=0,avoidCollisions:J=!0,collisionBoundary:$=[],collisionPadding:Q=0,sticky:ee="partial",hideWhenDetached:en=!1,updatePositionStrategy:ei="optimized",onPlaced:ea,...es}=e,eo=eF(ek,X),[ec,eu]=t.useState(null),eh=(0,eC.useComposedRefs)(n,e=>eu(e)),[ed,ef]=t.useState(null),ep=function(e){let[n,i]=t.useState(void 0);return(0,eD.useLayoutEffect)(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,r;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,r=t.blockSize}else n=e.offsetWidth,r=e.offsetHeight;i({width:n,height:r})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}i(void 0)},[e]),n}(ed),em=ep?.width??0,eg=ep?.height??0,eR="number"==typeof Q?Q:{top:0,right:0,bottom:0,left:0,...Q},eP=Array.isArray($)?$:[$],eN=eP.length>0,eI={padding:eR,boundary:eP.filter(eY),altBoundary:eN},{refs:eU,floatingStyles:eO,placement:eB,isPositioned:ez,middlewareData:eV}=function(e){void 0===e&&(e={});let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,d]=t.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[f,p]=t.useState(r);eS(f,r)||p(r);let[m,g]=t.useState(null),[_,v]=t.useState(null),x=t.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),y=t.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),M=s||m,S=o||_,E=t.useRef(null),T=t.useRef(null),b=t.useRef(h),w=null!=c,R=eb(c),C=eb(a),P=eb(u),L=t.useCallback(()=>{var e,t;let r,a,s;if(!E.current||!T.current)return;let o={placement:n,strategy:i,middleware:f};C.current&&(o.platform=C.current),(e=E.current,t=T.current,r=new Map,s={...(a={platform:e_,...o}).platform,_c:r},A(e,t,{...a,platform:s})).then(e=>{let t={...e,isPositioned:!1!==P.current};D.current&&!eS(b.current,t)&&(b.current=t,ey.flushSync(()=>{d(t)}))})},[f,n,i,C,P]);eM(()=>{!1===u&&b.current.isPositioned&&(b.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let D=t.useRef(!1);eM(()=>(D.current=!0,()=>{D.current=!1}),[]),eM(()=>{if(M&&(E.current=M),S&&(T.current=S),M&&S){if(R.current)return R.current(M,S,L);L()}},[M,S,L,R,w]);let N=t.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:y}),[x,y]),I=t.useMemo(()=>({reference:M,floating:S}),[M,S]),U=t.useMemo(()=>{let e={position:i,left:0,top:0};if(!I.floating)return e;let t=eT(I.floating,h.x),n=eT(I.floating,h.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...eE(I.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:t,top:n}},[i,l,I.floating,h.x,h.y]);return t.useMemo(()=>({...h,update:L,refs:N,elements:I,floatingStyles:U}),[h,L,N,I,U])}({strategy:"fixed",placement:j+("center"!==Y?"-"+Y:""),whileElementsMounted:(...e)=>(function(e,t,n,a){let o;void 0===a&&(a={});let{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:h="function"==typeof IntersectionObserver,animationFrame:d=!1}=a,f=er(e),p=l||c?[...f?et(f):[],...et(t)]:[];
1p.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),c&&e.addEventListener("resize",n)});let m=f&&h?function(e,t){let n,a=null,o=U(e);function l(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return!function c(u,h){void 0===u&&(u=!1),void 0===h&&(h=1),l();let d=e.getBoundingClientRect(),{left:f,top:p,width:m,height:g}=d;if(u||t(),!m||!g)return;let _={rootMargin:-s(p)+"px "+-s(o.clientWidth-(f+m))+"px "+-s(o.clientHeight-(p+g))+"px "+-s(f)+"px",threshold:r(0,i(1,h))||1},v=!0;function x(t){let i=t[0].intersectionRatio;if(i!==h){if(!v)return c();i?c(!1,i):n=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==i||ev(d,e.getBoundingClientRect())||c(),v=!1}try{a=new IntersectionObserver(x,{..._,root:o.ownerDocument})}catch(e){a=new IntersectionObserver(x,_)}a.observe(e)}(!0),l}(f,n):null,g=-1,_=null;u&&(_=new ResizeObserver(e=>{let[i]=e;i&&i.target===f&&_&&(_.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=_)||e.observe(t)})),n()}),f&&!d&&_.observe(f),_.observe(t));let v=d?el(e):null;return d&&function t(){let i=el(e);v&&!ev(v,i)&&n(),v=i,o=requestAnimationFrame(t)}(),n(),()=>{var e;p.forEach(e=>{l&&e.removeEventListener("scroll",n),c&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=_)||e.disconnect(),_=null,d&&cancelAnimationFrame(o)}})(...e,{animationFrame:"always"===ei}),elements:{reference:eo.anchor},middleware:[{...{name:"offset",options:l=a={mainAxis:q+eg,alignmentAxis:K},async fn(e){var t,n;let{x:i,y:r,placement:a,middlewareData:s}=e,o=await L(e,l);return a===(null==(t=s.offset)?void 0:t.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+o.x,y:r+o.y,data:{...o,placement:a}}}},options:[a,o]},J&&{...{name:"shift",options:w=T={mainAxis:!0,crossAxis:!1,limiter:"partial"===ee?{...(void 0===(E=c)&&(E={}),{options:E,fn(e){let{x:t,y:n,placement:i,rects:r,middlewareData:a}=e,{offset:s=0,mainAxis:o=!0,crossAxis:l=!0}=u(E,e),c={x:t,y:n},d=g(i),p=f(d),m=c[p],_=c[d],v=u(s,e),x="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(o){let e="y"===p?"height":"width",t=r.reference[p]-r.floating[e]+x.mainAxis,n=r.reference[p]+r.reference[e]-x.mainAxis;m<t?m=t:m>n&&(m=n)}if(l){var y,M;let e="y"===p?"width":"height",t=P.has(h(i)),n=r.reference[d]-r.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:x.crossAxis),s=r.reference[d]+r.reference[e]+(t?0:(null==(M=a.offset)?void 0:M[d])||0)-(t?x.crossAxis:0);_<n?_=n:_>s&&(_=s)}return{[p]:m,[d]:_}}}),options:[c,m]}:void 0,...eI},async fn(e){let{x:t,y:n,placement:a,platform:s}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...d}=u(w,e),p={x:t,y:n},m=await s.detectOverflow(e,d),_=g(h(a)),v=f(_),x=p[v],y=p[_];if(o){let e="y"===v?"top":"left",t="y"===v?"bottom":"right",n=x+m[e],a=x-m[t];x=r(n,i(x,a))}if(l){let e="y"===_?"top":"left",t="y"===_?"bottom":"right",n=y+m[e],a=y-m[t];y=r(n,i(y,a))}let M=c.fn({...e,[v]:x,[_]:y});return{...M,data:{x:M.x-t,y:M.y-n,enabled:{[v]:o,[_]:l}}}}},options:[T,b]},J&&{...{name:"flip",options:I=D={...eI},async fn(e){var t,n,i,r,a,s,o,l;let c,m,E,{placement:T,middlewareData:b,rects:w,initialPlacement:A,platform:R,elements:C}=e,{mainAxis:P=!0,crossAxis:L=!0,fallbackPlacements:D,fallbackStrategy:N="bestFit",fallbackAxisSideDirection:U="none",flipAlignment:O=!0,...F}=u(I,e);if(null!=(t=b.arrow)&&t.alignmentOffset)return{};let B=h(T),z=g(A),V=h(A)===A,k=await (null==R.isRTL?void 0:R.isRTL(C.floating)),G=D||(V||!O?[S(A)]:(c=S(A),[_(A),c,_(c)])),H="none"!==U;!D&&H&&G.push(...(m=d(A),E=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?x:v;return t?v:x;case"left":case"right":return t?y:M;default:return[]}}(h(A),"start"===U,k),m&&(E=E.map(e=>e+"-"+m),O&&(E=E.concat(E.map(_)))),E));let W=[A,...G],X=await R.detectOverflow(e,F),j=[],q=(null==(n=b.flip)?void 0:n.overflows)||[];if(P&&j.push(X[B]),L){let e,t,n,i,r=(s=T,o=w,void 0===(l=k)&&(l=!1),e=d(s),n=p(t=f(g(s))),i="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",o.reference[n]>o.floating[n]&&(i=S(i)),[i,S(i)]);j.push(X[r[0]],X[r[1]])}if(q=[...q,{placement:T,overflows:j}],!j.every(e=>e<=0)){let e=((null==(i=b.flip)?void 0:i.index)||0)+1,t=W[e];if(t&&("alignment"!==L||z===g(t)||q.every(e=>g(e.placement)!==z||e.overflows[0]>0)))return{data:{index:e,overflows:q},reset:{placement:t}};let n=null==(r=q.filter(e=>e.overflows[0]<=0).sort((e,t)=>
1e.overflows[1]-t.overflows[1])[0])?void 0:r.placement;if(!n)switch(N){case"bestFit":{let e=null==(a=q.filter(e=>{if(H){let t=g(e.placement);return t===z||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=A}if(T!==n)return{reset:{placement:n}}}return{}}},options:[D,N]},{...{name:"size",options:B=O={...eI,apply:({elements:e,rects:t,availableWidth:n,availableHeight:i})=>{let{width:r,height:a}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${i}px`),s.setProperty("--radix-popper-anchor-width",`${r}px`),s.setProperty("--radix-popper-anchor-height",`${a}px`)}},async fn(e){var t,n;let a,s,{placement:o,rects:l,platform:c,elements:f}=e,{apply:p=()=>{},...m}=u(B,e),_=await c.detectOverflow(e,m),v=h(o),x=d(o),y="y"===g(o),{width:M,height:S}=l.floating;"top"===v||"bottom"===v?(a=v,s=x===(await (null==c.isRTL?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(s=v,a="end"===x?"top":"bottom");let E=S-_.top-_.bottom,T=M-_.left-_.right,b=i(S-_[a],E),w=i(M-_[s],T),A=!e.middlewareData.shift,R=b,C=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=T),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(R=E),A&&!x){let e=r(_.left,0),t=r(_.right,0),n=r(_.top,0),i=r(_.bottom,0);y?C=M-2*(0!==e||0!==t?e+t:r(_.left,_.right)):R=S-2*(0!==n||0!==i?n+i:r(_.top,_.bottom))}await p({...e,availableWidth:C,availableHeight:R});let P=await c.getDimensions(f.floating);return M!==P.width||S!==P.height?{reset:{rects:!0}}:{}}},options:[O,F]},ed&&{...{name:"arrow",options:k=z={element:ed,padding:Z},fn(e){let{element:t,padding:n}="function"==typeof k?k(e):k;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?ex({element:t.current,padding:n}).fn(e):{}:t?ex({element:t,padding:n}).fn(e):{}}},options:[z,V]},eK({arrowWidth:em,arrowHeight:eg}),en&&{...{name:"hide",options:W=G={strategy:"referenceHidden",...eI},async fn(e){let{rects:t,platform:n}=e,{strategy:i="referenceHidden",...r}=u(W,e);switch(i){case"referenceHidden":{let i=R(await n.detectOverflow(e,{...r,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:C(i)}}}case"escaped":{let i=R(await n.detectOverflow(e,{...r,altBoundary:!0}),t.floating);return{data:{escapedOffsets:i,escaped:C(i)}}}default:return{}}}},options:[G,H]}]}),[eH,eW]=eZ(eB),eX=(0,eL.useCallbackRef)(ea);(0,eD.useLayoutEffect)(()=>{ez&&eX?.()},[ez,eX]);let ej=eV.arrow?.x,eq=eV.arrow?.y,eJ=eV.arrow?.centerOffset!==0,[e$,eQ]=t.useState();return(0,eD.useLayoutEffect)(()=>{ec&&eQ(window.getComputedStyle(ec).zIndex)},[ec]),(0,eA.jsx)("div",{ref:eU.setFloating,"data-radix-popper-content-wrapper":"",style:{...eO,transform:ez?eO.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:e$,"--radix-popper-transform-origin":[eV.transformOrigin?.x,eV.transformOrigin?.y].join(" "),...eV.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,eA.jsx)(eG,{scope:X,placedSide:eH,onArrowChange:ef,arrowX:ej,arrowY:eq,shouldHideArrow:eJ,children:(0,eA.jsx)(ew.Primitive.div,{"data-side":eH,"data-align":eW,...es,ref:eh,style:{...es.style,animation:ez?void 0:"none"}})})})});eW.displayName=ek;var eX="PopperArrow",ej={top:"bottom",right:"left",bottom:"top",left:"right"},eq=t.forwardRef(function(e,t){let{__scopePopper:n,...i}=e,r=eH(eX,n),a=ej[r.placedSide];return(0,eA.jsx)("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:(0,eA.jsx)(eR,{...i,ref:t,style:{...i.style,display:"block"}})})});function eY(e){return null!==e}eq.displayName=eX;var eK=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:i,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,s=a?0:e.arrowWidth,o=a?0:e.arrowHeight,[l,c]=eZ(n),u={start:"0%",center:"50%",end:"100%"}[c],h=(r.arrow?.x??0)+s/2,d=(r.arrow?.y??0)+o/2,f="",p="";return"bottom"===l?(f=a?u:`${h}px`,p=`${-o}px`):"top"===l?(f=a?u:`${h}px`,p=`${i.floating.height+o}px`):"right"===l?(f=`${-o}px`,p=a?u:`${d}px`):"left"===l&&(f=`${i.floating.width+o}px`,p=a?u:`${d}px`),{data:{x:f,y:p}}}});function eZ(e){let[t,n="center"]=e.split("-");return[t,n]}e.s(["Anchor",()=>eV,"Arrow",()=>eq,"Content",()=>eW,"Root",()=>eB,"createPopperScope",()=>eU],853660)},610772,774606,296626,e=>{"use strict";var t=e.i(271645),n=e.i(934620),i=t[" useId ".trim().toString()]||(()=>void 0),r=0;function a(e){let[a,s]=t.useState(i());return(0,n.useLayoutEffect)(()=>{e||s(e=>e??String(r++))}
1,[e]),e||(a?`radix-${a}`:"")}e.s(["useId",()=>a],610772);var s=e.i(174080),o=e.i(248425),l=e.i(843476),c=t.forwardRef((e,i)=>{let{container:r,...a}=e,[c,u]=t.useState(!1);(0,n.useLayoutEffect)(()=>u(!0),[]);let h=r||c&&globalThis?.document?.body;return h?s.default.createPortal((0,l.jsx)(o.Primitive.div,{...a,ref:i}),h):null});c.displayName="Portal",e.s(["Portal",()=>c],774606);var u=e.i(820783),h=e=>{var i;let r,a,{present:s,children:o}=e,l=function(e){var i,r;let[a,s]=t.useState(),o=t.useRef(null),l=t.useRef(e),c=t.useRef("none"),[u,h]=(i=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>r[e][t]??e,i));return t.useEffect(()=>{let e=d(o.current);c.current="mounted"===u?e:"none"},[u]),(0,n.useLayoutEffect)(()=>{let t=o.current,n=l.current;if(n!==e){let i=c.current,r=d(t);e?h("MOUNT"):"none"===r||t?.display==="none"?h("UNMOUNT"):n&&i!==r?h("ANIMATION_OUT"):h("UNMOUNT"),l.current=e}},[e,h]),(0,n.useLayoutEffect)(()=>{if(a){let e,t=a.ownerDocument.defaultView??window,n=n=>{let i=d(o.current).includes(CSS.escape(n.animationName));if(n.target===a&&i&&(h("ANIMATION_END"),!l.current)){let n=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=n)})}},i=e=>{e.target===a&&(c.current=d(o.current))};return a.addEventListener("animationstart",i),a.addEventListener("animationcancel",n),a.addEventListener("animationend",n),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",i),a.removeEventListener("animationcancel",n),a.removeEventListener("animationend",n)}}h("ANIMATION_END")},[a,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:t.useCallback(e=>{o.current=e?getComputedStyle(e):null,s(e)},[])}}(s),c="function"==typeof o?o({present:l.isPresent}):t.Children.only(o),h=(0,u.useComposedRefs)(l.ref,(i=c,(a=(r=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?i.ref:(a=(r=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?i.props.ref:i.props.ref||i.ref));return"function"==typeof o||l.isPresent?t.cloneElement(c,{ref:h}):null};function d(e){return e?.animationName||"none"}h.displayName="Presence",e.s(["Presence",()=>h],296626)},186312,e=>{"use strict";var t=new WeakMap,n=new WeakMap,i={},r=0,a=function(e){return e&&(e.host||a(e.parentNode))},s=function(e,s,o,l){var c=(Array.isArray(e)?e:[e]).map(function(e){if(s.contains(e))return e;var t=a(e);return t&&s.contains(t)?t:(console.error("aria-hidden",e,"in not contained inside",s,". Doing nothing"),null)}).filter(function(e){return!!e});i[o]||(i[o]=new WeakMap);var u=i[o],h=[],d=new Set,f=new Set(c),p=function(e){!e||d.has(e)||(d.add(e),p(e.parentNode))};c.forEach(p);var m=function(e){!e||f.has(e)||Array.prototype.forEach.call(e.children,function(e){if(d.has(e))m(e);else try{var i=e.getAttribute(l),r=null!==i&&"false"!==i,a=(t.get(e)||0)+1,s=(u.get(e)||0)+1;t.set(e,a),u.set(e,s),h.push(e),1===a&&r&&n.set(e,!0),1===s&&e.setAttribute(o,"true"),r||e.setAttribute(l,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return m(s),d.clear(),r++,function(){h.forEach(function(e){var i=t.get(e)-1,r=u.get(e)-1;t.set(e,i),u.set(e,r),i||(n.has(e)||e.removeAttribute(l),n.delete(e)),r||e.removeAttribute(o)}),--r||(t=new WeakMap,t=new WeakMap,n=new WeakMap,i={})}},o=function(e,t,n){void 0===n&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),s(i,r,n,"aria-hidden")):function(){return null}};e.s(["hideOthers",()=>o])},985369,e=>{"use strict";var t,n,i,r,a,s,o,l=function(){return(l=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function c(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)0>t.indexOf(i[r])&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}var u=("function"==typeof SuppressedError&&SuppressedError,e.i(271645)),h="right-scroll-bar-position",d="width-before-scroll-bar";function f(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var p="undefined"!=typeof window?u.useLayoutEffect:u.useEffect,m=new WeakMap,g=(void 0===t&&(t={}),(void 0===n&&(n=function(e){return e}),i=[],r=!1,a={read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=n(e,r);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(r=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){r=!0;var t=[];if(i.length){var n=i;
1i=[],n.forEach(e),t=i}var a=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(a)};s(),i={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),i}}}}).options=l({async:!0,ssr:!1},t),a),_=function(){},v=u.forwardRef(function(e,t){var n,i,r,a,s=u.useRef(null),o=u.useState({onScrollCapture:_,onWheelCapture:_,onTouchMoveCapture:_}),h=o[0],d=o[1],v=e.forwardProps,x=e.children,y=e.className,M=e.removeScrollBar,S=e.enabled,E=e.shards,T=e.sideCar,b=e.noRelative,w=e.noIsolation,A=e.inert,R=e.allowPinchZoom,C=e.as,P=e.gapMode,L=c(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=(n=[s,t],i=function(e){return n.forEach(function(t){return f(t,e)})},(r=(0,u.useState)(function(){return{value:null,callback:i,facade:{get current(){return r.value},set current(value){var e=r.value;e!==value&&(r.value=value,r.callback(value,e))}}}})[0]).callback=i,a=r.facade,p(function(){var e=m.get(a);if(e){var t=new Set(e),i=new Set(n),r=a.current;t.forEach(function(e){i.has(e)||f(e,null)}),i.forEach(function(e){t.has(e)||f(e,r)})}m.set(a,n)},[n]),a),N=l(l({},L),h);return u.createElement(u.Fragment,null,S&&u.createElement(T,{sideCar:g,removeScrollBar:M,shards:E,noRelative:b,noIsolation:w,inert:A,setCallbacks:d,allowPinchZoom:!!R,lockRef:s,gapMode:P}),v?u.cloneElement(u.Children.only(x),l(l({},N),{ref:D})):u.createElement(void 0===C?"div":C,l({},N,{className:y,ref:D}),x))});v.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},v.classNames={fullWidth:d,zeroRight:h};var x=function(e){var t=e.sideCar,n=c(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw Error("Sidecar medium not found");return u.createElement(i,l({},n))};x.isSideCarExport=!0;var y=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o||("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var i,r;(i=t).styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n)),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},M=function(){var e=y();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},S=function(){var e=M();return function(t){return e(t.styles,t.dynamic),null}},E={left:0,top:0,right:0,gap:0},T=function(e){return parseInt(e||"",10)||0},b=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],i=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[T(n),T(i),T(r)]},w=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return E;var t=b(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},A=S(),R="data-scroll-locked",C=function(e,t,n,i){var r=e.left,a=e.top,s=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(i,";\n padding-right: ").concat(o,"px ").concat(i,";\n }\n body[").concat(R,"] {\n overflow: hidden ").concat(i,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(i,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(i,";\n "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(i,";")].filter(Boolean).join(""),"\n }\n \n .").concat(h," {\n right: ").concat(o,"px ").concat(i,";\n }\n \n .").concat(d," {\n margin-right: ").concat(o,"px ").concat(i,";\n }\n \n .").concat(h," .").concat(h," {\n right: 0 ").concat(i,";\n }\n \n .").concat(d," .").concat(d," {\n margin-right: 0 ").concat(i,";\n }\n \n body[").concat(R,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},P=function(){var e=parseInt(document.body.getAttribute(R)||"0",10);return isFinite(e)?e:0},L=function(){u.useEffect(function(){return document.body.setAttribute(R,(P()+1).toString()),function(){var e=P()-1;e<=0?document.body.removeAttribute(R):document.body.setAttribute(R,e.toString())}},[])},D=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=void 0===i?"margin":i;L();var a=u.useMemo(function(){return w(r)},[r]);return u.createElement(A,{styles:C(a,!t,r,n?"":"!important")})},N=!1;if("undefined"!=typeof window)try{var I=Object.defineProperty({},"passive",{get:function(){return N=!0,!0}});window.addEventListener("test",I,I),window.removeEventListener("test",I,I)}catch(e){N=!1}var U=!!N&&{passive:!1},O=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},F=function(e,t){var n=t.ownerDocument,i=t;do{if("undefined"!=typeof ShadowRoot&&i instanceof ShadowRoot&&(i=i.host),B(e,i)){var r=z(e,i);if(r[1]>r[2])return!0}i=i.parentNode}while(i&&i!==n.body)return!1},B=function(e,t){return"v"===e?O(t,"overflowY"):O(t,"overflowX")},z=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},V=function(e,t,n,i,r){var a,s=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),o=s*i,l=n.target,c=t.contains(l),u=!1,h=o>0,d=0,f=0;do{if(!l)break;var p=z(e,l),m=p[0],g=p[1]-p[2]-s*m;(m||g)&&B(e,l)&&(d+=g,f+=m);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!c&&l!==document.body||c&&(t.contains(l)||t===l))return h&&(r&&1>Math.abs(d)||!r&&o>d)?u=!0:!h&&(r&&1>Math.abs(f)||!r&&-o>f)&&(u=!0),u},k=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},G=function(e){return[e.deltaX,e.deltaY]},H=function(e){return e&&"current"in e?e.current:e},W=0,X=[];let j=(s=function(e){var t=u.useRef([]),n=u.useRef([0,0]),i=u.useRef(),r=u.useState(W++)[0],a=u.useState(S)[0],s=u.useRef(e);u.useEffect(function(){s.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var t=(function(e,t,n){if(n||2==arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}
1)([e.lockRef.current],(e.shards||[]).map(H),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var r,a=k(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-a[0],c="deltaY"in e?e.deltaY:o[1]-a[1],u=e.target,h=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===h&&"range"===u.type)return!1;var d=window.getSelection(),f=d&&d.anchorNode;if(f&&(f===u||f.contains(u)))return!1;var p=F(h,u);if(!p)return!0;if(p?r=h:(r="v"===h?"h":"v",p=F(h,u)),!p)return!1;if(!i.current&&"changedTouches"in e&&(l||c)&&(i.current=r),!r)return!0;var m=i.current||r;return V(m,t,e,"h"===m?l:c,!0)},[]),l=u.useCallback(function(e){if(X.length&&X[X.length-1]===a){var n="deltaY"in e?G(e):k(e),i=t.current.filter(function(t){var i;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(i=t.delta,i[0]===n[0]&&i[1]===n[1])})[0];if(i&&i.should){e.cancelable&&e.preventDefault();return}if(!i){var r=(s.current.shards||[]).map(H).filter(Boolean).filter(function(t){return t.contains(e.target)});(r.length>0?o(e,r[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=u.useCallback(function(e,n,i,r){var a={name:e,delta:n,target:i,should:r,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(i)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),h=u.useCallback(function(e){n.current=k(e),i.current=void 0},[]),d=u.useCallback(function(t){c(t.type,G(t),t.target,o(t,e.lockRef.current))},[]),f=u.useCallback(function(t){c(t.type,k(t),t.target,o(t,e.lockRef.current))},[]);u.useEffect(function(){return X.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,U),document.addEventListener("touchmove",l,U),document.addEventListener("touchstart",h,U),function(){X=X.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,U),document.removeEventListener("touchmove",l,U),document.removeEventListener("touchstart",h,U)}},[]);var p=e.removeScrollBar,m=e.inert;return u.createElement(u.Fragment,null,m?u.createElement(a,{styles:"\n .block-interactivity-".concat(r," {pointer-events: none;}\n .allow-interactivity-").concat(r," {pointer-events: all;}\n")}):null,p?u.createElement(D,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},g.useMedium(s),x);var q=u.forwardRef(function(e,t){return u.createElement(v,l({},e,{ref:t,sideCar:j}))});q.classNames=v.classNames,e.s(["RemoveScroll",0,q],985369)},540666,e=>{"use strict";var t=e.i(271645),n=e.i(981140),i=e.i(820783),r=e.i(30030),a=e.i(369340),s=e.i(248425),o=e.i(991918),l=e.i(843476);function c(e){let n=e+"CollectionProvider",[a,s]=(0,r.createContextScope)(n),[c,u]=a(n,{collectionRef:{current:null},itemMap:new Map}),h=e=>{let{scope:n,children:i}=e,r=t.default.useRef(null),a=t.default.useRef(new Map).current;return(0,l.jsx)(c,{scope:n,itemMap:a,collectionRef:r,children:i})};h.displayName=n;let d=e+"CollectionSlot",f=(0,o.createSlot)(d),p=t.default.forwardRef((e,t)=>{let{scope:n,children:r}=e,a=u(d,n),s=(0,i.useComposedRefs)(t,a.collectionRef);return(0,l.jsx)(f,{ref:s,children:r})});p.displayName=d;let m=e+"CollectionItemSlot",g="data-radix-collection-item",_=(0,o.createSlot)(m),v=t.default.forwardRef((e,n)=>{let{scope:r,children:a,...s}=e,o=t.default.useRef(null),c=(0,i.useComposedRefs)(n,o),h=u(m,r);return t.default.useEffect(()=>(h.itemMap.set(o,{ref:o,...s}),()=>void h.itemMap.delete(o))),(0,l.jsx)(_,{...{[g]:""},ref:c,children:a})});return v.displayName=m,[{Provider:h,Slot:p,ItemSlot:v},function(n){let i=u(e+"CollectionConsumer",n);return t.default.useCallback(()=>{let e=i.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(i.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[i.collectionRef,i.itemMap])},s]}var u=new WeakMap;function h(e,t){var n,i;let r,a,s;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(n=e,i=t,r=n.length,(s=(a=d(i))>=0?a:r+a)<0||s>=r?-1:s);return -1===o?void 0:e[o]}function d(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],u.set(this,!0)}set(e,t){return u.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let i,r=this.has(t),a=this.#e.length,s=d(e),o=s>=0?s:a+s,l=o<0||o>=a?-1:o;if(l===this.size||r&&l===this.size-1||-1===l)return this.set(t,n),this;let c=this.size+ +!r;s<0&&o++;let u=[...this.#e],h=!1;for(let e=o;e<c;e++)if(o===e){let a=u[e];u[e]===t&&(a=u[e+1]),r&&this.delete(t),i=this.get(a),this.set(t,n)}else{h||u[e-1]!==t||(h=!0);let n=u[h?e:e-1],r=i;i=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,i){let r=new e(this);return r.insert(t,n,i),r}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=h(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=h(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return h(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let i=n+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let i=n+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(e,t){let n=0;for(let i of this){if(Reflect.apply(e,t,[i,n,this]))return i;n++}}findIndex(e,t){let n=0;for(let i of this){if(Reflect.apply(e,t,[i,n,this]))return n;n++}return -1}filter(t,n){let i=[],r=0;for(let e of this)Reflect.apply(t,n,[e,r,this])&&i.push(e),r++;return new e(i)}map(t,n){let i=[],r=0;for(let e of this)i.push([e[0],Reflect.apply(t,n,[e,r,this])]),r++;return new e(i)}reduce(...e){let[t,n]=e,i=0,r=n??this.at(0);for(let n of this)r=0===i&&1===e.length?n:Reflect.apply(t,this,[r,n,i,this]),i++;return r}reduceRight(...e){let[t,n]=e,i=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let r=this.at(n);i=n===this.size-1&&1===e.length?r:Reflect.apply(t,this,[i,r,n,this])}return i}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),i=this.get(n);t.set(n,i)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let i=new e,r=this.size-1;if(void 0===t)return i;t<0&&(t+=this.size),void 0!==n&&n>0&&(r=n-1);for(let e=t;e<=r;e++){let t=this.keyAt(e),n=this.get(t);i.set(t,n)}return i}every(e,t){let n=0;for(let i of this){if(!Reflect.apply(e,t,[i,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let i of this){if(Reflect.apply(e,t,[i,n,this]))return!0;n++}return!1}});var f=t.createContext(void 0);function p(e){let n=t.useContext(f);return e||n||"ltr"}var m=e.i(726330),g=e.i(303536),_=e.i(765491),v=e.i(610772),x=e.i(853660),y=e.i(774606),M=e.i(296626),S=e.i(30207),E="rovingFocusGroup.onEntryFocus",T={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[w,A,R]=c(b),[C,P]=(0,r.createContextScope)(b,[R]),[L,D]=C(b),N=t.forwardRef((e,t)=>
1(0,l.jsx)(w.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,l.jsx)(w.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,l.jsx)(I,{...e,ref:t})})}));N.displayName=b;var I=t.forwardRef((e,r)=>{let{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:h,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:g,preventScrollOnEntryFocus:_=!1,...v}=e,x=t.useRef(null),y=(0,i.useComposedRefs)(r,x),M=p(h),[w,R]=(0,a.useControllableState)({prop:d,defaultProp:f??null,onChange:m,caller:b}),[C,P]=t.useState(!1),D=(0,S.useCallbackRef)(g),N=A(o),I=t.useRef(!1),[U,O]=t.useState(0);return t.useEffect(()=>{let e=x.current;if(e)return e.addEventListener(E,D),()=>e.removeEventListener(E,D)},[D]),(0,l.jsx)(L,{scope:o,orientation:c,dir:M,loop:u,currentTabStopId:w,onItemFocus:t.useCallback(e=>R(e),[R]),onItemShiftTab:t.useCallback(()=>P(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,l.jsx)(s.Primitive.div,{tabIndex:C||0===U?-1:0,"data-orientation":c,...v,ref:y,style:{outline:"none",...e.style},onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,n.composeEventHandlers)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!C){let t=new CustomEvent(E,T);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=N().filter(e=>e.focusable);B([e.find(e=>e.active),e.find(e=>e.id===w),...e].filter(Boolean).map(e=>e.ref.current),_)}}I.current=!1}),onBlur:(0,n.composeEventHandlers)(e.onBlur,()=>P(!1))})})}),U="RovingFocusGroupItem",O=t.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:r,focusable:a=!0,active:o=!1,tabStopId:c,children:u,...h}=e,d=(0,v.useId)(),f=c||d,p=D(U,r),m=p.currentTabStopId===f,g=A(r),{onFocusableItemAdd:_,onFocusableItemRemove:x,currentTabStopId:y}=p;return t.useEffect(()=>{if(a)return _(),()=>x()},[a,_,x]),(0,l.jsx)(w.ItemSlot,{scope:r,id:f,focusable:a,active:o,children:(0,l.jsx)(s.Primitive.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...h,ref:i,onMouseDown:(0,n.composeEventHandlers)(e.onMouseDown,e=>{a?p.onItemFocus(f):e.preventDefault()}),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,n){var i;
1let r=(i=e.key,"rtl"!==n?i:"ArrowLeft"===i?"ArrowRight":"ArrowRight"===i?"ArrowLeft":i);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return F[r]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){var n,i;"prev"===t&&r.reverse();let a=r.indexOf(e.currentTarget);r=p.loop?(n=r,i=a+1,n.map((e,t)=>n[(i+t)%n.length])):r.slice(a+1)}setTimeout(()=>B(r))}}),children:"function"==typeof u?u({isCurrentTabStop:m,hasTabStop:null!=y}):u})})});O.displayName=U;var F={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B(e,t=!1){let n=document.activeElement;for(let i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}var z=e.i(186312),V=e.i(985369),k=["Enter"," "],G=["ArrowUp","PageDown","End"],H=["ArrowDown","PageUp","Home",...G],W={ltr:[...k,"ArrowRight"],rtl:[...k,"ArrowLeft"]},X={ltr:["ArrowLeft"],rtl:["ArrowRight"]},j="Menu",[q,Y,K]=c(j),[Z,J]=(0,r.createContextScope)(j,[K,x.createPopperScope,P]),$=(0,x.createPopperScope)(),Q=P(),[ee,et]=Z(j),[en,ei]=Z(j),er=e=>{let{__scopeMenu:n,open:i=!1,children:r,dir:a,onOpenChange:s,modal:o=!0}=e,c=$(n),[u,h]=t.useState(null),d=t.useRef(!1),f=(0,S.useCallbackRef)(s),m=p(a);return t.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,l.jsx)(x.Root,{...c,children:(0,l.jsx)(ee,{scope:n,open:i,onOpenChange:f,content:u,onContentChange:h,children:(0,l.jsx)(en,{scope:n,onClose:t.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:m,modal:o,children:r})})})};er.displayName=j;var ea=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e,r=$(n);return(0,l.jsx)(x.Anchor,{...r,...i,ref:t})});ea.displayName="MenuAnchor";var es="MenuPortal",[eo,el]=Z(es,{forceMount:void 0}),ec=e=>{let{__scopeMenu:t,forceMount:n,children:i,container:r}=e,a=et(es,t);return(0,l.jsx)(eo,{scope:t,forceMount:n,children:(0,l.jsx)(M.Presence,{present:n||a.open,children:(0,l.jsx)(y.Portal,{asChild:!0,container:r,children:i})})})};ec.displayName=es;var eu="MenuContent",[eh,ed]=Z(eu),ef=t.forwardRef((e,t)=>{let n=el(eu,e.__scopeMenu),{forceMount:i=n.forceMount,...r}=e,a=et(eu,e.__scopeMenu),s=ei(eu,e.__scopeMenu);return(0,l.jsx)(q.Provider,{scope:e.__scopeMenu,children:(0,l.jsx)(M.Presence,{present:i||a.open,children:(0,l.jsx)(q.Slot,{scope:e.__scopeMenu,children:s.modal?(0,l.jsx)(ep,{...r,ref:t}):(0,l.jsx)(em,{...r,ref:t})})})})}),ep=t.forwardRef((e,r)=>{let a=et(eu,e.__scopeMenu),s=t.useRef(null),o=(0,i.useComposedRefs)(r,s);return t.useEffect(()=>{let e=s.current;if(e)return(0,z.hideOthers)(e)},[]),(0,l.jsx)(e_,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),em=t.forwardRef((e,t)=>{let n=et(eu,e.__scopeMenu);return(0,l.jsx)(e_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),eg=(0,o.createSlot)("MenuContent.ScrollLock"),e_=t.forwardRef((e,r)=>{let{__scopeMenu:a,loop:s=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:h,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:v,onInteractOutside:y,onDismiss:M,disableOutsideScroll:S,...E}=e,T=et(eu,a),b=ei(eu,a),w=$(a),A=Q(a),R=Y(a),[C,P]=t.useState(null),L=t.useRef(null),D=(0,i.useComposedRefs)(r,L,T.onContentChange),I=t.useRef(0),U=t.useRef(""),O=t.useRef(0),F=t.useRef(null),B=t.useRef("right"),z=t.useRef(0),k=S?V.RemoveScroll:t.Fragment;t.useEffect(()=>()=>window.clearTimeout(I.current),[]),(0,g.useFocusGuards)();let W=t.useCallback(e=>{var t,n;return B.current===F.current?.side&&(t=e,!!(n=F.current?.area)&&function(e,t){let{x:n,y:i}=e,r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let s=t[e],o=t[a],l=s.x,c=s.y,u=o.x,h=o.y;c>i!=h>i&&n<(u-l)*(i-c)/(h-c)+l&&(r=!r)}return r}({x:t.clientX,y:t.clientY},n))},[]);return(0,l.jsx)(eh,{scope:a,searchRef:U,onItemEnter:t.useCallback(e=>{W(e)&&e.preventDefault()},[W]),onItemLeave:t.useCallback(e=>{W(e)||(L.current?.focus(),P(null))},[W]),onTriggerLeave:t.useCallback(e=>{W(e)&&e.preventDefault()},[W]),pointerGraceTimerRef:O,onPointerGraceIntentChange:t.useCallback(e=>{F.current=e},[]),children:(0,l.jsx)(k,{...S?{as:eg,allowPinchZoom:!0}:void 0,children:(0,l.jsx)(_.FocusScope,{asChild:!0,trapped:o,onMountAutoFocus:(0,n.composeEventHandlers)(c,e=>{e.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:(0,l.jsx)(m.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:v,onInteractOutside:y,onDismiss:M,children:(0,l.jsx)(N,{asChild:!0,...A,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:(0,n.composeEventHandlers)(d,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,l.jsx)(x.Content,{role:"menu","aria-orientation":"vertical","data-state":eH(T.open),"data-radix-menu-content":"",dir:b.dir,...w,...E,ref:D,style:{outline:"none",...E.style},onKeyDown:(0,n.composeEventHandlers)(E.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,i=1===e.ke
1y.length;if(t){var r;let t,a,s,o,l,c;"Tab"===e.key&&e.preventDefault(),!n&&i&&(r=e.key,t=U.current+r,a=R().filter(e=>!e.disabled),s=document.activeElement,o=a.find(e=>e.ref.current===s)?.textValue,l=function(e,t,n){var i;let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=n?e.indexOf(n):-1,s=(i=Math.max(a,0),e.map((t,n)=>e[(i+n)%e.length]));1===r.length&&(s=s.filter(e=>e!==n));let o=s.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o!==n?o:void 0}(a.map(e=>e.textValue),t,o),c=a.find(e=>e.textValue===l)?.ref.current,function e(t){U.current=t,window.clearTimeout(I.current),""!==t&&(I.current=window.setTimeout(()=>e(""),1e3))}(t),c&&setTimeout(()=>c.focus()))}let a=L.current;if(e.target!==a||!H.includes(e.key))return;e.preventDefault();let s=R().filter(e=>!e.disabled).map(e=>e.ref.current);G.includes(e.key)&&s.reverse(),function(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}(s)}),onBlur:(0,n.composeEventHandlers)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(I.current),U.current="")}),onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,ej(e=>{let t=e.target,n=z.current!==e.clientX;e.currentTarget.contains(t)&&n&&(B.current=e.clientX>z.current?"right":"left",z.current=e.clientX)}))})})})})})})});ef.displayName=eu;var ev=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,l.jsx)(s.Primitive.div,{role:"group",...i,ref:t})});ev.displayName="MenuGroup";var ex=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,l.jsx)(s.Primitive.div,{...i,ref:t})});ex.displayName="MenuLabel";var ey="MenuItem",eM="menu.itemSelect",eS=t.forwardRef((e,r)=>{let{disabled:a=!1,onSelect:o,...c}=e,u=t.useRef(null),h=ei(ey,e.__scopeMenu),d=ed(ey,e.__scopeMenu),f=(0,i.useComposedRefs)(r,u),p=t.useRef(!1);return(0,l.jsx)(eE,{...c,ref:f,disabled:a,onClick:(0,n.composeEventHandlers)(e.onClick,()=>{let e=u.current;if(!a&&e){let t=new CustomEvent(eM,{bubbles:!0,cancelable:!0});e.addEventListener(eM,e=>o?.(e),{once:!0}),(0,s.dispatchDiscreteCustomEvent)(e,t),t.defaultPrevented?p.current=!1:h.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),p.current=!0},onPointerUp:(0,n.composeEventHandlers)(e.onPointerUp,e=>{p.current||e.currentTarget?.click()}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{let t=""!==d.searchRef.current;a||t&&" "===e.key||k.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});eS.displayName=ey;var eE=t.forwardRef((e,r)=>{let{__scopeMenu:a,disabled:o=!1,textValue:c,...u}=e,h=ed(ey,a),d=Q(a),f=t.useRef(null),p=(0,i.useComposedRefs)(r,f),[m,g]=t.useState(!1),[_,v]=t.useState("");return t.useEffect(()=>{let e=f.current;e&&v((e.textContent??"").trim())},[u.children]),(0,l.jsx)(q.ItemSlot,{scope:a,disabled:o,textValue:c??_,children:(0,l.jsx)(O,{asChild:!0,...d,focusable:!o,children:(0,l.jsx)(s.Primitive.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:p,onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,ej(e=>{o?h.onItemLeave(e):(h.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,n.composeEventHandlers)(e.onPointerLeave,ej(e=>h.onItemLeave(e))),onFocus:(0,n.composeEventHandlers)(e.onFocus,()=>g(!0)),onBlur:(0,n.composeEventHandlers)(e.onBlur,()=>g(!1))})})})}),eT=t.forwardRef((e,t)=>{let{checked:i=!1,onCheckedChange:r,...a}=e;return(0,l.jsx)(eD,{scope:e.__scopeMenu,checked:i,children:(0,l.jsx)(eS,{role:"menuitemcheckbox","aria-checked":eW(i)?"mixed":i,...a,ref:t,"data-state":eX(i),onSelect:(0,n.composeEventHandlers)(a.onSelect,()=>r?.(!!eW(i)||!i),{checkForDefaultPrevented:!1})})})});eT.displayName="MenuCheckboxItem";var eb="MenuRadioGroup",[ew,eA]=Z(eb,{value:void 0,onValueChange:()=>{}}),eR=t.forwardRef((e,t)=>{let{value:n,onValueChange:i,...r}=e,a=(0,S.useCallbackRef)(i);return(0,l.jsx)(ew,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,l.jsx)(ev,{...r,ref:t})})});eR.displayName=eb;var eC="MenuRadioItem",eP=t.forwardRef((e,t)=>{let{value:i,...r}=e,a=eA(eC,e.__scopeMenu),s=i===a.value;return(0,l.jsx)(eD,{scope:e.__scopeMenu,checked:s,children:(0,l.jsx)(eS,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":eX(s),onSelect:(0,n.composeEventHandlers)(r.onSelect,()=>a.onValueChange?.(i),{checkForDefaultPrevented:!1})})})});eP.displayName=eC;var eL="MenuItemIndicator",[eD,eN]=Z(eL,{checked:!1}
1),eI=t.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:i,...r}=e,a=eN(eL,n);return(0,l.jsx)(M.Presence,{present:i||eW(a.checked)||!0===a.checked,children:(0,l.jsx)(s.Primitive.span,{...r,ref:t,"data-state":eX(a.checked)})})});eI.displayName=eL;var eU=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e;return(0,l.jsx)(s.Primitive.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});eU.displayName="MenuSeparator";var eO=t.forwardRef((e,t)=>{let{__scopeMenu:n,...i}=e,r=$(n);return(0,l.jsx)(x.Arrow,{...r,...i,ref:t})});eO.displayName="MenuArrow";var[eF,eB]=Z("MenuSub"),ez="MenuSubTrigger",eV=t.forwardRef((e,r)=>{let a=et(ez,e.__scopeMenu),s=ei(ez,e.__scopeMenu),o=eB(ez,e.__scopeMenu),c=ed(ez,e.__scopeMenu),u=t.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:d}=c,f={__scopeMenu:e.__scopeMenu},p=t.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return t.useEffect(()=>p,[p]),t.useEffect(()=>{let e=h.current;return()=>{window.clearTimeout(e),d(null)}},[h,d]),(0,l.jsx)(ea,{asChild:!0,...f,children:(0,l.jsx)(eE,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":o.contentId,"data-state":eH(a.open),...e,ref:(0,i.composeRefs)(r,o.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:(0,n.composeEventHandlers)(e.onPointerMove,ej(t=>{c.onItemEnter(t),!t.defaultPrevented&&(e.disabled||a.open||u.current||(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{a.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,n.composeEventHandlers)(e.onPointerLeave,ej(e=>{p();let t=a.content?.getBoundingClientRect();if(t){let n=a.content?.dataset.side,i="right"===n,r=t[i?"left":"right"],s=t[i?"right":"left"];c.onPointerGraceIntentChange({area:[{x:e.clientX+(i?-5:5),y:e.clientY},{x:r,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:r,y:t.bottom}],side:n}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(e),e.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,t=>{let n=""!==c.searchRef.current;e.disabled||n&&" "===t.key||W[s.dir].includes(t.key)&&(a.onOpenChange(!0),a.content?.focus(),t.preventDefault())})})})});eV.displayName=ez;var ek="MenuSubContent",eG=t.forwardRef((e,r)=>{let a=el(eu,e.__scopeMenu),{forceMount:s=a.forceMount,...o}=e,c=et(eu,e.__scopeMenu),u=ei(eu,e.__scopeMenu),h=eB(ek,e.__scopeMenu),d=t.useRef(null),f=(0,i.useComposedRefs)(r,d);return(0,l.jsx)(q.Provider,{scope:e.__scopeMenu,children:(0,l.jsx)(M.Presence,{present:s||c.open,children:(0,l.jsx)(q.Slot,{scope:e.__scopeMenu,children:(0,l.jsx)(e_,{id:h.contentId,"aria-labelledby":h.triggerId,...o,ref:f,align:"start",side:"rtl"===u.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{u.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,n.composeEventHandlers)(e.onFocusOutside,e=>{e.target!==h.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:(0,n.composeEventHandlers)(e.onEscapeKeyDown,e=>{u.onClose(),e.preventDefault()}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=X[u.dir].includes(e.key);t&&n&&(c.onOpenChange(!1),h.trigger?.focus(),e.preventDefault())})})})})})});function eH(e){return e?"open":"closed"}function eW(e){return"indeterminate"===e}function eX(e){return eW(e)?"indeterminate":e?"checked":"unchecked"}function ej(e){return t=>"mouse"===t.pointerType?e(t):void 0}eG.displayName=ek;var eq="DropdownMenu",[eY,eK]=(0,r.createContextScope)(eq,[J]),eZ=J(),[eJ,e$]=eY(eq),eQ=e=>{let{__scopeDropdownMenu:n,children:i,dir:r,open:s,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,h=eZ(n),d=t.useRef(null),[f,p]=(0,a.useControllableState)({prop:s,defaultProp:o??!1,onChange:c,caller:eq});return(0,l.jsx)(eJ,{scope:n,triggerId:(0,v.useId)(),triggerRef:d,contentId:(0,v.useId)(),open:f,onOpenChange:p,onOpenToggle:t.useCallback(()=>p(e=>!e),[p]),modal:u,children:(0,l.jsx)(er,{...h,open:f,onOpenChange:p,dir:r,modal:u,children:i})})};eQ.displayName=eq;var e0="DropdownMenuTrigger",e1=t.forwardRef((e,t)=>
1{let{__scopeDropdownMenu:r,disabled:a=!1,...o}=e,c=e$(e0,r),u=eZ(r);return(0,l.jsx)(ea,{asChild:!0,...u,children:(0,l.jsx)(s.Primitive.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...o,ref:(0,i.composeRefs)(t,c.triggerRef),onPointerDown:(0,n.composeEventHandlers)(e.onPointerDown,e=>{!a&&0===e.button&&!1===e.ctrlKey&&(c.onOpenToggle(),c.open||e.preventDefault())}),onKeyDown:(0,n.composeEventHandlers)(e.onKeyDown,e=>{!a&&(["Enter"," "].includes(e.key)&&c.onOpenToggle(),"ArrowDown"===e.key&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});e1.displayName=e0;var e3=e=>{let{__scopeDropdownMenu:t,...n}=e,i=eZ(t);return(0,l.jsx)(ec,{...i,...n})};e3.displayName="DropdownMenuPortal";var e2="DropdownMenuContent",e4=t.forwardRef((e,i)=>{let{__scopeDropdownMenu:r,...a}=e,s=e$(e2,r),o=eZ(r),c=t.useRef(!1);return(0,l.jsx)(ef,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...a,ref:i,onCloseAutoFocus:(0,n.composeEventHandlers)(e.onCloseAutoFocus,e=>{c.current||s.triggerRef.current?.focus(),c.current=!1,e.preventDefault()}),onInteractOutside:(0,n.composeEventHandlers)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,i=2===t.button||n;(!s.modal||i)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});e4.displayName=e2,t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(ev,{...r,...i,ref:t})}).displayName="DropdownMenuGroup",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(ex,{...r,...i,ref:t})}).displayName="DropdownMenuLabel";var e5=t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eS,{...r,...i,ref:t})});e5.displayName="DropdownMenuItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eT,{...r,...i,ref:t})}).displayName="DropdownMenuCheckboxItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eR,{...r,...i,ref:t})}).displayName="DropdownMenuRadioGroup",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eP,{...r,...i,ref:t})}).displayName="DropdownMenuRadioItem",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eI,{...r,...i,ref:t})}).displayName="DropdownMenuItemIndicator",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eU,{...r,...i,ref:t})}).displayName="DropdownMenuSeparator",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eO,{...r,...i,ref:t})}).displayName="DropdownMenuArrow",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eV,{...r,...i,ref:t})}).displayName="DropdownMenuSubTrigger",t.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...i}=e,r=eZ(n);return(0,l.jsx)(eG,{...r,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent",e.s(["Content",()=>e4,"Item",()=>e5,"Portal",()=>e3,"Root",()=>eQ,"Trigger",()=>e1],540666)},190072,408560,e=>{"use strict";let t,n,i,r,a,s="srgb",o="srgb-linear",l="linear",c="srgb",u="300 es";function h(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function d(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function f(){let e=d("canvas");return e.style.display="block",e}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;let p={};function m(...e){console.log("THREE."+e.shift(),...e)}function g(...e){console.warn("THREE."+e.shift(),...e)}function _(...e){console.error("THREE."+e.shift(),...e)}function v(...e){let t=e.join(" ");t in p||(p[t]=!0,g(...e))}function x(e,t,n){return new Promise(function(i,r){setTimeout(function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:i()}},n)})}class y{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){let n=this._listeners;if(void 0===n)return;let i=n[e];if(void 0!==i){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(void 0===t)return;let n=t[e.type];if(void 0!==n){e.target=this;let t=n.slice(0);for(let n=0,i=t.length;n<i;n++)t[n].call(this,e);e.target=null}}}let M=["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","5
15","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"],S=Math.PI/180,E=180/Math.PI;function T(){let e=0xffffffff*Math.random()|0,t=0xffffffff*Math.random()|0,n=0xffffffff*Math.random()|0,i=0xffffffff*Math.random()|0;return(M[255&e]+M[e>>8&255]+M[e>>16&255]+M[e>>24&255]+"-"+M[255&t]+M[t>>8&255]+"-"+M[t>>16&15|64]+M[t>>24&255]+"-"+M[63&n|128]+M[n>>8&255]+"-"+M[n>>16&255]+M[n>>24&255]+M[255&i]+M[i>>8&255]+M[i>>16&255]+M[i>>24&255]).toLowerCase()}function b(e,t,n){return Math.max(t,Math.min(n,e))}function w(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 A(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.")}}class R{constructor(e=0,t=0){R.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw 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,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[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=b(this.x,e.x,t.x),this.y=b(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=b(this.x,e,t),this.y=b(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(b(n,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(b(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}
vendor: 5,961 bytes, line 1
1lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=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}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class C{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,s){let o=n[i+0],l=n[i+1],c=n[i+2],u=n[i+3],h=r[a+0],d=r[a+1],f=r[a+2],p=r[a+3];if(s<=0){e[t+0]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u;return}if(s>=1){e[t+0]=h,e[t+1]=d,e[t+2]=f,e[t+3]=p;return}if(u!==p||o!==h||l!==d||c!==f){let e=o*h+l*d+c*f+u*p;e<0&&(h=-h,d=-d,f=-f,p=-p,e=-e);let t=1-s;if(e<.9995){let n=Math.acos(e),i=Math.sin(n);o=o*(t=Math.sin(t*n)/i)+h*(s=Math.sin(s*n)/i),l=l*t+d*s,c=c*t+f*s,u=u*t+p*s}else{let e=1/Math.sqrt((o=o*t+h*s)*o+(l=l*t+d*s)*l+(c=c*t+f*s)*c+(u=u*t+p*s)*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,i,r,a){let s=n[i],o=n[i+1],l=n[i+2],c=n[i+3],u=r[a],h=r[a+1],d=r[a+2],f=r[a+3];return e[t]=s*f+c*u+o*d-l*h,e[t+1]=o*f+c*h+l*u-s*d,e[t+2]=l*f+c*d+s*h-o*u,e[t+3]=c*f-s*u-o*h-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,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,i=e._y,r=e._z,a=e._order,s=Math.cos,o=Math.sin,l=s(n/2),c=s(i/2),u=s(r/2),h=o(n/2),d=o(i/2),f=o(r/2);switch(a){case"XYZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"YXZ":this._x=h*c*u+l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"ZXY":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u-h*d*f;break;case"ZYX":this._x=h*c*u-l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u+h*d*f;break;case"YZX":this._x=h*c*u+l*d*f,this._y=l*d*u+h*c*f,this._z=l*c*f-h*d*u,this._w=l*c*u-h*d*f;break;case"XZY":this._x=h*c*u-l*d*f,this._y=l*d*u-h*c*f,this._z=l*c*f+h*d*u,this._w=l*c*u+h*d*f;break;default:g("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=n+s+u;if(h>0){let e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(r-l)*e,this._z=(a-i)*e}else if(n>s&&n>u){let e=2*Math.sqrt(1+n-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(r+l)/e}else if(s>u){let e=2*Math.sqrt(1+s-n-u);this._w=(r-l)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(o+c)/e}else{let e=2*Math.sqrt(1+u-n-s);this._w=(a-i)/e,this._x=(r+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=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=n,this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(b(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(0===n)return this;let i=Math.min(1,t/n);return this.slerp(e,i),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 n=e._x,i=e._y,r=e._z,a=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+a*s+i*l-r*o,this._y=i*c+a*o+r*s-n*l,this._z=r*c+a*l+n*o-i*s,this._w=a*c-n*s-i*o-r*l,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,i=e._y,r=e._z,a=e._w,s=this.dot(e);s<0&&(n=-n,i=-i,r=-r,a=-a,s=-s);let o=1-t;if(s<.9995){let e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this._onChangeCallback()}else this._x=this._x*o+n*t,this._y=this._y*o+i*t,this._z=this._z*o+r*t,this._w=this._w*o+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*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,t=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(e=[],t=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()}
vendor: 4,120 bytes, line 1
1_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class P{constructor(e=0,t=0,n=0){P.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw 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(D.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(D.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,l=2*(a*i-s*n),c=2*(s*t-r*i),u=2*(r*n-a*t);return this.x=t+o*l+a*u-s*c,this.y=n+o*c+s*l-r*u,this.z=i+o*u+r*c-a*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,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,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=b(this.x,e.x,t.x),this.y=b(this.y,e.y,t.y),this.z=b(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=b(this.x,e,t),this.y=b(this.y,e,t),this.z=b(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(b(n,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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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}
vendor: 5,601 bytes, line 1
1lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,i=e.y,r=e.z,a=t.x,s=t.y,o=t.z;return this.x=i*o-r*s,this.y=r*a-n*o,this.z=n*s-i*a,this}projectOnVector(e){let t=e.lengthSq();if(0===t)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return L.copy(this).projectOnVector(e),this.sub(L)}reflect(e){return this.sub(L.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(b(this.dot(e)/t,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){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(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,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,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=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,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}let L=new P,D=new C;class N{constructor(e,t,n,i,r,a,s,o,l){N.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,i,r,a,s,o,l)}set(e,t,n,i,r,a,s,o,l){let c=this.elements;return c[0]=e,c[1]=i,c[2]=s,c[3]=t,c[4]=r,c[5]=o,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){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 n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[3],o=n[6],l=n[1],c=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=i[0],m=i[3],g=i[6],_=i[1],v=i[4],x=i[7],y=i[2],M=i[5],S=i[8];return r[0]=a*p+s*_+o*y,r[3]=a*m+s*v+o*M,r[6]=a*g+s*x+o*S,r[1]=l*p+c*_+u*y,r[4]=l*m+c*v+u*M,r[7]=l*g+c*x+u*S,r[2]=h*p+d*_+f*y,r[5]=h*m+d*v+f*M,r[8]=h*g+d*x+f*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],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*a*c-t*s*l-n*r*c+n*s*o+i*r*l-i*a*o}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*a-s*l,h=s*o-c*r,d=l*r-a*o,f=t*u+n*h+i*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);let p=1/f;return e[0]=u*p,e[1]=(i*l-c*n)*p,e[2]=(s*n-i*a)*p,e[3]=h*p,e[4]=(c*t-i*o)*p,e[5]=(i*r-s*t)*p,e[6]=d*p,e[7]=(n*o-l*t)*p,e[8]=(a*t-n*r)*p,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,n,i,r,a,s){let o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*a+l*s)+a+e,-i*l,i*o,-i*(-l*a+o*s)+s+t,0,0,1),this}scale(e,t){return this.premultiply(I.makeScale(e,t)),this}rotate(e){return this.premultiply(I.makeRotation(-e)),this}translate(e,t){return this.premultiply(I.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),n=Math.sin(e);return this.set(t,-n,0,n,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,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}let I=new N,U=new N().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),O=new N().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.20397
17,1.0569715),F=(i=[.64,.33,.3,.6,.15,.06],r=[.2126,.7152,.0722],a=[.3127,.329],(n={enabled:!0,workingColorSpace:o,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n&&(this.spaces[t].transfer===c&&(e.r=B(e.r),e.g=B(e.g),e.b=B(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===c&&(e.r=z(e.r),e.g=z(e.g),e.b=z(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?l:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(e,t){return v("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(e,t)},toWorkingColorSpace:function(e,t){return v("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(e,t)}}).define({[o]:{primaries:i,whitePoint:a,transfer:l,toXYZ:U,fromXYZ:O,luminanceCoefficients:r,workingColorSpaceConfig:{unpackColorSpace:s},outputColorSpaceConfig:{drawingBufferColorSpace:s}},[s]:{primaries:i,whitePoint:a,transfer:c,toXYZ:U,fromXYZ:O,luminanceCoefficients:r,outputColorSpaceConfig:{drawingBufferColorSpace:s}}}),n);function B(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function z(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class V{static getDataURL(e,n="image/png"){let i;if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)i=e;else{void 0===t&&(t=d("canvas")),t.width=e.width,t.height=e.height;let n=t.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),i=t}return i.toDataURL(n)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){let t=d("canvas");t.width=e.width,t.height=e.height;let n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);let i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let e=0;e<r.length;e++)r[e]=255*B(r[e]/255);return n.putImageData(i,0,0),t}if(!e.data)return g("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),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*B(t[e]/255)):t[e]=B(t[e]);return{data:t,width:e.width,height:e.height}}}}let k=0;class G{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:k++}),this.uuid=T(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){let t=this.data;return"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"undefined"!=typeof VideoFrame&&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 n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(H(i[t].image)):e.push(H(i[t]))}else e=H(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function H(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?V.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(g("Texture: Unable to serialize Texture."),{})}let W=0,X=new P;class j extends y{constructor(e=j.DEFAULT_IMAGE,t=j.DEFAULT_MAPPING,n=1001,i=1001,r=1006,a=1008,s=1023,o=1009,l=j.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:W++}),this.uuid=T(),this.name="",this.source=new G(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new R(0,0),this.repeat=new R(1,1),this.center=new R(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new N,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
1=c,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}get width(){return this.source.getSize(X).x}get height(){return this.source.getSize(X).y}get depth(){return this.source.getSize(X).z}get image(){return this.source.data}set image(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=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 n=e[t];if(void 0===n){g(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){g(`Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];let n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002: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 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002: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++}}j.DEFAULT_IMAGE=null,j.DEFAULT_MAPPING=300,j.DEFAULT_ANISOTROPY=1;class q{constructor(e=0,t=0,n=0,i=1){q.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,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}
1sub(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,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[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,n,i,r,a=e.elements,s=a[0],o=a[4],l=a[8],c=a[1],u=a[5],h=a[9],d=a[2],f=a[6],p=a[10];if(.01>Math.abs(o-c)&&.01>Math.abs(l-d)&&.01>Math.abs(h-f)){if(.1>Math.abs(o+c)&&.1>Math.abs(l+d)&&.1>Math.abs(h+f)&&.1>Math.abs(s+u+p-3))return this.set(1,0,0,0),this;t=Math.PI;let e=(s+1)/2,a=(u+1)/2,m=(p+1)/2,g=(o+c)/4,_=(l+d)/4,v=(h+f)/4;return e>a&&e>m?e<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(e)),r=_/n):a>m?a<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(a)),r=v/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=_/(r=Math.sqrt(m)),i=v/r),this.set(n,i,r,t),this}let m=Math.sqrt((f-h)*(f-h)+(l-d)*(l-d)+(c-o)*(c-o));return .001>Math.abs(m)&&(m=1),this.x=(f-h)/m,this.y=(l-d)/m,this.z=(c-o)/m,this.w=Math.acos((s+u+p-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=b(this.x,e.x,t.x),this.y=b(this.y,e.y,t.y),this.z=b(this.z,e.z,t.z),this.w=b(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=b(this.x,e,t),this.y=b(this.y,e,t),this.z=b(this.z,e,t),this.w=b(this.w,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(b(n,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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=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}}class Y extends y{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:1006,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new q(0,0,e,t),this.scissorTest=!1,this.viewport=new q(0,0,e,t);const i=new j({width:e,height:t,depth:n.depth});this.textures=[];const r=n.count;for(let e=0;e<r;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){let t={minFilter:1006,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
vendor: 8,793 bytes, line 1
1=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,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,!0!==this.textures[i].isData3DTexture&&(this.textures[i].isArrayTexture=this.textures[i].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,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;let n=Object.assign({},e.textures[t].image);this.textures[t].source=new G(n)}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"})}}class K extends Y{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Z extends j{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class J extends j{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ${constructor(e=new P(Infinity,Infinity,Infinity),t=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(ee.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(ee.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let n=ee.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!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,t=!1){e.updateWorldMatrix(!1,!1);let n=e.geometry;if(void 0!==n){let i=n.getAttribute("position");if(!0===t&&void 0!==i&&!0!==e.isInstancedMesh)for(let t=0,n=i.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,ee):ee.fromBufferAttribute(i,t),ee.applyMatrix4(e.matrixWorld),this.expandByPoint(ee);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),et.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),et.copy(n.boundingBox)),et.applyMatrix4(e.matrixWorld),this.union(et)}let i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[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,ee),ee.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(el),ec.subVectors(this.max,el),en.subVectors(e.a,el),ei.subVectors(e.b,el),er.subVectors(e.c,el),ea.subVectors(ei,en),es.subVectors(er,ei),eo.subVectors(en,er);let t=[0,-ea.z,ea.y,0,-es.z,es.y,0,-eo.z,eo.y,ea.z,0,-ea.x,es.z,0,-es.x,eo.z,0,-eo.x,-ea.y,ea.x,0,-es.y,es.x,0,-eo.y,eo.x,0];return!!ed(t,en,ei,er,ec)&&!!ed(t=[1,0,0,0,1,0,0,0,1],en,ei,er,ec)&&(eu.crossVectors(ea,es),ed(t=[eu.x,eu.y,eu.z],en,ei,er,ec))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ee).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(ee).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()||(Q[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Q[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Q[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Q[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Q[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Q[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Q[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Q[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Q)),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}}let Q=[new P,new P,new P,new P,new P,new P,new P,new P],ee=new P,et=new $,en=new P,ei=new P,er=new P,ea=new P,es=new P,eo=new P,el=new P,ec=new P,eu=new P,eh=new P;function ed(e,t,n,i,r){for(let a=0,s=e.length-3;a<=s;a+=3){eh.fromArray(e,a);let s=r.x*Math.abs(eh.x)+r.y*Math.abs(eh.y)+r.z*Math.abs(eh.z),o=t.dot(eh),l=n.dot(eh),c=i.dot(eh);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}let ef=new $,ep=new P,em=new P;class eg{constructor(e=new P,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;void 0!==t?n.copy(t):ef.setFromPoints(e).getCenter(n);let i=0;for(let t=0,r=e.length;t<r;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),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 n=this.center.distanceToSquared(e);return t.copy(e),n>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}
1applyMatrix4(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;ep.subVectors(e,this.center);let t=ep.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(ep,n/e),this.radius+=n}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):(em.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(ep.copy(e.center).add(em)),this.expandByPoint(ep.copy(e.center).sub(em)))),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}}let e_=new P,ev=new P,ex=new P,ey=new P,eM=new P,eS=new P,eE=new P;class eT{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}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,e_)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=e_.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(e_.copy(this.origin).addScaledVector(this.direction,t),e_.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){let r,a,s,o;ev.copy(e).add(t).multiplyScalar(.5),ex.copy(t).sub(e).normalize(),ey.copy(this.origin).sub(ev);let l=.5*e.distanceTo(t),c=-this.direction.dot(ex),u=ey.dot(this.direction),h=-ey.dot(ex),d=ey.lengthSq(),f=Math.abs(1-c*c);if(f>0)if(r=c*h-u,a=c*u-h,o=l*f,r>=0)if(a>=-o)if(a<=o){let e=1/f;r*=e,a*=e,s=r*(r+c*a+2*u)+a*(c*r+a+2*h)+d}else s=-(r=Math.max(0,-(c*(a=l)+u)))*r+a*(a+2*h)+d;else s=-(r=Math.max(0,-(c*(a=-l)+u)))*r+a*(a+2*h)+d;else a<=-o?(a=(r=Math.max(0,-(-c*l+u)))>0?-l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d):a<=o?(r=0,s=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+d):(a=(r=Math.max(0,-(c*l+u)))>0?l:Math.min(Math.max(-l,-h),l),s=-r*r+a*(a+2*h)+d);else a=c>0?-l:l,s=-(r=Math.max(0,-(c*a+u)))*r+a*(a+2*h)+d;return n&&n.copy(this.origin).addScaledVector(this.direction,r),i&&i.copy(ev).addScaledVector(ex,a),s}intersectSphere(e,t){e_.subVectors(e.center,this.origin);let n=e_.dot(this.direction),i=e_.dot(e_)-n*n,r=e.radius*e.radius;if(i>r)return null;let a=Math.sqrt(r-i),s=n-a,o=n+a;return o<0?null:s<0?this.at(o,t):this.at(s,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 n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return!!(0===t||e.normal.dot(this.direction)*t<0)}intersectBox(e,t){let n,i,r,a,s,o,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return(l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),c>=0?(r=(e.min.y-h.y)*c,a=(e.max.y-h.y)*c):(r=(e.max.y-h.y)*c,a=(e.min.y-h.y)*c),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),n>o||s>i||((s>n||n!=n)&&(n=s),(o<i||i!=i)&&(i=o),i<0)))?null:this.at(n>=0?n:i,t)}intersectsBox(e){return null!==this.intersectBox(e,e_)}intersectTriangle(e,t,n,i,r){let a;eM.subVectors(t,e),eS.subVectors(n,e),eE.crossVectors(eM,eS);let s=this.direction.dot(eE);if(s>0){if(i)return null;a=1}else{if(!(s<0))return null;a=-1,s=-s}ey.subVectors(this.origin,e);let o=a*this.direction.dot(eS.crossVectors(ey,eS));if(o<0)return null;let l=a*this.direction.dot(eM.cross(ey));if(l<0||o+l>s)return null;
vendor: 5,537 bytes, line 1
1let c=-a*ey.dot(eE);return c<0?null:this.at(c/s,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)}}class eb{constructor(e,t,n,i,r,a,s,o,l,c,u,h,d,f,p,m){eb.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,n,i,r,a,s,o,l,c,u,h,d,f,p,m)}set(e,t,n,i,r,a,s,o,l,c,u,h,d,f,p,m){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=s,g[13]=o,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new eb().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[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,n){return 0===this.determinant()?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1)):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2)),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinant())return this.identity();let t=this.elements,n=e.elements,i=1/ew.setFromMatrixColumn(e,0).length(),r=1/ew.setFromMatrixColumn(e,1).length(),a=1/ew.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),s=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),u=Math.sin(r);if("XYZ"===e.order){let e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=n+i*l,t[5]=e-r*l,t[9]=-s*o,t[2]=r-e*l,t[6]=i+n*l,t[10]=a*o}else if("YXZ"===e.order){let e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e+r*s,t[4]=i*s-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-s,t[2]=n*s-i,t[6]=r+e*s,t[10]=a*o}else if("ZXY"===e.order){let e=o*c,n=o*u,i=l*c,r=l*u;t[0]=e-r*s,t[4]=-a*u,t[8]=i+n*s,t[1]=n+i*s,t[5]=a*c,t[9]=r-e*s,t[2]=-a*l,t[6]=s,t[10]=a*o}else if("ZYX"===e.order){let e=a*c,n=a*u,i=s*c,r=s*u;t[0]=o*c,t[4]=i*l-n,t[8]=e*l+r,t[1]=o*u,t[5]=r*l+e,t[9]=n*l-i,t[2]=-l,t[6]=s*o,t[10]=a*o}else if("YZX"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=r-e*u,t[8]=i*u+n,t[1]=u,t[5]=a*c,t[9]=-s*c,t[2]=-l*c,t[6]=n*u+i,t[10]=e-r*u}else if("XZY"===e.order){let e=a*o,n=a*l,i=s*o,r=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+r,t[5]=a*c,t[9]=n*u-i,t[2]=i*u-n,t[6]=s*c,t[10]=r*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(eR,e,eC)}lookAt(e,t,n){let i=this.elements;return eD.subVectors(e,t),0===eD.lengthSq()&&(eD.z=1),eD.normalize(),eP.crossVectors(n,eD),0===eP.lengthSq()&&(1===Math.abs(n.z)?eD.x+=1e-4:eD.z+=1e-4,eD.normalize(),eP.crossVectors(n,eD)),eP.normalize(),eL.crossVectors(eD,eP),i[0]=eP.x,i[4]=eL.x,i[8]=eD.x,i[1]=eP.y,i[5]=eL.y,i[9]=eD.y,i[2]=eP.z,i[6]=eL.z,i[10]=eD.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,i=t.elements,r=this.elements,a=n[0],s=n[4],o=n[8],l=n[12],c=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],_=n[3],v=n[7],x=n[11],y=n[15],M=i[0],S=i[4],E=i[8],T=i[12],b=i[1],w=i[5],A=i[9],R=i[13],C=i[2],P=i[6],L=i[10],D=i[14],N=i[3],I=i[7],U=i[11],O=i[15];return r[0]=a*M+s*b+o*C+l*N,r[4]=a*S+s*w+o*P+l*I,r[8]=a*E+s*A+o*L+l*U,r[12]=a*T+s*R+o*D+l*O,r[1]=c*M+u*b+h*C+d*N,r[5]=c*S+u*w+h*P+d*I,r[9]=c*E+u*A+h*L+d*U,r[13]=c*T+u*R+h*D+d*O,r[2]=f*M+p*b+m*C+g*N,r[6]=f*S+p*w+m*P+g*I,r[10]=f*E+p*A+m*L+g*U,r[14]=f*T+p*R+m*D+g*O,r[3]=_*M+v*b+x*C+y*N,r[7]=_*S+v*w+x*P+y*I,r[11]=_*E+v*A+x*L+y*U,r[15]=_*T+v*R+x*D+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],n=e[4],i=e[8],r=e[12],a=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14],f=e[3],p=e[7],m=e[11],g=e[15],_=o*d-l*h,v=s*d-l*u,x=s*h-o*u,y=a*d-l*c,M=a*h-o*c,S=a*u-s*c;return t*(p*_-m*v+g*x)-n*(f*_-m*y+g*M)+i*(f*v-p*y+g*S)-r*(f*x-p*M+m*S)}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,n){let i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],f=e[12],p=e[13],m=e[14],g=e[15],_=u*m*l-p*h*l+p*o*d-s*m*d-u*o*g+s*h*g,v=f*h*l-c*m*l-f*o*d+a*m*d+c*o*g-a*h*g,x=c*p*l-f*u*l+f*s*d-a*p*d-c*s*g+a*u*g,y=f*u*o-c*p*o-f*s*h+a*p*h+c*s*m-a*u*m,M=t*_+n*v+i*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]=_*S,e[1]=(p*h*r-u*m*r-p*i*d+n*m*d+u*i*g-n*h*g)*S,e[2]=(s*m*r-p*o*r+p*i*l-n*m*l-s*i*g+n*o*g)*S,e[3]=(u*o*r-s*h*r-u*i*l+n*h*l+s*i*d-n*o*d)*S,e[4]=v*S,e[5]=(c*m*r-f*h*r+f*i*d-t*m*d-c*i*g+t*h*g)*S,e[6]=(f*o*r-a*m*r-f*i*l+t*m*l+a*i*g-t*o*g)*S,e[7]=(a
1*h*r-c*o*r+c*i*l-t*h*l-a*i*d+t*o*d)*S,e[8]=x*S,e[9]=(f*u*r-c*p*r-f*n*d+t*p*d+c*n*g-t*u*g)*S,e[10]=(a*p*r-f*s*r+f*n*l-t*p*l-a*n*g+t*s*g)*S,e[11]=(c*s*r-a*u*r-c*n*l+t*u*l+a*n*d-t*s*d)*S,e[12]=y*S,e[13]=(c*p*i-f*u*i+f*n*h-t*p*h-c*n*m+t*u*m)*S,e[14]=(f*s*i-a*p*i-f*n*o+t*p*o+a*n*m-t*s*m)*S,e[15]=(a*u*i-c*s*i+c*n*o-t*u*o-a*n*h+t*s*h)*S,this}scale(e){let t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){let e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],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,n){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,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,s=e.y,o=e.z,l=r*a,c=r*s;return this.set(l*a+n,l*s-i*o,l*o+i*s,0,l*s+i*o,c*s+n,c*o-i*a,0,l*o-i*s,c*o+i*a,r*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){let i=this.elements,r=t._x,a=t._y,s=t._z,o=t._w,l=r+r,c=a+a,u=s+s,h=r*l,d=r*c,f=r*u,p=a*c,m=a*u,g=s*u,_=o*l,v=o*c,x=o*u,y=n.x,M=n.y,S=n.z;return i[0]=(1-(p+g))*y,i[1]=(d+x)*y,i[2]=(f-v)*y,i[3]=0,i[4]=(d-x)*M,i[5]=(1-(h+g))*M,i[6]=(m+_)*M,i[7]=0,i[8]=(f+v)*S,i[9]=(m-_)*S,i[10]=(1-(h+p))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){let i=this.elements;if(e.x=i[12],e.y=i[13],e.z=i[14],0===this.determinant())return n.set(1,1,1),t.identity(),this;let r=ew.set(i[0],i[1],i[2]).length(),a=ew.set(i[4],i[5],i[6]).length(),s=ew.set(i[8],i[9],i[10]).length();0>this.determinant()&&(r=-r),eA.copy(this);let o=1/r,l=1/a,c=1/s;return eA.elements[0]*=o,eA.elements[1]*=o,eA.elements[2]*=o,eA.elements[4]*=l,eA.elements[5]*=l,eA.elements[6]*=l,eA.elements[8]*=c,eA.elements[9]*=c,eA.elements[10]*=c,t.setFromRotationMatrix(eA),n.x=r,n.y=a,n.z=s,this}makePerspective(e,t,n,i,r,a,s=2e3,o=!1){let l,c,u=this.elements;if(o)l=r/(a-r),c=a*r/(a-r);else if(2e3===s)l=-(a+r)/(a-r),c=-2*a*r/(a-r);else if(2001===s)l=-a/(a-r),c=-a*r/(a-r);else throw Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return u[0]=2*r/(t-e),u[4]=0,u[8]=(t+e)/(t-e),u[12]=0,u[1]=0,u[5]=2*r/(n-i),u[9]=(n+i)/(n-i),u[13]=0,u[2]=0,u[6]=0,u[10]=l,u[14]=c,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,t,n,i,r,a,s=2e3,o=!1){let l,c,u=this.elements;if(o)l=1/(a-r),c=a/(a-r);else if(2e3===s)l=-2/(a-r),c=-(a+r)/(a-r);else if(2001===s)l=-1/(a-r),c=-r/(a-r);else throw Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return u[0]=2/(t-e),u[4]=0,u[8]=0,u[12]=-(t+e)/(t-e),u[1]=0,u[5]=2/(n-i),u[9]=0,u[13]=-(n+i)/(n-i),u[2]=0,u[6]=0,u[10]=l,u[14]=c,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}let ew=new P,eA=new eb,eR=new P(0,0,0),eC=new P(1,1,1),eP=new P,eL=new P,eD=new P,eN=new eb,eI=new C;class eU{constructor(e=0,t=0,n=0,i=eU.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let i=e.elements,r=i[0],a=i[4],s=i[8],o=i[1],l=i[5],c=i[9],u=i[2],h=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(b(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-b(c,-1,1)),.9999999>Math.abs(c)?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(b(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(o,r));break;case"ZYX":this._y=Math.asin(-b(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,r)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(b(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-b(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,r)):(this._x=Math.atan2(-c,d),this._y=0);break;default:g("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return eN.makeRotationFromQuaternion(e),this.setFromRotationMatrix(eN,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return eI.setFromEuler(this),this.setFromQuaternion(eI,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(e=[],t=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}}eU.DEFAULT_ORDER="XYZ";class eO{constructor(){this.mask=1}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}}let eF=0,eB=new P,ez=new C,eV=new eb,ek=new P,eG=new P,eH=new P,eW=new C,eX=new P(1,0,0),ej=new P(0,1,0),eq=new P(0,0,1),eY={type:"added"},eK={type:"removed"},eZ={type:"childadded",child:null},eJ={type:"childremoved",child:null};class e$ extends y{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eF++}),this.uuid=T(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=e$.DEFAULT_UP.clone();const e=new P,t=new eU,n=new C,i=new P(1,1,1);t._onChange(function(){n.setFromEuler(t,!1)}),n._onChange(function(){t.setFromQuaternion(n,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:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new eb},normalMatrix:{value:new N}}),this.matrix=new eb,this.matrixWorld=new eb,this.matrixAutoUpdate=e$.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=e$.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new eO,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={}}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)}
vendor: 19,102 bytes, line 1
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ez.setFromAxisAngle(e,t),this.quaternion.multiply(ez),this}rotateOnWorldAxis(e,t){return ez.setFromAxisAngle(e,t),this.quaternion.premultiply(ez),this}rotateX(e){return this.rotateOnAxis(eX,e)}rotateY(e){return this.rotateOnAxis(ej,e)}rotateZ(e){return this.rotateOnAxis(eq,e)}translateOnAxis(e,t){return eB.copy(e).applyQuaternion(this.quaternion),this.position.add(eB.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(eX,e)}translateY(e){return this.translateOnAxis(ej,e)}translateZ(e){return this.translateOnAxis(eq,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(eV.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ek.copy(e):ek.set(e,t,n);let i=this.parent;this.updateWorldMatrix(!0,!1),eG.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?eV.lookAt(eG,ek,this.up):eV.lookAt(ek,eG,this.up),this.quaternion.setFromRotationMatrix(eV),i&&(eV.extractRotation(i.matrixWorld),ez.setFromRotationMatrix(eV),this.quaternion.premultiply(ez.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?_("Object3D.add: object can't be added as a child of itself.",e):e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(eY),eZ.child=e,this.dispatchEvent(eZ),eZ.child=null):_("Object3D.add: object not an instance of THREE.Object3D.",e),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(eK),eJ.child=e,this.dispatchEvent(eJ),eJ.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),eV.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),eV.multiply(e.parent.matrixWorld)),e.applyMatrix4(eV),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(eY),eZ.child=e,this.dispatchEvent(eZ),eZ.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 n=0,i=this.children.length;n<i;n++){let i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);let i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eG,e,eH),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(eG,eW,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 n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].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):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){let n=this.parent;if(!0===e&&null!==n&&n.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,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){let t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});let i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(e=>({...e})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(i.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(i.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(i.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);let t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){let n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){let i=n[t];r(e.shapes,i)}else r(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){let t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(r(e.materials,this.material[n]));i.material=t}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){let n=this.animations[t];i.animations.push(r(e.animations,n))}}if(t){let t=a(e.geometries),i=a(e.materials),r=a(e.textures),s=a(e.images),o=a(e.shapes),l=a(e.skeletons),c=a(e.animations),u=a(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),u.length>0&&(n.nodes=u)}return n.object=i,n;function a(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){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 n=e.children[t];this.add(n.clone())}return this}}e$.DEFAULT_UP=new P(0,1,0),e$.DEFAULT_MATRIX_AUTO_UPDATE=!0,e$.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;let eQ=new P,e0=new P,e1=new P,e3=new P,e2=new P,e4=new P,e5=new P,e6=new P,e8=new P,e9=new P,e7=new q,te=new q,tt=new q;class tn{constructor(e=new P,t=new P,n=new P){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),eQ.subVectors(e,t),i.cross(eQ);let r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){eQ.subVectors(i,t),e0.subVectors(n,t),e1.subVectors(e,t);let a=eQ.dot(eQ),s=eQ.dot(e0),o=eQ.dot(e1),l=e0.dot(e0),c=e0.dot(e1),u=a*l-s*s;if(0===u)return r.set(0,0,0),null;let h=1/u,d=(l*o-s*c)*h,f=(a*c-s*o)*h;return r.set(1-d-f,f,d)}static containsPoint(e,t,n,i){return null!==this.getBarycoord(e,t,n,i,e3)&&e3.x>=0&&e3.y>=0&&e3.x+e3.y<=1}static getInterpolation(e,t,n,i,r,a,s,o){return null===this.getBarycoord(e,t,n,i,e3)?(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,e3.x),o.addScaledVector(a,e3.y),o.addScaledVector(s,e3.z),o)}static getInterpolatedAttribute(e,t,n,i,r,a){return e7.setScalar(0),te.setScalar(0),tt.setScalar(0),e7.fromBufferAttribute(e,t),te.fromBufferAttribute(e,n),tt.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(e7,r.x),a.addScaledVector(te,r.y),a.addScaledVector(tt,r.z),a}static isFrontFacing(e,t,n,i){return eQ.subVectors(n,t),e0.subVectors(e,t),0>eQ.cross(e0).dot(i)}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),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 eQ.subVectors(this.c,this.b),e0.subVectors(this.a,this.b),.5*eQ.cross(e0).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return tn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return tn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return tn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return tn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return tn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n,i,r=this.a,a=this.b,s=this.c;e2.subVectors(a,r),e4.subVectors(s,r),e6.subVectors(e,r);let o=e2.dot(e6),l=e4.dot(e6);if(o<=0&&l<=0)return t.copy(r);e8.subVectors(e,a);let c=e2.dot(e8),u=e4.dot(e8);if(c>=0&&u<=c)return t.copy(a);let h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return n=o/(o-c),t.copy(r).addScaledVector(e2,n);e9.subVectors(e,s);let d=e2.dot(e9),f=e4.dot(e9);if(f>=0&&d<=f)return t.copy(s);let p=d*l-o*f;if(p<=0&&l>=0&&f<=0)return i=l/(l-f),t.copy(r).addScaledVector(e4,i);let m=c*f-d*u;if(m<=0&&u-c>=0&&d-f>=0)return e5.subVectors(s,a),i=(u-c)/(u-c+(d-f)),t.copy(a).addScaledVector(e5,i);let g=1/(m+p+h);return n=p*g,i=h*g,t.copy(r).addScaledVector(e2,n).addScaledVector(e4,i)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let ti={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},tr={h:0,s:0,l:0},ta={h:0,s:0,l:0};function ts(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*6*(2/3-n):e}class to{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){return void 0===t&&void 0===n?e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e):this.setRGB(e,t,n),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=s){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,F.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=F.workingColorSpace){return this.r=e,this.g=t,this.b=n,F.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=F.workingColorSpace){if(e=(e%1+1)%1,t=b(t,0,1),n=b(n,0,1),0===t)this.r=this.g=this.b=n;else{let i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=ts(r,i,e+1/3),this.g=ts(r,i,e),this.b=ts(r,i,e-1/3)}return F.colorSpaceToWorking(this,i),this}setStyle(e,t=s){let n;function i(t){void 0!==t&&1>parseFloat(t)&&g("Color: Alpha component of "+e+" will be ignored.")}if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let r,a=n[1],s=n[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:g("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let i=n[1],r=i.length;if(3===r)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===r)return this.setHex(parseInt(i,16),t);g("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=s){let n=ti[e.toLowerCase()];return void 0!==n?this.setHex(n,t):g("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=B(e.r),this.g=B(e.g),this.b=B(e.b),this}copyLinearToSRGB(e){return this.r=z(e.r),this.g=z(e.g),this.b=z(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=s){return F.workingToColorSpace(tl.copy(this),e),65536*Math.round(b(255*tl.r,0,255))+256*Math.round(b(255*tl.g,0,255))+Math.round(b(255*tl.b,0,255))}getHexString(e=s){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=F.workingColorSpace){let n,i;F.workingToColorSpace(tl.copy(this),t);let r=tl.r,a=tl.g,s=tl.b,o=Math.max(r,a,s),l=Math.min(r,a,s),c=(l+o)/2;if(l===o)n=0,i=0;else{let e=o-l;switch(i=c<=.5?e/(o+l):e/(2-o-l),o){case r:n=(a-s)/e+6*(a<s);break;case a:n=(s-r)/e+2;break;case s:n=(r-a)/e+4}n/=6}return e.h=n,e.s=i,e.l=c,e}getRGB(e,t=F.workingColorSpace){return F.workingToColorSpace(tl.copy(this),t),e.r=tl.r,e.g=tl.g,e.b=tl.b,e}getStyle(e=s){F.workingToColorSpace(tl.copy(this),e);let t=tl.r,n=tl.g,i=tl.b;return e!==s?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*i)})`}offsetHSL(e,t,n){return this.getHSL(tr),this.setHSL(tr.h+e,tr.s+t,tr.l+n)}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}
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){var n,i,r;this.getHSL(tr),e.getHSL(ta);let a=(n=tr.h,(1-t)*n+t*ta.h),s=(i=tr.s,(1-t)*i+t*ta.s),o=(r=tr.l,(1-t)*r+t*ta.l);return this.setHSL(a,s,o),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=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}}let tl=new to;to.NAMES=ti;let tc=0;class tu extends y{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:tc++}),this.uuid=T(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new to(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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}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 n=e[t];if(void 0===n){g(`Material: parameter '${t}' has value of undefined.`);continue}let i=this[t];if(void 0===i){g(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){let t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function i(e){let t=[];for(let n in e){let i=e[n];delete i.metadata,t.push(i)}return t}
vendor: 5,648 bytes, line 1
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),100!==this.blendEquation&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
1(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),7680!==this.stencilFail&&(n.stencilFail=this.stencilFail),7680!==this.stencilZFail&&(n.stencilZFail=this.stencilZFail),7680!==this.stencilZPass&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!1===this.allowOverride&&(n.allowOverride=!1),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){let t=i(e.textures),r=i(e.images);t.length>0&&(n.textures=t),r.length>0&&(n.images=r)}return n}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,n=null;if(null!==t){let e=t.length;n=Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,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++}}class th extends tu{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new to(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 eU,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}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}}let td=new P,tf=new R,tp=0;class tm{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:tp++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=35044,this.updateRanges=[],this.gpuType=1015,this.version=0}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,n){e*=this.itemSize,n*=t.itemSize;
vendor: 4,861 bytes, line 1
1for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)tf.fromBufferAttribute(this,t),tf.applyMatrix3(e),this.setXY(t,tf.x,tf.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)td.fromBufferAttribute(this,t),td.applyMatrix3(e),this.setXYZ(t,td.x,td.y,td.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)td.fromBufferAttribute(this,t),td.applyMatrix4(e),this.setXYZ(t,td.x,td.y,td.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)td.fromBufferAttribute(this,t),td.applyNormalMatrix(e),this.setXYZ(t,td.x,td.y,td.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)td.fromBufferAttribute(this,t),td.transformDirection(e),this.setXYZ(t,td.x,td.y,td.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=w(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=A(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=w(t,this.array)),t}setX(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=w(t,this.array)),t}setY(e,t){return this.normalized&&(t=A(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=w(t,this.array)),t}setZ(e,t){return this.normalized&&(t=A(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=w(t,this.array)),t}setW(e,t){return this.normalized&&(t=A(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array),i=A(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=A(t,this.array),n=A(n,this.array),i=A(i,this.array),r=A(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,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),35044!==this.usage&&(e.usage=this.usage),e}}class tg extends tm{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class t_ extends tm{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class tv extends tm{constructor(e,t,n){super(new Float32Array(e),t,n)}}let tx=0,ty=new eb,tM=new e$,tS=new P,tE=new $,tT=new $,tb=new P;class tw extends y{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tx++}),this.uuid=T(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(h(e)?t_:tg)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,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,n=0){this.groups.push({start:e,count:t,materialIndex:n})}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 n=this.attributes.normal;if(void 0!==n){let t=new N().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return ty.makeRotationFromQuaternion(e),this.applyMatrix4(ty),this}rotateX(e){return ty.makeRotationX(e),this.applyMatrix4(ty),this}rotateY(e){return ty.makeRotationY(e),this.applyMatrix4(ty),this}rotateZ(e){return ty.makeRotationZ(e),this.applyMatrix4(ty),this}translate(e,t,n){return ty.makeTranslation(e,t,n),this.applyMatrix4(ty),this}scale(e,t,n){return ty.makeScale(e,t,n),this.applyMatrix4(ty),this}lookAt(e){return tM.lookAt(e),tM.updateMatrix(),this.applyMatrix4(tM.matrix
1),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(tS).negate(),this.translate(tS.x,tS.y,tS.z),this}setFromPoints(e){let t=this.getAttribute("position");if(void 0===t){let t=[];for(let n=0,i=e.length;n<i;n++){let i=e[n];t.push(i.x,i.y,i.z||0)}this.setAttribute("position",new tv(t,3))}else{let n=Math.min(e.length,t.count);for(let i=0;i<n;i++){let n=e[i];t.setXYZ(i,n.x,n.y,n.z||0)}e.length>t.count&&g("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new $);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(Infinity,Infinity,Infinity));return}if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];tE.setFromBufferAttribute(n),this.morphTargetsRelative?(tb.addVectors(this.boundingBox.min,tE.min),this.boundingBox.expandByPoint(tb),tb.addVectors(this.boundingBox.max,tE.max),this.boundingBox.expandByPoint(tb)):(this.boundingBox.expandByPoint(tE.min),this.boundingBox.expandByPoint(tE.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&_('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new eg);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){_("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new P,1/0);return}if(e){let n=this.boundingSphere.center;if(tE.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){let n=t[e];tT.setFromBufferAttribute(n),this.morphTargetsRelative?(tb.addVectors(tE.min,tT.min),tE.expandByPoint(tb),tb.addVectors(tE.max,tT.max),tE.expandByPoint(tb)):(tE.expandByPoint(tT.min),tE.expandByPoint(tT.max))}tE.getCenter(n);let i=0;for(let t=0,r=e.count;t<r;t++)tb.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(tb));if(t)for(let r=0,a=t.length;r<a;r++){let a=t[r],s=this.morphTargetsRelative;for(let t=0,r=a.count;t<r;t++)tb.fromBufferAttribute(a,t),s&&(tS.fromBufferAttribute(e,t),tb.add(tS)),i=Math.max(i,n.distanceToSquared(tb))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&_('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void _("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");let n=t.position,i=t.normal,r=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new tm(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),s=[],o=[];for(let e=0;e<n.count;e++)s[e]=new P,o[e]=new P;let l=new P,c=new P,u=new P,h=new R,d=new R,f=new R,p=new P,m=new P,g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,i=g.length;t<i;++t){let i=g[t],a=i.start,_=i.count;for(let t=a,i=a+_;t<i;t+=3)!function(e,t,i){l.fromBufferAttribute(n,e),c.fromBufferAttribute(n,t),u.fromBufferAttribute(n,i),h.fromBufferAttribute(r,e),d.fromBufferAttribute(r,t),f.fromBufferAttribute(r,i),c.sub(l),u.sub(l),d.sub(h),f.sub(h);let a=1/(d.x*f.y-f.x*d.y);isFinite(a)&&(p.copy(c).multiplyScalar(f.y).addScaledVector(u,-d.y).multiplyScalar(a),m.copy(u).multiplyScalar(d.x).addScaledVector(c,-f.x).multiplyScalar(a),s[e].add(p),s[t].add(p),s[i].add(p),o[e].add(m),o[t].add(m),o[i].add(m))}(e.getX(t+0),e.getX(t+1),e.getX(t+2))}let v=new P,x=new P,y=new P,M=new P;function S(e){y.fromBufferAttribute(i,e),M.copy(y);let t=s[e];v.copy(t),v.sub(y.multiplyScalar(y.dot(t))).normalize(),x.crossVectors(M,t);let n=x.dot(o[e]);a.setXYZW(e,v.x,v.y,v.z,n<0?-1:1)}for(let t=0,n=g.length;t<n;++t){let n=g[t],i=n.start,r=n.count;for(let t=i,n=i+r;t<n;t+=3)S(e.getX(t+0)),S(e.getX(t+1)),S(e.getX(t+2))}}computeVertexNormals(){let e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new tm(new Float32Array(3*t.count),3),this.setAttribute("normal",n
vendor: 5,268 bytes, line 1
1);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);let i=new P,r=new P,a=new P,s=new P,o=new P,l=new P,c=new P,u=new P;if(e)for(let h=0,d=e.count;h<d;h+=3){let d=e.getX(h+0),f=e.getX(h+1),p=e.getX(h+2);i.fromBufferAttribute(t,d),r.fromBufferAttribute(t,f),a.fromBufferAttribute(t,p),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),s.fromBufferAttribute(n,d),o.fromBufferAttribute(n,f),l.fromBufferAttribute(n,p),s.add(c),o.add(c),l.add(c),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),c.subVectors(a,r),u.subVectors(i,r),c.cross(u),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)tb.fromBufferAttribute(e,t),tb.normalize(),e.setXYZ(t,tb.x,tb.y,tb.z)}toNonIndexed(){function e(e,t){let n=e.array,i=e.itemSize,r=e.normalized,a=new n.constructor(t.length*i),s=0,o=0;for(let r=0,l=t.length;r<l;r++){s=e.isInterleavedBufferAttribute?t[r]*e.data.stride+e.offset:t[r]*i;for(let e=0;e<i;e++)a[o++]=n[s++]}return new tm(a,i,r)}if(null===this.index)return g("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let t=new tw,n=this.index.array,i=this.attributes;for(let r in i){let a=e(i[r],n);t.setAttribute(r,a)}let r=this.morphAttributes;for(let i in r){let a=[],s=r[i];for(let t=0,i=s.length;t<i;t++){let i=e(s[t],n);a.push(i)}t.morphAttributes[i]=a}t.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let e=0,n=a.length;e<n;e++){let n=a[e];t.addGroup(n.start,n.count,n.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 n in t)void 0!==t[n]&&(e[n]=t[n]);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 n=this.attributes;for(let t in n){let i=n[t];e.data.attributes[t]=i.toJSON(e.data)}let i={},r=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,i=n.length;t<i;t++){let i=n[t];a.push(i.toJSON(e.data))}a.length>0&&(i[t]=a,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.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 n=e.index;null!==n&&this.setIndex(n.clone());let i=e.attributes;for(let e in i){let n=i[e];this.setAttribute(e,n.clone(t))}let r=e.morphAttributes;for(let e in r){let n=[],i=r[e];for(let e=0,r=i.length;e<r;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;let a=e.groups;for(let e=0,t=a.length;e<t;e++){let t=a[e];this.addGroup(t.start,t.count,t.materialIndex)}let s=e.boundingBox;null!==s&&(this.boundingBox=s.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"})}}let tA=new eb,tR=new eT,tC=new eg,tP=new P,tL=new P,tD=new P,tN=new P,tI=new P,tU=new P,tO=new P,tF=new P;class tB extends e${constructor(e=new tw,t=new th){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()}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 n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){let n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);let s=this.morphTargetInfluences;if(r&&s){tU.set(0,0,0);for(let n=0,i=r.length;n<i;n++){let i=s[n],o=r[n];0!==i&&(tI.fromBufferAttribute(o,e),a?tU.addScaledVector(tI,i):tU.addScaledVector(tI.sub(t),i))}t.add(tU)}return t}raycast(e,t){let n=this.geometry,i=this.material,r=this.matrixWorld;void 0===i||(null===n.boundingSphere&&n.computeBoundingSphere(),tC.copy(n.boundingSphere),tC.applyMatrix4(r),tR.copy(e.ray).recast(e.near),!1===tC.containsPoint(tR.origin)&&(null===tR.intersectSphere(tC,tP)||tR.origin.distanceToSquared(tP)>
1(e.far-e.near)**2)||(tA.copy(r).invert(),tR.copy(e.ray).applyMatrix4(tA),(null===n.boundingBox||!1!==tR.intersectsBox(n.boundingBox))&&this._computeIntersections(e,t,tR)))}_computeIntersections(e,t,n){let i,r=this.geometry,a=this.material,s=r.index,o=r.attributes.position,l=r.attributes.uv,c=r.attributes.uv1,u=r.attributes.normal,h=r.groups,d=r.drawRange;if(null!==s)if(Array.isArray(a))for(let r=0,o=h.length;r<o;r++){let o=h[r],f=a[o.materialIndex],p=Math.max(o.start,d.start),m=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));for(let r=p;r<m;r+=3)(i=tz(this,f,e,n,l,c,u,s.getX(r),s.getX(r+1),s.getX(r+2)))&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=o.materialIndex,t.push(i))}else{let r=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);for(let h=r;h<o;h+=3)(i=tz(this,a,e,n,l,c,u,s.getX(h),s.getX(h+1),s.getX(h+2)))&&(i.faceIndex=Math.floor(h/3),t.push(i))}else if(void 0!==o)if(Array.isArray(a))for(let r=0,s=h.length;r<s;r++){let s=h[r],f=a[s.materialIndex],p=Math.max(s.start,d.start),m=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));for(let r=p;r<m;r+=3)(i=tz(this,f,e,n,l,c,u,r,r+1,r+2))&&(i.faceIndex=Math.floor(r/3),i.face.materialIndex=s.materialIndex,t.push(i))}else{let r=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);for(let o=r;o<s;o+=3)(i=tz(this,a,e,n,l,c,u,o,o+1,o+2))&&(i.faceIndex=Math.floor(o/3),t.push(i))}}}function tz(e,t,n,i,r,a,s,o,l,c){e.getVertexPosition(o,tL),e.getVertexPosition(l,tD),e.getVertexPosition(c,tN);let u=function(e,t,n,i,r,a,s,o){if(null===(1===t.side?i.intersectTriangle(s,a,r,!0,o):i.intersectTriangle(r,a,s,0===t.side,o)))return null;tF.copy(o),tF.applyMatrix4(e.matrixWorld);let l=n.ray.origin.distanceTo(tF);return l<n.near||l>n.far?null:{distance:l,point:tF.clone(),object:e}}(e,t,n,i,tL,tD,tN,tO);if(u){let e=new P;tn.getBarycoord(tO,tL,tD,tN,e),r&&(u.uv=tn.getInterpolatedAttribute(r,o,l,c,e,new R)),a&&(u.uv1=tn.getInterpolatedAttribute(a,o,l,c,e,new R)),s&&(u.normal=tn.getInterpolatedAttribute(s,o,l,c,e,new P),u.normal.dot(i.direction)>0&&u.normal.multiplyScalar(-1));let t={a:o,b:l,c:c,normal:new P,materialIndex:0};tn.getNormal(tL,tD,tN,t.normal),u.face=t,u.barycoord=e}return u}class tV extends tw{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const s=this;i=Math.floor(i),r=Math.floor(r);const o=[],l=[],c=[],u=[];let h=0,d=0;function f(e,t,n,i,r,a,f,p,m,g,_){let v=a/m,x=f/g,y=a/2,M=f/2,S=p/2,E=m+1,T=g+1,b=0,w=0,A=new P;for(let a=0;a<T;a++){let s=a*x-M;for(let o=0;o<E;o++){let h=o*v-y;A[e]=h*i,A[t]=s*r,A[n]=S,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=p>0?1:-1,c.push(A.x,A.y,A.z),u.push(o/m),u.push(1-a/g),b+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){let n=h+t+E*e,i=h+t+E*(e+1),r=h+(t+1)+E*(e+1),a=h+(t+1)+E*e;o.push(n,i,a),o.push(i,r,a),w+=6}s.addGroup(d,w,_),d+=w,h+=b}f("z","y","x",-1,-1,n,t,e,a=Math.floor(a),r,0),f("z","y","x",1,-1,n,t,-e,a,r,1),f("x","z","y",1,1,e,n,t,i,a,2),f("x","z","y",1,-1,e,n,-t,i,a,3),f("x","y","z",1,-1,e,t,n,i,r,4),f("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(o),this.setAttribute("position",new tv(l,3)),this.setAttribute("normal",new tv(c,3)),this.setAttribute("uv",new tv(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tV(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function tk(e){let t={};for(let n in e)for(let i in t[n]={},e[n]){let r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(g("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[n][i]=null):t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function tG(e){let t={};for(let n=0;n<e.length;n++){let i=tk(e[n]);for(let e in i)t[e]=i[e]}return t}function tH(e){let t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:F.workingColorSpace}let tW={clone:tk,merge:tG};class tX extends tu{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)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=tk(e.uniforms),this.uniformsGroups=function(e){let t=[];for(let n=0;n<e.length;n++)t.push(e[n].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.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){let t=super.toJSON(e);for(let n in t.glslVersion=this.glslVersion,t.uniforms={},this.uniforms){let i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}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 n={};for(let e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class tj extends e${constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new eb,this.projectionMatrix=new eb,this.projectionMatrixInverse=new eb,this.coordinateSystem=2e3,this._reversedDepth=!1}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)}}let tq=new P,tY=new R,tK=new R;class tZ extends tj{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}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*E*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(.5*S*this.fov);return .5*this.getFilmHeight()/e}
1getEffectiveFOV(){return 2*E*Math.atan(Math.tan(.5*S*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,n){tq.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(tq.x,tq.y).multiplyScalar(-e/tq.z),tq.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(tq.x,tq.y).multiplyScalar(-e/tq.z)}getViewSize(e,t){return this.getViewBounds(e,tY,tK),t.subVectors(tK,tY)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(.5*S*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){let e=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/e,t-=a.offsetY*n/s,i*=a.width/e,n*=a.height/s}let s=this.filmOffset;0!==s&&(r+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,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}}class tJ extends e${constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new tZ(-90,1,e,t);i.layers=this.layers,this.add(i);const r=new tZ(-90,1,e,t);r.layers=this.layers,this.add(r);const a=new tZ(-90,1,e,t);a.layers=this.layers,this.add(a);const s=new tZ(-90,1,e,t);s.layers=this.layers,this.add(s);const o=new tZ(-90,1,e,t);o.layers=this.layers,this.add(o);const l=new tZ(-90,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,s,o]=t;for(let e of t)this.remove(e);if(2e3===e)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else if(2001===e)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),s.up.set(0,-1,0),s.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:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[r,a,s,o,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,s),e.setRenderTarget(n,3,i),e.render(t,o),e.setRenderTarget(n,4,i),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,i),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=f,n.texture.needsPMREMUpdate=!0}}class t$ extends j{constructor(e=[],t=301,n,i,r,a,s,o,l,c){super(e,t,n,i,r,a,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class tQ extends K{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1};this.texture=new t$([n,n,n,n,n,n]),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace
1=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` 2 3 varying vec3 vWorldDirection; 4 5 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 6 7 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 8 9 } 10 11 void main() { 12 13 vWorldDirection = transformDirection( position, modelMatrix ); 14 15 #include <begin_vertex> 16 #include <project_vertex> 17 18 } 19 `,fragmentShader:` 20 21 uniform sampler2D tEquirect; 22 23 varying vec3 vWorldDirection; 24 25 #include <common> 26 27 void main() { 28 29 vec3 direction = normalize( vWorldDirection ); 30 31 vec2 sampleUV = equirectUv( direction ); 32 33 gl_FragColor = texture2D( tEquirect, sampleUV ); 34 35 } 36 `},i=new tV(5,5,5),r=new tX({name:"CubemapFromEquirect",uniforms:tk(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;let a=new tB(i,r),s=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new tJ(1,10,this).update(e,a),t.minFilter=s,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){let r=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(t,n,i);e.setRenderTarget(r)}}class t0 extends e${constructor(){super(),this.isGroup=!0,this.type="Group"}}let t1={type:"move"};class t3{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new t0,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 t0,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new t0,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P),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 n of e.hand.values())this._getHandJoint(t,n)}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,n){let i=null,r=null,a=null,s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){for(let i of(a=!0,e.hand.values())){let e=t.getJointPose(i,n),r=this._getHandJoint(l,i);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 i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],s=i.position.distanceTo(r.position);l.inputState.pinching&&s>.025?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=.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,n))&&(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!==s&&(null===(i=t.getPose(e.targetRaySpace,n))&&null!==r&&(i=r),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(t1)))}return null!==s&&(s.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==a),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){let n=new t0;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class t2 extends e${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 eU,this.environmentIntensity=1,this.environmentRotation=new eU,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),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}}class t4 extends j{constructor(e=null,t=1,n=1,i,r,a,s,o,l=1003,c=1003,u,h){super(null,a,s,o,l,c,i,r,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}let t5=new P,t6=new P,t8=new N;class t9{constructor(e=new P(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}
36setFromCoplanarPoints(e,t,n){let i=t5.subVectors(n,t).cross(t6.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 n=e.delta(t5),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;let r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let n=t||t8.getNormalMatrix(e),i=this.coplanarPoint(t5).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.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)}}let t7=new eg,ne=new R(.5,.5),nt=new P;class nn{constructor(e=new t9,t=new t9,n=new t9,i=new t9,r=new t9,a=new t9){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3,n=!1){let i=this.planes,r=e.elements,a=r[0],s=r[1],o=r[2],l=r[3],c=r[4],u=r[5],h=r[6],d=r[7],f=r[8],p=r[9],m=r[10],g=r[11],_=r[12],v=r[13],x=r[14],y=r[15];if(i[0].setComponents(l-a,d-c,g-f,y-_).normalize(),i[1].setComponents(l+a,d+c,g+f,y+_).normalize(),i[2].setComponents(l+s,d+u,g+p,y+v).normalize(),i[3].setComponents(l-s,d-u,g-p,y-v).normalize(),n)i[4].setComponents(o,h,m,x).normalize(),i[5].setComponents(l-o,d-h,g-m,y-x).normalize();else if(i[4].setComponents(l-o,d-h,g-m,y-x).normalize(),2e3===t)i[5].setComponents(l+o,d+h,g+m,y+x).normalize();else if(2001===t)i[5].setComponents(o,h,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(),t7.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),t7.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(t7)}intersectsSprite(e){return t7.center.set(0,0,0),t7.radius=.7071067811865476+ne.distanceTo(e.center),t7.applyMatrix4(e.matrixWorld),this.intersectsSphere(t7)}intersectsSphere(e){let t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){let t=this.planes;for(let n=0;n<6;n++){let i=t[n];if(nt.x=i.normal.x>0?e.max.x:e.min.x,nt.y=i.normal.y>0?e.max.y:e.min.y,nt.z=i.normal.z>0?e.max.z:e.min.z,0>i.distanceToPoint(nt))return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}clone(){return new this.constructor().copy(this)}}class ni extends tu{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new to(0xffffff),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}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}}let nr=new eb,na=new eT,ns=new eg,no=new P;class nl extends e${constructor(e=new tw,t=new ni){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}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 n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),ns.copy(n.boundingSphere),ns.applyMatrix4(i),ns.radius+=r,!1===e.ray.intersectsSphere(ns))return;nr.copy(i).invert(),na.copy(e.ray).applyMatrix4(nr);let s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=n.index,c=n.attributes.position;if(null!==l){let n=Math.max(0,a.start),r=Math.min(l.count,a.start+a.count);for(let a=n;a<r;a++){let n=l.getX(a);no.fromBufferAttribute(c,n),nc(no,n,o,i,e,t,this)}}else{let n=Math.max(0,a.start),r=Math.min(c.count,a.start+a.count);for(let a=n;a<r;a++)no.fromBufferAttribute(c,a),nc(no,a,o,i,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){let t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function nc(e,t,n,i,r,a,s){let o=na.distanceSqToPoint(e);if(o<n){let n=new P;na.closestPointToPoint(e,n),n.applyMatrix4(i);let l=r.ray.origin.distanceTo(n);if(l<r.near||l>r.far)return;a.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:s})}}class nu extends j{constructor(e,t,n,i,r,a,s,o,l){super(e,t,n,i,r,a,s,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class nh extends j{constructor(e,t,n=1014,i,r,a,s=1003,o=1003,l,c=1026,u=1){if(1026!==c&&1027!==c)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:u},i,r,a,s,o,c,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new G(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}}class nd extends nh{constructor(e,t=1014,n=301,i,r,a=1003,s=1003,o,l=1026){const c={width:e,height:e,depth:1};super(e,e,t,n,i,r,a,s,o,l),this.image=[c,c,c,c,c,c],this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class nf extends j{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class np{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){g("Curve: .getPoint() not implemented.")}getPointAt(e,t){let n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){let t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){let e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let t=[],n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)t.push(r+=(n=this.getPoint(a/e)).distanceTo(i)),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){let n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];let s=0,o=a-1,l;for(;s<=o;)if((l=i[r=Math.floor(s+(o-s)/2)]-n)<0)s=r+1;else if(l>0)o=r-1;else{o=r;break}if(i[r=o]===n)return r/(a-1);let c=i[r],u=i[r+1];return(r+(n-c)/(u-c))/(a-1)}getTangent(e,t){let n=e-1e-4,i=e+1e-4;n<0&&(n=0),i>1&&(i=1);let r=this.getPoint(n),a=this.getPoint(i),s=t||(r.isVector2?new R:new P);return s.copy(a).sub(r).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new P,i=[],r=[],a=[],s=new P,o=new eb;for(let t=0;t<=e;t++){let n=t/e;i[t]=this.getTangentAt(n,new P)}r[0]=new P,a[0]=new P;let l=Number.MAX_VALUE,c=Math.abs(i[0].x),u=Math.abs(i[0].y),h=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),h<=l&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),a[0].crossVectors(i[0],r[0]);for(let t=1;t<=e;
36t++){if(r[t]=r[t-1].clone(),a[t]=a[t-1].clone(),s.crossVectors(i[t-1],i[t]),s.length()>Number.EPSILON){s.normalize();let e=Math.acos(b(i[t-1].dot(i[t]),-1,1));r[t].applyMatrix4(o.makeRotationAxis(s,e))}a[t].crossVectors(i[t],r[t])}if(!0===t){let t=Math.acos(b(r[0].dot(r[e]),-1,1));t/=e,i[0].dot(s.crossVectors(r[0],r[e]))>0&&(t=-t);for(let n=1;n<=e;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),a[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:a}}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.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class nm extends np{constructor(e=0,t=0,n=1,i=1,r=0,a=2*Math.PI,s=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=s,this.aRotation=o}getPoint(e,t=new R){let n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=n;for(;i>n;)i-=n;i<Number.EPSILON&&(i=r?0:n),!0!==this.aClockwise||r||(i===n?i=-n:i-=n);let a=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(a),o=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,i=o-this.aY;s=n*e-i*t+this.aX,o=n*t+i*e+this.aY}return t.set(s,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}}function ng(){let e=0,t=0,n=0,i=0;function r(r,a,s,o){e=r,t=s,n=-3*r+3*a-2*s-o,i=2*r-2*a+s+o}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,s,o){let l=(t-e)/a-(n-e)/(a+s)+(n-t)/s,c=(n-t)/s-(i-t)/(s+o)+(i-n)/o;r(t,n,l*=s,c*=s)},calc:function(r){let a=r*r;return e+t*r+n*a+a*r*i}}}let n_=new P,nv=new ng,nx=new ng,ny=new ng;function nM(e,t,n,i,r){let a=(i-t)*.5,s=(r-n)*.5,o=e*e;return e*o*(2*n-2*i+a+s)+(-3*n+3*i-2*a-s)*o+a*e+n}function nS(e,t,n,i){let r;return(r=1-e)*r*t+2*(1-e)*e*n+e*e*i}function nE(e,t,n,i,r){let a,s;return(a=1-e)*a*a*t+3*(s=1-e)*s*e*n+3*(1-e)*e*e*i+e*e*e*r}class nT extends np{constructor(e=new R,t=new R,n=new R,i=new R){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new R){let n=this.v0,i=this.v1,r=this.v2,a=this.v3;return t.set(nE(e,n.x,i.x,r.x,a.x),nE(e,n.y,i.y,r.y,a.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}}class nb extends np{constructor(e=new R,t=new R){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new R){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,t=new R){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}}class nw extends np{constructor(e=new R,t=new R,n=new R){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new R){let n=this.v0,i=this.v1,r=this.v2;return t.set(nS(e,n.x,i.x,r.x),nS(e,n.y,i.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}}class nA extends np{constructor(e=new P,t=new P,n=new P){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new P){let n=this.v0,i=this.v1,r=this.v2;return t.set(nS(e,n.x,i.x,r.x),nS(e,n.y,i.y,r.y),nS(e,n.z,i.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}}class nR extends np{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new R){let n=this.points,i=(n.length-1)*e,r=Math.floor(i),a=i-r,s=n[0===r?r:r-1],o=n[r],l=n[r>n.length-2?n.length-1:r+1],c=n[r>n.length-3?n.length-1:r+2];return t.set(nM(a,s.x,o.x,l.x,c.x),nM(a,s.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(n.clone())}return this}toJSON(){let e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){let n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){let n=e.points[t];this.points.push(new R().fromArray(n))}return this}}
36class nC extends tw{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,s=Math.floor(n),o=Math.floor(i),l=s+1,c=o+1,u=e/s,h=t/o,d=[],f=[],p=[],m=[];for(let e=0;e<c;e++){const t=e*h-a;for(let n=0;n<l;n++){const i=n*u-r;f.push(i,-t,0),p.push(0,0,1),m.push(n/s),m.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const n=t+l*e,i=t+l*(e+1),r=t+1+l*(e+1),a=t+1+l*e;d.push(n,i,a),d.push(i,r,a)}this.setIndex(d),this.setAttribute("position",new tv(f,3)),this.setAttribute("normal",new tv(p,3)),this.setAttribute("uv",new tv(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nC(e.width,e.height,e.widthSegments,e.heightSegments)}}class nP extends tX{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class nL extends tu{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}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}}class nD extends tu{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)}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}}function nN(e,t){return e&&e.constructor!==t?"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e):e}class nI{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{let a;n:{i:if(!(e<i)){for(let a=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(r=i,e<(i=t[++n]))break t}a=t.length;break n}if(!(e>=r)){let s=t[1];e<s&&(n=2,r=s);for(let a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.copySampleValue_(0);if(n===a)break;if(i=r,e>=(r=t[--n-1]))break t}a=n,n=0;break n}break e}for(;n<a;){let i=n+a>>>1;e<t[i]?a=i:n=i+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let e=0;e!==i;++e)t[e]=n[r+e];return t}interpolate_(){throw Error("call to abstract method")}intervalChanged_(){}}class nU extends nI{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){let i=this.parameterPositions,r=e-2,a=e+1,s=i[r],o=i[a];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-n;break;case 2402:r=i.length-2,s=t+i[r]-i[r+1];break;default:r=e,s=n}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:a=e,o=2*n-t;break;case 2402:a=1,o=n+i[1]-i[0];break;default:a=e-1,o=t}let l=(n-t)*.5,c=this.valueSize;this._weightPrev=l/(t-s),this._weightNext=l/(o-n),this._offsetPrev=r*c,this._offsetNext=a*c}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-t)/(i-t),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,_=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,v=(-1-d)*m+(1.5+d)*p+.5*f,x=d*m-d*p;for(let e=0;e!==s;++e)r[e]=g*a[c+e]+_*a[l+e]+v*a[o+e]+x*a[u+e];return r}}class nO extends nI{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=e*s,l=o-s,c=(n-t)/(i-t),u=1-c;for(let e=0;e!==s;++e)r[e]=a[l+e]*u+a[o+e]*c;return r}}class nF extends nI{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class nB{constructor(e,t,n,i){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=nN(t,this.TimeBufferType),this.values=nN(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){let t,n=e.constructor;if(n.toJSON!==this.toJSON)t=n.toJSON(e);else{t={name:e.name,times:nN(e.times,Array),values:nN(e.values,Array)};let n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}InterpolantFactoryMethodDiscrete(e){return new nF(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new nO(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new nU(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302: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 g("KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){let t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){let n=this.times,i=n.length,r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);let e=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*e,a*e)}return this}validate(){var e;let t=!0,n=this.getValueSize();n-Math.floor(n)!=0&&(_("KeyframeTrack: Invalid value size in track.",this),t=!1);let i=this.times,r=this.values,a=i.length;0===a&&(_("KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==a;e++){let n=i[e];if("number"==typeof n&&isNaN(n)){_("KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>
36n){_("KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==r&&ArrayBuffer.isView(e=r)&&!(e instanceof DataView))for(let e=0,n=r.length;e!==n;++e){let n=r[e];if(isNaN(n)){_("KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1,a=1;for(let s=1;s<r;++s){let r=!1,o=e[s];if(o!==e[s+1]&&(1!==s||o!==e[0]))if(i)r=!0;else{let e=s*n,i=e-n,a=e+n;for(let s=0;s!==n;++s){let n=t[e+s];if(n!==t[i+s]||n!==t[a+s]){r=!0;break}}}if(r){if(s!==a){e[a]=e[s];let i=s*n,r=a*n;for(let e=0;e!==n;++e)t[r+e]=t[i+e]}++a}}if(r>0){e[a]=e[r];for(let e=r*n,i=a*n,s=0;s!==n;++s)t[i+s]=t[e+s];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}nB.prototype.ValueTypeName="",nB.prototype.TimeBufferType=Float32Array,nB.prototype.ValueBufferType=Float32Array,nB.prototype.DefaultInterpolation=2301;class nz extends nB{constructor(e,t,n){super(e,t,n)}}nz.prototype.ValueTypeName="bool",nz.prototype.ValueBufferType=Array,nz.prototype.DefaultInterpolation=2300,nz.prototype.InterpolantFactoryMethodLinear=void 0,nz.prototype.InterpolantFactoryMethodSmooth=void 0,(class extends nB{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="color",(class extends nB{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="number";class nV extends nI{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){let r=this.resultBuffer,a=this.sampleValues,s=this.valueSize,o=(n-t)/(i-t),l=e*s;for(let e=l+s;l!==e;l+=4)C.slerpFlat(r,0,a,l-s,a,l,o);return r}}class nk extends nB{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new nV(this.times,this.values,this.getValueSize(),e)}}nk.prototype.ValueTypeName="quaternion",nk.prototype.InterpolantFactoryMethodSmooth=void 0;class nG extends nB{constructor(e,t,n){super(e,t,n)}}nG.prototype.ValueTypeName="string",nG.prototype.ValueBufferType=Array,nG.prototype.DefaultInterpolation=2300,nG.prototype.InterpolantFactoryMethodLinear=void 0,nG.prototype.InterpolantFactoryMethodSmooth=void 0,(class extends nB{constructor(e,t,n,i){super(e,t,n,i)}}).prototype.ValueTypeName="vector";let nH={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={}}},nW=new class{constructor(e,t,n){let i;const r=this;let a=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(e){o++,!1===a&&void 0!==r.onStart&&r.onStart(e,s,o),a=!0},this.itemEnd=function(e){s++,void 0!==r.onProgress&&r.onProgress(e,s,o),s===o&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=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,n=l.length;t<n;t+=2){let n=l[t],i=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return i}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}};class nX{constructor(e){this.manager=void 0!==e?e:nW,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let n=this;return new Promise(function(i,r){n.load(e,i,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}}nX.DEFAULT_MATERIAL_NAME="__DEFAULT";let nj=new WeakMap;
36class nq extends nX{constructor(e){super(e)}load(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);let r=this,a=nH.get(`image:${e}`);if(void 0!==a){if(!0===a.complete)r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0);else{let e=nj.get(a);void 0===e&&(e=[],nj.set(a,e)),e.push({onLoad:t,onError:i})}return a}let s=d("img");function o(){c(),t&&t(this);let n=nj.get(this)||[];for(let e=0;e<n.length;e++){let t=n[e];t.onLoad&&t.onLoad(this)}nj.delete(this),r.manager.itemEnd(e)}function l(t){c(),i&&i(t),nH.remove(`image:${e}`);let n=nj.get(this)||[];for(let e=0;e<n.length;e++){let i=n[e];i.onError&&i.onError(t)}nj.delete(this),r.manager.itemError(e),r.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),nH.add(`image:${e}`,s),r.manager.itemStart(e),s.src=e,s}}class nY extends nX{constructor(e){super(e)}load(e,t,n,i){let r=new j,a=new nq(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){r.image=e,r.needsUpdate=!0,void 0!==t&&t(r)},n,i),r}}class nK extends tj{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}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,n,i,r,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,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),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,s=i+t,o=i-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,a=r+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(r,a,s,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}}new WeakMap;class nZ extends tZ{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}let nJ="\\[\\]\\.:\\/",n$=RegExp("["+nJ+"]","g"),nQ="[^"+nJ+"]",n0="[^"+nJ.replace("\\.","")+"]",n1=RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",nQ)+/(WCOD+)?/.source.replace("WCOD",n0)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",nQ)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",nQ)+"$"),n3=["material","materials","bones","map"];class n2{constructor(e,t,n){this.path=t,this.parsedPath=n||n2.parseTrackName(t),this.node=n2.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new n2.Composite(e,t,n):new n2(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(n$,"")}static parseTrackName(e){let t=n1.exec(e);if(null===t)throw Error("PropertyBinding: Cannot parse trackName: "+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){let e=n.nodeName.substring(i+1);-1!==n3.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){let n=function(e){for(let i=0;i<e.length;i++){let r=e[i];if(r.name===t||r.uuid===t)return r;let a=n(r.children);if(a)return a}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)e[t++]=n[i]}_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 n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}
vendor: 4,545 bytes, line 36
36_setValue_array_setMatrixWorldNeedsUpdate(e,t){let n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=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,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=n2.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void g("PropertyBinding: No target node found for track: "+this.path+".");if(n){let i=t.objectIndex;switch(n){case"materials":if(!e.material)return void _("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void _("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void _("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material)return void _("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.map)return void _("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);e=e.material.map;break;default:if(void 0===e[n])return void _("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void _("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}let a=e[i];if(void 0===a)return void _("PropertyBinding: Trying to update property for track: "+t.nodeName+"."+i+" but it wasn't found.",e);let s=this.Versioning.None;this.targetObject=e,!0===e.isMaterial?s=this.Versioning.NeedsUpdate:!0===e.isObject3D&&(s=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void _("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void _("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}o=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(o=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][s]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}function n4(e,t,n,i){let r=function(e){switch(e){case 1009:case 1010:return{byteLength:1,components:1};case 1012:case 1011:case 1016:return{byteLength:2,components:1};case 1017:case 1018:return{byteLength:2,components:4};case 1014:case 1013:case 1015:return{byteLength:4,components:1};case 35902:case 35899:return{byteLength:4,components:3}}throw Error(`Unknown texture type ${e}.`)}(i);switch(n){case 1021:return e*t;case 1028:case 1029:return e*t/r.components*r.byteLength;case 1030:case 1031:return e*t*2/r.components*r.byteLength;case 1022:return e*t*3/r.components*r.byteLength;case 1023:case 1033:return e*t*4/r.components*r.byteLength;case 33776:case 33777:case 36196:case 37492:case 37488:case 37489:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case 33778:case 33779:case 37496:case 37490:case 37491:case 37808:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case 35841:case 35843:return Math.max(e,16)*Math.max(t,8)/4;case 35840:case 35842:return Math.max(e,8)*Math.max(t,8)/2;
36case 37809:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case 37810:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case 37811:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case 37812:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case 37813:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case 37814:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case 37815:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case 37816:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case 37817:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case 37818:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case 37819:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case 37820:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case 37821:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case 36492:case 36494:case 36495:case 36285:case 36286:return Math.ceil(e/4)*Math.ceil(t/4)*16;case 36283:case 36284:return Math.ceil(e/4)*Math.ceil(t/4)*8}throw Error(`Unable to determine texture byte length for ${n} format.`)}function n5(){let e=null,t=!1,n=null,i=null;function r(t,a){n(t,a),i=e.requestAnimationFrame(r)}return{start:function(){!0===t||null!==n&&(i=e.requestAnimationFrame(r),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function n6(e){let t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);let i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){let e=t.get(n);(!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version});return}let r=t.get(n);if(void 0===r)t.set(n,function(t,n){let i,r=t.array,a=t.usage,s=r.byteLength,o=e.createBuffer();if(e.bindBuffer(n,o),e.bufferData(n,r,a),t.onUploadCallback(),r instanceof Float32Array)i=e.FLOAT;else if("undefined"!=typeof Float16Array&&r instanceof Float16Array)i=e.HALF_FLOAT;else if(r instanceof Uint16Array)i=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)i=e.SHORT;else if(r instanceof Uint32Array)i=e.UNSIGNED_INT;else if(r instanceof Int32Array)i=e.INT;else if(r instanceof Int8Array)i=e.BYTE;else if(r instanceof Uint8Array)i=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)i=e.UNSIGNED_BYTE;else throw Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);return{buffer:o,type:i,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,i));else if(r.version<n.version){if(r.size!==n.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,n,i){let r=n.array,a=n.updateRanges;if(e.bindBuffer(i,t),0===a.length)e.bufferSubData(i,0,r);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],i=a[e];i.start<=n.start+n.count+1?n.count=Math.max(n.count,i.start+i.count-n.start):a[++t]=i}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(i,n.start*r.BYTES_PER_ELEMENT,r,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(r.buffer,n,i),r.version=n.version}}}}n2.Composite=class{constructor(e,t,n){const i=n||n2.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},n2.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},n2.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},n2.prototype.GetterByBindingType=[n2.prototype._getValue_direct,n2.prototype._getValue_array,n2.prototype._getValue_arrayElement,n2.prototype._getValue_toArray],n2.prototype.SetterByBindingTypeAndVersioning=[[n2.prototype._setValue_direct,n2.prototype._setValue_direct_setNeedsUpdate,n2.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[n2.prototype._setValue_array,n2.prototype._setValue_array_setNeedsUpdate,n2.prototype._setValue_array_setMatr
36ixWorldNeedsUpdate],[n2.prototype._setValue_arrayElement,n2.prototype._setValue_arrayElement_setNeedsUpdate,n2.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[n2.prototype._setValue_fromArray,n2.prototype._setValue_fromArray_setNeedsUpdate,n2.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]],new Float32Array(1),"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"182"}})),"undefined"!=typeof window&&(window.__THREE__?g("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="182"),e.s(["ACESFilmicToneMapping",()=>4,"AddEquation",()=>100,"AddOperation",()=>2,"AdditiveBlending",()=>2,"AgXToneMapping",()=>6,"AlphaFormat",()=>1021,"AlwaysCompare",()=>519,"AlwaysDepth",()=>1,"ArrayCamera",()=>nZ,"BackSide",()=>1,"BoxGeometry",()=>tV,"BufferAttribute",()=>tm,"BufferGeometry",()=>tw,"ByteType",()=>1010,"CanvasTexture",()=>nu,"CineonToneMapping",()=>3,"ClampToEdgeWrapping",()=>1001,"Color",()=>to,"ColorManagement",()=>F,"ConstantAlphaFactor",()=>213,"ConstantColorFactor",()=>211,"CubeDepthTexture",()=>nd,"CubeReflectionMapping",()=>301,"CubeRefractionMapping",()=>302,"CubeTexture",()=>t$,"CubeUVReflectionMapping",()=>306,"CullFaceBack",()=>1,"CullFaceFront",()=>2,"CullFaceNone",()=>0,"CustomBlending",()=>5,"CustomToneMapping",()=>5,"Data3DTexture",()=>J,"DataArrayTexture",()=>Z,"DataTexture",()=>t4,"DepthFormat",()=>1026,"DepthStencilFormat",()=>1027,"DepthTexture",()=>nh,"DoubleSide",()=>2,"DstAlphaFactor",()=>206,"DstColorFactor",()=>208,"EqualCompare",()=>514,"EqualDepth",()=>4,"EquirectangularReflectionMapping",()=>303,"EquirectangularRefractionMapping",()=>304,"Euler",()=>eU,"EventDispatcher",()=>y,"ExternalTexture",()=>nf,"Float32BufferAttribute",()=>tv,"FloatType",()=>1015,"FrontSide",()=>0,"Frustum",()=>nn,"GLSL3",()=>u,"GreaterCompare",()=>516,"GreaterDepth",()=>6,"GreaterEqualCompare",()=>518,"GreaterEqualDepth",()=>5,"HalfFloatType",()=>1016,"IntType",()=>1013,"Layers",()=>eO,"LessCompare",()=>513,"LessDepth",()=>2,"LessEqualCompare",()=>515,"LessEqualDepth",()=>3,"LinearFilter",()=>1006,"LinearMipmapLinearFilter",()=>1008,"LinearMipmapNearestFilter",()=>1007,"LinearSRGBColorSpace",()=>o,"LinearToneMapping",()=>1,"LinearTransfer",()=>l,"Matrix3",()=>N,"Matrix4",()=>eb,"MaxEquation",()=>104,"Mesh",()=>tB,"MeshBasicMaterial",()=>th,"MeshDepthMaterial",()=>nL,"MeshDistanceMaterial",()=>nD,"MinEquation",()=>103,"MirroredRepeatWrapping",()=>1002,"MixOperation",()=>1,"MultiplyBlending",()=>4,"MultiplyOperation",()=>0,"NearestFilter",()=>1003,"NearestMipmapLinearFilter",()=>1005,"NearestMipmapNearestFilter",()=>1004,"NeutralToneMapping",()=>7,"NeverCompare",()=>512,"NeverDepth",()=>0,"NoBlending",()=>0,"NoColorSpace",()=>"","NoToneMapping",()=>0,"NormalBlending",()=>1,"NotEqualCompare",()=>517,"NotEqualDepth",()=>7,"ObjectSpaceNormalMap",()=>1,"OneFactor",()=>201,"OneMinusConstantAlphaFactor",()=>214,"OneMinusConstantColorFactor",()=>212,"OneMinusDstAlphaFactor",()=>207,"OneMinusDstColorFactor",()=>209,"OneMinusSrcAlphaFactor",()=>205,"OneMinusSrcColorFactor",()=>203,"OrthographicCamera",()=>nK,"PCFShadowMap",()=>1,"PCFSoftShadowMap",()=>2,"PerspectiveCamera",()=>tZ,"Plane",()=>t9,"PlaneGeometry",()=>nC,"Points",()=>nl,"PointsMaterial",()=>ni,"R11_EAC_Format",()=>37488,"RAD2DEG",()=>E,"RED_GREEN_RGTC2_Format",()=>36285,"RED_RGTC1_Format",()=>36283,"REVISION",()=>"182","RG11_EAC_Format",()=>37490,"RGBAFormat",()=>1023,"RGBAIntegerFormat",()=>1033,"RGBA_ASTC_10x10_Format",()=>37819,"RGBA_ASTC_10x5_Format",()=>37816,"RGBA_ASTC_10x6_Format",()=>37817,"RGBA_ASTC_10x8_Format",()=>37818,"RGBA_ASTC_12x10_Format",()=>37820,"RGBA_ASTC_12x12_Format",()=>37821,"RGBA_ASTC_4x4_Format",()=>37808,"RGBA_ASTC_5x4_Format",()=>37809,"RGBA_ASTC_5x5_Format",()=>37810,"RGBA_ASTC_6x5_Format",()=>37811,"RGBA_ASTC_6x6_Format",()=>37812,"RGBA_ASTC_8x5_Format",()=>37813,"RGBA_ASTC_8x6_Format",()=>37814,"RGBA_ASTC_8x8_Format",()=>37815,"RGBA_BPTC_Format",()=>36492,"RGBA_ETC2_EAC_Format",()=>37496,"RGBA_PVRTC_2BPPV1_Format",()=>35843,"RGBA_PVRTC_4BPPV1_Format",()=>35842,"RGBA_S3TC_DXT1_Format",()=>33777,"RGBA_S3TC_DXT3_Format",()=>33778,"RGBA_S3TC_DXT5_Format",()=>33779,"RGBFormat",()=>1022,"RGB_BPTC_SIGNED_Format",()=>36494,"RGB_BPTC_UNSIGNED_Format",()=>36495,"RGB_ETC1_Format",()=>36196,"RGB_ETC2_Format",()=>37492,"RGB_PVRTC_2BPPV1_Format",()=>35841,"RGB_PVRTC_4BPPV1_Format",()=>35840,"RGB_S3TC_DXT1_Format",()=>33776,"RGFormat",()=>1030,"RGIntegerFormat",()=>1031,"RawShaderMaterial",()=>nP,"RedFormat",()=>1028,"RedIntegerFormat",()=>1029,"ReinhardToneMapping",()=>2,"RepeatWrapping",()=>1e3,"ReverseSubtractEquation",()=>102,"SIGNED_R11_EAC_Format",()=>37489,"SIGNED_RED_GREEN_RGTC2_Format",()=>
3636286,"SIGNED_RED_RGTC1_Format",()=>36284,"SIGNED_RG11_EAC_Format",()=>37491,"SRGBColorSpace",()=>s,"SRGBTransfer",()=>c,"Scene",()=>t2,"ShaderMaterial",()=>tX,"ShortType",()=>1011,"SrcAlphaFactor",()=>204,"SrcAlphaSaturateFactor",()=>210,"SrcColorFactor",()=>202,"SubtractEquation",()=>101,"SubtractiveBlending",()=>3,"TangentSpaceNormalMap",()=>0,"Texture",()=>j,"TextureLoader",()=>nY,"Uint16BufferAttribute",()=>tg,"Uint32BufferAttribute",()=>t_,"UniformsUtils",()=>tW,"UnsignedByteType",()=>1009,"UnsignedInt101111Type",()=>35899,"UnsignedInt248Type",()=>1020,"UnsignedInt5999Type",()=>35902,"UnsignedIntType",()=>1014,"UnsignedShort4444Type",()=>1017,"UnsignedShort5551Type",()=>1018,"UnsignedShortType",()=>1012,"VSMShadowMap",()=>3,"Vector2",()=>R,"Vector3",()=>P,"Vector4",()=>q,"WebGLCoordinateSystem",()=>2e3,"WebGLCubeRenderTarget",()=>tQ,"WebGLRenderTarget",()=>K,"WebXRController",()=>t3,"ZeroFactor",()=>200,"arrayNeedsUint32",()=>h,"cloneUniforms",()=>tk,"createCanvasElement",()=>f,"createElementNS",()=>d,"error",()=>_,"getByteLength",()=>n4,"getUnlitUniformColorSpace",()=>tH,"log",()=>m,"mergeUniforms",()=>tG,"probeAsync",()=>x,"warn",()=>g,"warnOnce",()=>v],190072);let n8={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( 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 );
36\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 );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );
36\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}\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 );
36\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#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 );
36\n reflectVec = normalize( mix( reflectVec, normal, pow4( 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 }
36 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 }
36\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;\nmaterial.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.metalness = 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 = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor;\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = vec3( 0.04 );\n material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor );\n material.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n material.clearcoat = clearcoat;
36\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.0001, 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:"uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n vec3 diffuseColor;\n vec3 diffuseContribution;\n vec3 specularColor;\n vec3 specularColorBlended;\n float roughness;\n float metalness;\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 vec3 iridescenceFresnelDielectric;\n vec3 iridescenceFresnelMetallic;\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
36aB * dotBV, dotNV ) );\n float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n float v = 0.5 / ( gv + gl );\n return 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.specularColorBlended;\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 >
36 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 * transpose( 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 rInv = 1.0 / ( roughness + 0.1 );\n float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv;\n float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv;\n float DG = exp( a * dotNV + b );\n return saturate( DG );\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\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 float dotNV = saturate( dot( normal, viewDir ) );\n vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg;\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}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
36\n float dotNL = saturate( dot( normal, lightDir ) );\n float dotNV = saturate( dot( normal, viewDir ) );\n vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg;\n vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg;\n vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y;\n vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y;\n float Ess_V = dfgV.x + dfgV.y;\n float Ess_L = dfgL.x + dfgL.y;\n float Ems_V = 1.0 - Ess_V;\n float Ems_L = 1.0 - Ess_L;\n vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619;\n vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON );\n float compensationFactor = Ems_V * Ems_L;\n vec3 multiScatter = Fms * compensationFactor;\n return singleScatter + multiScatter;\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.specularColorBlended * t2.x + ( vec3( 1.0 ) - material.specularColorBlended ) * t2.y );\n reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n reflectedLight.directDiffuse += lightColor * material.diffuseContribution * 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 \n sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n \n float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness );\n \n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL );\n \n irradiance *= sheenEnergyComp;\n \n #endif\n reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution );\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 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution );\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n diffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectDiffuse += diffuse;\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 ) * RECIPROCAL_PI;\n #endif\n vec3 singleScatteringDielectric = vec3( 0.0 );\n vec3 multiScatteringDielectric = vec3( 0.0 );\n vec3 singleScatteringMetallic = vec3( 0.0 );\n vec3 multiScatteringMetallic = vec3( 0.0 );
36\n #ifdef USE_IRIDESCENCE\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #else\n computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric );\n computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic );\n #endif\n vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness );\n vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness );\n vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric;\n vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric );\n vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n vec3 indirectSpecular = radiance * singleScattering;\n indirectSpecular += multiScattering * cosineWeightedIrradiance;\n vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance;\n #ifdef USE_SHEEN\n float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo;\n indirectSpecular *= sheenEnergyComp;\n indirectDiffuse *= sheenEnergyComp;\n #endif\n reflectedLight.indirectSpecular += indirectSpecular;\n reflectedLight.indirectDiffuse += indirectDiffuse;\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.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor );\n material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness );\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 ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\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 }
36\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_LIGHT_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 );
36\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
365.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 #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #else\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n #endif\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 #if defined( SHADOWMAP_TYPE_PCF )\n uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #else\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n #endif\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 #if defined( SHADOWMAP_TYPE_PCF )\n uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #elif defined( SHADOWMAP_TYPE_BASIC )\n uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n #endif\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 #if defined( SHADOWMAP_TYPE_PCF )\n float interleavedGradientNoise( vec2 position ) {\n return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) );\n }\n vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) {\n const float goldenAngle = 2.399963229728653;\n float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) );\n float theta = float( sampleIndex ) * goldenAngle + phi;\n return vec2( cos( theta ), sin( theta ) ) * r;\n }\n #endif\n #if defined( SHADOWMAP_TYPE_PCF )\n float getShadow( sampler2DShadow 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 vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float radius = shadowRadius * texelSize.x;\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) +\n texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_VSM )\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 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg;\n float mean = distribution.x;\n float variance = distribution.y * distribution.y;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n float hard_shadow = step( mean, shadowCoord.z );\n #else\n float hard_shadow = step( shadowCoord.z, mean );\n #endif\n if ( hard_shadow == 1.0 ) {\n shadow = 1.0;\n } else {\n variance = max( variance, 0.0000001 );\n float d = shadowCoord.z - mean;\n float p_max = variance / ( variance + d * d );\n p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 );\n shadow = max( hard_shadow, p_max );\n }\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #else\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 float depth = texture2D( shadowMap, shadowCoord.xy ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, shadowCoord.z );\n #else\n shadow = step( shadowCoord.z, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #if NUM_POINT_LIGHT_SHADOWS > 0\n #if defined( SHADOWMAP_TYPE_PCF )\n float getPointShadow( samplerCubeShadow 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 vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float texelSize = shadowRadius / shadowMapSize.x;\n vec3 absDir = abs( bd3D );\n vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 );\n tangent = normalize( cross( bd3D, tangent ) );\n vec3 bitangent = cross( bd3D, tangent );\n float phi = interleavedGradientNoise( gl_FragCoord.xy ) * 6.28318530718;\n shadow = (\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 0, 5, phi ).x + bitangent * vogelDiskSample( 0, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 1, 5, phi ).x + bitangent * vogelDiskSample( 1, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 2, 5, phi ).x + bitangent * vogelDiskSample( 2, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 3, 5, phi ).x + bitangent * vogelDiskSample( 3, 5, phi ).y ) * texelSize, dp ) ) +\n texture( shadowMap, vec4( bd3D + ( tangent * vogelDiskSample( 4, 5, phi ).x + bitangent * vogelDiskSample( 4, 5, phi ).y ) * texelSize, dp ) )\n ) * 0.2;\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #elif defined( SHADOWMAP_TYPE_BASIC )\n float getPointShadow( samplerCube 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 vec3 bd3D = normalize( lightToPosition );\n vec3 absVec = abs( lightToPosition );\n float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z );\n if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) {\n float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );\n dp += shadowBias;\n float depth = textureCube( shadowMap, bd3D ).r;\n #ifdef USE_REVERSED_DEPTH_BUFFER\n shadow = step( depth, dp );\n #else\n shadow = step( dp, depth );\n #endif\n }\n return mix( 1.0, shadow, shadowIntensity );\n }\n #endif\n #endif\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_L
36IGHT_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 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) )\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;
36\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 );
36\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.diffuseContribution, material.specularColorBlended, 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;
36\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;
36\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}",distance_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}",distance_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\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 <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 = vec4( dist, 0.0, 0.0, 1.0 );\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 <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 #include <begin_vertex>\n #include <morphtarget_ve
36rtex>\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 <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( normalize( normal ) * 0.5 + 0.5, 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 <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;
36\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 <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 \n outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect;\n \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;
36\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 <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 <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}"},n9={common:{diffuse:{value:new to(0xffffff)},opacity:{value:1},map:{value:null},mapTransform:{value:new N}
vendor: 4,122 bytes, line 36
36,alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new N}},envmap:{envMap:{value:null},envMapRotation:{value:new N},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new N}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new N}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new N},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new N},normalScale:{value:new R(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new N},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new N}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new N}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new N}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new to(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 to(0xffffff)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0},uvTransform:{value:new N}},sprite:{diffuse:{value:new to(0xffffff)},opacity:{value:1},center:{value:new R(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new N},alphaMap:{value:null},alphaMapTransform:{value:new N},alphaTest:{value:0}}},n7={basic:{uniforms:tG([n9.common,n9.specularmap,n9.envmap,n9.aomap,n9.lightmap,n9.fog]),vertexShader:n8.meshbasic_vert,fragmentShader:n8.meshbasic_frag},lambert:{uniforms:tG([n9.common,n9.specularmap,n9.envmap,n9.aomap,n9.lightmap,n9.emissivemap,n9.bumpmap,n9.normalmap,n9.displacementmap,n9.fog,n9.lights,{emissive:{value:new to(0)}}]),vertexShader:n8.meshlambert_vert,fragmentShader:n8.meshlambert_frag},phong:{uniforms:tG([n9.common,n9.specularmap,n9.envmap,n9.aomap,n9.lightmap,n9.emissivemap,n9.bumpmap,n9.normalmap,n9.displacementmap,n9.fog,n9.lights,{emissive:{value:new to(0)},specular:{value:new to(1118481)},shininess:{value:30}}]),vertexShader:n8.meshphong_vert,fragmentShader:n8.meshphong_frag},standard:{uniforms:tG([n9.common,n9.envmap,n9.aomap,n9.lightmap,n9.emissivemap,n9.bumpmap,n9.normalmap,n9.displacementmap,n9.roughnessmap,n9.metalnessmap,n9.fog,n9.lights,{emissive:{value:new to(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:n8.meshphysical_vert,fragmentShader:n8.meshphysical_frag},toon:{uniforms:tG([n9.common,n9.aomap,n9.lightmap,n9.emissivemap,n9.bumpmap,n9.normalmap,n9.displacementmap,n9.gradientmap,n9.fog,n9.lights,{emissive:{value:new to(0)}}]),vertexShader:n8.meshtoon_vert,fragmentShader:n8.meshtoon_frag},matcap:{uniforms:tG([n9.common,n9.bumpmap,n9.normalmap,n9.displacementmap,n9.fog,{matc
36ap:{value:null}}]),vertexShader:n8.meshmatcap_vert,fragmentShader:n8.meshmatcap_frag},points:{uniforms:tG([n9.points,n9.fog]),vertexShader:n8.points_vert,fragmentShader:n8.points_frag},dashed:{uniforms:tG([n9.common,n9.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:n8.linedashed_vert,fragmentShader:n8.linedashed_frag},depth:{uniforms:tG([n9.common,n9.displacementmap]),vertexShader:n8.depth_vert,fragmentShader:n8.depth_frag},normal:{uniforms:tG([n9.common,n9.bumpmap,n9.normalmap,n9.displacementmap,{opacity:{value:1}}]),vertexShader:n8.meshnormal_vert,fragmentShader:n8.meshnormal_frag},sprite:{uniforms:tG([n9.sprite,n9.fog]),vertexShader:n8.sprite_vert,fragmentShader:n8.sprite_frag},background:{uniforms:{uvTransform:{value:new N},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:n8.background_vert,fragmentShader:n8.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new N}},vertexShader:n8.backgroundCube_vert,fragmentShader:n8.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:n8.cube_vert,fragmentShader:n8.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:n8.equirect_vert,fragmentShader:n8.equirect_frag},distance:{uniforms:tG([n9.common,n9.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:n8.distance_vert,fragmentShader:n8.distance_frag},shadow:{uniforms:tG([n9.lights,n9.fog,{color:{value:new to(0)},opacity:{value:1}}]),vertexShader:n8.shadow_vert,fragmentShader:n8.shadow_frag}};n7.physical={uniforms:tG([n7.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new N},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new N},clearcoatNormalScale:{value:new R(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new N},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new N},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new N},sheen:{value:0},sheenColor:{value:new to(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new N},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new N},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new N},transmissionSamplerSize:{value:new R},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new N},attenuationDistance:{value:0},attenuationColor:{value:new to(0)},specularColor:{value:new to(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new N},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new N},anisotropyVector:{value:new R},anisotropyMap:{value:null},anisotropyMapTransform:{value:new N}}]),vertexShader:n8.meshphysical_vert,fragmentShader:n8.meshphysical_frag};let ie={r:0,b:0,g:0},it=new eU,ii=new eb;function ir(e,t,n,i,r,a,s){let o,l,u=new to(0),h=+(!0!==a),d=null,f=0,p=null;function m(e){let i=!0===e.isScene?e.background:null;return i&&i.isTexture&&(i=(e.backgroundBlurriness>0?n:t).get(i)),i}function g(t,n){t.getRGB(ie,tH(e)),i.buffers.color.setClear(ie.r,ie.g,ie.b,n,s)}return{getClearColor:function(){return u},setClearColor:function(e,t=1){u.set(e),g(u,h=t)},getClearAlpha:function(){return h},setClearAlpha:function(e){g(u,h=e)},render:function(t){let n=!1,r=m(t);null===r?g(u,h):r&&r.isColor&&(g(r,1),n=!0);let a=e.xr.getEnvironmentBlendMode();"additive"===a?i.buffers.color.setClear(0,0,0,1,s):"alpha-blend"===a&&i.buffers.color.setClear(0,0,0,0,s),(e.autoClear||n)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){let i=m(n);
36i&&(i.isCubeTexture||306===i.mapping)?(void 0===l&&((l=new tB(new tV(1,1,1),new tX({name:"BackgroundCubeMaterial",uniforms:tk(n7.backgroundCube.uniforms),vertexShader:n7.backgroundCube.vertexShader,fragmentShader:n7.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),it.copy(n.backgroundRotation),it.x*=-1,it.y*=-1,it.z*=-1,i.isCubeTexture&&!1===i.isRenderTargetTexture&&(it.y*=-1,it.z*=-1),l.material.uniforms.envMap.value=i,l.material.uniforms.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(ii.makeRotationFromEuler(it)),l.material.toneMapped=F.getTransfer(i.colorSpace)!==c,(d!==i||f!==i.version||p!==e.toneMapping)&&(l.material.needsUpdate=!0,d=i,f=i.version,p=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(void 0===o&&((o=new tB(new nC(2,2),new tX({name:"BackgroundMaterial",uniforms:tk(n7.background.uniforms),vertexShader:n7.background.vertexShader,fragmentShader:n7.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=i,o.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,o.material.toneMapped=F.getTransfer(i.colorSpace)!==c,!0===i.matrixAutoUpdate&&i.updateMatrix(),o.material.uniforms.uvTransform.value.copy(i.matrix),(d!==i||f!==i.version||p!==e.toneMapping)&&(o.material.needsUpdate=!0,d=i,f=i.version,p=e.toneMapping),o.layers.enableAll(),t.unshift(o,o.geometry,o.material,0,0,null))},dispose:function(){void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0),void 0!==o&&(o.geometry.dispose(),o.material.dispose(),o=void 0)}}}function ia(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),i={},r=c(null),a=r,s=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function c(e){let t=[],i=[],r=[];for(let e=0;e<n;e++)t[e]=0,i[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:i,attributeDivisors:r,object:e,attributes:{},index:null}}function u(){let e=a.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function h(e){d(e,0)}function d(t,n){let i=a.newAttributes,r=a.enabledAttributes,s=a.attributeDivisors;i[t]=1,0===r[t]&&(e.enableVertexAttribArray(t),r[t]=1),s[t]!==n&&(e.vertexAttribDivisor(t,n),s[t]=n)}function f(){let t=a.newAttributes,n=a.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function p(t,n,i,r,a,s,o){!0===o?e.vertexAttribIPointer(t,n,i,a,s):e.vertexAttribPointer(t,n,i,r,a,s)}function m(){g(),s=!0,a!==r&&o((a=r).object)}function g(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:function(n,r,l,m,g){var _,v;let x,y,M,S,E=!1,T=(_=m,v=l,x=!0===r.wireframe,void 0===(y=i[_.id])&&(y={},i[_.id]=y),void 0===(M=y[v.id])&&(M={},y[v.id]=M),void 0===(S=M[x])&&(S=c(e.createVertexArray()),M[x]=S),S);a!==T&&o((a=T).object),(E=function(e,t,n,i){let r=a.attributes,s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=r[t],i=s[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n||n.attribute!==i||i&&n.data!==i.data)return!0;o++}return a.attributesNum!==o||a.index!==i}(n,m,l,g))&&function(e,t,n,i){let r={},s=t.attributes,o=0,l=n.getAttributes();for(let t in l)if(l[t].location>=0){let n=s[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));let i={};i.attribute=n,n&&n.data&&(i.data=n.data),r[t]=i,o++}a.attributes=r,a.attributesNum=o,a.index=i}(n,m,l,g),null!==g&&t.update(g,e.ELEMENT_ARRAY_BUFFER),(E||s)&&(s=!1,function(n,i,r,a){u();let s=a.attributes,o=r.getAttributes(),l=i.defaultAttributeValues;for(let i in o){let r=o[i];if(r.location>=0){let o=s[i];if(void 0===o&&("instanceMatrix"===i&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===i&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){let i=o.normalized,s=o.itemSize,l=t.get(o);if(void 0===l)continue;let c=l.buffer,u=l.type,f=l.bytesPerElement,m=u===e.INT||u===e.UNSIGNED_INT||1013===o.gpuType;if(o.isInterleavedBufferAttribute){let t=o.data,l=t.stride,g=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)d(r.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,i,l*f,(g+s/r.locationSize*e)*f,m)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)d(r.location+e,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)}
36else for(let e=0;e<r.locationSize;e++)h(r.location+e);e.bindBuffer(e.ARRAY_BUFFER,c);for(let e=0;e<r.locationSize;e++)p(r.location+e,s/r.locationSize,u,i,s*f,s/r.locationSize*e*f,m)}}else if(void 0!==l){let t=l[i];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(r.location,t);break;case 3:e.vertexAttrib3fv(r.location,t);break;case 4:e.vertexAttrib4fv(r.location,t);break;default:e.vertexAttrib1fv(r.location,t)}}}}f()}(n,r,l,m),null!==g&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(g).buffer))},reset:m,resetDefaultState:g,dispose:function(){for(let e in m(),i){let t=i[e];for(let e in t){let n=t[e];for(let e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e]}},releaseStatesOfGeometry:function(e){if(void 0===i[e.id])return;let t=i[e.id];for(let e in t){let n=t[e];for(let e in n)l(n[e].object),delete n[e];delete t[e]}delete i[e.id]},releaseStatesOfProgram:function(e){for(let t in i){let n=i[t];if(void 0===n[e.id])continue;let r=n[e.id];for(let e in r)l(r[e].object),delete r[e];delete n[e.id]}},initAttributes:u,enableAttribute:h,disableUnusedAttributes:f}}function is(e,t,n){let i;function r(t,r,a){0!==a&&(e.drawArraysInstanced(i,t,r,a),n.update(r,i,a))}this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i,1)},this.renderInstances=r,this.renderMultiDraw=function(e,r,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,e,0,r,0,a);let s=0;for(let e=0;e<a;e++)s+=r[e];n.update(s,i,1)},this.renderMultiDrawInstances=function(e,a,s,o){if(0===s)return;let l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)r(e[t],a[t],o[t]);
36else{l.multiDrawArraysInstancedWEBGL(i,e,0,a,0,o,0,s);let t=0;for(let e=0;e<s;e++)t+=a[e]*o[e];n.update(t,i,1)}}}function io(e,t,n,i){let r;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 s=void 0!==n.precision?n.precision:"highp",o=a(s);return o!==s&&(g("WebGLRenderer:",s,"not supported, using",o,"instead."),s=o),{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){let n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:a,textureFormatReadable:function(t){return 1023===t||i.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){let r=1016===n&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return 1009===n||i.convert(n)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)||1015===n||!!r},precision:s,logarithmicDepthBuffer:!0===n.logarithmicDepthBuffer,reversedDepthBuffer:!0===n.reversedDepthBuffer&&t.has("EXT_clip_control"),maxTextures:e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),maxVertexTextures:e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),maxSamples:e.getParameter(e.MAX_SAMPLES),samples:e.getParameter(e.SAMPLES)}}function il(e){let t=this,n=null,i=0,r=!1,a=!1,s=new t9,o=new N,l={value:null,needsUpdate:!1};function c(e,n,i,r){let a=null!==e?e.length:0,c=null;if(0!==a){if(c=l.value,!0!==r||null===c){let t=i+4*a,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==a;++t,n+=4)s.copy(e[t]).applyMatrix4(r,o),s.normal.toArray(c,n),c[n+3]=s.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=a,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=0!==e.length||t||0!==i||r;return r=t,i=e.length,n},this.beginShadows=function(){a=!0,c(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=c(e,t,0)},this.setState=function(s,o,u){let h=s.clippingPlanes,d=s.clipIntersection,f=s.clipShadows,p=e.get(s);if(r&&null!==h&&0!==h.length&&(!a||f)){let e=a?0:i,t=4*e,r=p.clippingState||null;l.value=r,r=c(h,o,t,u);for(let e=0;e!==t;++e)r[e]=n[e];p.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}else a?c(null):(l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0)}}function ic(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping;if(303===a||304===a)if(t.has(r))return n(t.get(r).texture,r.mapping);else{let a=r.image;if(!a||!(a.height>0))return null;{let s=new tQ(a.height);return s.fromEquirectangularTexture(e,r),t.set(r,s),r.addEventListener("dispose",i),n(s.texture,r.mapping)}}}return r},dispose:function(){t=new WeakMap}}}let iu=[.125,.215,.35,.446,.526,.582],ih=new nK,id=new to,ip=null,im=0,ig=0,i_=!1,iv=new P;class ix{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,i=100,r={}){let{size:a=256,position:s=iv}=r;ip=this._renderer.getRenderTarget(),im=this._renderer.getActiveCubeFace(),ig=this._renderer.getActiveMipmapLevel(),i_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);let o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,i,o,s),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=iE(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=iS(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial&&this._ggxMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(ip,im,ig),this._renderer.xr.enabled=i_,e.scissorTest=!1,iM(e,0,0,e.width,e.height)}_fromTexture(e,t){301===e.mapping||302===e.mapping?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ip=this._renderer.getRenderTarget(),im=this._renderer.getActiveCubeFace(),ig=this._renderer.getActiveMipmapLevel(),i_=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,colorSpace:o,depthBuffer:!1},i=iy(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){var r,a;null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=iy(e,t,n);let{_lodMax:i}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=function(e){let t=[],n=[],i=[],r=e,a=e-4+1+iu.length;for(let s=0;s<a;s++){let a=Math.pow(2,r);t.push(a);let o=1/a;s>e-4?o=iu[s-e+4-1]:0===s&&(o=0),n.push(o);let l=1/(a-2),c=-l,u=1+l,h=[c,c,u,c,u,u,c,c,u,u,c,u],d=new Float32Array(108),f=new Float32Array(72),p=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];
36d.set(i,18*e),f.set(h,12*e);let r=[e,e,e,e,e,e];p.set(r,6*e)}let m=new tw;m.setAttribute("position",new tm(d,3)),m.setAttribute("uv",new tm(f,2)),m.setAttribute("faceIndex",new tm(p,1)),i.push(new tB(m,null)),r>4&&r--}return{lodMeshes:i,sizeLods:t,sigmas:n}}(i)),this._blurMaterial=(r=i,new tX({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new P(0,1,0)}},vertexShader:iT(),fragmentShader:` 37 38 precision mediump float; 39 precision mediump int; 40 41 varying vec3 vOutputDirection; 42 43 uniform sampler2D envMap; 44 uniform int samples; 45 uniform float weights[ n ]; 46 uniform bool latitudinal; 47 uniform float dTheta; 48 uniform float mipInt; 49 uniform vec3 poleAxis; 50 51 #define ENVMAP_TYPE_CUBE_UV 52 #include <cube_uv_reflection_fragment> 53 54 vec3 getSample( float theta, vec3 axis ) { 55 56 float cosTheta = cos( theta ); 57 // Rodrigues' axis-angle rotation 58 vec3 sampleDirection = vOutputDirection * cosTheta 59 + cross( axis, vOutputDirection ) * sin( theta ) 60 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 61 62 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 63 64 } 65 66 void main() { 67 68 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 69 70 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 71 72 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 73 74 } 75 76 axis = normalize( axis ); 77 78 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 79 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 80 81 for ( int i = 1; i < n; i++ ) { 82 83 if ( i >= samples ) { 84 85 break; 86 87 } 88 89 float theta = dTheta * float( i ); 90 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 91 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 92 93 } 94 95 } 96 `,blending:0,depthTest:!1,depthWrite:!1})),this._ggxMaterial=(a=i,new tX({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:256,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${a}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:iT(),fragmentShader:` 97 98 precision highp float; 99 precision highp int; 100 101 varying vec3 vOutputDirection; 102 103 uniform sampler2D envMap; 104 uniform float roughness; 105 uniform float mipInt; 106 107 #define ENVMAP_TYPE_CUBE_UV 108 #include <cube_uv_reflection_fragment> 109 110 #define PI 3.14159265359 111 112 // Van der Corput radical inverse 113 float radicalInverse_VdC(uint bits) { 114 bits = (bits << 16u) | (bits >> 16u); 115 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 116 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 117 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 118 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 119 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 120 } 121 122 // Hammersley sequence 123 vec2 hammersley(uint i, uint N) { 124 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 125 } 126 127 // GGX VNDF importance sampling (Eric Heitz 2018) 128 // "Sampling the GGX Distribution of Visible Normals" 129 // https://jcgt.org/published/0007/04/01/ 130 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 131 float alpha = roughness * roughness; 132 133 // Section 3.2: Transform view direction to hemisphere configuration 134 vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z)); 135 136 // Section 4.1: Orthonormal basis 137 float lensq = Vh.x * Vh.x + Vh.y * Vh.y; 138 vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0); 139 vec3 T2 = cross(Vh, T1); 140 141 // Section 4.2: Parameterization of projected area 142 float r = sqrt(Xi.x); 143 float phi = 2.0 * PI * Xi.y; 144 float t1 = r * cos(phi); 145 float t2 = r * sin(phi); 146 float s = 0.5 * (1.0 + Vh.z); 147 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 148 149 // Section 4.3: Reprojection onto hemisphere 150 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh; 151 152 // Section 3.4: Transform back to ellipsoid configuration 153 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 154 } 155 156 void main() { 157 vec3 N = normalize(vOutputDirection); 158 vec3 V = N; // Assume view direction equals normal for pre-filtering 159 160 vec3 prefilteredColor = vec3(0.0); 161 float totalWeight = 0.0; 162 163 // For very low roughness, just sample the environment directly 164 if (roughness < 0.001) { 165 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 166 return; 167 } 168 169 // Tangent space basis for VNDF sampling 170 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 171 vec3 tangent = normalize(cross(up, N)); 172 vec3 bitangent = cross(N, tangent); 173
174 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 175 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 176 177 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 178 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 179 180 // Transform H back to world space 181 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 182 vec3 L = normalize(2.0 * dot(V, H) * H - V); 183 184 float NdotL = max(dot(N, L), 0.0); 185 186 if(NdotL > 0.0) { 187 // Sample environment at fixed mip level 188 // VNDF importance sampling handles the distribution filtering 189 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 190 191 // Weight by NdotL for the split-sum approximation 192 // VNDF PDF naturally accounts for the visible microfacet distribution 193 prefilteredColor += sampleColor * NdotL; 194 totalWeight += NdotL; 195 } 196 } 197 198 if (totalWeight > 0.0) { 199 prefilteredColor = prefilteredColor / totalWeight; 200 } 201 202 gl_FragColor = vec4(prefilteredColor, 1.0); 203 } 204 `,blending:0,depthTest:!1,depthWrite:!1}))}return i}_compileMaterial(e){let t=new tB(new tw,e);this._renderer.compile(t,ih)}_sceneToCubeUV(e,t,n,i,r){let a=new tZ(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,u=l.toneMapping;l.getClearColor(id),l.toneMapping=0,l.autoClear=!1,l.state.buffers.depth.getReversed()&&(l.setRenderTarget(i),l.clearDepth(),l.setRenderTarget(null)),null===this._backgroundBox&&(this._backgroundBox=new tB(new tV,new th({name:"PMREM.Backgroun
204d",side:1,depthWrite:!1,depthTest:!1})));let h=this._backgroundBox,d=h.material,f=!1,p=e.background;p?p.isColor&&(d.color.copy(p),e.background=null,f=!0):(d.color.copy(id),f=!0);for(let t=0;t<6;t++){let n=t%3;0===n?(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x+o[t],r.y,r.z)):1===n?(a.up.set(0,0,s[t]),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y+o[t],r.z)):(a.up.set(0,s[t],0),a.position.set(r.x,r.y,r.z),a.lookAt(r.x,r.y,r.z+o[t]));let c=this._cubeSize;iM(i,n*c,t>2?c:0,c,c),l.setRenderTarget(i),f&&l.render(h,a),l.render(e,a)}l.toneMapping=u,l.autoClear=c,e.background=p}_textureToCubeUV(e,t){let n=this._renderer,i=301===e.mapping||302===e.mapping;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=iE()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=iS());let r=i?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=r,r.uniforms.envMap.value=e;let s=this._cubeSize;iM(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,ih)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let i=this._lodMeshes.length;for(let t=1;t<i;t++)this._applyGGXFilter(e,t-1,t);t.autoClear=n}_applyGGXFilter(e,t,n){let i=this._renderer,r=this._pingPongRenderTarget,a=this._ggxMaterial,s=this._lodMeshes[n];s.material=a;let o=a.uniforms,l=n/(this._lodMeshes.length-1),c=t/(this._lodMeshes.length-1),u=Math.sqrt(l*l-c*c),{_lodMax:h}=this,d=this._sizeLods[n],f=3*d*(n>h-4?n-h+4:0),p=4*(this._cubeSize-d);o.envMap.value=e.texture,o.roughness.value=u*(0+1.25*l),o.mipInt.value=h-t,iM(r,f,p,3*d,2*d),i.setRenderTarget(r),i.render(s,ih),o.envMap.value=r.texture,o.roughness.value=0,o.mipInt.value=h-n,iM(e,f,p,3*d,2*d),i.setRenderTarget(e),i.render(s,ih)}_blur(e,t,n,i,r){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,s){let o=this._renderer,l=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&_("blur direction must be either latitudinal or longitudinal!");let c=this._lodMeshes[i];c.material=l;let u=l.uniforms,h=this._sizeLods[n]-1,d=isFinite(r)?Math.PI/(2*h):2*Math.PI/39,f=r/d,p=isFinite(r)?1+Math.floor(3*f):20;p>20&&g(`sigmaRadians, ${r}, is too large and will clip, as it requested ${p} samples when the maximum is set to 20`);let m=[],v=0;for(let e=0;e<20;++e){let t=e/f,n=Math.exp(-t*t/2);m.push(n),0===e?v+=n:e<p&&(v+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/v;u.envMap.value=e.texture,u.samples.value=p,u.weights.value=m,u.latitudinal.value="latitudinal"===a,s&&(u.poleAxis.value=s);let{_lodMax:x}=this;u.dTheta.value=d,u.mipInt.value=x-n;let y=this._sizeLods[i],M=4*(this._cubeSize-y);iM(t,3*y*(i>x-4?i-x+4:0),M,3*y,2*y),o.setRenderTarget(t),o.render(c,ih)}}function iy(e,t,n){let i=new K(e,t,n);return i.texture.mapping=306,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function iM(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function iS(){return new tX({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:iT(),fragmentShader:` 205 206 precision mediump float; 207 precision mediump int; 208 209 varying vec3 vOutputDirection; 210 211 uniform sampler2D envMap; 212 213 #include <common> 214 215 void main() { 216 217 vec3 outputDirection = normalize( vOutputDirection ); 218 vec2 uv = equirectUv( outputDirection ); 219 220 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 221 222 } 223 `,blending:0,depthTest:!1,depthWrite:!1})}function iE(){return new tX({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:iT(),fragmentShader:` 224 225 precision mediump float; 226 precision mediump int; 227 228 uniform float flipEnvMap; 229 230 varying vec3 vOutputDirection; 231 232 uniform samplerCube envMap; 233 234 void main() { 235 236 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 237 238 } 239 `,blending:0,depthTest:!1,depthWrite:!1})}function iT(){return` 240 241 precision mediump float; 242 precision mediump int; 243 244 attribute float faceIndex; 245 246 varying vec3 vOutputDirection; 247 248 // RH coordinate system; PMREM face-indexing convention 249 vec3 getDirection( vec2 uv, float face ) { 250 251 uv = 2.0 * uv - 1.0; 252 253 vec3 direction = vec3( uv, 1.0 ); 254 255 if ( face == 0.0 ) { 256 257 direction = direction.zyx; // ( 1, v, u ) pos x 258 259 } else if ( face == 1.0 ) { 260 261 direction = direction.xzy; 262 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 263 264 } else if ( face == 2.0 ) { 265 266 direction.x *= -1.0; // ( -u, v, 1 ) pos z 267 268 } else if ( face == 3.0 ) { 269 270 direction = direction.zyx; 271 direction.xz *= -1.0; // ( -1, v, -u ) neg x 272 273 } else if ( face == 4.0 ) { 274 275 direction = direction.xzy; 276 direction.xy *= -1.0; // ( -u, -1, v ) neg y 277 278 } else if ( face == 5.0 ) { 279 280 direction.z *= -1.0; // ( u, v, -1 ) neg z 281 282 } 283 284 return direction; 285 286 } 287 288 void main() { 289 290 vOutputDirection = getDirection( uv, faceIndex ); 291 gl_Position = vec4( position, 1.0 ); 292 293 } 294 `}function ib(e){let t=new WeakMap,n=null;function i(e){let n=e.target;n.removeEventListener("dispose",i);let r=t.get(n);void 0!==r&&(t.delete(n),r.dispose())}return{get:function(r){if(r&&r.isTexture){let a=r.mapping,s=303===a||304===a,o=301===a||302===a;if(s||o){let a=t.get(r),l=void 0!==a?a.texture.pmremVersion:0;if(r.isRenderTargetTexture&&r.pmremVersion!==l)return null===n&&(n=new ix(e)),(a=s?n.fromEquirectangular(r,a):n.fromCubemap(r,a)).texture.pmremVersion=r.pmremVersion,t.set(r,a),a.texture;{if(void 0!==a)return a.texture;
294let l=r.image;return s&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new ix(e)),(a=s?n.fromEquirectangular(r):n.fromCubemap(r)).texture.pmremVersion=r.pmremVersion,t.set(r,a),r.addEventListener("dispose",i),a.texture):null}}}return r},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function iw(e){let t={};function n(n){if(void 0!==t[n])return t[n];let i=e.getExtension(n);return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){let t=n(e);return null===t&&v("WebGLRenderer: "+e+" extension not supported."),t}}}function iA(e,t,n,i){let r={},a=new WeakMap;function s(e){let o=e.target;for(let e in null!==o.index&&t.remove(o.index),o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",s),delete r[o.id];let l=a.get(o);l&&(t.remove(l),a.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){let n=[],i=e.index,r=e.attributes.position,s=0;if(null!==i){let e=i.array;s=i.version;for(let t=0,i=e.length;t<i;t+=3){let i=e[t+0],r=e[t+1],a=e[t+2];n.push(i,r,r,a,a,i)}}else{if(void 0===r)return;let e=r.array;s=r.version;for(let t=0,i=e.length/3-1;t<i;t+=3){let e=t+0,i=t+1,r=t+2;n.push(e,i,i,r,r,e)}}let o=new(h(n)?t_:tg)(n,1);o.version=s;let l=a.get(e);l&&t.remove(l),a.set(e,o)}return{get:function(e,t){return!0===r[t.id]||(t.addEventListener("dispose",s),r[t.id]=!0,n.memory.geometries++),t},update:function(n){let i=n.attributes;for(let n in i)t.update(i[n],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){let t=a.get(e);if(t){let n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return a.get(e)}}}function iR(e,t,n){let i,r,a;function s(t,s,o){0!==o&&(e.drawElementsInstanced(i,s,r,t*a,o),n.update(s,i,o))}this.setMode=function(e){i=e},this.setIndex=function(e){r=e.type,a=e.bytesPerElement},this.render=function(t,s){e.drawElements(i,s,r,t*a),n.update(s,i,1)},this.renderInstances=s,this.renderMultiDraw=function(e,a,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,a,0,r,e,0,s);let o=0;for(let e=0;e<s;e++)o+=a[e];n.update(o,i,1)},this.renderMultiDrawInstances=function(e,o,l,c){if(0===l)return;let u=t.get("WEBGL_multi_draw");if(null===u)for(let t=0;t<e.length;t++)s(e[t]/a,o[t],c[t]);else{u.multiDrawElementsInstancedWEBGL(i,o,0,r,e,0,c,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*c[e];n.update(t,i,1)}}}function iC(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(n,i,r){switch(t.calls++,i){case e.TRIANGLES:t.triangles+=n/3*r;break;case e.LINES:t.lines+=n/2*r;break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:_("WebGLInfo: Unknown draw mode:",i)}}}}function iP(e,t,n){let i=new WeakMap,r=new q;return{update:function(a,s,o){let l=a.morphTargetInfluences,c=s.morphAttributes.position||s.morphAttributes.normal||s.morphAttributes.color,u=void 0!==c?c.length:0,h=i.get(s);if(void 0===h||h.count!==u){void 0!==h&&h.texture.dispose();let e=void 0!==s.morphAttributes.position,n=void 0!==s.morphAttributes.normal,a=void 0!==s.morphAttributes.color,o=s.morphAttributes.position||[],l=s.morphAttributes.normal||[],c=s.morphAttributes.color||[],d=0;!0===e&&(d=1),!0===n&&(d=2),!0===a&&(d=3);let f=s.attributes.position.count*d,p=1;f>t.maxTextureSize&&(p=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);let m=new Float32Array(f*p*4*u),g=new Z(m,f,p,u);g.type=1015,g.needsUpdate=!0;let _=4*d;for(let t=0;t<u;t++){let i=o[t],s=l[t],u=c[t],h=f*p*4*t;for(let t=0;t<i.count;t++){let o=t*_;!0===e&&(r.fromBufferAttribute(i,t),m[h+o+0]=r.x,m[h+o+1]=r.y,m[h+o+2]=r.z,m[h+o+3]=0),!0===n&&(r.fromBufferAttribute(s,t),m[h+o+4]=r.x,m[h+o+5]=r.y,m[h+o+6]=r.z,m[h+o+7]=0),!0===a&&(r.fromBufferAttribute(u,t),m[h+o+8]=r.x,m[h+o+9]=r.y,m[h+o+10]=r.z,m[h+o+11]=4===u.itemSize?r.w:1)}}h={count:u,texture:g,size:new R(f,p)},i.set(s,h),s.addEventListener("dispose",function e(){g.dispose(),i.delete(s),s.removeEventListener("dispose",e)})}if(!0===a.isInstancedMesh&&null!==a.morphTexture)o.getUniforms().setValue(e,"morphTexture",a.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];let n=s.morphTargetsRelative?1:1-t;o.getUniforms().setValue(e,"morphTargetBaseInfluence",n),o.getUniforms().setValue(e,"morphTargetInfluences",l)}o.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),o.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function iL(e,t,n,i){let r=new WeakMap;function a(e){let t=e.target;t.removeEventListener("dispose",a),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(s){let o=i.render.frame,l=s.geometry,c=t.get(s,l);if(r.get(c)!==o&&(t.update(c),r.set(c,o)),s.isInstancedMesh&&(!1===s.hasEventListener("dispose",a)&&s.addEventListener("dispose",a),r.get(s)!==o&&(n.update(s.instanceMatrix,e.ARRAY_BUFFER),null!==s.instanceColor&&n.update(s.instanceColor,e.ARRAY_BUFFER),r.set(s,o))),s.isSkinnedMesh){let e=s.skeleton;
294r.get(e)!==o&&(e.update(),r.set(e,o))}return c},dispose:function(){r=new WeakMap}}}let iD={1:"LINEAR_TONE_MAPPING",2:"REINHARD_TONE_MAPPING",3:"CINEON_TONE_MAPPING",4:"ACES_FILMIC_TONE_MAPPING",6:"AGX_TONE_MAPPING",7:"NEUTRAL_TONE_MAPPING",5:"CUSTOM_TONE_MAPPING"};function iN(e,t,n,i,r){let a,s=new K(t,n,{type:e,depthBuffer:i,stencilBuffer:r}),o=new K(t,n,{type:1016,depthBuffer:!1,stencilBuffer:!1}),l=new tw;l.setAttribute("position",new tv([-1,3,0,-1,-1,0,3,-1,0],3)),l.setAttribute("uv",new tv([0,2,0,0,2,0],2));let u=new nP({uniforms:{tDiffuse:{value:null}},vertexShader:` 295 precision highp float; 296 297 uniform mat4 modelViewMatrix; 298 uniform mat4 projectionMatrix; 299 300 attribute vec3 position; 301 attribute vec2 uv; 302 303 varying vec2 vUv; 304 305 void main() { 306 vUv = uv; 307 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 308 }`,fragmentShader:` 309 precision highp float; 310 311 uniform sampler2D tDiffuse; 312 313 varying vec2 vUv; 314 315 #include <tonemapping_pars_fragment> 316 #include <colorspace_pars_fragment> 317 318 void main() { 319 gl_FragColor = texture2D( tDiffuse, vUv ); 320 321 #ifdef LINEAR_TONE_MAPPING 322 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 323 #elif defined( REINHARD_TONE_MAPPING ) 324 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 325 #elif defined( CINEON_TONE_MAPPING ) 326 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 327 #elif defined( ACES_FILMIC_TONE_MAPPING ) 328 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 329 #elif defined( AGX_TONE_MAPPING ) 330 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 331 #elif defined( NEUTRAL_TONE_MAPPING ) 332 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 333 #elif defined( CUSTOM_TONE_MAPPING ) 334 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 335 #endif 336 337 #ifdef SRGB_TRANSFER 338 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 339 #endif 340 }`,depthTest:!1,depthWrite:!1}),h=new tB(l,u),d=new nK(-1,1,1,-1,0,1),f=null,p=null,m=!1,g=null,_=[],v=!1;this.setSize=function(e,t){s.setSize(e,t),o.setSize(e,t);for(let n=0;n<_.length;n++){let i=_[n];i.setSize&&i.setSize(e,t)}},this.setEffects=function(e){v=(_=e).length>0&&!0===_[0].isRenderPass;let t=s.width,n=s.height;for(let e=0;e<_.length;e++){let i=_[e];i.setSize&&i.setSize(t,n)}},this.begin=function(e,t){if(m||0===e.toneMapping&&0===_.length)return!1;if(g=t,null!==t){let e=t.width,n=t.height;(s.width!==e||s.height!==n)&&this.setSize(e,n)}return!1===v&&e.setRenderTarget(s),a=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=a,m=!0;let n=s,i=o;for(let r=0;r<_.length;r++){let a=_[r];if(!1!==a.enabled&&(a.render(e,i,n,t),!1!==a.needsSwap)){let e=n;n=i,i=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,u.defines={},F.getTransfer(f)===c&&(u.defines.SRGB_TRANSFER="");let t=iD[p];t&&(u.defines[t]=""),u.needsUpdate=!0}u.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(h,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){s.dispose(),o.dispose(),l.dispose(),u.dispose()}}let iI=new j,iU=new nh(1,1),iO=new Z,iF=new J,iB=new t$,iz=[],iV=[],ik=new Float32Array(16),iG=new Float32Array(9),iH=new Float32Array(4);function iW(e,t,n){let i=e[0];if(i<=0||i>0)return e;let r=t*n,a=iz[r];if(void 0===a&&(a=new Float32Array(r),iz[r]=a),0!==t){i.toArray(a,0);for(let i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r)}return a}function iX(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function ij(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function iq(e,t){let n=iV[t];void 0===n&&(n=new Int32Array(t),iV[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function iY(e,t){let n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function iK(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iX(n,t))return;e.uniform2fv(this.addr,t),ij(n,t)}}function iZ(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)(n[0]!==t.r||n[1]!==t.g||n[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(iX(n,t))return;e.uniform3fv(this.addr,t),ij(n,t)}}function iJ(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iX(n,t))return;e.uniform4fv(this.addr,t),ij(n,t)}}function i$(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iX(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),ij(n,t)}else{if(iX(n,i))return;iH.set(i),e.uniformMatrix2fv(this.addr,!1,iH),ij(n,i)}}function iQ(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iX(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),ij(n,t)}else{if(iX(n,i))return;iG.set(i),e.uniformMatrix3fv(this.addr,!1,iG),ij(n,i)}}function i0(e,t){let n=this.cache,i=t.elements;if(void 0===i){if(iX(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),ij(n,t)}else{if(iX(n,i))return;ik.set(i),e.uniformMatrix4fv(this.addr,!1,ik),ij(n,i)}}function i1(e,t){let n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function i3(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iX(n,t))return;e.uniform2iv(this.addr,t),ij(n,t)}}function i2(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(iX(n,t))return;e.uniform3iv(this.addr,t),ij(n,t)}}function i4(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iX(n,t))return;e.uniform4iv(this.addr,t),ij(n,t)}}function i5(e,t){let n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function i6(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(iX(n,t))return;e.uniform2uiv(this.addr,t),ij(n,t)}}function i8(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(iX(n,t))return;e.uniform3uiv(this.addr,t),ij(n,t)}}function i9(e,t){let n=this.cache;if(void 0!==t.x)(n[0]!==t.x||n[1]!==t.y||n[2]!==t.z||n[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(iX(n,t))return;e.uniform4uiv(this.addr,t),ij(n,t)}}
340function i7(e,t,n){let i,r=this.cache,a=n.allocateTextureUnit();r[0]!==a&&(e.uniform1i(this.addr,a),r[0]=a),this.type===e.SAMPLER_2D_SHADOW?(iU.compareFunction=n.isReversedDepthBuffer()?518:515,i=iU):i=iI,n.setTexture2D(t||i,a)}function re(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||iF,r)}function rt(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(t||iB,r)}function rn(e,t,n){let i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||iO,r)}function ri(e,t){e.uniform1fv(this.addr,t)}function rr(e,t){let n=iW(t,this.size,2);e.uniform2fv(this.addr,n)}function ra(e,t){let n=iW(t,this.size,3);e.uniform3fv(this.addr,n)}function rs(e,t){let n=iW(t,this.size,4);e.uniform4fv(this.addr,n)}function ro(e,t){let n=iW(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function rl(e,t){let n=iW(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function rc(e,t){let n=iW(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function ru(e,t){e.uniform1iv(this.addr,t)}function rh(e,t){e.uniform2iv(this.addr,t)}function rd(e,t){e.uniform3iv(this.addr,t)}function rf(e,t){e.uniform4iv(this.addr,t)}function rp(e,t){e.uniform1uiv(this.addr,t)}function rm(e,t){e.uniform2uiv(this.addr,t)}function rg(e,t){e.uniform3uiv(this.addr,t)}function r_(e,t){e.uniform4uiv(this.addr,t)}function rv(e,t,n){let i,r=this.cache,a=t.length,s=iq(n,a);iX(r,s)||(e.uniform1iv(this.addr,s),ij(r,s)),i=this.type===e.SAMPLER_2D_SHADOW?iU:iI;for(let e=0;e!==a;++e)n.setTexture2D(t[e]||i,s[e])}function rx(e,t,n){let i=this.cache,r=t.length,a=iq(n,r);iX(i,a)||(e.uniform1iv(this.addr,a),ij(i,a));for(let e=0;e!==r;++e)n.setTexture3D(t[e]||iF,a[e])}function ry(e,t,n){let i=this.cache,r=t.length,a=iq(n,r);iX(i,a)||(e.uniform1iv(this.addr,a),ij(i,a));for(let e=0;e!==r;++e)n.setTextureCube(t[e]||iB,a[e])}function rM(e,t,n){let i=this.cache,r=t.length,a=iq(n,r);iX(i,a)||(e.uniform1iv(this.addr,a),ij(i,a));for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||iO,a[e])}class rS{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return iY;case 35664:return iK;case 35665:return iZ;case 35666:return iJ;case 35674:return i$;case 35675:return iQ;case 35676:return i0;case 5124:case 35670:return i1;case 35667:case 35671:return i3;case 35668:case 35672:return i2;case 35669:case 35673:return i4;case 5125:return i5;case 36294:return i6;case 36295:return i8;case 36296:return i9;case 35678:case 36198:case 36298:case 36306:case 35682:return i7;case 35679:case 36299:case 36307:return re;case 35680:case 36300:case 36308:case 36293:return rt;case 36289:case 36303:case 36311:case 36292:return rn}}(t.type)}}class rE{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return ri;case 35664:return rr;case 35665:return ra;case 35666:return rs;case 35674:return ro;case 35675:return rl;case 35676:return rc;case 5124:case 35670:return ru;case 35667:case 35671:return rh;case 35668:case 35672:return rd;case 35669:case 35673:return rf;case 5125:return rp;case 36294:return rm;case 36295:return rg;case 36296:return r_;case 35678:case 36198:case 36298:case 36306:case 35682:return rv;case 35679:case 36299:case 36307:return rx;case 35680:case 36300:case 36308:case 36293:return ry;case 36289:case 36303:case 36311:case 36292:return rM}}(t.type)}}class rT{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){let i=this.seq;for(let r=0,a=i.length;r!==a;++r){let a=i[r];a.setValue(e,t[a.id],n)}}}let rb=/(\w+)(\])?(\[|\.)?/g;function rw(e,t){e.seq.push(t),e.map[t.id]=t}class rA{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i),r=e.getUniformLocation(t,n.name);!function(e,t,n){let i=e.name,r=i.length;for(rb.lastIndex=0;;){let a=rb.exec(i),s=rb.lastIndex,o=a[1],l="]"===a[2],c=a[3];if(l&&(o|=0),void 0===c||"["===c&&s+2===r){rw(n,void 0===c?new rS(o,e,t):new rE(o,e,t));break}{let e=n.map[o];void 0===e&&rw(n,e=new rT(o)),n=e}}}(n,r,this)}const i=[],r=[];for(const t of this.seq)t.type===e.SAMPLER_2D_SHADOW||t.type===e.SAMPLER_CUBE_SHADOW||t.type===e.SAMPLER_2D_ARRAY_SHADOW?i.push(t):r.push(t);i.length>0&&(this.seq=i.concat(r))}setValue(e,t,n,i){let r=this.map[t];void 0!==r&&r.setValue(e,n,i)}setOptional(e,t,n){let i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){let a=t[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(e,s.value,i)}}static seqWithValue(e,t){let n=[];for(let i=0,r=e.length;i!==r;++i){let r=e[i];r.id in t&&n.push(r)}return n}}function rR(e,t,n){let i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let rC=0,rP=new N;function rL(e,t,n){let i=e.getShaderParameter(t,e.COMPILE_STATUS),r=(e.getShaderInfoLog(t)||"").trim();if(i&&""===r)return"";let a=/ERROR: 0:(\d+)/.exec(r);if(!a)return r;{let i=parseInt(a[1]);return n.toUpperCase()+"\n\n"+r+"\n\n"+function(e,t){let n=e.split("\n"),i=[],r=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=r;
340e<a;e++){let r=e+1;i.push(`${r===t?">":" "} ${r}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}}let rD={1:"Linear",2:"Reinhard",3:"Cineon",4:"ACESFilmic",6:"AgX",7:"Neutral",5:"Custom"},rN=new P;function rI(e){return""!==e}function rU(e,t){let n=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,n).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 rO(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}let rF=/^[ \t]*#include +<([\w\d./]+)>/gm;function rB(e){return e.replace(rF,rV)}let rz=new Map;function rV(e,t){let n=n8[t];if(void 0===n){let e=rz.get(t);if(void 0!==e)n=n8[e],g('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,e);else throw Error("Can not resolve #include <"+t+">")}return rB(n)}let rk=/#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 rG(e){return e.replace(rk,rH)}function rH(e,t,n,i){let r="";for(let e=parseInt(t);e<parseInt(n);e++)r+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return r}function rW(e){let t=`precision ${e.precision} float; 341 precision ${e.precision} int; 342 precision ${e.precision} sampler2D; 343 precision ${e.precision} samplerCube; 344 precision ${e.precision} sampler3D; 345 precision ${e.precision} sampler2DArray; 346 precision ${e.precision} sampler2DShadow; 347 precision ${e.precision} samplerCubeShadow; 348 precision ${e.precision} sampler2DArrayShadow; 349 precision ${e.precision} isampler2D; 350 precision ${e.precision} isampler3D; 351 precision ${e.precision} isamplerCube; 352 precision ${e.precision} isampler2DArray; 353 precision ${e.precision} usampler2D; 354 precision ${e.precision} usampler3D; 355 precision ${e.precision} usamplerCube; 356 precision ${e.precision} usampler2DArray; 357 `;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}let rX={1:"SHADOWMAP_TYPE_PCF",3:"SHADOWMAP_TYPE_VSM"},rj={301:"ENVMAP_TYPE_CUBE",302:"ENVMAP_TYPE_CUBE",306:"ENVMAP_TYPE_CUBE_UV"},rq={302:"ENVMAP_MODE_REFRACTION"},rY={0:"ENVMAP_BLENDING_MULTIPLY",1:"ENVMAP_BLENDING_MIX",2:"ENVMAP_BLENDING_ADD"};function rK(e,t,n,i){var r,a;let s,o,h,d,f=e.getContext(),p=n.defines,m=n.vertexShader,v=n.fragmentShader,x=rX[n.shadowMapType]||"SHADOWMAP_TYPE_BASIC",y=!1===n.envMap?"ENVMAP_TYPE_CUBE":rj[n.envMapMode]||"ENVMAP_TYPE_CUBE",M=!1===n.envMap?"ENVMAP_MODE_REFLECTION":rq[n.envMapMode]||"ENVMAP_MODE_REFLECTION",S=!1===n.envMap?"ENVMAP_BLENDING_NONE":rY[n.combine]||"ENVMAP_BLENDING_NONE",E=function(e){let t=e.envMapCubeUVHeight;if(null===t)return null;let n=Math.log2(t)-2;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:1/t,maxMip:n}}(n),T=[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(rI).join("\n"),b=function(e){let t=[];for(let n in e){let i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(p),w=f.createProgram(),A=n.glslVersion?"#version "+n.glslVersion+"\n":"";if(n.isRawShaderMaterial)(s=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(rI).join("\n")).length>0&&(s+="\n"),(o=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(rI).join("\n")).length>0&&(o+="\n");else{let e,t,i,u,h;s=[rW(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.extensionCl
vendor: 5,447 bytes, line 357
357ipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+M:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.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(rI).join("\n"),o=[rW(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
357aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+y:"",n.envMap?"#define "+M:"",n.envMap?"#define "+S:"",E?"#define CUBEUV_TEXEL_WIDTH "+E.texelWidth:"",E?"#define CUBEUV_TEXEL_HEIGHT "+E.texelHeight:"",E?"#define CUBEUV_MAX_MIP "+E.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+x:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?n8.tonemapping_pars_fragment:"",0!==n.toneMapping?(r="toneMapping",void 0===(e=rD[a=n.toneMapping])?(g("WebGLProgram: Unsupported toneMapping:",a),"vec3 "+r+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+r+"( vec3 color ) { return "+e+"ToneMapping( color ); }"):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",n8.colorspace_pars_fragment,(t=function(e){F._getMatrix(rP,F.workingColorSpace,e);let t=`mat3( ${rP.elements.map(e=>e.toFixed(4))} )`;switch(F.getTransfer(e)){case l:return[t,"LinearTransferOETF"];case c:return[t,"sRGBTransferOETF"];default:return g("WebGLProgram: Unsupported color space: ",e),[t,"LinearTransferOETF"]}}(n.outputColorSpace),`vec4 linearToOutputTexel( vec4 value ) { 358 return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) ); 359}`),(F.getLuminanceCoefficients(rN),i=rN.x.toFixed(4),u=rN.y.toFixed(4),h=rN.z.toFixed(4),`float luminance( const in vec3 rgb ) { 360 const vec3 weights = vec3( ${i}, ${u}, ${h} ); 361 return dot( weights, rgb ); 362}`),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(rI).join("\n")}m=rO(m=rU(m=rB(m),n),n),v=rO(v=rU(v=rB(v),n),n),m=rG(m),v=rG(v),!0!==n.isRawShaderMaterial&&(A="#version 300 es\n",s=[T,"#define attribute in\n#define varying out\n#define texture2D texture"].join("\n")+"\n"+s,o=["#define varying in",
362n.glslVersion===u?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===u?"":"#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 R=A+s+m,C=A+o+v,P=rR(f,f.VERTEX_SHADER,R),L=rR(f,f.FRAGMENT_SHADER,C);function D(t){if(e.debug.checkShaderErrors){let n=f.getProgramInfoLog(w)||"",i=f.getShaderInfoLog(P)||"",r=f.getShaderInfoLog(L)||"",a=n.trim(),l=i.trim(),c=r.trim(),u=!0,h=!0;if(!1===f.getProgramParameter(w,f.LINK_STATUS))if(u=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(f,w,P,L);else{let e=rL(f,P,"vertex"),n=rL(f,L,"fragment");_("THREE.WebGLProgram: Shader Error "+f.getError()+" - VALIDATE_STATUS "+f.getProgramParameter(w,f.VALIDATE_STATUS)+"\n\nMaterial Name: "+t.name+"\nMaterial Type: "+t.type+"\n\nProgram Info Log: "+a+"\n"+e+"\n"+n)}else""!==a?g("WebGLProgram: Program Info Log:",a):(""===l||""===c)&&(h=!1);h&&(t.diagnostics={runnable:u,programLog:a,vertexShader:{log:l,prefix:s},fragmentShader:{log:c,prefix:o}})}f.deleteShader(P),f.deleteShader(L),h=new rA(f,w),d=function(e,t){let n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let r=0;r<i;r++){let i=e.getActiveAttrib(t,r),a=i.name,s=1;i.type===e.FLOAT_MAT2&&(s=2),i.type===e.FLOAT_MAT3&&(s=3),i.type===e.FLOAT_MAT4&&(s=4),n[a]={type:i.type,location:e.getAttribLocation(t,a),locationSize:s}}return n}(f,w)}f.attachShader(w,P),f.attachShader(w,L),void 0!==n.index0AttributeName?f.bindAttribLocation(w,0,n.index0AttributeName):!0===n.morphTargets&&f.bindAttribLocation(w,0,"position"),f.linkProgram(w),this.getUniforms=function(){return void 0===h&&D(this),h},this.getAttributes=function(){return void 0===d&&D(this),d};let N=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===N&&(N=f.getProgramParameter(w,37297)),N},this.destroy=function(){i.releaseStatesOfProgram(this),f.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=rC++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=P,this.fragmentShader=L,this}let rZ=0;class rJ{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return!1===a.has(i)&&(a.add(i),i.usedTimes++),!1===a.has(r)&&(a.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,n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return void 0===n&&(n=new r$(e),t.set(e,n)),n}}class r${constructor(e){this.id=rZ++,this.code=e,this.usedTimes=0}}function rQ(e,t,n,i,r,a,s){let l=new eO,u=new rJ,h=new Set,d=[],f=new Map,p=r.logarithmicDepthBuffer,m=r.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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(h.add(e),0===e)?"uv":`uv${e}`}return{getParameters:function(a,l,d,f,x){let y,M,S,E,T=f.fog,b=x.geometry,w=a.isMeshStandardMaterial?f.environment:null,A=(a.isMeshStandardMaterial?n:t).get(a.envMap||w),R=A&&306===A.mapping?A.image.height:null,C=_[a.t
362ype];null!==a.precision&&(m=r.getMaxPrecision(a.precision))!==a.precision&&g("WebGLProgram.getParameters:",a.precision,"not supported, using",m,"instead.");let P=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,L=void 0!==P?P.length:0,D=0;if(void 0!==b.morphAttributes.position&&(D=1),void 0!==b.morphAttributes.normal&&(D=2),void 0!==b.morphAttributes.color&&(D=3),C){let e=n7[C];y=e.vertexShader,M=e.fragmentShader}else y=a.vertexShader,M=a.fragmentShader,u.update(a),S=u.getVertexShaderID(a),E=u.getFragmentShaderID(a);let N=e.getRenderTarget(),I=e.state.buffers.depth.getReversed(),U=!0===x.isInstancedMesh,O=!0===x.isBatchedMesh,B=!!a.map,z=!!a.matcap,V=!!A,k=!!a.aoMap,G=!!a.lightMap,H=!!a.bumpMap,W=!!a.normalMap,X=!!a.displacementMap,j=!!a.emissiveMap,q=!!a.metalnessMap,Y=!!a.roughnessMap,K=a.anisotropy>0,Z=a.clearcoat>0,J=a.dispersion>0,$=a.iridescence>0,Q=a.sheen>0,ee=a.transmission>0,et=K&&!!a.anisotropyMap,en=Z&&!!a.clearcoatMap,ei=Z&&!!a.clearcoatNormalMap,er=Z&&!!a.clearcoatRoughnessMap,ea=$&&!!a.iridescenceMap,es=$&&!!a.iridescenceThicknessMap,eo=Q&&!!a.sheenColorMap,el=Q&&!!a.sheenRoughnessMap,ec=!!a.specularMap,eu=!!a.specularColorMap,eh=!!a.specularIntensityMap,ed=ee&&!!a.transmissionMap,ef=ee&&!!a.thicknessMap,ep=!!a.gradientMap,em=!!a.alphaMap,eg=a.alphaTest>0,e_=!!a.alphaHash,ev=!!a.extensions,ex=0;a.toneMapped&&(null===N||!0===N.isXRRenderTarget)&&(ex=e.toneMapping);let ey={shaderID:C,shaderType:a.type,shaderName:a.name,vertexShader:y,fragmentShader:M,defines:a.defines,customVertexShaderID:S,customFragmentShaderID:E,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:m,batching:O,batchingColor:O&&null!==x._colorsTexture,instancing:U,instancingColor:U&&null!==x.instanceColor,instancingMorph:U&&null!==x.morphTexture,outputColorSpace:null===N?e.outputColorSpace:!0===N.isXRRenderTarget?N.texture.colorSpace:o,alphaToCoverage:!!a.alphaToCoverage,map:B,matcap:z,envMap:V,envMapMode:V&&A.mapping,envMapCubeUVHeight:R,aoMap:k,lightMap:G,bumpMap:H,normalMap:W,displacementMap:X,emissiveMap:j,normalMapObjectSpace:W&&1===a.normalMapType,normalMapTangentSpace:W&&0===a.normalMapType,metalnessMap:q,roughnessMap:Y,anisotropy:K,anisotropyMap:et,clearcoat:Z,clearcoatMap:en,clearcoatNormalMap:ei,clearcoatRoughnessMap:er,dispersion:J,iridescence:$,iridescenceMap:ea,iridescenceThicknessMap:es,sheen:Q,sheenColorMap:eo,sheenRoughnessMap:el,specularMap:ec,specularColorMap:eu,specularIntensityMap:eh,transmission:ee,transmissionMap:ed,thicknessMap:ef,gradientMap:ep,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:em,alphaTest:eg,alphaHash:e_,combine:a.combine,mapUv:B&&v(a.map.channel),aoMapUv:k&&v(a.aoMap.channel),lightMapUv:G&&v(a.lightMap.channel),bumpMapUv:H&&v(a.bumpMap.channel),normalMapUv:W&&v(a.normalMap.channel),displacementMapUv:X&&v(a.displacementMap.channel),emissiveMapUv:j&&v(a.emissiveMap.channel),metalnessMapUv:q&&v(a.metalnessMap.channel),roughnessMapUv:Y&&v(a.roughnessMap.channel),anisotropyMapUv:et&&v(a.anisotropyMap.channel),clearcoatMapUv:en&&v(a.clearcoatMap.channel),clearcoatNormalMapUv:ei&&v(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:er&&v(a.clearcoatRoughnessMap.channel),iridescenceMapUv:ea&&v(
362a.iridescenceMap.channel),iridescenceThicknessMapUv:es&&v(a.iridescenceThicknessMap.channel),sheenColorMapUv:eo&&v(a.sheenColorMap.channel),sheenRoughnessMapUv:el&&v(a.sheenRoughnessMap.channel),specularMapUv:ec&&v(a.specularMap.channel),specularColorMapUv:eu&&v(a.specularColorMap.channel),specularIntensityMapUv:eh&&v(a.specularIntensityMap.channel),transmissionMapUv:ed&&v(a.transmissionMap.channel),thicknessMapUv:ef&&v(a.thicknessMap.channel),alphaMapUv:em&&v(a.alphaMap.channel),vertexTangents:!!b.attributes.tangent&&(W||K),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,pointsUvs:!0===x.isPoints&&!!b.attributes.uv&&(B||em),fog:!!T,useFog:!0===a.fog,fogExp2:!!T&&T.isFogExp2,flatShading:!0===a.flatShading&&!1===a.wireframe,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:p,reversedDepthBuffer:I,skinning:!0===x.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:L,morphTextureStride:D,numDirLights:l.directional.length,numPointLights:l.point.length,numSpotLights:l.spot.length,numSpotLightMaps:l.spotLightMap.length,numRectAreaLights:l.rectArea.length,numHemiLights:l.hemi.length,numDirLightShadows:l.directionalShadowMap.length,numPointLightShadows:l.pointShadowMap.length,numSpotLightShadows:l.spotShadowMap.length,numSpotLightShadowsWithMaps:l.numSpotLightShadowsWithMaps,numLightProbes:l.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:a.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:ex,decodeVideoTexture:B&&!0===a.map.isVideoTexture&&F.getTransfer(a.map.colorSpace)===c,decodeVideoTextureEmissive:j&&!0===a.emissiveMap.isVideoTexture&&F.getTransfer(a.emissiveMap.colorSpace)===c,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:1===a.side,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionClipCullDistance:ev&&!0===a.extensions.clipCullDistance&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ev&&!0===a.extensions.multiDraw||O)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return ey.vertexUv1s=h.has(1),ey.vertexUv2s=h.has(2),ey.vertexUv3s=h.has(3),h.clear(),ey},getProgramCacheKey:function(t){var n,i,r,a;let s=[];if(t.shaderID?s.push(t.shaderID):(s.push(t.customVertexShaderID),s.push(t.customFragmentShaderID)),void 0!==t.defines)for(let e in t.defines)s.push(e),s.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(n=s,i=t,n.push(i.precision),n.push(i.outputColorSpace),n.push(i.envMapMode),n.push(i.envMapCubeUVHeight),n.push(i.mapUv),n.push(i.alphaMapUv),n.push(i.lightMapUv),n.push(i.aoMapUv),n.push(i.bumpMapUv),n.push(i.normalMapUv),n.push(i.displacementMapUv),n.push(i.emissiveMapUv),n.push(i.metalnessMapUv),n.push(i.roughnessMapUv),n.push(i.anisotropyMapUv),n.push(i.clearcoatMapUv),n.push(i.clearcoatNormalMapUv),n.push(i.clearcoatRoughnessMapUv),n.push(i.iridescenceMapUv),n.push(i.iridescenceThicknessMapUv),n.push(i.sheenColorMapUv),n.push(i.sheenRoughnessMapUv),n.push(i.specularMapUv),n.push(i.specularColorMapUv),n.push(i.specularIntensityMapUv),n.push(i.transmissionMapUv),n.push(i.thicknessMapUv),n.push(i.combine),n.push(i.fogExp2),n.push(i.sizeAttenuation),n.push(i.morphTargetsCount),n.push(i.morphAttributeCount),n.push(i.numDirLights),n.push(i.numPointLights),n.push(i.numSpotLights),n.push(i.numSpotLightMaps),n.push(i.numHemiLights),n.push(i.numRectAreaLights),n.push(i.numDirLightShadows),n.push(i.numPointLightShadows),n.push(i.numSpotLightShadows),n.push(i.numSpotLightShadowsWithMaps),n.push(i.numLightProbes),n.push(i.shadowMapType),n.push(i.toneMapping),n.push(i.numClippingPlanes),n.push(i.numClipIntersection),n.push(i.depthPacking),r=s,a=t,l.disableAll(),a.instancing&&l.enable(0),a.instancingColor&&l.enable(1),a.instancingMorph&&l.enable(2),a.matcap&&l.enable(3),a.envMap&&l.enable(4),a.normalMapObjectSpace&&l.enable(5),a.normalMapTangentSpace&&l.enable(6),a.clearcoat&&l.enable(7),a.iridescence&&l.enable(8),a.alphaTest&&l.enable(9),a.vertexColors&&l.enable(10),a.vertexAlphas&&l.enable(11),a.vertexUv1s&&l.enable(12),a.vertexUv2s&&l.enable(13),a.vertexUv3s&&l.enable(14),a.vertexTangents&&l.enable(15),a.anisotropy&&l.enable(16),a.alphaHash&&l.enable(17),a.batching&&l.enable(18),a.dispersion&&l.enable(19),a.batchingColor&&l.enable(20),a.gradientMap&&l.enable(21),r.push(l.mask),l.disableAll(),a.fog&&l.enable(0),a.useFog&&l.enable(1),a.flatShading&&l.enable(2),a.logarithmicDepthBuffer&&l.enable(3),a.reversedDepthBuffer&&l.enable(4),a.skinning&&l.enable(5),a.morphTargets&&l.enable(6),a.morphNormals&&l.enable(7),a.morphColors&&l.enable(8),a.premultipliedAlpha&&l.enable(9),a.shadowMapEnabled&&l.enable(10),a.doubleSided&&l.enable(11),a.flipSided&&l.enable(12),a.useDepthPacking&&l.enable(13),a.dithering&&l.enable(14),a.transmission&&l.enable(15),a.sheen&&l.enable(16),a.opaque&&l.enable(17),a.pointsUvs&&l.enable(18),a.decodeVideoTexture&&l.enable(19),a.decodeVideoTextureEmissive&&l.enable(20),a.alphaToCoverage&&l.enable(21),r.push(l.mask),s.push(e.outputColorSpace)),s.push(t.customProgramCacheKey),s.join()},getUniforms:function(e){let t,n=_[e.type];if(n){let e=n7[n];t=tW.clone(e.uniforms)}else t=e.uniforms;return t},acquireProgram:function(t,n){let i=f.get(n);return void 0!==i?++i.usedTimes:(i=new rK(e,n,t,a),d.push(i),f.set(n,i)),i},releaseProgram:function(e){if(0==--e.usedTimes){let t=d.indexOf(e);
362d[t]=d[d.length-1],d.pop(),f.delete(e.cacheKey),e.destroy()}},releaseShaderCache:function(e){u.remove(e)},programs:d,dispose:function(){u.dispose()}}}function r0(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function r1(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 r3(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 r2(){let e=[],t=0,n=[],i=[],r=[];function a(n,i,r,a,s,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:r,groupOrder:a,renderOrder:n.renderOrder,z:s,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=r,l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=o),t++,l}return{opaque:n,transmissive:i,transparent:r,init:function(){t=0,n.length=0,i.length=0,r.length=0},push:function(e,t,s,o,l,c){let u=a(e,t,s,o,l,c);s.transmission>0?i.push(u):!0===s.transparent?r.push(u):n.push(u)},unshift:function(e,t,s,o,l,c){let u=a(e,t,s,o,l,c);s.transmission>0?i.unshift(u):!0===s.transparent?r.unshift(u):n.unshift(u)},finish:function(){for(let n=t,i=e.length;n<i;n++){let t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||r1),i.length>1&&i.sort(t||r3),r.length>1&&r.sort(t||r3)}}}function r4(){let e=new WeakMap;return{get:function(t,n){let i,r=e.get(t);return void 0===r?(i=new r2,e.set(t,[i])):n>=r.length?(i=new r2,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function r5(){let e={};return{get:function(t){let n;if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":n={direction:new P,color:new to};break;case"SpotLight":n={position:new P,direction:new P,color:new to,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new P,color:new to,distance:0,decay:0};break;case"HemisphereLight":n={direction:new P,skyColor:new to,groundColor:new to};break;case"RectAreaLight":n={color:new to,position:new P,halfWidth:new P,halfHeight:new P}}return e[t.id]=n,n}}}let r6=0;function r8(e,t){return 2*!!t.castShadow-2*!!e.castShadow+ +!!t.map-!!e.map}function r9(e){let t,n=new r5,i=(t={},{get:function(e){let n;if(void 0!==t[e.id])return t[e.id];switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new R};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new R,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),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 P);let a=new P,s=new eb,o=new eb;return{setup:function(t){let a=0,s=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,_=0,v=0;t.sort(r8);for(let e=0,x=t.length;e<x;e++){let x=t[e],y=x.color,M=x.intensity,S=x.distance,E=null;if(x.shadow&&x.shadow.map&&(E=1030===x.shadow.map.texture.format?x.shadow.map.texture:x.shadow.map.depthTexture||x.shadow.map.texture),x.isAmbientLight)a+=y.r*M,s+=y.g*M,o+=y.b*M;else if(x.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(x.sh.coefficients[e],M);v++}else if(x.isDirectionalLight){let e=n.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),x.castShadow){let e=x.shadow,t=i.get(x);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.n
vendor: 4,632 bytes, line 362
362ormalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=E,r.directionalShadowMatrix[l]=x.shadow.matrix,f++}r.directional[l]=e,l++}else if(x.isSpotLight){let e=n.get(x);e.position.setFromMatrixPosition(x.matrixWorld),e.color.copy(y).multiplyScalar(M),e.distance=S,e.coneCos=Math.cos(x.angle),e.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),e.decay=x.decay,r.spot[u]=e;let t=x.shadow;if(x.map&&(r.spotLightMap[g]=x.map,g++,t.updateMatrices(x),x.castShadow&&_++),r.spotLightMatrix[u]=t.matrix,x.castShadow){let e=i.get(x);e.shadowIntensity=t.intensity,e.shadowBias=t.bias,e.shadowNormalBias=t.normalBias,e.shadowRadius=t.radius,e.shadowMapSize=t.mapSize,r.spotShadow[u]=e,r.spotShadowMap[u]=E,m++}u++}else if(x.isRectAreaLight){let e=n.get(x);e.color.copy(y).multiplyScalar(M),e.halfWidth.set(.5*x.width,0,0),e.halfHeight.set(0,.5*x.height,0),r.rectArea[h]=e,h++}else if(x.isPointLight){let e=n.get(x);if(e.color.copy(x.color).multiplyScalar(x.intensity),e.distance=x.distance,e.decay=x.decay,x.castShadow){let e=x.shadow,t=i.get(x);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]=E,r.pointShadowMatrix[c]=x.shadow.matrix,p++}r.point[c]=e,c++}else if(x.isHemisphereLight){let e=n.get(x);e.skyColor.copy(x.color).multiplyScalar(M),e.groundColor.copy(x.groundColor).multiplyScalar(M),r.hemi[d]=e,d++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=n9.LTC_FLOAT_1,r.rectAreaLTC2=n9.LTC_FLOAT_2):(r.rectAreaLTC1=n9.LTC_HALF_1,r.rectAreaLTC2=n9.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=s,r.ambient[2]=o;let x=r.hash;(x.directionalLength!==l||x.pointLength!==c||x.spotLength!==u||x.rectAreaLength!==h||x.hemiLength!==d||x.numDirectionalShadows!==f||x.numPointShadows!==p||x.numSpotShadows!==m||x.numSpotMaps!==g||x.numLightProbes!==v)&&(r.directional.length=l,r.spot.length=u,r.rectArea.length=h,r.point.length=c,r.hemi.length=d,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=p,r.pointShadowMap.length=p,r.spotShadow.length=m,r.spotShadowMap.length=m,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=p,r.spotLightMatrix.length=m+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,x.directionalLength=l,x.pointLength=c,x.spotLength=u,x.rectAreaLength=h,x.hemiLength=d,x.numDirectionalShadows=f,x.numPointShadows=p,x.numSpotShadows=m,x.numSpotMaps=g,x.numLightProbes=v,r.version=r6++)},setupView:function(e,t){let n=0,i=0,l=0,c=0,u=0,h=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){let d=e[t];if(d.isDirectionalLight){let e=r.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),n++}else if(d.isSpotLight){let e=r.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(d.matrixWorld),a.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(a),e.direction.transformDirection(h),l++}else if(d.isRectAreaLight){let e=r.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),o.identity(),s.copy(d.matrixWorld),s.premultiply(h),o.extractRotation(s),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(d.isPointLight){let e=r.point[i];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(h),i++}else if(d.isHemisphereLight){let e=r.hemi[u];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(h),u++}}},state:r}}function r7(e){let t=new r9(e),n=[],i=[],r={lightsArray:n,shadowsArray:i,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){r.camera=e,n.length=0,i.length=0},state:r,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){i.push(e)}}}function ae(e){let t=new WeakMap;return{get:function(n,i=0){let r,a=t.get(n);return void 0===a?(r=new r7(e),t.set(n,[r])):i>=a.length?(r=new r7(e),a.push(r)):r=a[i],r},dispose:function(){t=new WeakMap}}}let at=[new P(1,0,0),new P(-1,0,0),new P(0,1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1)],an=[new P(0,-1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1),new P(0,-1,0),new P(0,-1,0)],ai=new eb,ar=new P,aa=new P;function as(e,t,n){let i=new nn,r=new R,a=new R,s=new q,o=new nL,l=new nD,c={},u=n.maxTextureSize,h={0:1,1:0,2:2}
362,d=new tX({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new R},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;\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 = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\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( max( 0.0, squared_mean - mean * mean ) );\n gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;let p=new tw;p.setAttribute("position",new tm(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new tB(p,d),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let v=this.type;function x(t,n,i,r){let a=null,s=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==s)a=s;else if(a=!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){let e=a.uuid,t=n.uuid,i=c[e];void 0===i&&(i={},c[e]=i);let r=i[t];void 0===r&&(r=a.clone(),i[t]=r,n.addEventListener("dispose",y)),a=r}return a.visible=n.visible,a.wireframe=n.wireframe,3===r?a.side=null!==n.shadowSide?n.shadowSide:n.side:a.side=null!==n.shadowSide?n.shadowSide:h[n.side],a.alphaMap=n.alphaMap,a.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===i.isPointLight&&!0===a.isMeshDistanceMaterial&&(e.properties.get(a).light=i),a}function y(e){for(let t in e.target.removeEventListener("dispose",y),c){let n=c[t],i=e.target.uuid;i in n&&(n[i].dispose(),delete n[i])}}this.render=function(n,o,l){if(!1===_.enabled||!1===_.autoUpdate&&!1===_.needsUpdate||0===n.length)return;2===n.type&&(g("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),n.type=1);let c=e.getRenderTarget(),h=e.getActiveCubeFace(),p=e.getActiveMipmapLevel(),y=e.state;y.setBlending(0),!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=v!==this.type;M&&o.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,h=n.length;c<h;c++){let h=n[c],p=h.shadow;if(void 0===p){g("WebGLShadowMap:",h,"has no shadow.");continue}if(!1===p.autoUpdate&&!1===p.needsUpdate)continue;r.copy(p.mapSize);let _=p.getFrameExtents();if(r.multiply(_),a.copy(p.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(a.x=Math.floor(u/_.x),r.x=a.x*_.x,p.mapSize.x=a.x),r.y>u&&(a.y=Math.floor(u/_.y),r.y=a.y*_.y,p.mapSize.y=a.y)),null===p.map||!0===M){if(null!==p.map&&(null!==p.map.depthTexture&&(p.map.depthTexture.dispose(),p.map.depthTexture=null),p.map.dispose()),3===this.type){if(h.isPointLight){g("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}p.map=new K(r.x,r.y,{format:1030,type:1016,minFilter:1006,magFilter:1006,generateMipmaps:!1}),p.map.texture.name=h.name+".shadowMap",p.map.depthTexture=new nh(r.x,r.y,1015),p.map.depthTexture.name=h.name+".shadowMapDepth",p.map.depthTexture.format=1026,p.map.depthTexture.compareFunction=null,p.map.depthTexture.minFilter=1003,p.map.depthTexture.magFilter=1003}else{h.isPointLight?(p.map=new tQ(r.x),p.map.depthTexture=new nd(r.x,1014)):(p.map=new K(r.x,r.y),p.map.depthTexture=new nh(r.x,r.y,1014)),p.map.depthTexture.name=h.name+".shadowMap",p.map.depthTexture.format=1026;let t=e.state.buffers.depth.getReversed();1===this.type?(p.map.depthTexture.compareFunction=t?518:515,p.map.depthTexture.minFilter=1006,p.map.depthTexture.magFilter=1006):(p.map.depthTexture.compareFunction=null,p.map.depthTexture.minFilter=1003,p.map.depthTexture.magFilter=1003)}p.camera.updateProjectionMatrix()}
362let v=p.map.isWebGLCubeRenderTarget?6:1;for(let n=0;n<v;n++){if(p.map.isWebGLCubeRenderTarget)e.setRenderTarget(p.map,n),e.clear();else{0===n&&(e.setRenderTarget(p.map),e.clear());let t=p.getViewport(n);s.set(a.x*t.x,a.y*t.y,a.x*t.z,a.y*t.w),y.viewport(s)}if(h.isPointLight){let e=p.camera,t=p.matrix,i=h.distance||e.far;i!==e.far&&(e.far=i,e.updateProjectionMatrix()),ar.setFromMatrixPosition(h.matrixWorld),e.position.copy(ar),aa.copy(e.position),aa.add(at[n]),e.up.copy(an[n]),e.lookAt(aa),e.updateMatrixWorld(),t.makeTranslation(-ar.x,-ar.y,-ar.z),ai.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),p._frustum.setFromProjectionMatrix(ai,e.coordinateSystem,e.reversedDepth)}else p.updateMatrices(h);i=p.getFrustum(),function n(r,a,s,o,l){if(!1===r.visible)return;if(r.layers.test(a.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===l)&&(!r.frustumCulled||i.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,r.matrixWorld);let n=t.update(r),i=r.material;if(Array.isArray(i)){let t=n.groups;for(let c=0,u=t.length;c<u;c++){let u=t[c],h=i[u.materialIndex];if(h&&h.visible){let t=x(r,h,o,l);r.onBeforeShadow(e,r,a,s,n,t,u),e.renderBufferDirect(s,null,n,t,r,u),r.onAfterShadow(e,r,a,s,n,t,u)}}}else if(i.visible){let t=x(r,i,o,l);r.onBeforeShadow(e,r,a,s,n,t,null),e.renderBufferDirect(s,null,n,t,r,null),r.onAfterShadow(e,r,a,s,n,t,null)}}let c=r.children;for(let e=0,t=c.length;e<t;e++)n(c[e],a,s,o,l)}(o,l,p.camera,h,this.type)}!0!==p.isPointLightShadow&&3===this.type&&function(n,i){let a=t.update(m);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new K(r.x,r.y,{format:1030,type:1016})),d.uniforms.shadow_pass.value=n.map.depthTexture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,a,d,m,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,a,f,m,null)}(p,l),p.needsUpdate=!1}v=this.type,_.needsUpdate=!1,e.setRenderTarget(c,h,p)}}let ao={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};function al(e,t){let n=new function(){let t=!1,n=new q,i=null,r=new q(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,s,o){!0===o&&(t*=s,i*=s,a*=s),n.set(t,i,a,s),!1===r.equals(n)&&(e.clearColor(t,i,a,s),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},i=new function(){let n=!1,i=!1,r=null,a=null,s=null;return{setReversed:function(e){if(i!==e){let n=t.get("EXT_clip_control");e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),i=e;let r=s;s=null,this.setClear(r)}},getReversed:function(){return i},setTest:function(t){t?V(e.DEPTH_TEST):k(e.DEPTH_TEST)},setMask:function(t){r===t||n||(e.depthMask(t),r=t)},setFunc:function(t){if(i&&(t=ao[t]),a!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}a=t}},setLocked:function(e){n=e},setClear:function(t){s!==t&&(i&&(t=1-t),e.clearDepth(t),s=t)},reset:function(){n=!1,r=null,a=null,s=null,i=!1}}},r=new function(){let t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null;return{setTest:function(n){t||(n?V(e.STENCIL_TEST):k(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,s){(i!==t||r!==n||a!==s)&&(e.stencilFunc(t,n,s),i=t,r=n,a=s)},setOp:function(t,n,i){(s!==t||o!==n||l!==i)&&(e.stencilOp(t,n,i),s=t,o=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,s=null,o=null,l=null,c=null}}},a=new WeakMap,s=new WeakMap,o={},l={},c=new WeakMap,u=[],h=null,d=!1,f=null,p=null,m=null,g=null,v=null,x=null,y=null,M=new to(0,0,0),S=0,E=!1,T=null,b=null,w=null,A=null,R=null,C=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),P=!1,L=e.getParameter(e.VERSION);-1!==L.indexOf("WebGL")?P=parseFloat(/^WebGL (\d)/.exec(L)[1])>=1:-1!==L.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL ES (\d)/.exec(L)[1])>=2);let D=null,N={},I=e.getParameter(e.SCISSOR_BOX),U=e.getParameter(e.VIEWPORT),O=new q().fromArray(I),F=new q().fromArray(U);function B(t,n,i,r){let a=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let s=0;s<i;s++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,r,0,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(n+s,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,a);return s}let z={};function V(t){!0!==o[t]&&(e.enable(t),o[t]=!0)}function k(t){!1!==o[t]&&(e.disable(t),o[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),n.setClear(0,0,0,1),i.setClear(1),r.setClear(0),V(e.DEPTH_TEST),i.setFunc(3),X(!1),j(1),V(e.CULL_FACE),W(0);let G={100:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};G[103]=e.MIN,G[104]=e.MAX;let H={200:e.ZERO,201:e.ONE,202:e.SRC_COLOR,204:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,205:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function W(t,n,i,r,a,s,o,l,c,u){if(0===t){!0===d&&(k(e.BLEND),d=!1);return}if(!1===d&&(V(e.BLEND),d=!0),5!==t){if(t!==f||u!==E){if((100!==p||100!==v)&&(e.blendEquation(e.FUNC_ADD),p=100,v=100),u)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA,e.ZERO,e.ONE);break;default:_("WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE,e.ONE,e.ONE);break;case 3:_("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case 4:_("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:_("WebGLState: Invalid blending: ",t)}m=null,g=null,x=null,y=null,M.set(0,0,0),S=0,f=t,E=u}return}a=a||n,s=s||i,o=o||r,(n!==p||a!==v)&&(e.blendEquationSeparate(G[n],G[a]),p=n,v=a),(i!==m||r!==g||s!==x||o!==y)&&(e.blendFuncSeparate(H[i],H[r],H[s],H[o]),m=i,g=r,x=s,y=o),(!1===l.equals(M)||c!==S)&&(e.blendColor
362(l.r,l.g,l.b,c),M.copy(l),S=c),f=t,E=!1}function X(t){T!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),T=t)}function j(t){0!==t?(V(e.CULL_FACE),t!==b&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):k(e.CULL_FACE),b=t}function Y(t,n,i){t?(V(e.POLYGON_OFFSET_FILL),(A!==n||R!==i)&&(e.polygonOffset(n,i),A=n,R=i)):k(e.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:i,stencil:r},enable:V,disable:k,bindFramebuffer:function(t,n){return l[t]!==n&&(e.bindFramebuffer(t,n),l[t]=n,t===e.DRAW_FRAMEBUFFER&&(l[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(l[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let i=u,r=!1;if(t){void 0===(i=c.get(n))&&(i=[],c.set(n,i));let a=t.textures;if(i.length!==a.length||i[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=a.length;t<n;t++)i[t]=e.COLOR_ATTACHMENT0+t;i.length=a.length,r=!0}}else i[0]!==e.BACK&&(i[0]=e.BACK,r=!0);r&&e.drawBuffers(i)},useProgram:function(t){return h!==t&&(e.useProgram(t),h=t,!0)},setBlending:W,setMaterial:function(t,a){2===t.side?k(e.CULL_FACE):V(e.CULL_FACE);let s=1===t.side;a&&(s=!s),X(s),1===t.blending&&!1===t.transparent?W(0):W(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),i.setFunc(t.depthFunc),i.setTest(t.depthTest),i.setMask(t.depthWrite),n.setMask(t.colorWrite);let o=t.stencilWrite;r.setTest(o),o&&(r.setMask(t.stencilWriteMask),r.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),r.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Y(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?V(e.SAMPLE_ALPHA_TO_COVERAGE):k(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:X,setCullFace:j,setLineWidth:function(t){t!==w&&(P&&e.lineWidth(t),w=t)},setPolygonOffset:Y,setScissorTest:function(t){t?V(e.SCISSOR_TEST):k(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+C-1),D!==t&&(e.activeTexture(t),D=t)},bindTexture:function(t,n,i){void 0===i&&(i=null===D?e.TEXTURE0+C-1:D);let r=N[i];void 0===r&&(r={type:void 0,texture:void 0},N[i]=r),(r.type!==t||r.texture!==n)&&(D!==i&&(e.activeTexture(i),D=i),e.bindTexture(t,n||z[t]),r.type=t,r.texture=n)},unbindTexture:function(){let t=N[D];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){_("WebGLState:",e)}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(e){_("WebGLState:",e)}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(e){_("WebGLState:",e)}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(e){_("WebGLState:",e)}},updateUBOMapping:function(t,n){let i=s.get(n);void 0===i&&(i=new WeakMap,s.set(n,i));let r=i.get(t);void 0===r&&(r=e.getUniformBlockIndex(n,t.name),i.set(t,r))},uniformBlockBinding:function(t,n){let i=s.get(n).get(t);a.get(n)!==i&&(e.uniformBlockBinding(n,i,t.__bindingPointIndex),a.set(n,i))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(e){_("WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(e){_("WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(e){_("WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(e){_("WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(e){_("WebGLState:",e)}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(e){_("WebGLState:",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(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),i.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),o={},D=null,N={},l={},c=new WeakMap,u=[],h=null,d=!1,f=null,p=null,m=null,g=null,v=null,x=null,y=null,M=new to(0,0,0),S=0,E=!1,T=null,b=null,w=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),n.reset(),i.reset(),r.reset()}}}function ac(e,t,n,i,r,a,s){let u,h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,f="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),p=new R,m=new WeakMap,v=new WeakMap,x=!1;try{x="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function y(e,t){return x?new OffscreenCanvas(e,t):d("canvas")}function M(e,t,n){let i=1,r=Z(e);if((r.width>n||r.height>n)&&(i=n/Math.max(r.width,r.height)),i<1)if("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 n=Math.floor(i*r.width),a=Math.floor(i*r.height);void 0===u&&(u=y(n,a));let s=t?y(n,a):u;return s.width=n,s.height=a,s.getContext("2d").drawImage(e,0,0,n,a),g("WebGLRenderer: Texture has been resized from ("+r.width+"x"+r.height+") to ("+n+"x"+a+")."),s}else"data"in e&&g("WebGLRenderer: Image in DataTexture is too big ("+r.width+"x"+r.height+").");return e}function S(e){return e.generateMipmaps}function E(t){e.generateMipmap(t)}function T(n,i,r,a,s=!1){if(null!==n){if(void 0!==e[n])return e[n];g("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;if(i===e.RED&&(r===e.FLOAT&&(o=e.R32F),r===e.HALF_FLOAT&&(o=e.R16F),r===e.UNSIGNED_BYTE&&(o=e.R8)),i===e.RED_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.R8UI),r===e.UNSIGNED_SHORT&&(o=e.R16UI),r===e.UNSIGNED_INT&&(
362o=e.R32UI),r===e.BYTE&&(o=e.R8I),r===e.SHORT&&(o=e.R16I),r===e.INT&&(o=e.R32I)),i===e.RG&&(r===e.FLOAT&&(o=e.RG32F),r===e.HALF_FLOAT&&(o=e.RG16F),r===e.UNSIGNED_BYTE&&(o=e.RG8)),i===e.RG_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RG8UI),r===e.UNSIGNED_SHORT&&(o=e.RG16UI),r===e.UNSIGNED_INT&&(o=e.RG32UI),r===e.BYTE&&(o=e.RG8I),r===e.SHORT&&(o=e.RG16I),r===e.INT&&(o=e.RG32I)),i===e.RGB_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGB8UI),r===e.UNSIGNED_SHORT&&(o=e.RGB16UI),r===e.UNSIGNED_INT&&(o=e.RGB32UI),r===e.BYTE&&(o=e.RGB8I),r===e.SHORT&&(o=e.RGB16I),r===e.INT&&(o=e.RGB32I)),i===e.RGBA_INTEGER&&(r===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),r===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),r===e.UNSIGNED_INT&&(o=e.RGBA32UI),r===e.BYTE&&(o=e.RGBA8I),r===e.SHORT&&(o=e.RGBA16I),r===e.INT&&(o=e.RGBA32I)),i===e.RGB&&(r===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.UNSIGNED_INT_10F_11F_11F_REV&&(o=e.R11F_G11F_B10F)),i===e.RGBA){let t=s?l:F.getTransfer(a);r===e.FLOAT&&(o=e.RGBA32F),r===e.HALF_FLOAT&&(o=e.RGBA16F),r===e.UNSIGNED_BYTE&&(o=t===c?e.SRGB8_ALPHA8:e.RGBA8),r===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),r===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return(o===e.R16F||o===e.R32F||o===e.RG16F||o===e.RG32F||o===e.RGBA16F||o===e.RGBA32F)&&t.get("EXT_color_buffer_float"),o}function b(t,n){let i;return t?null===n||1014===n||1020===n?i=e.DEPTH24_STENCIL8:1015===n?i=e.DEPTH32F_STENCIL8:1012===n&&(i=e.DEPTH24_STENCIL8,g("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===n||1014===n||1020===n?i=e.DEPTH_COMPONENT24:1015===n?i=e.DEPTH_COMPONENT32F:1012===n&&(i=e.DEPTH_COMPONENT16),i}function w(e,t){return!0===S(e)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?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 A(e){let t=e.target;t.removeEventListener("dispose",A),function(e){let t=i.get(e);if(void 0===t.__webglInit)return;let n=e.source,r=v.get(n);if(r){let i=r[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&P(e),0===Object.keys(r).length&&v.delete(n)}i.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function C(t){let n=t.target;n.removeEventListener("dispose",C),function(t){let n=i.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),i.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let i=0;i<n.__webglFramebuffer[t].length;i++)e.deleteFramebuffer(n.__webglFramebuffer[t][i]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}let r=t.textures;for(let t=0,n=r.length;t<n;t++){let n=i.get(r[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),s.memory.textures--),i.remove(r[t])}i.remove(t)}(n)}function P(t){let n=i.get(t);e.deleteTexture(n.__webglTexture);let r=t.source,a=v.get(r);delete a[n.__cacheKey],s.memory.textures--}let L=0;function D(t,r){var a;let o,l=i.get(t);if(t.isVideoTexture&&(a=t,o=s.render.frame,m.get(a)!==o&&(m.set(a,o),a.update())),!1===t.isRenderTargetTexture&&!0!==t.isExternalTexture&&t.version>0&&l.__version!==t.version){let e=t.image;if(null===e)g("WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==e.complete)return void V(l,t,r);g("WebGLRenderer: Texture marked for update but image is incomplete")}}else t.isExternalTexture&&(l.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,l.__webglTexture,e.TEXTURE0+r)}let N={1e3:e.REPEAT,1001:e.CLAMP_TO_EDGE,1002:e.MIRRORED_REPEAT},I={1003:e.NEAREST,1004:e.NEAREST_MIPMAP_NEAREST,1005:e.NEAREST_MIPMAP_LINEAR,1006:e.LINEAR,1007:e.LINEAR_MIPMAP_NEAREST,1008:e.LINEAR_MIPMAP_LINEAR},U={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function O(n,a){if((1015===a.type&&!1===t.has("OES_texture_float_linear")&&(1006===a.magFilter||1007===a.magFilter||1005===a.magFilter||1008===a.magFilter||1006===a.minFilter||1007===a.minFilter||1005===a.minFilter||1008===a.minFilter)&&g("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(n,e.TEXTURE_WRAP_S,N[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,N[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,N[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,I[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,I[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,U[a.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic"))&&1003!==a.magFilter&&(1005===a.minFilter||1008===a.minFilter)&&(1015!==a.type||!1!==t.has("OES_texture_float_linear"))&&(a.anisotropy>1||i.get(a).__currentAnisotropy)){let s=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy}}function B(t,n){let i,r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",A));let a=n.source,o=v.get(a);void 0===o&&(o={},v.set(a,o));let l=((i=[]).push(n.wrapS),i.push(n.wrapT),i.push(n.wrapR||0),i.push(n.magFilter),i.push(n.minFilter),i.push(n.anisotropy),i.push(n.internalFormat),i.push(n.format),i.push(n.type),i.push(n.generateMipmaps),i.push(n.premultiplyAlpha),i.push(n.flipY),i.push(n.unpackAlignment),i.push(n.colorSpace),i.join());if(l!==t.__cacheKey){void 0===o[l]&&(o[l]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,r=!0),o[l].usedTimes++;let i=o[t.__cacheKey];void 0!==i&&(o[t.__cacheKey].usedTimes--,0===i.usedTimes&&P(n)),t.__cacheKey=l,t.__webglTexture=o[l].texture}return r}function z(e,t,n){return Math.floor(Math.floor(e/n)/t)}
362function V(t,s,o){let l=e.TEXTURE_2D;(s.isDataArrayTexture||s.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),s.isData3DTexture&&(l=e.TEXTURE_3D);let c=B(t,s),u=s.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);let h=i.get(u);if(u.version!==h.__version||!0===c){let t;n.activeTexture(e.TEXTURE0+o);let i=F.getPrimaries(F.workingColorSpace),d=""===s.colorSpace?null:F.getPrimaries(s.colorSpace),f=""===s.colorSpace||i===d?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,f);let p=M(s.image,!1,r.maxTextureSize);p=K(s,p);let m=a.convert(s.format,s.colorSpace),_=a.convert(s.type),v=T(s.internalFormat,m,_,s.colorSpace,s.isVideoTexture);O(l,s);let x=s.mipmaps,y=!0!==s.isVideoTexture,A=void 0===h.__version||!0===c,R=u.dataReady,C=w(s,p);if(s.isDepthTexture)v=b(1027===s.format,s.type),A&&(y?n.texStorage2D(e.TEXTURE_2D,1,v,p.width,p.height):n.texImage2D(e.TEXTURE_2D,0,v,p.width,p.height,0,m,_,null));else if(s.isDataTexture)if(x.length>0){y&&A&&n.texStorage2D(e.TEXTURE_2D,C,v,x[0].width,x[0].height);for(let i=0,r=x.length;i<r;i++)t=x[i],y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,_,t.data):n.texImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,m,_,t.data);s.generateMipmaps=!1}else y?(A&&n.texStorage2D(e.TEXTURE_2D,C,v,p.width,p.height),R&&function(t,i,r,a){let s=t.updateRanges;if(0===s.length)n.texSubImage2D(e.TEXTURE_2D,0,0,0,i.width,i.height,r,a,i.data);else{s.sort((e,t)=>e.start-t.start);let o=0;for(let e=1;e<s.length;e++){let t=s[o],n=s[e],r=t.start+t.count,a=z(n.start,i.width,4),l=z(t.start,i.width,4);n.start<=r+1&&a===l&&z(n.start+n.count-1,i.width,4)===a?t.count=Math.max(t.count,n.start+n.count-t.start):s[++o]=n}s.length=o+1;let l=e.getParameter(e.UNPACK_ROW_LENGTH),c=e.getParameter(e.UNPACK_SKIP_PIXELS),u=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,i.width);for(let t=0,o=s.length;t<o;t++){let o=s[t],l=Math.floor(o.start/4),c=Math.ceil(o.count/4),u=l%i.width,h=Math.floor(l/i.width);e.pixelStorei(e.UNPACK_SKIP_PIXELS,u),e.pixelStorei(e.UNPACK_SKIP_ROWS,h),n.texSubImage2D(e.TEXTURE_2D,0,u,h,c,1,r,a,i.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,l),e.pixelStorei(e.UNPACK_SKIP_PIXELS,c),e.pixelStorei(e.UNPACK_SKIP_ROWS,u)}}(s,p,m,_)):n.texImage2D(e.TEXTURE_2D,0,v,p.width,p.height,0,m,_,p.data);else if(s.isCompressedTexture)if(s.isCompressedArrayTexture){y&&A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,v,x[0].width,x[0].height,p.depth);for(let i=0,r=x.length;i<r;i++)if(t=x[i],1023!==s.format)if(null!==m)if(y){if(R)if(s.layerUpdates.size>0){let r=n4(t.width,t.height,s.format,s.type);for(let a of s.layerUpdates){let s=t.data.subarray(a*r/t.data.BYTES_PER_ELEMENT,(a+1)*r/t.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,t.width,t.height,1,m,s)}s.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,p.depth,m,t.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,v,t.width,t.height,p.depth,0,t.data,0,0);else g("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else y?R&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,t.width,t.height,p.depth,m,_,t.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,v,t.width,t.height,p.depth,0,m,_,t.data)}else{y&&A&&n.texStorage2D(e.TEXTURE_2D,C,v,x[0].width,x[0].height);for(let i=0,r=x.length;i<r;i++)t=x[i],1023!==s.format?null!==m?y?R&&n.compressedTexSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,t.data):n.compressedTexImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,t.data):g("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,t.width,t.height,m,_,t.data):n.texImage2D(e.TEXTURE_2D,i,v,t.width,t.height,0,m,_,t.data)}else if(s.isDataArrayTexture)if(y){if(A&&n.texStorage3D(e.TEXTURE_2D_ARRAY,C,v,p.width,p.height,p.depth),R)if(s.layerUpdates.size>0){let t=n4(p.width,p.height,s.format,s.type);for(let i of s.layerUpdates){let r=p.data.subarray(i*t/p.data.BYTES_PER_ELEMENT,(i+1)
362*t/p.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,i,p.width,p.height,1,m,_,r)}s.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,p.width,p.height,p.depth,m,_,p.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,v,p.width,p.height,p.depth,0,m,_,p.data);else if(s.isData3DTexture)y?(A&&n.texStorage3D(e.TEXTURE_3D,C,v,p.width,p.height,p.depth),R&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,p.width,p.height,p.depth,m,_,p.data)):n.texImage3D(e.TEXTURE_3D,0,v,p.width,p.height,p.depth,0,m,_,p.data);else if(s.isFramebufferTexture){if(A)if(y)n.texStorage2D(e.TEXTURE_2D,C,v,p.width,p.height);else{let t=p.width,i=p.height;for(let r=0;r<C;r++)n.texImage2D(e.TEXTURE_2D,r,v,t,i,0,m,_,null),t>>=1,i>>=1}}else if(x.length>0){if(y&&A){let t=Z(x[0]);n.texStorage2D(e.TEXTURE_2D,C,v,t.width,t.height)}for(let i=0,r=x.length;i<r;i++)t=x[i],y?R&&n.texSubImage2D(e.TEXTURE_2D,i,0,0,m,_,t):n.texImage2D(e.TEXTURE_2D,i,v,m,_,t);s.generateMipmaps=!1}else if(y){if(A){let t=Z(p);n.texStorage2D(e.TEXTURE_2D,C,v,t.width,t.height)}R&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,m,_,p)}else n.texImage2D(e.TEXTURE_2D,0,v,m,_,p);S(s)&&E(l),h.__version=u.version,s.onUpdate&&s.onUpdate(s)}t.__version=s.version}function k(t,r,s,o,l,c){let u=a.convert(s.format,s.colorSpace),d=a.convert(s.type),f=T(s.internalFormat,u,d,s.colorSpace),p=i.get(r),m=i.get(s);if(m.__renderTarget=r,!p.__hasExternalTextures){let t=Math.max(1,r.width>>c),i=Math.max(1,r.height>>c);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,c,f,t,i,r.depth,0,u,d,null):n.texImage2D(l,c,f,t,i,0,u,d,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),Y(r)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,o,l,m.__webglTexture,0,q(r)):(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),n.bindFramebuffer(e.FRAMEBUFFER,null)}function G(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let r=n.depthTexture,a=r&&r.isDepthTexture?r.type:null,s=b(n.stencilBuffer,a),o=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;Y(n)?h.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,q(n),s,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,q(n),s,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,s,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,o,e.RENDERBUFFER,t)}else{let t=n.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=T(s.internalFormat,o,l,s.colorSpace);Y(n)?h.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,q(n),c,n.width,n.height):i?e.renderbufferStorageMultisample(e.RENDERBUFFER,q(n),c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function H(t,r,s){let o=!0===r.isWebGLCubeRenderTarget;if(n.bindFramebuffer(e.FRAMEBUFFER,t),!(r.depthTexture&&r.depthTexture.isDepthTexture))throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");let l=i.get(r.depthTexture);if(l.__renderTarget=r,l.__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),o){if(void 0===l.__webglInit&&(l.__webglInit=!0,r.depthTexture.addEventListener("dispose",A)),void 0===l.__webglTexture){let t;l.__webglTexture=e.createTexture(),n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),O(e.TEXTURE_CUBE_MAP,r.depthTexture);let i=a.convert(r.depthTexture.format),s=a.convert(r.depthTexture.type);1026===r.depthTexture.format?t=e.DEPTH_COMPONENT24:1027===r.depthTexture.format&&(t=e.DEPTH24_STENCIL8);for(let n=0;n<6;n++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0,t,r.width,r.height,0,i,s,null)}}else D(r.depthTexture,0);let c=l.__webglTexture,u=q(r),d=o?e.TEXTURE_CUBE_MAP_POSITIVE_X+s:e.TEXTURE_2D,f=1027===r.depthTexture.format?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;if(1026===r.depthTexture.format)Y(r)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,d,c,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,f,d,c,0);else if(1027===r.depthTexture.format)Y(r)?h.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,f,d,c,0,u):e.framebufferTexture2D(e.FRAMEBUFFER,f,d,c,0);else throw Error("Unknown depthTexture format")}
362function W(t){let r=i.get(t),a=!0===t.isWebGLCubeRenderTarget;if(r.__boundDepthTexture!==t.depthTexture){let e=t.depthTexture;if(r.__depthDisposeCallback&&r.__depthDisposeCallback(),e){let t=()=>{delete r.__boundDepthTexture,delete r.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),r.__depthDisposeCallback=t}r.__boundDepthTexture=e}if(t.depthTexture&&!r.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)H(r.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?H(r.__webglFramebuffer[0],t,0):H(r.__webglFramebuffer,t,0)}else if(a){r.__webglDepthbuffer=[];for(let i=0;i<6;i++)if(n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[i]),void 0===r.__webglDepthbuffer[i])r.__webglDepthbuffer[i]=e.createRenderbuffer(),G(r.__webglDepthbuffer[i],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=r.__webglDepthbuffer[i];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let i=t.texture.mipmaps;if(i&&i.length>0?n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,r.__webglFramebuffer),void 0===r.__webglDepthbuffer)r.__webglDepthbuffer=e.createRenderbuffer(),G(r.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,i=r.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,i),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,i)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}let X=[],j=[];function q(e){return Math.min(r.maxSamples,e.samples)}function Y(e){let n=i.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function K(e,t){let n=e.colorSpace,i=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==o&&""!==n&&(F.getTransfer(n)===c?(1023!==i||1009!==r)&&g("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):_("WebGLTextures: Unsupported texture color space:",n)),t}function Z(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(p.width=e.naturalWidth||e.width,p.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(p.width=e.displayWidth,p.height=e.displayHeight):(p.width=e.width,p.height=e.height),p}this.allocateTextureUnit=function(){let e=L;return e>=r.maxTextures&&g("WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),L+=1,e},this.resetTextureUnits=function(){L=0},this.setTexture2D=D,this.setTexture2DArray=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?V(a,t,r):(t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+r))},this.setTexture3D=function(t,r){let a=i.get(t);!1===t.isRenderTargetTexture&&t.version>0&&a.__version!==t.version?V(a,t,r):n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+r)},this.setTextureCube=function(t,s){let o=i.get(t);!0!==t.isCubeDepthTexture&&t.version>0&&o.__version!==t.version?function(t,s,o){if(6!==s.image.length)return;let l=B(t,s),c=s.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);let u=i.get(c);if(c.version!==u.__version||!0===l){let t;n.activeTexture(e.TEXTURE0+o);let i=F.getPrimaries(F.workingColorSpace),h=""===s.colorSpace?null:F.getPrimaries(s.colorSpace),d=""===s.colorSpace||i===h?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,s.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,s.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);let f=s.isCompressedTexture||s.image[0].isCompressedTexture,p=s.image[0]&&s.image[0].isDataTexture,m=[];for(let e=0;e<6;e++)f||p?m[e]=p?s.image[e].image:s.image[e]:m[e]=M(s.image[e],!0,r.maxCubemapSize),m[e]=K(s,m[e]);let _=m[0],v=a.convert(s.format,s.colorSpace),x=a.convert(s.type),y=T(s.internalFormat,v,x,s.colorSpace),b=!0!==s.isVideoTexture,A=void 0===u.__version||!0===l,R=c.dataReady,C=w(s,_);if(O(e.TEXTURE_CUBE_MAP,s),f){b&&A&&n.texStorage2D(e.TEXTURE_CUBE_MAP,C,y,_.width,_.height);for(let i=0;i<6;i++){t=m[i].mipmaps;for(let r=0;r<t.length;r++){let a=t[r];
vendor: 4,568 bytes, line 362
3621023!==s.format?null!==v?b?R&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,0,0,a.width,a.height,v,a.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,y,a.width,a.height,0,a.data):g("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,0,0,a.width,a.height,v,x,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r,y,a.width,a.height,0,v,x,a.data)}}}else{if(t=s.mipmaps,b&&A){t.length>0&&C++;let i=Z(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,C,y,i.width,i.height)}for(let i=0;i<6;i++)if(p){b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,m[i].width,m[i].height,v,x,m[i].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,y,m[i].width,m[i].height,0,v,x,m[i].data);for(let r=0;r<t.length;r++){let a=t[r].image[i].image;b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,0,0,a.width,a.height,v,x,a.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,y,a.width,a.height,0,v,x,a.data)}}else{b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,0,0,v,x,m[i]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,y,v,x,m[i]);for(let r=0;r<t.length;r++){let a=t[r];b?R&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,0,0,v,x,a.image[i]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,r+1,y,v,x,a.image[i])}}}S(s)&&E(e.TEXTURE_CUBE_MAP),u.__version=c.version,s.onUpdate&&s.onUpdate(s)}t.__version=s.version}(o,t,s):n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture,e.TEXTURE0+s)},this.rebindTextures=function(t,n,r){let a=i.get(t);void 0!==n&&k(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==r&&W(t)},this.setupRenderTarget=function(t){let r=t.texture,o=i.get(t),l=i.get(r);t.addEventListener("dispose",C);let c=t.textures,u=!0===t.isWebGLCubeRenderTarget,h=c.length>1;if(!h&&(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=r.version,s.memory.textures++),u){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n<r.mipmaps.length;n++)o.__webglFramebuffer[t][n]=e.createFramebuffer()}else o.__webglFramebuffer[t]=e.createFramebuffer()}else{if(r.mipmaps&&r.mipmaps.length>0){o.__webglFramebuffer=[];for(let t=0;t<r.mipmaps.length;t++)o.__webglFramebuffer[t]=e.createFramebuffer()}else o.__webglFramebuffer=e.createFramebuffer();if(h)for(let t=0,n=c.length;t<n;t++){let n=i.get(c[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),s.memory.textures++)}if(t.samples>0&&!1===Y(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<c.length;n++){let i=c[n];o.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o.__webglColorRenderbuffer[n]);let r=a.convert(i.format,i.colorSpace),s=a.convert(i.type),l=T(i.internalFormat,r,s,i.colorSpace,!0===t.isXRRenderTarget),u=q(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,u,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,o.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),G(o.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(u){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),O(e.TEXTURE_CUBE_MAP,r);for(let n=0;n<6;n++)if(r.mipmaps&&r.mipmaps.length>0)for(let i=0;i<r.mipmaps.length;i++)k(o.__webglFramebuffer[n][i],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,i);else k(o.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);S(r)&&E(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let r=0,a=c.length;r<a;r++){let a=c[r],s=i.get(a),l=e.TEXTURE_2D;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(l=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(l,s.__webglTexture),O(l,a),k(o.__webglFramebuffer,t,a,e.COLOR_ATTACHMENT0+r,l,0),S(a)&&E(l)}n.unbindTexture()}else{let i=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(i=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(i,l.__webglTexture),O(i,r),r.mipmaps&&r.mipmaps.length>0)for(let n=0;n<r.mipmaps.length;n++)k(o.__webglFramebuffer[n],t,r,e.COLOR_ATTACHMENT0,i,n);else k(o.__webglFramebuffer,t,r,e.COLOR_ATTACHMENT0,i,0);S(r)&&E(i),n.unbindTexture()}t.depthBuffer&&W(t)},this.updateRenderTargetMipmap=function(t){let r=t.textures;for(let a=0,s=r.length;a<s;a++){let s=r[a];
362if(S(s)){let r=t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D,a=i.get(s).__webglTexture;n.bindTexture(r,a),E(r),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0){if(!1===Y(t)){let r=t.textures,a=t.width,s=t.height,o=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=i.get(t),u=r.length>1;if(u)for(let t=0;t<r.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer);let h=t.texture.mipmaps;h&&h.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n<r.length;n++){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,c.__webglColorRenderbuffer[n]);let t=i.get(r[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,a,s,0,0,a,s,o,e.NEAREST),!0===f&&(X.length=0,j.length=0,X.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(X.push(l),j.push(l),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,j)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,X))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),u)for(let t=0;t<r.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);let a=i.get(r[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,a,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&f){let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}}},this.setupDepthRenderbuffer=W,this.setupFrameBufferTexture=k,this.useMultisampledRTT=Y,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function au(e,t){return{convert:function(n,i=""){let r,a=F.getTransfer(i);if(1009===n)return e.UNSIGNED_BYTE;if(1017===n)return e.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return e.UNSIGNED_SHORT_5_5_5_1;if(35902===n)return e.UNSIGNED_INT_5_9_9_9_REV;if(35899===n)return e.UNSIGNED_INT_10F_11F_11F_REV;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(1012===n)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(1014===n)return e.UNSIGNED_INT;if(1015===n)return e.FLOAT;if(1016===n)return e.HALF_FLOAT;if(1021===n)return e.ALPHA;if(1022===n)return e.RGB;if(1023===n)return e.RGBA;if(1026===n)return e.DEPTH_COMPONENT;if(1027===n)return e.DEPTH_STENCIL;if(1028===n)return e.RED;if(1029===n)return e.RED_INTEGER;if(1030===n)return e.RG;if(1031===n)return e.RG_INTEGER;if(1033===n)return e.RGBA_INTEGER;if(33776===n||33777===n||33778===n||33779===n)if(a===c){if(null===(r=t.get("WEBGL_compressed_texture_s3tc_srgb")))return null;if(33776===n)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===n)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===n)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===n)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===n)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===n)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n||37492===n||37496===n||37488===n||37489===n||37490===n||37491===n){if(null===(r=t.get("WEBGL_compressed_texture_etc")))return null;if(36196===n||37492===n)return a===c?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(37496===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC;
362if(37488===n)return r.COMPRESSED_R11_EAC;if(37489===n)return r.COMPRESSED_SIGNED_R11_EAC;if(37490===n)return r.COMPRESSED_RG11_EAC;if(37491===n)return r.COMPRESSED_SIGNED_RG11_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(null===(r=t.get("WEBGL_compressed_texture_astc")))return null;if(37808===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return a===c?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===n||36494===n||36495===n){if(null===(r=t.get("EXT_texture_compression_bptc")))return null;if(36492===n)return a===c?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(null===(r=t.get("EXT_texture_compression_rgtc")))return null;if(36283===n)return r.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return 1020===n?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}let ah=` 363void main() { 364 365 gl_Position = vec4( position, 1.0 ); 366 367}`,ad=` 368uniform sampler2DArray depthColor; 369uniform float depthWidth; 370uniform float depthHeight; 371 372void main() { 373 374 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 375 376 if ( coord.x >= 1.0 ) { 377 378 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 379 380 } else { 381 382 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 383 384 } 385 386}`;class af{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(null===this.texture){let n=new nf(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(null!==this.texture&&null===this.mesh){let t=e.cameras[0].viewport,n=new tX({vertexShader:ah,fragmentShader:ad,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new tB(new nC(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class ap extends y{constructor(e,t){super();const n=this;let i=null,r=1,a=null,s="local-floor",o=1,l=null,c=null,u=null,h=null,d=null,f=null;const p="undefined"!=typeof XRWebGLBinding,m=new af,_={},v=t.getContextAttributes();let x=null,y=null;const M=[],S=[],T=new R;let b=null;const w=new tZ;w.viewport=new q;const A=new tZ;A.viewport=new q;const C=[w,A],L=new nZ;let D=null,N=null;function I(e){let t=S.indexOf(e.inputSource);if(-1===t)return;let n=M[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function U(){i.removeEventListener("select",I),i.removeEventListener("selectstart",I),i.removeEventListener("selectend",I),i.removeEventListener("squeeze",I),i.removeEventListener("squeezestart",I),i.removeEventListener("squeezeend",I),i.removeEventListener("end",U
386),i.removeEventListener("inputsourceschange",O);for(let e=0;e<M.length;e++){let t=S[e];null!==t&&(S[e]=null,M[e].disconnect(t))}for(let e in D=null,N=null,m.reset(),_)delete _[e];e.setRenderTarget(x),d=null,h=null,u=null,i=null,y=null,k.stop(),n.isPresenting=!1,e.setPixelRatio(b),e.setSize(T.width,T.height,!1),n.dispatchEvent({type:"sessionend"})}function O(e){for(let t=0;t<e.removed.length;t++){let n=e.removed[t],i=S.indexOf(n);i>=0&&(S[i]=null,M[i].disconnect(n))}for(let t=0;t<e.added.length;t++){let n=e.added[t],i=S.indexOf(n);if(-1===i){for(let e=0;e<M.length;e++)if(e>=S.length){S.push(n),i=e;break}else if(null===S[e]){S[e]=n,i=e;break}if(-1===i)break}let r=M[i];r&&r.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=M[e];return void 0===t&&(t=new t3,M[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=M[e];return void 0===t&&(t=new t3,M[e]=t),t.getGripSpace()},this.getHand=function(e){let t=M[e];return void 0===t&&(t=new t3,M[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){r=e,!0===n.isPresenting&&g("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){s=e,!0===n.isPresenting&&g("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l||a},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return null===u&&p&&(u=new XRWebGLBinding(i,t)),u},this.getFrame=function(){return f},this.getSession=function(){return i},this.setSession=async function(c){if(null!==(i=c)){if(x=e.getRenderTarget(),i.addEventListener("select",I),i.addEventListener("selectstart",I),i.addEventListener("selectend",I),i.addEventListener("squeeze",I),i.addEventListener("squeezestart",I),i.addEventListener("squeezeend",I),i.addEventListener("end",U),i.addEventListener("inputsourceschange",O),!0!==v.xrCompatible&&await t.makeXRCompatible(),b=e.getPixelRatio(),e.getSize(T),p&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,a=null,s=null;v.depth&&(s=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=v.stencil?1027:1026,a=v.stencil?1020:1014);let o={colorFormat:t.RGBA8,depthFormat:s,scaleFactor:r};h=(u=this.getBinding()).createProjectionLayer(o),i.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),y=new K(h.textureWidth,h.textureHeight,{format:1023,type:1009,depthTexture:new nh(h.textureWidth,h.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:4*!!v.antialias,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{let n={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),y=new K(d.framebufferWidth,d.framebufferHeight,{format:1023,type:1009,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:!1===d.ignoreDepthValues,resolveStencilBuffer:!1===d.ignoreDepthValues})}y.isXRRenderTarget=!0,this.setFoveation(o),l=null,a=await i.requestReferenceSpace(s),k.setContext(i),k.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==i)return i.environmentBlendMode},this.getDepthTexture=function(){return m.getDepthTexture()};const F=new P,B=new P;function z(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,n,r;if(null===i)return;let a=e.near,s=e.far;null!==m.texture&&(m.depthNear>0&&(a=m.depthNear),m.depthFar>0&&(s=m.depthFar)),L.near=A.near=w.near=a,L.far=A.far=w.far=s,(D!==L.near||N!==L.far)&&(i.updateRenderState({depthNear:L.near,depthFar:L.far}),D=L.near,N=L.far),L.layers.mask=6|e.layers.mask,w.layers.mask=3&L.layers.mask,A.layers.mask=5&L.layers.mask;let o=e.parent,l=L.cameras;z(L,o);for(let e=0;e<l.length;e++)z(l[e],o);2===l.length?function(e,t,n){F.setFromMatrixPosition(t.matrixWorld),B.setFromMatrixPosition(n.matrixWorld);let i=F.distanceTo(B),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,s=r[14]/(r[10]-1),o=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],d=i/(-u+h),f=-(d*u);if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),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=s+d,n=o+d;e.projectionMatrix.makePerspective(s*u-f,s*h+(i-f),l*o/n*t,c*o/n*t,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(L,w,A):L.projectionMatrix.copy(w.projectionMatrix),t=e,n=L,null===(r=o)?t.matrix.copy(n.matrixWorld):(t.matrix.copy(r.matrixWorld),t.matrix.invert(),t.matrix.multiply(n.matrixWorld)),t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(n.projectionMatrix),t.projectionMatrixInverse.copy(n.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*E*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)},this.getCamera=function(){return L},this.getFoveation=function(){if(null!==h||null!==d)return o},this.setFoveation=function(e){o=e,null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==m.texture},this.getDepthSensingMesh=function(){return m.getMesh(L)},this.getCameraTexture=function(e){return _[e]};let V=null;
386const k=new n5;k.setAnimationLoop(function(t,r){if(c=r.getViewerPose(l||a),f=r,null!==c){let t=c.views;null!==d&&(e.setRenderTargetFramebuffer(y,d.framebuffer),e.setRenderTarget(y));let r=!1;t.length!==L.cameras.length&&(L.cameras.length=0,r=!0);for(let n=0;n<t.length;n++){let i=t[n],a=null;if(null!==d)a=d.getViewport(i);else{let t=u.getViewSubImage(h,i);a=t.viewport,0===n&&(e.setRenderTargetTextures(y,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(y))}let s=C[n];void 0===s&&((s=new tZ).layers.enable(n),s.viewport=new q,C[n]=s),s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.quaternion,s.scale),s.projectionMatrix.fromArray(i.projectionMatrix),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),s.viewport.set(a.x,a.y,a.width,a.height),0===n&&(L.matrix.copy(s.matrix),L.matrix.decompose(L.position,L.quaternion,L.scale)),!0===r&&L.cameras.push(s)}let a=i.enabledFeatures;if(a&&a.includes("depth-sensing")&&"gpu-optimized"==i.depthUsage&&p){let e=(u=n.getBinding()).getDepthInformation(t[0]);e&&e.isValid&&e.texture&&m.init(e,i.renderState)}if(a&&a.includes("camera-access")&&p){e.state.unbindTexture(),u=n.getBinding();for(let e=0;e<t.length;e++){let n=t[e].camera;if(n){let e=_[n];e||(e=new nf,_[n]=e);let t=u.getCameraImage(n);e.sourceTexture=t}}}}for(let e=0;e<M.length;e++){let t=S[e],n=M[e];null!==t&&void 0!==n&&n.update(t,r,l||a)}V&&V(t,r),r.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:r}),f=null}),this.setAnimationLoop=function(e){V=e},this.dispose=function(){}}}let am=new eU,ag=new eb;function a_(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function i(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map,n(i.map,e.mapTransform)),i.alphaMap&&(e.alphaMap.value=i.alphaMap,n(i.alphaMap,e.alphaMapTransform)),i.bumpMap&&(e.bumpMap.value=i.bumpMap,n(i.bumpMap,e.bumpMapTransform),e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,n(i.normalMap,e.normalMapTransform),e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,n(i.displacementMap,e.displacementMapTransform),e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,e.emissiveMapTransform)),i.specularMap&&(e.specularMap.value=i.specularMap,n(i.specularMap,e.specularMapTransform)),i.alphaTest>0&&(e.alphaTest.value=i.alphaTest);let r=t.get(i),a=r.envMap,s=r.envMapRotation;a&&(e.envMap.value=a,am.copy(s),am.x*=-1,am.y*=-1,am.z*=-1,a.isCubeTexture&&!1===a.isRenderTargetTexture&&(am.y*=-1,am.z*=-1),e.envMapRotation.value.setFromMatrix4(ag.makeRotationFromEuler(am)),e.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,e.reflectivity.value=i.reflectivity,e.ior.value=i.ior,e.refractionRatio.value=i.refractionRatio),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity,n(i.lightMap,e.lightMapTransform)),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,tH(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,r,a,s,o){var l,c,u,h,d,f,p,m,g,_,v,x,y,M,S,E,T,b,w,A,R,C,P;let L;r.isMeshBasicMaterial||r.isMeshLambertMaterial?i(e,r):r.isMeshToonMaterial?(i(e,r),l=e,(c=r).gradientMap&&(l.gradientMap.value=c.gradientMap)):r.isMeshPhongMaterial?(i(e,r),u=e,h=r,u.specular.value.copy(h.specular),u.shininess.value=Math.max(h.shininess,1e-4)):r.isMeshStandardMaterial?(i(e,r),d=e,f=r,d.metalness.value=f.metalness,f.metalnessMap&&(d.metalnessMap.value=f.metalnessMap,n(f.metalnessMap,d.metalnessMapTransform)),d.roughness.value=f.roughness,f.roughnessMap&&(d.roughnessMap.value=f.roughnessMap,n(f.roughnessMap,d.roughnessMapTransform)),f.envMap&&(d.envMapIntensity.value=f.envMapIntensity),r.isMeshPhysicalMaterial&&(p=e,m=r,g=o,p.ior.value=m.ior,m.sheen>0&&(p.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),p.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(p.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,p.sheenColorMapTransform)),m.sheenRoughnessMap&&(p.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,p.sheenRoughnessMapTransform))),m.clearcoat>0&&(p.clearcoat.value=m.clearcoat,p.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(p.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,p.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(p.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),1===m.side&&p.clearcoatNormalScale.value.negate())),m.dispersion>
3860&&(p.dispersion.value=m.dispersion),m.iridescence>0&&(p.iridescence.value=m.iridescence,p.iridescenceIOR.value=m.iridescenceIOR,p.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(p.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,p.iridescenceMapTransform)),m.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),m.transmission>0&&(p.transmission.value=m.transmission,p.transmissionSamplerMap.value=g.texture,p.transmissionSamplerSize.value.set(g.width,g.height),m.transmissionMap&&(p.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,p.transmissionMapTransform)),p.thickness.value=m.thickness,m.thicknessMap&&(p.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=m.attenuationDistance,p.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(p.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(p.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=m.specularIntensity,p.specularColor.value.copy(m.specularColor),m.specularColorMap&&(p.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,p.specularColorMapTransform)),m.specularIntensityMap&&(p.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,p.specularIntensityMapTransform)))):r.isMeshMatcapMaterial?(i(e,r),_=e,(v=r).matcap&&(_.matcap.value=v.matcap)):r.isMeshDepthMaterial?i(e,r):r.isMeshDistanceMaterial?(i(e,r),x=e,y=r,L=t.get(y).light,x.referencePosition.value.setFromMatrixPosition(L.matrixWorld),x.nearDistance.value=L.shadow.camera.near,x.farDistance.value=L.shadow.camera.far):r.isMeshNormalMaterial?i(e,r):r.isLineBasicMaterial?(M=e,S=r,M.diffuse.value.copy(S.color),M.opacity.value=S.opacity,S.map&&(M.map.value=S.map,n(S.map,M.mapTransform)),r.isLineDashedMaterial&&(E=e,T=r,E.dashSize.value=T.dashSize,E.totalSize.value=T.dashSize
386+T.gapSize,E.scale.value=T.scale)):r.isPointsMaterial?(b=e,w=r,A=a,R=s,b.diffuse.value.copy(w.color),b.opacity.value=w.opacity,b.size.value=w.size*A,b.scale.value=.5*R,w.map&&(b.map.value=w.map,n(w.map,b.uvTransform)),w.alphaMap&&(b.alphaMap.value=w.alphaMap,n(w.alphaMap,b.alphaMapTransform)),w.alphaTest>0&&(b.alphaTest.value=w.alphaTest)):r.isSpriteMaterial?(C=e,P=r,C.diffuse.value.copy(P.color),C.opacity.value=P.opacity,C.rotation.value=P.rotation,P.map&&(C.map.value=P.map,n(P.map,C.mapTransform)),P.alphaMap&&(C.alphaMap.value=P.alphaMap,n(P.alphaMap,C.alphaMapTransform)),P.alphaTest>0&&(C.alphaTest.value=P.alphaTest)):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function av(e,t,n,i){let r={},a={},s=[],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?g("WebGLRenderer: Texture samplers can not be part of an uniforms group."):g("WebGLRenderer: Unsupported uniform value type.",e),t}function c(t){let n=t.target;n.removeEventListener("dispose",c);let i=s.indexOf(n.__bindingPointIndex);s.splice(i,1),e.deleteBuffer(r[n.id]),delete r[n.id],delete a[n.id]}return{bind:function(e,t){let n=t.program;i.uniformBlockBinding(e,n)},update:function(n,u){var h;let d,f,p,m,g=r[n.id];void 0===g&&(function(e){let t=e.uniforms,n=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,t=i.length;e<t;e++){let t=i[e],r=Array.isArray(t.value)?t.value:[t.value];for(let e=0,i=r.length;e<i;e++){let i=l(r[e]),a=n%16,s=a%i.boundary,o=a+s;n+=s,0!==o&&16-o<i.storage&&(n+=16-o),t.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=i.storage}}}let i=n%16;i>0&&(n+=16-i),e.__size=n,e.__cache={}}(n),(h=n).__bindingPointIndex=d=function(){for(let e=0;e<o;e++)if(-1===s.indexOf(e))return s.push(e),e;return _("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}(),f=e.createBuffer(),p=h.__size,m=h.usage,e.bindBuffer(e.UNIFORM_BUFFER,f),e.bufferData(e.UNIFORM_BUFFER,p,m),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,d,f),g=f,r[n.id]=g,n.addEventListener("dispose",c));let v=u.program;i.updateUBOMapping(n,v);let x=t.render.frame;a[n.id]!==x&&(function(t){let n=r[t.id],i=t.uniforms,a=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=i.length;t<n;t++){let n=Array.isArray(i[t])?i[t]:[i[t]];for(let i=0,r=n.length;i<r;i++){let r=n[i];if(!0===function(e,t,n,i){let r=e.value,a=t+"_"+n;if(void 0===i[a])return"number"==typeof r||"boolean"==typeof r?i[a]=r:i[a]=r.clone(),!0;{let e=i[a];if("number"==typeof r||"boolean"==typeof r){if(e!==r)return i[a]=r,!0}else if(!1===e.equals(r))return e.copy(r),!0}return!1}(r,t,i,a)){let t=r.__offset,n=Array.isArray(r.value)?r.value:[r.value],i=0;for(let a=0;a<n.length;a++){let s=n[a],o=l(s);"number"==typeof s||"boolean"==typeof s?(r.__data[0]=s,e.bufferSubData(e.UNIFORM_BUFFER,t+i,r.__data)):s.isMatrix3?(r.__data[0]=s.elements[0],r.__data[1]=s.elements[1],r.__data[2]=s.elements[2],r.__data[3]=0,r.__data[4]=s.elements[3],r.__data[5]=s.elements[4],r.__data[6]=s.elements[5],r.__data[7]=0,r.__data[8]=s.elements[6],r.__data[9]=s.elements[7],r.__data[10]=s.elements[8],r.__data[11]=0):(s.toArray(r.__data,i),i+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,r.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),a[n.id]=x)},dispose:function(){for(let t in r)e.deleteBuffer(r[t]);s=[],r={},a={}}}}let ax=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10
386751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),ay=null;class aM{constructor(e={}){let t,n,i,r,a,l,c,u,h,d,p,y,M,S,E,T,b,w,A,R,C,L,D,N,I;const{canvas:U=f(),context:O=null,depth:B=!0,stencil:z=!1,alpha:V=!1,antialias:k=!1,premultipliedAlpha:G=!0,preserveDrawingBuffer:H=!1,powerPreference:W="default",failIfMajorPerformanceCaveat:X=!1,reversedDepthBuffer:j=!1,outputBufferType:Y=1009}=e;if(this.isWebGLRenderer=!0,null!==O){if("undefined"!=typeof WebGLRenderingContext&&O instanceof WebGLRenderingContext)throw Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");t=O.getContextAttributes().alpha}else t=V;const Z=new Set([1033,1031,1029]),J=new Set([1009,1014,1012,1020,1017,1018]),$=new Uint32Array(4),Q=new Int32Array(4);let ee=null,et=null;const en=[],ei=[];let er=null;this.domElement=U,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=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const ea=this;let es=!1;this._outputColorSpace=s;let eo=0,el=0,ec=null,eu=-1,eh=null;const ed=new q,ef=new q;let ep=null;const em=new to(0);let eg=0,e_=U.width,ev=U.height,ex=1,ey=null,eM=null;const eS=new q(0,0,e_,ev),eE=new q(0,0,e_,ev);let eT=!1;const ew=new nn;let eA=!1,eR=!1;const eC=new eb,eP=new P,eL=new q,eD={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let eN=!1;function eI(){return null===ec?ex:1}let eU=O;function eO(e,t){return U.getContext(e,t)}try{if("setAttribute"in U&&U.setAttribute("data-engine","three.js r182"),U.addEventListener("webglcontextlost",ez,!1),U.addEventListener("webglcontextrestored",eV,!1),U.addEventListener("webglcontextcreationerror",ek,!1),null===eU){const e="webgl2";if(eU=eO(e,{alpha:!0,depth:B,stencil:z,antialias:k,premultipliedAlpha:G,preserveDrawingBuffer:H,powerPreference:W,failIfMajorPerformanceCaveat:X}),null===eU)if(eO(e))throw Error("Error creating WebGL context with your selected attributes.");else throw Error("Error creating WebGL context.")}}catch(e){throw _("WebGLRenderer: "+e.message),e}function eF(){(n=new iw(eU)).init(),D=new au(eU,n),i=new io(eU,n,e,D),r=new al(eU,n),i.reversedDepthBuffer&&j&&r.buffers.depth.setReversed(!0),a=new iC(eU),l=new r0,c=new ac(eU,n,r,l,i,D,a),u=new ic(ea),h=new ib(ea),d=new n6(eU),N=new ia(eU,d),p=new iA(eU,d,a,N),y=new iL(eU,p,d,a),R=new iP(eU,i,c),b=new il(l),M=new rQ(ea,u,h,n,i,N,b),S=new a_(ea,l),E=new r4,T=new ae(n),A=new ir(ea,u,h,r,y,t,G),w=new as(ea,y,i),I=new av(eU,a,i,r),C=new is(eU,n,a),L=new iR(eU,n,a),a.programs=M.programs,ea.capabilities=i,ea.extensions=n,ea.properties=l,ea.renderLists=E,ea.shadowMap=w,ea.state=r,ea.info=a}eF(),1009!==Y&&(er=new iN(Y,U.width,U.height,B,z));const eB=new ap(ea,eU);function ez(e){e.preventDefault(),m("WebGLRenderer: Context Lost."),es=!0}function eV(){m("WebGLRenderer: Context Restored."),es=!1;let e=a.autoReset,t=w.enabled,n=w.autoUpdate,i=w.needsUpdate,r=w.type;eF(),a.autoReset=e,w.enabled=t,w.autoUpdate=n,w.needsUpdate=i,w.type=r}function ek(e){_("WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function eG(e){var t,n;let i,r=e.target;r.removeEventListener("dispose",eG),n=t=r,void 0!==(i=l.get(n).programs)&&(i.forEach(function(e){M.releaseProgram(e)}),n.isShaderMaterial&&M.releaseShaderCache(n)),l.remove(t)}function eH(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,eQ(e,t,n),e.side=0,e.needsUpdate=!0,eQ(e,t,n),e.side=2):eQ(e,t,n)}this.xr=eB,this.getContext=function(){return eU},this.getContextAttributes=function(){return eU.getContextAttributes()},this.forceContextLoss=function(){let e=n.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){let e=n.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return ex},this.setPixelRatio=function(e){void 0!==e&&(ex=e,this.setSize(e_,ev,!1))}
386,this.getSize=function(e){return e.set(e_,ev)},this.setSize=function(e,t,n=!0){eB.isPresenting?g("WebGLRenderer: Can't change size while VR device is presenting."):(e_=e,ev=t,U.width=Math.floor(e*ex),U.height=Math.floor(t*ex),!0===n&&(U.style.width=e+"px",U.style.height=t+"px"),null!==er&&er.setSize(U.width,U.height),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return e.set(e_*ex,ev*ex).floor()},this.setDrawingBufferSize=function(e,t,n){e_=e,ev=t,ex=n,U.width=Math.floor(e*n),U.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.setEffects=function(e){if(1009===Y)return void console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");if(e){for(let t=0;t<e.length;t++)if(!0===e[t].isOutputPass){console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}er.setEffects(e||[])},this.getCurrentViewport=function(e){return e.copy(ed)},this.getViewport=function(e){return e.copy(eS)},this.setViewport=function(e,t,n,i){e.isVector4?eS.set(e.x,e.y,e.z,e.w):eS.set(e,t,n,i),r.viewport(ed.copy(eS).multiplyScalar(ex).round())},this.getScissor=function(e){return e.copy(eE)},this.setScissor=function(e,t,n,i){e.isVector4?eE.set(e.x,e.y,e.z,e.w):eE.set(e,t,n,i),r.scissor(ef.copy(eE).multiplyScalar(ex).round())},this.getScissorTest=function(){return eT},this.setScissorTest=function(e){r.setScissorTest(eT=e)},this.setOpaqueSort=function(e){ey=e},this.setTransparentSort=function(e){eM=e},this.getClearColor=function(e){return e.copy(A.getClearColor())},this.setClearColor=function(){A.setClearColor(...arguments)},this.getClearAlpha=function(){return A.getClearAlpha()},this.setClearAlpha=function(){A.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let i=0;if(e){let e=!1;if(null!==ec){let t=ec.texture.format;e=Z.has(t)}if(e){let e=ec.texture.type,t=J.has(e),n=A.getClearColor(),i=A.getClearAlpha(),r=n.r,a=n.g,s=n.b;t?($[0]=r,$[1]=a,$[2]=s,$[3]=i,eU.clearBufferuiv(eU.COLOR,0,$)):(Q[0]=r,Q[1]=a,Q[2]=s,Q[3]=i,eU.clearBufferiv(eU.COLOR,0,Q))}else i|=eU.COLOR_BUFFER_BIT}t&&(i|=eU.DEPTH_BUFFER_BIT),n&&(i|=eU.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(0xffffffff)),eU.clear(i)},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(){U.removeEventListener("webglcontextlost",ez,!1),U.removeEventListener("webglcontextrestored",eV,!1),U.removeEventListener("webglcontextcreationerror",ek,!1),A.dispose(),E.dispose(),T.dispose(),l.dispose(),u.dispose(),h.dispose(),y.dispose(),N.dispose(),I.dispose(),M.dispose(),eB.dispose(),eB.removeEventListener("sessionstart",eX),eB.removeEventListener("sessionend",ej),eq.stop()},this.renderBufferDirect=function(e,t,a,s,f,m){let g;null===t&&(t=eD);let _=f.isMesh&&0>f.matrixWorld.determinant(),x=function(e,t,n,a,s){var d,f;!0!==t.isScene&&(t=eD),c.resetTextureUnits();let p=t.fog,m=a.isMeshStandardMaterial?t.environment:null,g=null===ec?ea.outputColorSpace:!0===ec.isXRRenderTarget?ec.texture.colorSpace:o,_=(a.isMeshStandardMaterial?h:u).get(a.envMap||m),v=!0===a.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,x=!!n.attributes.tangent&&(!!a.normalMap||a.anisotropy>0),y=!!n.morphAttributes.position,M=!!n.morphAttributes.normal,E=!!n.morphAttributes.color,T=0;a.toneMapped&&(null===ec||!0===ec.isXRRenderTarget)&&(T=ea.toneMapping);let w=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,A=void 0!==w?w.length:0,C=l.get(a),P=et.state.lights;if(!0===eA&&(!0===eR||e!==eh)){let t=e===eh&&a.id===eu;b.setState(a,e,t)}let L=!1;a.version===C.__version?C.needsLights&&C.lightsStateVersion!==P.state.version||C.outputColorSpace!==g||s.isBatchedMesh&&!1===C.batching?L=!0:s.isBatchedMesh||!0!==C.batching?s.isBatchedMesh&&!0===C.batchingColor&&null===s.colorTexture||s.isBatchedMesh&&!1===C.batchingColor&&null!==s.colorTexture||s.isInstancedMesh&&!1===C.instancing?L=!0:s.isInstancedMesh||!0!==C.instancing?s.isSkinnedMesh&&
386!1===C.skinning?L=!0:s.isSkinnedMesh||!0!==C.skinning?s.isInstancedMesh&&!0===C.instancingColor&&null===s.instanceColor||s.isInstancedMesh&&!1===C.instancingColor&&null!==s.instanceColor||s.isInstancedMesh&&!0===C.instancingMorph&&null===s.morphTexture||s.isInstancedMesh&&!1===C.instancingMorph&&null!==s.morphTexture||C.envMap!==_||!0===a.fog&&C.fog!==p||void 0!==C.numClippingPlanes&&(C.numClippingPlanes!==b.numPlanes||C.numIntersection!==b.numIntersection)||C.vertexAlphas!==v||C.vertexTangents!==x||C.morphTargets!==y||C.morphNormals!==M||C.morphColors!==E||C.toneMapping!==T?L=!0:C.morphTargetsCount!==A&&(L=!0):L=!0:L=!0:L=!0:(L=!0,C.__version=a.version);let D=C.currentProgram;!0===L&&(D=eQ(a,t,s));let N=!1,U=!1,O=!1,F=D.getUniforms(),B=C.uniforms;if(r.useProgram(D.program)&&(N=!0,U=!0,O=!0),a.id!==eu&&(eu=a.id,U=!0),N||eh!==e){r.buffers.depth.getReversed()&&!0!==e.reversedDepth&&(e._reversedDepth=!0,e.updateProjectionMatrix()),F.setValue(eU,"projectionMatrix",e.projectionMatrix),F.setValue(eU,"viewMatrix",e.matrixWorldInverse);let t=F.map.cameraPosition;void 0!==t&&t.setValue(eU,eP.setFromMatrixPosition(e.matrixWorld)),i.logarithmicDepthBuffer&&F.setValue(eU,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(a.isMeshPhongMaterial||a.isMeshToonMaterial||a.isMeshLambertMaterial||a.isMeshBasicMaterial||a.isMeshStandardMaterial||a.isShaderMaterial)&&F.setValue(eU,"isOrthographic",!0===e.isOrthographicCamera),eh!==e&&(eh=e,U=!0,O=!0)}if(C.needsLights&&(P.state.directionalShadowMap.length>0&&F.setValue(eU,"directionalShadowMap",P.state.directionalShadowMap,c),P.state.spotShadowMap.length>
3860&&F.setValue(eU,"spotShadowMap",P.state.spotShadowMap,c),P.state.pointShadowMap.length>0&&F.setValue(eU,"pointShadowMap",P.state.pointShadowMap,c)),s.isSkinnedMesh){F.setOptional(eU,s,"bindMatrix"),F.setOptional(eU,s,"bindMatrixInverse");let e=s.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),F.setValue(eU,"boneTexture",e.boneTexture,c))}s.isBatchedMesh&&(F.setOptional(eU,s,"batchingTexture"),F.setValue(eU,"batchingTexture",s._matricesTexture,c),F.setOptional(eU,s,"batchingIdTexture"),F.setValue(eU,"batchingIdTexture",s._indirectTexture,c),F.setOptional(eU,s,"batchingColorTexture"),null!==s._colorsTexture&&F.setValue(eU,"batchingColorTexture",s._colorsTexture,c));let z=n.morphAttributes;if((void 0!==z.position||void 0!==z.normal||void 0!==z.color)&&R.update(s,n,D),(U||C.receiveShadow!==s.receiveShadow)&&(C.receiveShadow=s.receiveShadow,F.setValue(eU,"receiveShadow",s.receiveShadow)),a.isMeshGouraudMaterial&&null!==a.envMap&&(B.envMap.value=_,B.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1),a.isMeshStandardMaterial&&null===a.envMap&&null!==t.environment&&(B.envMapIntensity.value=t.environmentIntensity),void 0!==B.dfgLUT&&(B.dfgLUT.value=(null===ay&&((ay=new t4(ax,16,16,1030,1016)).name="DFG_LUT",ay.minFilter=1006,ay.magFilter=1006,ay.wrapS=1001,ay.wrapT=1001,ay.generateMipmaps=!1,ay.needsUpdate=!0),ay)),U&&(F.setValue(eU,"toneMappingExposure",ea.toneMappingExposure),C.needsLights&&(d=B,f=O,d.ambientLightColor.needsUpdate=f,d.lightProbe.needsUpdate=f,d.directionalLights.needsUpdate=f,d.directionalLightShadows.needsUpdate=f,d.pointLights.needsUpdate=f,d.pointLightShadows.needsUpdate=f,d.spotLights.needsUpdate=f,d.spotLightShadows.needsUpdate=f,d.rectAreaLights.needsUpdate=f,d.hemisphereLights.needsUpdate=f),p&&!0===a.fog&&S.refreshFogUniforms(B,p),S.refreshMaterialUniforms(B,a,ex,ev,et.state.transmissionRenderTarget[e.id]),rA.upload(eU,e0(C),B,c)),a.isShaderMaterial&&!0===a.uniformsNeedUpdate&&(rA.upload(eU,e0(C),B,c),a.uniformsNeedUpdate=!1),a.isSpriteMaterial&&F.setValue(eU,"center",s.center),F.setValue(eU,"modelViewMatrix",s.modelViewMatrix),F.setValue(eU,"normalMatrix",s.normalMatrix),F.setValue(eU,"modelMatrix",s.matrixWorld),a.isShaderMaterial||a.isRawShaderMaterial){let e=a.uniformsGroups;for(let t=0,n=e.length;t<n;t++){let n=e[t];I.update(n,D),I.bind(n,D)}}return D}(e,t,a,s,f);r.setMaterial(s,_);let y=a.index,M=1;if(!0===s.wireframe){if(void 0===(y=p.getWireframeAttribute(a)))return;M=2}let E=a.drawRange,T=a.attributes.position,w=E.start*M,A=(E.start+E.count)*M;null!==m&&(w=Math.max(w,m.start*M),A=Math.min(A,(m.start+m.count)*M)),null!==y?(w=Math.max(w,0),A=Math.min(A,y.count)):null!=T&&(w=Math.max(w,0),A=Math.min(A,T.count));let P=A-w;if(P<0||P===1/0)return;N.setup(f,s,x,a,y);let D=C;if(null!==y&&(g=d.get(y),(D=L).setIndex(g)),f.isMesh)!0===s.wireframe?(r.setLineWidth(s.wireframeLinewidth*eI()),D.setMode(eU.LINES)):D.setMode(eU.TRIANGLES);else if(f.isLine){let e=s.linewidth;void 0===e&&(e=1),r.setLineWidth(e*eI()),f.isLineSegments?D.setMode(eU.LINES):f.isLineLoop?D.setMode(eU.LINE_LOOP):D.setMode(eU.LINE_STRIP)}else f.isPoints?D.setMode(eU.POINTS):f.isSprite&&D.setMode(eU.TRIANGLES);if(f.isBatchedMesh)if(null!==f._multiDrawInstances)v("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),D.renderMultiDrawInstances(f._multiDrawStarts,f._multiDrawCounts,f._multiDrawCount,f._multiDrawInstances);else if(n.get("WEBGL_multi_draw"))D.renderMultiDraw(f._multiDrawStarts,f._multiDrawCounts,f._multiDrawCount);else{let e=f._multiDrawStarts,t=f._multiDrawCounts,n=f._multiDrawCount,i=y?d.get(y).bytesPerElement:1,r=l.get(s).currentProgram.getUniforms();for(let a=0;a<n;a++)r.setValue(eU,"_gl_DrawID",a),D.render(e[a]/i,t[a])}else if(f.isInstancedMesh)D.renderInstances(w,P,f.count);else if(a.isInstancedBufferGeometry){let e=void 0!==a._maxInstanceCount?a._maxInstanceCount:1/0,t=Math.min(a.instanceCount,e);D.renderInstances(w,P,t)}else D.render(w,P)},this.compile=function(e,t,n=null){null===n&&(n=e),(et=T.get(n)).init(t),ei.push(et),n.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(et.pushLight(e),e.castShadow&&et.pushShadow(e))}),e!==n&&e.traverseVisible(function(e){e.isLight&&e.layers.test(t.layers)&&(et.pushLight(e),e.castShadow&&et.pushShadow(e))}),et.setupLights();let i=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 a=t[r];eH(a,n,e),i.add(a)}else eH(t,n,e),i.add(t)}),et=ei.pop(),i},this.compileAsync=function(e,t,i=null){let r=this.compile(e,t,i);return new Promise(t=>{function i(){(r.forEach(function(e){l.get(e).currentProgram.isReady()&&r.delete(e)}),0===r.size)?t(e):setTimeout(i,10)}null!==n.get("KHR_parallel_shader_compile")?i():setTimeout(i,10)})};let eW=null;function eX(){eq.stop()}function ej(){eq.start()}const eq=new n5;function eY(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)et.pushLight(e),e.castShadow&&et.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||ew.intersectsSprite(e)){i&&eL.setFromMatrixPosition(e.matrixWorld).applyMatrix4(eC);let t=y.update(e),r=e.material;r.visible&&ee.push(e,t,r,n,eL.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||ew.intersectsObject(e))){let t=y.update(e),r=e.material;if(i&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),eL.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),eL.copy(t.boundingSphere.center)),eL.applyMatrix4(e.matrixWorld).applyMatrix4(eC)),Array.isArray(r)){let i=t.groups;for(let a=0,s=i.length;a<s;a++){let s=i[a],o=r[s.materialIndex];o&&o.visible&&ee.push(e,t,o,n,eL.z,s)}}else r.visible&&ee.push(e,t,r,n,eL.z,null)}}let r=e.children;for(let e=0,a=r.length;e<a;e++)eY(r[e],t,n,i)}function eK(e,t,n,i){let{opaque:a,transmissive:s,transparent:o}=e;et.setupLightsView(n),!0===eA&&b.setGlobalState(ea.clippingPlanes,n),i&&r.viewport(ed.copy(i)),a.length>0&&eJ(a,t,n),s.length>0&&eJ(s,t,n),o.length>0&&eJ(o,t,n),r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),r.setPolygonOffset(!1)}function eZ(e,t,r,a){if(null!==(!0===r.isScene?r.overrideMaterial:null))return;if(void 0===et.state.transmissionRenderTarget[a.id]){let e=n.has("EXT_color_buffer_half_float")||n.has("EXT_color_buffer_float");et.state.transmissionRenderTarget[a.id]=new K(1,1,{generateMipmaps:!0,type:e?1016:1009,minFilter:1008,samples:i.samples,stencilBuffer:z,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:F.workingColorSpace})}let s=et.state.transmissionRenderTarget[a.id],o=a.viewport||ed;s.setSize(o.z*ea.transmissionResolutionScale,o.w*ea.transmissionResolutionScale);let l=ea.getRenderTarget(),u=ea.getActiveCubeFace(),h=ea.getActiveMipmapLevel();ea.setRenderTarget(s),ea.getClearColor(em),(eg=ea.getClearAlpha())<1&&ea.setClearColor(0xffffff,.5),ea.clear(),eN&&A.render(r);let d=ea.toneMapping;ea.toneMapping=0;let f=a.viewport;if(void 0!==a.viewport&&(a.viewport=void 0),et.setupLightsView(a),!0===eA&&b.setGlobalState(ea.clippingPlanes,a),eJ(e,r,a),c.updateMultisampleRenderTarget(s),c.updateRenderTargetMipmap(s),!1===n.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let n=0,i=t.length;n<i;n++){let{object:i,geometry:s,material:o,group:l}=t[n];
386if(2===o.side&&i.layers.test(a.layers)){let t=o.side;o.side=1,o.needsUpdate=!0,e$(i,r,a,s,o,l),o.side=t,o.needsUpdate=!0,e=!0}}!0===e&&(c.updateMultisampleRenderTarget(s),c.updateRenderTargetMipmap(s))}ea.setRenderTarget(l,u,h),ea.setClearColor(em,eg),void 0!==f&&(a.viewport=f),ea.toneMapping=d}function eJ(e,t,n){let i=!0===t.isScene?t.overrideMaterial:null;for(let r=0,a=e.length;r<a;r++){let a=e[r],{object:s,geometry:o,group:l}=a,c=a.material;!0===c.allowOverride&&null!==i&&(c=i),s.layers.test(n.layers)&&e$(s,t,n,o,c,l)}}function e$(e,t,n,i,r,a){e.onBeforeRender(ea,t,n,i,r,a),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),r.onBeforeRender(ea,t,n,i,e,a),!0===r.transparent&&2===r.side&&!1===r.forceSinglePass?(r.side=1,r.needsUpdate=!0,ea.renderBufferDirect(n,t,i,r,e,a),r.side=0,r.needsUpdate=!0,ea.renderBufferDirect(n,t,i,r,e,a),r.side=2):ea.renderBufferDirect(n,t,i,r,e,a),e.onAfterRender(ea,t,n,i,r,a)}function eQ(e,t,n){var i;!0!==t.isScene&&(t=eD);let r=l.get(e),a=et.state.lights,s=et.state.shadowsArray,o=a.state.version,c=M.getParameters(e,a.state,s,t,n),d=M.getProgramCacheKey(c),f=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?h:u).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===f&&(e.addEventListener("dispose",eG),r.programs=f=new Map);let p=f.get(d);if(void 0!==p){if(r.currentProgram===p&&r.lightsStateVersion===o)return e1(e,c),p}else c.uniforms=M.getUniforms(e),e.onBeforeCompile(c,ea),p=M.acquireProgram(c,d),f.set(d,p),r.uniforms=c.uniforms;let m=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(m.clippingPlanes=b.uniform),e1(e,c),r.needsLights=(i=e).isMeshLambertMaterial||i.isMeshToonMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isShadowMaterial||i.isShaderMaterial&&!0===i.lights,r.lightsStateVersion=o,r.needsLights&&(m.ambientLightColor.value=a.state.ambient,m.lightProbe.value=a.state.probe,m.directionalLights.value=a.state.directional,m.directionalLightShadows.value=a.state.directionalShadow,m.spotLights.value=a.state.spot,m.spotLightShadows.value=a.state.spotShadow,m.rectAreaLights.value=a.state.rectArea,m.ltc_1.value=a.state.rectAreaLTC1,m.ltc_2.value=a.state.rectAreaLTC2,m.pointLights.value=a.state.point,m.pointLightShadows.value=a.state.pointShadow,m.hemisphereLights.value=a.state.hemi,m.directionalShadowMap.value=a.state.directionalShadowMap,m.directionalShadowMatrix.value=a.state.directionalShadowMatrix,m.spotShadowMap.value=a.state.spotShadowMap,m.spotLightMatrix.value=a.state.spotLightMatrix,m.spotLightMap.value=a.state.spotLightMap,m.pointShadowMap.value=a.state.pointShadowMap,m.pointShadowMatrix.value=a.state.pointShadowMatrix),r.currentProgram=p,r.uniformsList=null,p}function e0(e){if(null===e.uniformsList){let t=e.currentProgram.getUniforms();e.uniformsList=rA.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function e1(e,t){let n=l.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}eq.setAnimationLoop(function(e){eW&&eW(e)}),"undefined"!=typeof self&&eq.setContext(self),this.setAnimationLoop=function(e){eW=e,eB.setAnimationLoop(e),null===e?eq.stop():eq.start()},eB.addEventListener("sessionstart",eX),eB.addEventListener("sessionend",ej),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void _("WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===es)return;let n=!0===eB.enabled&&!0===eB.isPresenting,i=null!==er&&(null===ec||n)&&er.begin(ea,ec);if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===eB.enabled&&!0===eB.isPresenting&&(null===er||!1===er.isCompositing(
386))&&(!0===eB.cameraAutoUpdate&&eB.updateCamera(t),t=eB.getCamera()),!0===e.isScene&&e.onBeforeRender(ea,e,t,ec),(et=T.get(e,ei.length)).init(t),ei.push(et),eC.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ew.setFromProjectionMatrix(eC,2e3,t.reversedDepth),eR=this.localClippingEnabled,eA=b.init(this.clippingPlanes,eR),(ee=E.get(e,en.length)).init(),en.push(ee),!0===eB.enabled&&!0===eB.isPresenting){let e=ea.xr.getDepthSensingMesh();null!==e&&eY(e,t,-1/0,ea.sortObjects)}eY(e,t,0,ea.sortObjects),ee.finish(),!0===ea.sortObjects&&ee.sort(ey,eM),(eN=!1===eB.enabled||!1===eB.isPresenting||!1===eB.hasDepthSensing())&&A.addToRenderList(ee,e),this.info.render.frame++,!0===eA&&b.beginShadows();let r=et.state.shadowsArray;if(w.render(r,e,t),!0===eA&&b.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1===(i&&er.hasRenderPass())){let n=ee.opaque,i=ee.transmissive;if(et.setupLights(),t.isArrayCamera){let r=t.cameras;if(i.length>0)for(let t=0,a=r.length;t<a;t++)eZ(n,i,e,r[t]);eN&&A.render(e);for(let t=0,n=r.length;t<n;t++){let n=r[t];eK(ee,e,n,n.viewport)}}else i.length>0&&eZ(n,i,e,t),eN&&A.render(e),eK(ee,e,t)}null!==ec&&0===el&&(c.updateMultisampleRenderTarget(ec),c.updateRenderTargetMipmap(ec)),i&&er.end(ea),!0===e.isScene&&e.onAfterRender(ea,e,t),N.resetDefaultState(),eu=-1,eh=null,ei.pop(),ei.length>0?(et=ei[ei.length-1],!0===eA&&b.setGlobalState(ea.clippingPlanes,et.state.camera)):et=null,en.pop(),ee=en.length>0?en[en.length-1]:null},this.getActiveCubeFace=function(){return eo},this.getActiveMipmapLevel=function(){return el},this.getRenderTarget=function(){return ec},this.setRenderTargetTextures=function(e,t,n){let i=l.get(e);i.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===i.__autoAllocateDepthBuffer&&(i.__useRenderToTexture=!1),l.get(e.texture).__webglTexture=t,l.get(e.depthTexture).__webglTexture=i.__autoAllocateDepthBuffer?void 0:n,i.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){let n=l.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};const e3=eU.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){ec=e,eo=t,el=n;let i=null,a=!1,s=!1;if(e){let o=l.get(e);if(void 0!==o.__useDefaultFramebuffer){r.bindFramebuffer(eU.FRAMEBUFFER,o.__webglFramebuffer),ed.copy(e.viewport),ef.copy(e.scissor),ep=e.scissorTest,r.viewport(ed),r.scissor(ef),r.setScissorTest(ep),eu=-1;return}if(void 0===o.__webglFramebuffer)c.setupRenderTarget(e);else if(o.__hasExternalTextures)c.rebindTextures(e,l.get(e.texture).__webglTexture,l.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){let t=e.depthTexture;if(o.__boundDepthTexture!==t){if(null!==t&&l.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)&&(s=!0);let h=l.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(h[t])?h[t][n]:h[t],a=!0):i=e.samples>0&&!1===c.useMultisampledRTT(e)?l.get(e).__webglMultisampledFramebuffer:Array.isArray(h)?h[n]:h,ed.copy(e.viewport),ef.copy(e.scissor),ep=e.scissorTest}else ed.copy(eS).multiplyScalar(ex).floor(),ef.copy(eE).multiplyScalar(ex).floor(),ep=eT;if(0!==n&&(i=e3),r.bindFramebuffer(eU.FRAMEBUFFER,i)&&r.drawBuffers(e,i),r.viewport(ed),r.scissor(ef),r.setScissorTest(ep),a){let i=l.get(e.texture);eU.framebufferTexture2D(eU.FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_CUBE_MAP_POSITIVE_X+t,i.__webglTexture,n)}else if(s)for(let i=0;i<e.textures.length;i++){let r=l.get(e.textures[i]);eU.framebufferTextureLayer(eU.FRAMEBUFFER,eU.COLOR_ATTACHMENT0+i,r.__webglTexture,n,t)}else if(null!==e&&0!==n){let t=l.get(e.texture);eU.framebufferTexture2D(eU.FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_2D,t.__webglTexture,n)}eu=-1},this.readRenderTargetPixels=function(e,t,n,a,s,o,c,u=0){if(!(e&&e.isWebGLRenderTarget))return void _("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=l.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==c&&(h=h[c]),h){r.bindFramebuffer(eU.FRAMEBUFFER,h);try{let r=e.textures[u],l=r.format,c=r.type;if(!i.textureFormatReadable(l))return void _("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(c))return void _("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-a&&n>=0&&n<=e.height-s&&(e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+u),eU.readPixels(t,n,a,s,D.convert(l),D.convert(c),o))}finally{let e=null!==ec?l.get(ec).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,a,s,o,c,u=0){if(!(e&&e.isWebGLRenderTarget))throw Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let h=l.get(e).__webglFramebuffer;
386if(e.isWebGLCubeRenderTarget&&void 0!==c&&(h=h[c]),h)if(t>=0&&t<=e.width-a&&n>=0&&n<=e.height-s){r.bindFramebuffer(eU.FRAMEBUFFER,h);let c=e.textures[u],d=c.format,f=c.type;if(!i.textureFormatReadable(d))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!i.textureTypeReadable(f))throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");let p=eU.createBuffer();eU.bindBuffer(eU.PIXEL_PACK_BUFFER,p),eU.bufferData(eU.PIXEL_PACK_BUFFER,o.byteLength,eU.STREAM_READ),e.textures.length>1&&eU.readBuffer(eU.COLOR_ATTACHMENT0+u),eU.readPixels(t,n,a,s,D.convert(d),D.convert(f),0);let m=null!==ec?l.get(ec).__webglFramebuffer:null;r.bindFramebuffer(eU.FRAMEBUFFER,m);let g=eU.fenceSync(eU.SYNC_GPU_COMMANDS_COMPLETE,0);return eU.flush(),await x(eU,g,4),eU.bindBuffer(eU.PIXEL_PACK_BUFFER,p),eU.getBufferSubData(eU.PIXEL_PACK_BUFFER,0,o),eU.deleteBuffer(p),eU.deleteSync(g),o}else throw Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(e,t=null,n=0){let i=Math.pow(2,-n),a=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),o=null!==t?t.x:0,l=null!==t?t.y:0;c.setTexture2D(e,0),eU.copyTexSubImage2D(eU.TEXTURE_2D,n,0,0,o,l,a,s),r.unbindTexture()};const e2=eU.createFramebuffer(),e4=eU.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,i=null,a=0,s=null){let o,u,h,d,f,p,m,g,_,x;null===s&&(0!==a?(v("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),s=a,a=0):s=0);let y=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==n)o=n.max.x-n.min.x,u=n.max.y-n.min.y,h=n.isBox3?n.max.z-n.min.z:1,d=n.min.x,f=n.min.y,p=n.isBox3?n.min.z:0;else{let t=Math.pow(2,-a);o=Math.floor(y.width*t),u=Math.floor(y.height*t),h=e.isDataArrayTexture?y.depth:e.isData3DTexture?Math.floor(y.depth*t):1,d=0,f=0,p=0}null!==i?(m=i.x,g=i.y,_=i.z):(m=0,g=0,_=0);let M=D.convert(t.format),S=D.convert(t.type);t.isData3DTexture?(c.setTexture3D(t,0),x=eU.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(c.setTexture2DArray(t,0),x=eU.TEXTURE_2D_ARRAY):(c.setTexture2D(t,0),x=eU.TEXTURE_2D),eU.pixelStorei(eU.UNPACK_FLIP_Y_WEBGL,t.flipY),eU.pixelStorei(eU.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),eU.pixelStorei(eU.UNPACK_ALIGNMENT,t.unpackAlignment);let E=eU.getParameter(eU.UNPACK_ROW_LENGTH),T=eU.getParameter(eU.UNPACK_IMAGE_HEIGHT),b=eU.getParameter(eU.UNPACK_SKIP_PIXELS),w=eU.getParameter(eU.UNPACK_SKIP_ROWS),A=eU.getParameter(eU.UNPACK_SKIP_IMAGES);eU.pixelStorei(eU.UNPACK_ROW_LENGTH,y.width),eU.pixelStorei(eU.UNPACK_IMAGE_HEIGHT,y.height),eU.pixelStorei(eU.UNPACK_SKIP_PIXELS,d),eU.pixelStorei(eU.UNPACK_SKIP_ROWS,f),eU.pixelStorei(eU.UNPACK_SKIP_IMAGES,p);let R=e.isDataArrayTexture||e.isData3DTexture,C=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=l.get(e),i=l.get(t),c=l.get(n.__renderTarget),v=l.get(i.__renderTarget);r.bindFramebuffer(eU.READ_FRAMEBUFFER,c.__webglFramebuffer),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,v.__webglFramebuffer);for(let n=0;n<h;n++)R&&(eU.framebufferTextureLayer(eU.READ_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,l.get(e).__webglTexture,a,p+n),eU.framebufferTextureLayer(eU.DRAW_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,l.get(t).__webglTexture,s,_+n)),eU.blitFramebuffer(d,f,o,u,m,g,o,u,eU.DEPTH_BUFFER_BIT,eU.NEAREST);r.bindFramebuffer(eU.READ_FRAMEBUFFER,null),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,null)}else if(0!==a||e.isRenderTargetTexture||l.has(e)){let n=l.get(e),i=l.get(t);r.bindFramebuffer(eU.READ_FRAMEBUFFER,e2),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,e4);for(let e=0;e<h;e++)R?eU.framebufferTextureLayer(eU.READ_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,n.__webglTexture,a,p+e):eU.framebufferTexture2D(eU.READ_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_2D,n.__webglTexture,a),C?eU.framebufferTextureLayer(eU.DRAW_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,i.__webglTexture,s,_+e):eU.framebufferTexture2D(eU.DRAW_FRAMEBUFFER,eU.COLOR_ATTACHMENT0,eU.TEXTURE_2D,i.__webglTexture,s),0!==a?eU.blitFramebuffer(d,f,o,u,m,g,o,u,eU.
386COLOR_BUFFER_BIT,eU.NEAREST):C?eU.copyTexSubImage3D(x,s,m,g,_+e,d,f,o,u):eU.copyTexSubImage2D(x,s,m,g,d,f,o,u);r.bindFramebuffer(eU.READ_FRAMEBUFFER,null),r.bindFramebuffer(eU.DRAW_FRAMEBUFFER,null)}else C?e.isDataTexture||e.isData3DTexture?eU.texSubImage3D(x,s,m,g,_,o,u,h,M,S,y.data):t.isCompressedArrayTexture?eU.compressedTexSubImage3D(x,s,m,g,_,o,u,h,M,y.data):eU.texSubImage3D(x,s,m,g,_,o,u,h,M,S,y):e.isDataTexture?eU.texSubImage2D(eU.TEXTURE_2D,s,m,g,o,u,M,S,y.data):e.isCompressedTexture?eU.compressedTexSubImage2D(eU.TEXTURE_2D,s,m,g,y.width,y.height,M,y.data):eU.texSubImage2D(eU.TEXTURE_2D,s,m,g,o,u,M,S,y);eU.pixelStorei(eU.UNPACK_ROW_LENGTH,E),eU.pixelStorei(eU.UNPACK_IMAGE_HEIGHT,T),eU.pixelStorei(eU.UNPACK_SKIP_PIXELS,b),eU.pixelStorei(eU.UNPACK_SKIP_ROWS,w),eU.pixelStorei(eU.UNPACK_SKIP_IMAGES,A),0===s&&t.generateMipmaps&&eU.generateMipmap(x),r.unbindTexture()},this.initRenderTarget=function(e){void 0===l.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),r.unbindTexture()},this.resetState=function(){eo=0,el=0,ec=null,r.reset(),N.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return 2e3}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=F._getDrawingBufferColorSpace(e),t.unpackColorSpace=F._getUnpackColorSpace()}}e.s(["WebGLRenderer",()=>aM],408560)},815969,e=>{"use strict";var t=e.i(843476),n=e.i(271645),i=e.i(618566),r=e.i(190072),a=e.i(408560);let s=({variant:e,opacity:i})=>
386{let s=(0,n.useRef)(null),[o,l]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t,n,i,o,c,u,h,d,f,p,m,g,_,v={particleCount:8e4,gridSize:128,settleStrength:"2"===e?3:"3"===e?6:3,jitter:"2"===e?.15:.06,drag:.9,speedLimit:"3"===e?3:2,viewScale:400,color:"#B8B4AC",particleSize:2,particleOpacity:.4,modeCount:"2"===e||"3"===e?2:3,mRange:{min:"3"===e?8:2,max:"2"===e?4:"3"===e?8:9},nRange:{min:"3"===e?10:2,max:"2"===e?4:"3"===e?10:9},fieldScale:"2"===e?1.3:"3"===e?.5:2,waveTypeA:"2"===e?"CurvedStripes":"Cartesian",waveTypeB:"2"===e?"Flower":"Web",waveMix:"3"===e?.6:.5,phaseJitter:"2"===e?.5:.85*("3"===e)},x=e=>e*e*(3-2*e),y=(e,t,n)=>Math.max(t,Math.min(n,e)),M="2"===e?{CurvedStripes:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos,a=.45*Math.sin(n.n*Math.PI*r+n.py);return Math.sin(n.m*Math.PI*(i+a)+n.px)},Flower:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos,a=Math.sqrt(i*i+r*r),s=Math.atan2(r,i);return Math.sin(n.m*s+n.px)*Math.cos(n.n*Math.PI*a+n.py)}}:"3"===e?{Web:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos,a=n.m*Math.PI;return Math.sin(a*i+n.px)+Math.sin(a*(-.5*i+.866*r)+n.py)+Math.sin(a*(-.5*i-.866*r))},Cartesian:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos;return Math.sin(n.m*Math.PI*(i+.5)+n.px)*Math.sin(n.n*Math.PI*(r+.5)+n.py)}}:{Cartesian:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos;return Math.sin(n.m*Math.PI*(i+.5)+n.px)*Math.sin(n.n*Math.PI*(r+.5)+n.py)},Gyroid:(e,t,n)=>{let i=10*n.m,r=10*Math.max(.5,n.n);return Math.sin(e*i)*Math.cos(t*r)+Math.sin(t*r)*Math.cos(n.px)},Web:(e,t,n)=>{let i=e*n.cos-t*n.sin,r=e*n.sin+t*n.cos,a=n.m*Math.PI;return Math.sin(a*i+n.px)+Math.sin(a*(-.5*i+.866*r)+n.py)+Math.sin(a*(-.5*i-.866*r))}},S=[],E=()=>{let e=s.current;return e?{width:window.innerWidth,height:e.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},T=()=>{let{width:e,height:t}=E();return t>0?e/t:window.innerWidth/window.innerHeight},b=(e=Math.random)=>{let t=T(),n=v.viewScale;return[(e()-.5)*2*(n*t),(e()-.5)*2*n]},w=(e,t,n,i,r=!1)=>{if(t<=1)return(n+i)*.5;let a=e/(t-1);return n+(i-n)*(r?1-a:a)},A=()=>{let e=v.gridSize,t=M[v.waveTypeA]||M.Cartesian,n=M[v.waveTypeB]||M.Cartesian,i=v.waveMix-.5,r=Math.max(.05,v.fieldScale||1),a=Math.SQRT1_2*r;for(let s=0;s<e;s++)for(let o=0;o<e;o++){let l=(o/(e-1)-.5)*r,c=(s/(e-1)-.5)*r,u=s*e+o,h=0,d=y(Math.sqrt(l*l+c*c)/a,0,1)+i,p=x(y(d,0,1));for(let e=0;e<S.length;e++){let i=S[e],r=Math.tanh(t(l,c,i))*(1-p)+Math.tanh(n(l,c,i))*p;h+=i.a*r}f[u]=h*h}let s=T(),o=2*(v.viewScale*Math.max(s,1))/(e-1);for(let t=0;t<e;t++){let n=Math.max(0,t-1),i=Math.min(e-1,t+1);for(let r=0;r<e;r++){let a=Math.max(0,r-1),s=Math.min(e-1,r+1),l=t*e+r,c=f[t*e+a],u=f[t*e+s],h=f[n*e+r],d=f[i*e+r];p[l]=(u-c)/(2*o),m[l]=(d-h)/(2*o)}}},R=()=>{let e=T(),{width:t,height:r}=E(),a=2*v.viewScale;n.left=-a*e/2,n.right=a*e/2,n.top=a/2,n.bottom=-a/2,n.updateProjectionMatrix(),i.setSize(t,r),A()},C=!0,P=()=>{g=requestAnimationFrame(P),(()=>{let e=v.gridSize,t=v.viewScale,n=u,i=h,r=v.particleCount,a=v.settleStrength,s=v.jitter,l=v.drag,c=v.speedLimit,d=T(),f=t*Math.max(d,1),g=(e-1)/(2*f),_=t*d;for(let o=0;o<r;o++){let r=3*o,u=2*o,h=n[r],d=n[r+1],v=i[u],x=i[u+1],y=!0;if((h<-_||h>_||d<-t||d>t)&&(y=!1),!y){let e=b(Math.random);h=e[0],d=e[1],v=0,x=0}let M=(h+f)*g,S=(d+f)*g,E=Math.floor(M=Math.max(0,Math.min(e-1.001,M))),T=Math.floor(S=Math.max(0,Math.min(e-1.001,S))),w=M-E,A=S-T,R=T*e+E,C=R+1,P=R+e,L=P+1,D=(p[R]*(1-w)+p[C]*w)*(1-A)+(p[P]*(1-w)+p[L]*w)*A,N=(m[R]*(1-w)+m[C]*w)*(1-A)+(m[P]*(1-w)+m[L]*w)*A;v-=D*a,x-=N*a,v+=(Math.random()-.5)*s,x+=(Math.random()-.5)*s;let I=Math.sqrt((v*=l)*v+(x*=l)*x);if(.002>Math.random()){let e=b(Math.random);h=e[0],d=e[1],v=0,x=0}if(I>c){let e=c/I;v*=e,x*=e}h+=v,d+=x,n[r]=h,n[r+1]=d,i[u]=v,i[u+1]=x}o.attributes.position.needsUpdate=!0})(),i.render(t,n),C&&(C=!1,l(!0))},L=()=>{let e,{width:l,height:g}=E();if(0===l||0===g){_=requestAnimationFrame(L);return}t=new r.Scene;let x=T(),y=2*v.viewScale;if((n=new r.OrthographicCamera(-y*x/2,y*x/2,y/2,-y/2,1,3e3)).position.set(0,0,500),(i=new a.WebGLRenderer({antialias:!0,powerPreference:"high-performance",preserveDrawingBuffer:!0,alpha:!0})).setSize(l,g),i.setPixelRatio(Math.min(window.devicePixelRatio,2)),s.current){for(;s.current.firstChild;)s.current.removeChild(s.current.firstChild);s.current.appendChild(i.domElement)}f=new Float32Array(e=v.gridSize*v.gridSize),p=new Float32Array(e),m=new Float32Array(e),(()=>{o=new r.BufferGeometry,u=new Float32Array(3*v.particleCount),h=new Float32Array(2*v.particleCount),d=new Float32Array(3*v.particleCount);let e=new r.Color(v.color),t=new r.Color("#00B894");for(let n=0;n<v.particleCount;n++){let[i,r]=b();u[3*n+0]=i,u[3*n+1]=r,u[3*n+2]=0,h[2*n+0]=0,h[2*n+1]=0;let a=.3>Math.random()?t:e;d[3*n+0]=a.r,d[3*n+1]=a.g,d[3*n+2]=a.b}o.setAttribute("position",new r.BufferAttribute(u,3)),o.setAttribute("color",new r.BufferAttribute(d,3))})(),(()=>{S=[];let e=Math.max(0,v.phaseJitter||0);for(let t=0;t<v.modeCount;t++){let n=w(t,v.modeCount,v.mRange.min,v.mRange.max),i=w(t,v.modeCount,v.nRange.min,v.nRange.max,!0);S.push({m:Math.max(.25,n),n:Math.max(.25,i),a:Math.exp(-(.35*t)),px:(2*Math.random()-1)*Math.PI*e,py:(2*Math.random()-1)*Math.PI*e,cos:1,sin:0})}let t=0;for(let e=0;e<S.length;e++)t+=Math.abs(S[e].a);if(t>0){let e=1/t;for(let t=0;t<S.length;t++)S[t].a*=e}})(),A();let M=new r.TextureLoader().load("https://threejs.org/examples/textures/sprites/disc.png"),C=new r.PointsMaterial({color:0xffffff,vertexColors:!0,size:v.particleSize,map:M,alph
386aTest:0,transparent:!0,opacity:v.particleOpacity,blending:r.AdditiveBlending,depthWrite:!1,sizeAttenuation:!1});c=new r.Points(o,C),t.add(c),window.addEventListener("resize",R),P()};return L(),()=>{window.removeEventListener("resize",R),cancelAnimationFrame(g),cancelAnimationFrame(_),s.current&&i?.domElement&&s.current.contains(i.domElement)&&s.current.removeChild(i.domElement),o&&o.dispose(),i&&i.dispose()}},[]),(0,t.jsx)("div",{ref:s,className:"absolute top-0 bottom-0 pointer-events-none",style:{left:"calc(100% - 100vw)",width:"100vw",opacity:o?i??1:0,transition:"opacity 1s ease-in"},"aria-hidden":"true"})};e.s(["default",0,function({opacity:e,...n}){let r=(0,i.usePathname)();return(0,t.jsx)(s,{opacity:e,...n},r)}])},975157,e=>{"use strict";var t=e.i(207670),n=e.i(919056);function i(...e){return(0,n.twMerge)((0,t.clsx)(e))}function r(e){return e?Math.max(1,Math.ceil(e.trim().split(/\s+/).filter(Boolean).length/265)):1}function a(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/864e5);return n<0?t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):0===n?"today":1===n?"yesterday":n<=30?`${n} days ago`:t.toLocaleDateString("en-US",{year:"numeric",month:"short"})}e.s(["calcReadTime",()=>r,"cn",()=>i,"formatRelativeDate",()=>a])},246349,e=>{"use strict";let t=(0,e.i(475254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["default",()=>t])},643531,e=>{"use strict";let t=(0,e.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",()=>t],643531)}]);
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.