(function(un){typeof define=="function"&&define.amd?define(un):un()})(function(){"use strict";var oj=Object.defineProperty,aj=Object.defineProperties;var lj=Object.getOwnPropertyDescriptors;var X0=Object.getOwnPropertySymbols;var WD=Object.prototype.hasOwnProperty,XD=Object.prototype.propertyIsEnumerable;var j0=Math.pow,TM=(un,En,mn)=>En in un?oj(un,En,{enumerable:!0,configurable:!0,writable:!0,value:mn}):un[En]=mn,_e=(un,En)=>{for(var mn in En||(En={}))WD.call(En,mn)&&TM(un,mn,En[mn]);if(X0)for(var mn of X0(En))XD.call(En,mn)&&TM(un,mn,En[mn]);return un},Ct=(un,En)=>aj(un,lj(En));var Wn=(un,En)=>{var mn={};for(var nr in un)WD.call(un,nr)&&En.indexOf(nr)<0&&(mn[nr]=un[nr]);if(un!=null&&X0)for(var nr of X0(un))En.indexOf(nr)<0&&XD.call(un,nr)&&(mn[nr]=un[nr]);return mn};var jD=(un,En,mn)=>TM(un,typeof En!="symbol"?En+"":En,mn);var fc=(un,En,mn)=>new Promise((nr,Ut)=>{var Ja=Zs=>{try{ff(mn.next(Zs))}catch(df){Ut(df)}},J0=Zs=>{try{ff(mn.throw(Zs))}catch(df){Ut(df)}},ff=Zs=>Zs.done?nr(Zs.value):Promise.resolve(Zs.value).then(Ja,J0);ff((mn=mn.apply(un,En)).next())});function un(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var En={exports:{}},mn={},nr={exports:{}},Ut={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ja=Symbol.for("react.element"),J0=Symbol.for("react.portal"),ff=Symbol.for("react.fragment"),Zs=Symbol.for("react.strict_mode"),df=Symbol.for("react.profiler"),JD=Symbol.for("react.provider"),KD=Symbol.for("react.context"),YD=Symbol.for("react.forward_ref"),QD=Symbol.for("react.suspense"),qD=Symbol.for("react.memo"),ZD=Symbol.for("react.lazy"),bM=Symbol.iterator;function $D(n){return n===null||typeof n!="object"?null:(n=bM&&n[bM]||n["@@iterator"],typeof n=="function"?n:null)}var RM={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},PM=Object.assign,IM={};function dc(n,e,t){this.props=n,this.context=e,this.refs=IM,this.updater=t||RM}dc.prototype.isReactComponent={},dc.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")},dc.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function BM(){}BM.prototype=dc.prototype;function K0(n,e,t){this.props=n,this.context=e,this.refs=IM,this.updater=t||RM}var Y0=K0.prototype=new BM;Y0.constructor=K0,PM(Y0,dc.prototype),Y0.isPureReactComponent=!0;var LM=Array.isArray,DM=Object.prototype.hasOwnProperty,Q0={current:null},FM={key:!0,ref:!0,__self:!0,__source:!0};function NM(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)DM.call(e,i)&&!FM.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,Ce=z[fe];if(0>>1;fer(Me,ie))Ier(Be,Me)?(z[fe]=Be,z[Ie]=ie,fe=Ie):(z[fe]=Me,z[re]=ie,fe=re);else if(Ier(Be,ie))z[fe]=Be,z[Ie]=ie,fe=Ie;else break e}}return te}function r(z,te){var ie=z.sortIndex-te.sortIndex;return ie!==0?ie:z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,h=null,p=3,g=!1,v=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(z){for(var te=t(c);te!==null;){if(te.callback===null)i(c);else if(te.startTime<=z)i(c),te.sortIndex=te.expirationTime,e(l,te);else break;te=t(c)}}function w(z){if(A=!1,S(z),!v)if(t(l)!==null)v=!0,K(I);else{var te=t(c);te!==null&&ge(w,te.startTime-z)}}function I(z,te){v=!1,A&&(A=!1,m(N),N=-1),g=!0;var ie=p;try{for(S(te),h=t(l);h!==null&&(!(h.expirationTime>te)||z&&!F());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,p=h.priorityLevel;var Ce=fe(h.expirationTime<=te);te=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),S(te)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(c);re!==null&&ge(w,re.startTime-te),ot=!1}return ot}finally{h=null,p=ie,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125fe?(z.sortIndex=ie,e(c,z),t(l)===null&&z===t(c)&&(A?(m(N),N=-1):A=!0,ge(w,ie-fe))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,K(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var te=p;return function(){var ie=p;p=te;try{return z.apply(this,arguments)}finally{p=ie}}}})(GM),HM.exports=GM;var fF=HM.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var dF=pe,Ar=fF;function Re(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;te}return!1}function Gi(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var gi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){gi[n]=new Gi(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];gi[e]=new Gi(e,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){gi[n]=new Gi(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){gi[n]=new Gi(n,2,!1,n,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){gi[n]=new Gi(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){gi[n]=new Gi(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){gi[n]=new Gi(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){gi[n]=new Gi(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){gi[n]=new Gi(n,5,!1,n.toLowerCase(),null,!1,!1)});var ty=/[\-:]([a-z])/g;function ny(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(ty,ny);gi[e]=new Gi(e,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(ty,ny);gi[e]=new Gi(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(ty,ny);gi[e]=new Gi(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){gi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!1,!1)}),gi.xlinkHref=new Gi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){gi[n]=new Gi(n,1,!1,n.toLowerCase(),null,!0,!0)});function iy(n,e,t,i){var r=gi.hasOwnProperty(e)?gi[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` `+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{fy=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?mf(n):""}function vF(n){switch(n.tag){case 5:return mf(n.type);case 16:return mf("Lazy");case 13:return mf("Suspense");case 19:return mf("SuspenseList");case 0:case 2:case 15:return n=dy(n.type,!1),n;case 11:return n=dy(n.type.render,!1),n;case 1:return n=dy(n.type,!0),n;default:return""}}function hy(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case mc:return"Fragment";case pc:return"Portal";case sy:return"Profiler";case ry:return"StrictMode";case ay:return"Suspense";case ly:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case JM:return(n.displayName||"Context")+".Consumer";case jM:return(n._context.displayName||"Context")+".Provider";case oy:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case cy:return e=n.displayName||null,e!==null?e:hy(n.type)||"Memo";case Uo:e=n._payload,n=n._init;try{return hy(n(e))}catch(t){}}return null}function yF(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hy(e);case 8:return e===ry?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Oo(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function QM(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function xF(n){var e=QM(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t!="undefined"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function np(n){n._valueTracker||(n._valueTracker=xF(n))}function qM(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=QM(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function ip(n){if(n=n||(typeof document!="undefined"?document:void 0),typeof n=="undefined")return null;try{return n.activeElement||n.body}catch(e){return n.body}}function py(n,e){var t=e.checked;return Pn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t!=null?t:n._wrapperState.initialChecked})}function ZM(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Oo(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function $M(n,e){e=e.checked,e!=null&&iy(n,"checked",e,!1)}function my(n,e){$M(n,e);var t=Oo(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?gy(n,e.type,t):e.hasOwnProperty("defaultValue")&&gy(n,e.type,Oo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function ew(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function gy(n,e,t){(e!=="number"||ip(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var gf=Array.isArray;function gc(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=rp.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function vf(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var yf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_F=["Webkit","ms","Moz","O"];Object.keys(yf).forEach(function(n){_F.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),yf[e]=yf[n]})});function ow(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||yf.hasOwnProperty(n)&&yf[n]?(""+e).trim():e+"px"}function aw(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=ow(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var AF=Pn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xy(n,e){if(e){if(AF[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Re(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Re(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Re(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Re(62))}}function _y(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ay=null;function Sy(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var My=null,vc=null,yc=null;function lw(n){if(n=zf(n)){if(typeof My!="function")throw Error(Re(280));var e=n.stateNode;e&&(e=Tp(e),My(n.stateNode,n.type,e))}}function cw(n){vc?yc?yc.push(n):yc=[n]:vc=n}function uw(){if(vc){var n=vc,e=yc;if(yc=vc=null,lw(n),e)for(n=0;n>>=0,n===0?32:31-(BF(n)/LF|0)|0}var cp=64,up=4194304;function Sf(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function fp(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=Sf(a):(s&=o,s!==0&&(i=Sf(s)))}else o=t&~r,o!==0?i=Sf(o):s!==0&&(i=Sf(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Mf(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-os(e),n[e]=t}function UF(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=If),Ow=" ",kw=!1;function zw(n,e){switch(n){case"keyup":return fN.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hw(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ac=!1;function hN(n,e){switch(n){case"compositionend":return Hw(e);case"keypress":return e.which!==32?null:(kw=!0,Ow);case"textInput":return n=e.data,n===Ow&&kw?null:n;default:return null}}function pN(n,e){if(Ac)return n==="compositionend"||!Hy&&zw(n,e)?(n=Bw(),gp=Fy=Vo=null,Ac=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Kw(t)}}function Qw(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Qw(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function qw(){for(var n=window,e=ip();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch(i){t=!1}if(t)n=e.contentWindow;else break;e=ip(n.document)}return e}function Wy(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function MN(n){var e=qw(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Qw(t.ownerDocument.documentElement,t)){if(i!==null&&Wy(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=Yw(t,s);var o=Yw(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,Sc=null,Xy=null,Ff=null,jy=!1;function Zw(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;jy||Sc==null||Sc!==ip(i)||(i=Sc,"selectionStart"in i&&Wy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ff&&Df(Ff,i)||(Ff=i,i=wp(Xy,"onSelect"),0Tc||(n.current=rx[Tc],rx[Tc]=null,Tc--)}function gn(n,e){Tc++,rx[Tc]=n.current,n.current=e}var Jo={},wi=jo(Jo),ir=jo(!1),qa=Jo;function bc(n,e){var t=n.type.contextTypes;if(!t)return Jo;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function rr(n){return n=n.childContextTypes,n!=null}function bp(){Sn(ir),Sn(wi)}function hE(n,e,t){if(wi.current!==Jo)throw Error(Re(168));gn(wi,e),gn(ir,t)}function pE(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Re(108,yF(n)||"Unknown",r));return Pn({},t,i)}function Rp(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Jo,qa=wi.current,gn(wi,n),gn(ir,ir.current),!0}function mE(n,e,t){var i=n.stateNode;if(!i)throw Error(Re(169));t?(n=pE(n,e,qa),i.__reactInternalMemoizedMergedChildContext=n,Sn(ir),Sn(wi),gn(wi,n)):Sn(ir),gn(ir,t)}var no=null,Pp=!1,sx=!1;function gE(n){no===null?no=[n]:no.push(n)}function FN(n){Pp=!0,gE(n)}function Ko(){if(!sx&&no!==null){sx=!0;var n=0,e=an;try{var t=no;for(an=1;n>=o,r-=o,io=1<<32-os(e)+r|t<N?(B=D,D=null):B=D.sibling;var T=p(m,D,S[N],w);if(T===null){D===null&&(D=B);break}n&&D&&T.alternate===null&&e(m,D),x=s(T,x,N),P===null?I=T:P.sibling=T,P=T,D=B}if(N===S.length)return t(m,D),Cn&&$a(m,N),I;if(D===null){for(;NN?(B=D,D=null):B=D.sibling;var F=p(m,D,T.value,w);if(F===null){D===null&&(D=B);break}n&&D&&F.alternate===null&&e(m,D),x=s(F,x,N),P===null?I=F:P.sibling=F,P=F,D=B}if(T.done)return t(m,D),Cn&&$a(m,N),I;if(D===null){for(;!T.done;N++,T=S.next())T=h(m,T.value,w),T!==null&&(x=s(T,x,N),P===null?I=T:P.sibling=T,P=T);return Cn&&$a(m,N),I}for(D=i(m,D);!T.done;N++,T=S.next())T=g(D,m,N,T.value,w),T!==null&&(n&&T.alternate!==null&&D.delete(T.key===null?N:T.key),x=s(T,x,N),P===null?I=T:P.sibling=T,P=T);return n&&D.forEach(function(X){return e(m,X)}),Cn&&$a(m,N),I}function _(m,x,S,w){if(typeof S=="object"&&S!==null&&S.type===mc&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case tp:e:{for(var I=S.key,P=x;P!==null;){if(P.key===I){if(I=S.type,I===mc){if(P.tag===7){t(m,P.sibling),x=r(P,S.props.children),x.return=m,m=x;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Uo&&SE(I)===P.type){t(m,P.sibling),x=r(P,S.props),x.ref=Hf(m,P,S),x.return=m,m=x;break e}t(m,P);break}else e(m,P);P=P.sibling}S.type===mc?(x=al(S.props.children,m.mode,w,S.key),x.return=m,m=x):(w=rm(S.type,S.key,S.props,null,m.mode,w),w.ref=Hf(m,x,S),w.return=m,m=w)}return o(m);case pc:e:{for(P=S.key;x!==null;){if(x.key===P)if(x.tag===4&&x.stateNode.containerInfo===S.containerInfo&&x.stateNode.implementation===S.implementation){t(m,x.sibling),x=r(x,S.children||[]),x.return=m,m=x;break e}else{t(m,x);break}else e(m,x);x=x.sibling}x=n_(S,m.mode,w),x.return=m,m=x}return o(m);case Uo:return P=S._init,_(m,x,P(S._payload),w)}if(gf(S))return v(m,x,S,w);if(pf(S))return A(m,x,S,w);Dp(m,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,x!==null&&x.tag===6?(t(m,x.sibling),x=r(x,S),x.return=m,m=x):(t(m,x),x=t_(S,m.mode,w),x.return=m,m=x),o(m)):t(m,x)}return _}var Bc=ME(!0),wE=ME(!1),Fp=jo(null),Np=null,Lc=null,fx=null;function dx(){fx=Lc=Np=null}function hx(n){var e=Fp.current;Sn(Fp),n._currentValue=e}function px(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function Dc(n,e){Np=n,fx=Lc=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(sr=!0),n.firstContext=null)}function Hr(n){var e=n._currentValue;if(fx!==n)if(n={context:n,memoizedValue:e,next:null},Lc===null){if(Np===null)throw Error(Re(308));Lc=n,Np.dependencies={lanes:0,firstContext:n}}else Lc=Lc.next=n;return e}var el=null;function mx(n){el===null?el=[n]:el.push(n)}function EE(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,mx(e)):(t.next=r.next,r.next=t),e.interleaved=t,so(n,i)}function so(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var Yo=!1;function gx(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function CE(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function oo(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function Qo(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Zt&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,so(n,t)}return r=i.interleaved,r===null?(e.next=e,mx(i)):(e.next=r.next,r.next=e),i.interleaved=e,so(n,t)}function Up(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Py(n,t)}}function TE(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,s=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};s===null?r=s=o:s=s.next=o,t=t.next}while(t!==null);s===null?r=s=e:s=s.next=e}else r=s=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function Op(n,e,t,i){var r=n.updateQueue;Yo=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var h=r.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,g=a.eventTime;if((i&p)===p){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=n,A=a;switch(p=e,g=t,A.tag){case 1:if(v=A.payload,typeof v=="function"){h=v.call(g,h,p);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=A.payload,p=typeof v=="function"?v.call(g,h,p):v,p==null)break e;h=Pn({},h,p);break e;case 2:Yo=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=g,l=h):d=d.next=g,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(d===null&&(l=h),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);il|=o,n.lanes=o,n.memoizedState=h}}function bE(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=Ax.transition;Ax.transition={};try{n(!1),e()}finally{an=t,Ax.transition=i}}function JE(){return Gr().memoizedState}function kN(n,e,t){var i=ea(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},KE(n))YE(e,t);else if(t=EE(n,e,t,i),t!==null){var r=Wi();ds(t,n,i,r),QE(t,e,i)}}function zN(n,e,t){var i=ea(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(KE(n))YE(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,as(a,o)){var l=e.interleaved;l===null?(r.next=r,mx(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch(c){}finally{}t=EE(n,e,r,i),t!==null&&(r=Wi(),ds(t,n,i,r),QE(t,e,i))}}function KE(n){var e=n.alternate;return n===Bn||e!==null&&e===Bn}function YE(n,e){Xf=Hp=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function QE(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,Py(n,t)}}var Wp={readContext:Hr,useCallback:Ei,useContext:Ei,useEffect:Ei,useImperativeHandle:Ei,useInsertionEffect:Ei,useLayoutEffect:Ei,useMemo:Ei,useReducer:Ei,useRef:Ei,useState:Ei,useDebugValue:Ei,useDeferredValue:Ei,useTransition:Ei,useMutableSource:Ei,useSyncExternalStore:Ei,useId:Ei,unstable_isNewReconciler:!1},HN={readContext:Hr,useCallback:function(n,e){return Ds().memoizedState=[n,e===void 0?null:e],n},useContext:Hr,useEffect:kE,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,Gp(4194308,4,GE.bind(null,e,n),t)},useLayoutEffect:function(n,e){return Gp(4194308,4,n,e)},useInsertionEffect:function(n,e){return Gp(4,2,n,e)},useMemo:function(n,e){var t=Ds();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Ds();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=kN.bind(null,Bn,n),[i.memoizedState,n]},useRef:function(n){var e=Ds();return n={current:n},e.memoizedState=n},useState:UE,useDebugValue:bx,useDeferredValue:function(n){return Ds().memoizedState=n},useTransition:function(){var n=UE(!1),e=n[0];return n=ON.bind(null,n[1]),Ds().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Bn,r=Ds();if(Cn){if(t===void 0)throw Error(Re(407));t=t()}else{if(t=e(),hi===null)throw Error(Re(349));nl&30||BE(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,kE(DE.bind(null,i,s,n),[n]),i.flags|=2048,Kf(9,LE.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=Ds(),e=hi.identifierPrefix;if(Cn){var t=ro,i=io;t=(i&~(1<<32-os(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=jf++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[Bs]=e,n[kf]=i,gC(n,e,!1,!1),e.stateNode=n;e:{switch(o=_y(t,i),t){case"dialog":An("cancel",n),An("close",n),r=i;break;case"iframe":case"object":case"embed":An("load",n),r=i;break;case"video":case"audio":for(r=0;rkc&&(e.flags|=128,i=!0,Yf(s,!1),e.lanes=4194304)}else{if(!i)if(n=kp(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Yf(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Cn)return Ci(e),null}else 2*Xn()-s.renderingStartTime>kc&&t!==1073741824&&(e.flags|=128,i=!0,Yf(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Xn(),e.sibling=null,t=In.current,gn(In,i?t&1|2:t&1),e):(Ci(e),null);case 22:case 23:return Zx(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Er&1073741824&&(Ci(e),e.subtreeFlags&6&&(e.flags|=8192)):Ci(e),null;case 24:return null;case 25:return null}throw Error(Re(156,e.tag))}function YN(n,e){switch(ax(e),e.tag){case 1:return rr(e.type)&&bp(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return Fc(),Sn(ir),Sn(wi),_x(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return yx(e),null;case 13:if(Sn(In),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Re(340));Ic()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Sn(In),null;case 4:return Fc(),null;case 10:return hx(e.type._context),null;case 22:case 23:return Zx(),null;case 24:return null;default:return null}}var Kp=!1,Ti=!1,QN=typeof WeakSet=="function"?WeakSet:Set,tt=null;function Uc(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Un(n,e,i)}else t.current=null}function zx(n,e,t){try{t()}catch(i){Un(n,e,i)}}var xC=!1;function qN(n,e){if(Zy=pp,n=qw(),Wy(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch(w){t=null;break e}var o=0,a=-1,l=-1,c=0,d=0,h=n,p=null;t:for(;;){for(var g;h!==t||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===n)break t;if(p===t&&++c===r&&(a=o),p===s&&++d===i&&(l=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for($y={focusedElem:n,selectionRange:t},pp=!1,tt=e;tt!==null;)if(e=tt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,tt=n;else for(;tt!==null;){e=tt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var A=v.memoizedProps,_=v.memoizedState,m=e.stateNode,x=m.getSnapshotBeforeUpdate(e.elementType===e.type?A:cs(e.type,A),_);m.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Re(163))}}catch(w){Un(e,e.return,w)}if(n=e.sibling,n!==null){n.return=e.return,tt=n;break}tt=e.return}return v=xC,xC=!1,v}function Qf(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&zx(e,t,s)}r=r.next}while(r!==i)}}function Yp(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function Hx(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function _C(n){var e=n.alternate;e!==null&&(n.alternate=null,_C(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Bs],delete e[kf],delete e[ix],delete e[LN],delete e[DN])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function AC(n){return n.tag===5||n.tag===3||n.tag===4}function SC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||AC(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Gx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Cp));else if(i!==4&&(n=n.child,n!==null))for(Gx(n,e,t),n=n.sibling;n!==null;)Gx(n,e,t),n=n.sibling}function Vx(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(Vx(n,e,t),n=n.sibling;n!==null;)Vx(n,e,t),n=n.sibling}var vi=null,us=!1;function qo(n,e,t){for(t=t.child;t!==null;)MC(n,e,t),t=t.sibling}function MC(n,e,t){if(Is&&typeof Is.onCommitFiberUnmount=="function")try{Is.onCommitFiberUnmount(lp,t)}catch(a){}switch(t.tag){case 5:Ti||Uc(t,e);case 6:var i=vi,r=us;vi=null,qo(n,e,t),vi=i,us=r,vi!==null&&(us?(n=vi,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):vi.removeChild(t.stateNode));break;case 18:vi!==null&&(us?(n=vi,t=t.stateNode,n.nodeType===8?nx(n.parentNode,t):n.nodeType===1&&nx(n,t),bf(n)):nx(vi,t.stateNode));break;case 4:i=vi,r=us,vi=t.stateNode.containerInfo,us=!0,qo(n,e,t),vi=i,us=r;break;case 0:case 11:case 14:case 15:if(!Ti&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&zx(t,e,o),r=r.next}while(r!==i)}qo(n,e,t);break;case 1:if(!Ti&&(Uc(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Un(t,e,a)}qo(n,e,t);break;case 21:qo(n,e,t);break;case 22:t.mode&1?(Ti=(i=Ti)||t.memoizedState!==null,qo(n,e,t),Ti=i):qo(n,e,t);break;default:qo(n,e,t)}}function wC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new QN),e.forEach(function(i){var r=o3.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function fs(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=Xn()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*$N(i/1960))-i,10n?16:n,$o===null)var i=!1;else{if(n=$o,$o=null,em=0,Zt&6)throw Error(Re(331));var r=Zt;for(Zt|=4,tt=n.current;tt!==null;){var s=tt,o=s.child;if(tt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lXn()-jx?sl(n,0):Xx|=t),ar(n,e)}function UC(n,e){e===0&&(n.mode&1?(e=up,up<<=1,!(up&130023424)&&(up=4194304)):e=1);var t=Wi();n=so(n,e),n!==null&&(Mf(n,e,t),ar(n,t))}function s3(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),UC(n,t)}function o3(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Re(314))}i!==null&&i.delete(e),UC(n,t)}var OC;OC=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||ir.current)sr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return sr=!1,JN(n,e,t);sr=!!(n.flags&131072)}else sr=!1,Cn&&e.flags&1048576&&vE(e,Bp,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;Jp(n,e),n=e.pendingProps;var r=bc(e,wi.current);Dc(e,t),r=Mx(null,e,i,n,r,t);var s=wx();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,rr(i)?(s=!0,Rp(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,gx(e),r.updater=Xp,e.stateNode=r,r._reactInternals=e,Px(e,i,n,t),e=Dx(null,e,i,!0,s,t)):(e.tag=0,Cn&&s&&ox(e),Vi(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(Jp(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=l3(i),n=cs(i,n),r){case 0:e=Lx(null,e,i,n,t);break e;case 1:e=uC(null,e,i,n,t);break e;case 11:e=sC(null,e,i,n,t);break e;case 14:e=oC(null,e,i,cs(i.type,n),t);break e}throw Error(Re(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),Lx(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),uC(n,e,i,r,t);case 3:e:{if(fC(e),n===null)throw Error(Re(387));i=e.pendingProps,s=e.memoizedState,r=s.element,CE(n,e),Op(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Nc(Error(Re(423)),e),e=dC(n,e,i,t,r);break e}else if(i!==r){r=Nc(Error(Re(424)),e),e=dC(n,e,i,t,r);break e}else for(wr=Xo(e.stateNode.containerInfo.firstChild),Mr=e,Cn=!0,ls=null,t=wE(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Ic(),i===r){e=ao(n,e,t);break e}Vi(n,e,i,t)}e=e.child}return e;case 5:return RE(e),n===null&&cx(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,ex(i,r)?o=null:s!==null&&ex(i,s)&&(e.flags|=32),cC(n,e),Vi(n,e,o,t),e.child;case 6:return n===null&&cx(e),null;case 13:return hC(n,e,t);case 4:return vx(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Bc(e,null,i,t):Vi(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),sC(n,e,i,r,t);case 7:return Vi(n,e,e.pendingProps,t),e.child;case 8:return Vi(n,e,e.pendingProps.children,t),e.child;case 12:return Vi(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,gn(Fp,i._currentValue),i._currentValue=o,s!==null)if(as(s.value,o)){if(s.children===r.children&&!ir.current){e=ao(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=oo(-1,t&-t),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),px(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Re(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),px(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Vi(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Dc(e,t),r=Hr(r),i=i(r),e.flags|=1,Vi(n,e,i,t),e.child;case 14:return i=e.type,r=cs(i,e.pendingProps),r=cs(i.type,r),oC(n,e,i,r,t);case 15:return aC(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:cs(i,r),Jp(n,e),e.tag=1,rr(i)?(n=!0,Rp(e)):n=!1,Dc(e,t),ZE(e,i,r),Px(e,i,r,t),Dx(null,e,i,!0,n,t);case 19:return mC(n,e,t);case 22:return lC(n,e,t)}throw Error(Re(156,e.tag))};function kC(n,e){return yw(n,e)}function a3(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(n,e,t,i){return new a3(n,e,t,i)}function e_(n){return n=n.prototype,!(!n||!n.isReactComponent)}function l3(n){if(typeof n=="function")return e_(n)?1:0;if(n!=null){if(n=n.$$typeof,n===oy)return 11;if(n===cy)return 14}return 2}function na(n,e){var t=n.alternate;return t===null?(t=Wr(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function rm(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")e_(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case mc:return al(t.children,r,s,e);case ry:o=8,r|=8;break;case sy:return n=Wr(12,t,e,r|2),n.elementType=sy,n.lanes=s,n;case ay:return n=Wr(13,t,e,r),n.elementType=ay,n.lanes=s,n;case ly:return n=Wr(19,t,e,r),n.elementType=ly,n.lanes=s,n;case KM:return sm(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case jM:o=10;break e;case JM:o=9;break e;case oy:o=11;break e;case cy:o=14;break e;case Uo:o=16,i=null;break e}throw Error(Re(130,n==null?n:typeof n,""))}return e=Wr(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function al(n,e,t,i){return n=Wr(7,n,i,e),n.lanes=t,n}function sm(n,e,t,i){return n=Wr(22,n,i,e),n.elementType=KM,n.lanes=t,n.stateNode={isHidden:!1},n}function t_(n,e,t){return n=Wr(6,n,null,e),n.lanes=t,n}function n_(n,e,t){return e=Wr(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function c3(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ry(0),this.expirationTimes=Ry(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ry(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function i_(n,e,t,i,r,s,o,a,l){return n=new c3(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Wr(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},gx(s),n}function u3(n,e,t){var i=3n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}function td(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const a_=n=>Array.isArray(n);function JC(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function l_(n,e,t,i){if(typeof e=="function"){const[r,s]=KC(i);e=e(t!==void 0?t:n.custom,r,s)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,s]=KC(i);e=e(t!==void 0?t:n.custom,r,s)}return e}function dm(n,e,t){const i=n.getProps();return l_(i,e,t!==void 0?t:i.custom,n)}const c_=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],u_=["initial",...c_],id=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ia=new Set(id),co=n=>n*1e3,uo=n=>n/1e3,v3={type:"spring",stiffness:500,damping:25,restSpeed:10},y3=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),x3={type:"keyframes",duration:.8},_3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},A3=(n,{keyframes:e})=>e.length>2?x3:ia.has(n)?n.startsWith("scale")?y3(e[1]):v3:_3;function S3(h){var p=h,{when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c}=p,d=Wn(p,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);return!!Object.keys(d).length}function f_(n,e){return n[e]||n.default||n}const M3={skipAnimations:!1,useManualTiming:!1},w3=n=>n!==null;function hm(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(w3),s=e&&t!=="loop"&&e%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const xi=n=>n;function E3(n){let e=new Set,t=new Set,i=!1,r=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),n()),c(o)}const l={schedule:(c,d=!1,h=!1)=>{const g=h&&i?e:t;return d&&s.add(c),g.has(c)||g.add(c),c},cancel:c=>{t.delete(c),s.delete(c)},process:c=>{if(o=c,i){r=!0;return}i=!0,[e,t]=[t,e],t.clear(),e.forEach(a),i=!1,r&&(r=!1,l.process(c))}};return l}const pm=["read","resolveKeyframes","update","preRender","render","postRender"],C3=40;function YC(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>t=!0,o=pm.reduce((m,x)=>(m[x]=E3(s),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:h,postRender:p}=o,g=()=>{const m=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(m-r.timestamp,C3),1),r.timestamp=m,r.isProcessing=!0,a.process(r),l.process(r),c.process(r),d.process(r),h.process(r),p.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(g))},v=()=>{t=!0,i=!0,r.isProcessing||n(g)};return{schedule:pm.reduce((m,x)=>{const S=o[x];return m[x]=(w,I=!1,P=!1)=>(t||v(),S.schedule(w,I,P)),m},{}),cancel:m=>{for(let x=0;x/^0[^.\s]+$/u.test(n);function T3(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||QC(n):!0}let b3=xi,h_=xi;const qC=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),ZC=n=>e=>typeof e=="string"&&e.startsWith(n),$C=ZC("--"),R3=ZC("var(--"),p_=n=>R3(n)?P3.test(n.split("/*")[0].trim()):!1,P3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,I3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function B3(n){const e=I3.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t!=null?t:i}`,r]}function eT(n,e,t=1){const[i,r]=B3(n);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const o=s.trim();return qC(o)?parseFloat(o):o}return p_(r)?eT(r,e,t+1):r}const ra=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},rd=Ct(_e({},Hc),{transform:n=>ra(0,1,n)}),mm=Ct(_e({},Hc),{default:1}),sd=n=>Math.round(n*1e5)/1e5,m_=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,L3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,D3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function od(n){return typeof n=="string"}function F3(n){return n==null}const ad=n=>({test:e=>od(e)&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),sa=ad("deg"),Ns=ad("%"),St=ad("px"),N3=ad("vh"),U3=ad("vw"),tT=Ct(_e({},Ns),{parse:n=>Ns.parse(n)/100,transform:n=>Ns.transform(n*100)}),O3=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),nT=n=>n===Hc||n===St,iT=(n,e)=>parseFloat(n.split(", ")[e]),rT=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return iT(r[1],e);{const s=i.match(/^matrix\((.+)\)$/u);return s?iT(s[1],n):0}},k3=new Set(["x","y","z"]),z3=id.filter(n=>!k3.has(n));function H3(n){const e=[];return z3.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Gc={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:rT(4,13),y:rT(5,14)};Gc.translateX=Gc.x,Gc.translateY=Gc.y;const sT=n=>e=>e.test(n),oT=[Hc,St,Ns,sa,U3,N3,{test:n=>n==="auto",parse:n=>n}],aT=n=>oT.find(sT(n)),ll=new Set;let g_=!1,v_=!1;function lT(){if(v_){const n=Array.from(ll).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=H3(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([s,o])=>{var a;(a=i.getValue(s))===null||a===void 0||a.set(o)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}v_=!1,g_=!1,ll.forEach(n=>n.complete()),ll.clear()}function cT(){ll.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(v_=!0)})}function G3(){cT(),lT()}class y_{constructor(e,t,i,r,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ll.add(this),g_||(g_=!0,Xt.read(cT),Xt.resolveKeyframes(lT))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let s=0;st=>!!(od(t)&&D3.test(t)&&t.startsWith(n)||e&&!F3(t)&&Object.prototype.hasOwnProperty.call(t,e)),uT=(n,e,t)=>i=>{if(!od(i))return i;const[r,s,o,a]=i.match(m_);return{[n]:parseFloat(r),[e]:parseFloat(s),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},V3=n=>ra(0,255,n),__=Ct(_e({},Hc),{transform:n=>Math.round(V3(n))}),cl={test:x_("rgb","red"),parse:uT("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+__.transform(n)+", "+__.transform(e)+", "+__.transform(t)+", "+sd(rd.transform(i))+")"};function W3(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const A_={test:x_("#"),parse:W3,transform:cl.transform},Vc={test:x_("hsl","hue"),parse:uT("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ns.transform(sd(e))+", "+Ns.transform(sd(t))+", "+sd(rd.transform(i))+")"},bi={test:n=>cl.test(n)||A_.test(n)||Vc.test(n),parse:n=>cl.test(n)?cl.parse(n):Vc.test(n)?Vc.parse(n):A_.parse(n),transform:n=>od(n)?n:n.hasOwnProperty("red")?cl.transform(n):Vc.transform(n)};function X3(n){var e,t;return isNaN(n)&&od(n)&&(((e=n.match(m_))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(L3))===null||t===void 0?void 0:t.length)||0)>0}const fT="number",dT="color",j3="var",J3="var(",hT="${}",K3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ld(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let s=0;const a=e.replace(K3,l=>(bi.test(l)?(i.color.push(s),r.push(dT),t.push(bi.parse(l))):l.startsWith(J3)?(i.var.push(s),r.push(j3),t.push(l)):(i.number.push(s),r.push(fT),t.push(parseFloat(l))),++s,hT)).split(hT);return{values:t,split:a,indexes:i,types:r}}function pT(n){return ld(n).values}function mT(n){const{split:e,types:t}=ld(n),i=e.length;return r=>{let s="";for(let o=0;otypeof n=="number"?0:n;function Q3(n){const e=pT(n);return mT(n)(e.map(Y3))}const oa={test:X3,parse:pT,createTransformer:mT,getAnimatableNone:Q3},q3=new Set(["brightness","contrast","saturate","opacity"]);function Z3(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(m_)||[];if(!i)return n;const r=t.replace(i,"");let s=q3.has(e)?1:0;return i!==t&&(s*=100),e+"("+s+r+")"}const $3=/\b([a-z-]*)\(.*?\)/gu,S_=Ct(_e({},oa),{getAnimatableNone:n=>{const e=n.match($3);return e?e.map(Z3).join(" "):n}}),gT=Ct(_e({},Hc),{transform:Math.round}),M_={borderWidth:St,borderTopWidth:St,borderRightWidth:St,borderBottomWidth:St,borderLeftWidth:St,borderRadius:St,radius:St,borderTopLeftRadius:St,borderTopRightRadius:St,borderBottomRightRadius:St,borderBottomLeftRadius:St,width:St,maxWidth:St,height:St,maxHeight:St,size:St,top:St,right:St,bottom:St,left:St,padding:St,paddingTop:St,paddingRight:St,paddingBottom:St,paddingLeft:St,margin:St,marginTop:St,marginRight:St,marginBottom:St,marginLeft:St,rotate:sa,rotateX:sa,rotateY:sa,rotateZ:sa,scale:mm,scaleX:mm,scaleY:mm,scaleZ:mm,skew:sa,skewX:sa,skewY:sa,distance:St,translateX:St,translateY:St,translateZ:St,x:St,y:St,z:St,perspective:St,transformPerspective:St,opacity:rd,originX:tT,originY:tT,originZ:St,zIndex:gT,backgroundPositionX:St,backgroundPositionY:St,fillOpacity:rd,strokeOpacity:rd,numOctaves:gT},eU=Ct(_e({},M_),{color:bi,backgroundColor:bi,outlineColor:bi,fill:bi,stroke:bi,borderColor:bi,borderTopColor:bi,borderRightColor:bi,borderBottomColor:bi,borderLeftColor:bi,filter:S_,WebkitFilter:S_}),w_=n=>eU[n];function vT(n,e){let t=w_(n);return t!==S_&&(t=oa),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const tU=new Set(["auto","none","0"]);function nU(n,e,t){let i=0,r;for(;i{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function xT(n){let e;return()=>(e===void 0&&(e=n()),e)}let gm;function iU(){gm=void 0}const fo={now:()=>(gm===void 0&&fo.set(si.isProcessing||M3.useManualTiming?si.timestamp:performance.now()),gm),set:n=>{gm=n,queueMicrotask(iU)}},_T=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(oa.test(n)||n==="0")&&!n.startsWith("url("));function rU(n){const e=n[0];if(n.length===1)return!0;for(let t=0;toU?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&G3(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=fo.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!sU(e,i,r,s))if(o)this.options.duration=0;else{l==null||l(hm(e,this.options,t)),a==null||a(),this.resolveFinishedPromise();return}const d=this.initPlayback(e,t);d!==!1&&(this._resolved=_e({keyframes:e,finalKeyframe:t},d),this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function E_(n,e){return e?n*(1e3/e):0}const aU=5;function ST(n,e,t){const i=Math.max(e-aU,0);return E_(t-n(i),e-i)}const C_=.001,lU=.01,cU=10,uU=.05,fU=1;function dU({duration:n=800,bounce:e=.25,velocity:t=0,mass:i=1}){let r,s,o=1-e;o=ra(uU,fU,o),n=ra(lU,cU,uo(n)),o<1?(r=c=>{const d=c*o,h=d*n,p=d-t,g=T_(c,o),v=Math.exp(-h);return C_-p/g*v},s=c=>{const h=c*o*n,p=h*t+t,g=Math.pow(o,2)*Math.pow(c,2)*n,v=Math.exp(-h),A=T_(Math.pow(c,2),o);return(-r(c)+C_>0?-1:1)*((p-g)*v)/A}):(r=c=>{const d=Math.exp(-c*n),h=(c-t)*n+1;return-C_+d*h},s=c=>{const d=Math.exp(-c*n),h=(t-c)*(n*n);return d*h});const a=5/n,l=pU(r,s,a);if(n=co(n),isNaN(l))return{stiffness:100,damping:10,duration:n};{const c=Math.pow(l,2)*i;return{stiffness:c,damping:o*2*Math.sqrt(i*c),duration:n}}}const hU=12;function pU(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function vU(n){let e=_e({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},n);if(!MT(n,gU)&&MT(n,mU)){const t=dU(n);e=Ct(_e(_e({},e),t),{mass:1}),e.isResolvedFromDuration=!0}return e}function wT(r){var s=r,{keyframes:n,restDelta:e,restSpeed:t}=s,i=Wn(s,["keyframes","restDelta","restSpeed"]);const o=n[0],a=n[n.length-1],l={done:!1,value:o},{stiffness:c,damping:d,mass:h,duration:p,velocity:g,isResolvedFromDuration:v}=vU(Ct(_e({},i),{velocity:-uo(i.velocity||0)})),A=g||0,_=d/(2*Math.sqrt(c*h)),m=a-o,x=uo(Math.sqrt(c/h)),S=Math.abs(m)<5;t||(t=S?.01:2),e||(e=S?.005:.5);let w;if(_<1){const I=T_(x,_);w=P=>{const D=Math.exp(-_*x*P);return a-D*((A+_*x*m)/I*Math.sin(I*P)+m*Math.cos(I*P))}}else if(_===1)w=I=>a-Math.exp(-x*I)*(m+(A+x*m)*I);else{const I=x*Math.sqrt(_*_-1);w=P=>{const D=Math.exp(-_*x*P),N=Math.min(I*P,300);return a-D*((A+_*x*m)*Math.sinh(N)+I*m*Math.cosh(N))/I}}return{calculatedDuration:v&&p||null,next:I=>{const P=w(I);if(v)l.done=I>=p;else{let D=0;_<1&&(D=I===0?co(A):ST(w,I,P));const N=Math.abs(D)<=t,B=Math.abs(a-P)<=e;l.done=N&&B}return l.value=l.done?a:P,l}}}function ET({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const h=n[0],p={done:!1,value:h},g=N=>a!==void 0&&Nl,v=N=>a===void 0?l:l===void 0||Math.abs(a-N)-A*Math.exp(-N/i),S=N=>m+x(N),w=N=>{const B=x(N),T=S(N);p.done=Math.abs(B)<=c,p.value=p.done?m:T};let I,P;const D=N=>{g(p.value)&&(I=N,P=wT({keyframes:[p.value,v(p.value)],velocity:ST(S,N,p.value),damping:r,stiffness:s,restDelta:c,restSpeed:d}))};return D(0),{calculatedDuration:null,next:N=>{let B=!1;return!P&&I===void 0&&(B=!0,w(N),D(N)),I!==void 0&&N>=I?P.next(N-I):(!B&&w(N),p)}}}const CT=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,yU=1e-7,xU=12;function _U(n,e,t,i,r){let s,o,a=0;do o=e+(t-e)/2,s=CT(o,i,r)-n,s>0?t=o:e=o;while(Math.abs(s)>yU&&++a_U(s,0,1,n,t);return s=>s===0||s===1?s:CT(r(s),e,i)}const AU=cd(.42,0,1,1),SU=cd(0,0,.58,1),TT=cd(.42,0,.58,1),MU=n=>Array.isArray(n)&&typeof n[0]!="number",bT=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,RT=n=>e=>1-n(1-e),b_=n=>1-Math.sin(Math.acos(n)),PT=RT(b_),wU=bT(b_),IT=cd(.33,1.53,.69,.99),R_=RT(IT),BT={linear:xi,easeIn:AU,easeInOut:TT,easeOut:SU,circIn:b_,circInOut:wU,circOut:PT,backIn:R_,backInOut:bT(R_),backOut:IT,anticipate:n=>(n*=2)<1?.5*R_(n):.5*(2-Math.pow(2,-10*(n-1)))},LT=n=>{if(Array.isArray(n)){h_(n.length===4);const[e,t,i,r]=n;return cd(e,t,i,r)}else if(typeof n=="string")return h_(BT[n]!==void 0),BT[n];return n},EU=(n,e)=>t=>e(n(t)),Us=(...n)=>n.reduce(EU),Wc=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},Ln=(n,e,t)=>n+(e-n)*t;function P_(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function CU({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,s=0,o=0;if(!e)r=s=o=t;else{const a=t<.5?t*(1+e):t+e-t*e,l=2*t-a;r=P_(l,a,n+1/3),s=P_(l,a,n),o=P_(l,a,n-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:i}}function vm(n,e){return t=>t>0?e:n}const I_=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},TU=[A_,cl,Vc],bU=n=>TU.find(e=>e.test(n));function DT(n){const e=bU(n);if(!e)return!1;let t=e.parse(n);return e===Vc&&(t=CU(t)),t}const FT=(n,e)=>{const t=DT(n),i=DT(e);if(!t||!i)return vm(n,e);const r=_e({},t);return s=>(r.red=I_(t.red,i.red,s),r.green=I_(t.green,i.green,s),r.blue=I_(t.blue,i.blue,s),r.alpha=Ln(t.alpha,i.alpha,s),cl.transform(r))},B_=new Set(["none","hidden"]);function RU(n,e){return B_.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function PU(n,e){return t=>Ln(n,e,t)}function L_(n){return typeof n=="number"?PU:typeof n=="string"?p_(n)?vm:bi.test(n)?FT:LU:Array.isArray(n)?NT:typeof n=="object"?bi.test(n)?FT:IU:vm}function NT(n,e){const t=[...n],i=t.length,r=n.map((s,o)=>L_(s)(s,e[o]));return s=>{for(let o=0;o{for(const s in i)t[s]=i[s](r);return t}}function BU(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const t=oa.createTransformer(e),i=ld(n),r=ld(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?B_.has(n)&&!r.values.length||B_.has(e)&&!i.values.length?RU(n,e):Us(NT(BU(i,r),r.values),t):vm(n,e)};function UT(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Ln(n,e,t):L_(n)(n,e)}function DU(n,e,t){const i=[],r=t||UT,s=n.length-1;for(let o=0;oe[0];if(s===2&&n[0]===n[1])return()=>e[1];n[0]>n[s-1]&&(n=[...n].reverse(),e=[...e].reverse());const o=DU(e,i,r),a=o.length,l=c=>{let d=0;if(a>1)for(;dl(ra(n[0],n[s-1],c)):l}function FU(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=Wc(0,e,i);n.push(Ln(t,1,r))}}function OT(n){const e=[0];return FU(e,n.length-1),e}function NU(n,e){return n.map(t=>t*e)}function UU(n,e){return n.map(()=>e||TT).splice(0,n.length-1)}function ym({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=MU(i)?i.map(LT):LT(i),s={done:!1,value:e[0]},o=NU(t&&t.length===e.length?t:OT(e),n),a=D_(o,e,{ease:Array.isArray(r)?r:UU(e,r)});return{calculatedDuration:n,next:l=>(s.value=a(l),s.done=l>=n,s)}}const kT=2e4;function OU(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=kT?1/0:e}const kU=n=>{const e=({timestamp:t})=>n(t);return{start:()=>Xt.update(e,!0),stop:()=>hs(e),now:()=>si.isProcessing?si.timestamp:fo.now()}},zU={decay:ET,inertia:ET,tween:ym,keyframes:ym,spring:wT},HU=n=>n/100;class xm extends AT{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:t,motionValue:i,element:r,keyframes:s}=this.options,o=(r==null?void 0:r.KeyframeResolver)||y_,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,t,i,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:s,velocity:o=0}=this.options,a=zU[t]||ym;let l,c;a!==ym&&typeof e[0]!="number"&&(l=Us(HU,UT(e[0],e[1])),e=[0,100]);const d=a(Ct(_e({},this.options),{keyframes:e}));s==="mirror"&&(c=a(Ct(_e({},this.options),{keyframes:[...e].reverse(),velocity:-o}))),d.calculatedDuration===null&&(d.calculatedDuration=OU(d));const{calculatedDuration:h}=d,p=h+r,g=p*(i+1)-r;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){const{resolved:i}=this;if(!i){const{keyframes:N}=this.options;return{done:!0,value:N[N.length-1]}}const{finalKeyframe:r,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:h}=i;if(this.startTime===null)return s.next(0);const{delay:p,repeat:g,repeatType:v,repeatDelay:A,onUpdate:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-d/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const m=this.currentTime-p*(this.speed>=0?1:-1),x=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let S=this.currentTime,w=s;if(g){const N=Math.min(this.currentTime,d)/h;let B=Math.floor(N),T=N%1;!T&&N>=1&&(T=1),T===1&&B--,B=Math.min(B,g+1),!!(B%2)&&(v==="reverse"?(T=1-T,A&&(T-=A/h)):v==="mirror"&&(w=o)),S=ra(0,1,T)*h}const I=x?{done:!1,value:l[0]}:w.next(S);a&&(I.value=a(I.value));let{done:P}=I;!x&&c!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return D&&r!==void 0&&(I.value=hm(l,this.options,r)),_&&_(I.value),D&&this.finish(),I}get duration(){const{resolved:e}=this;return e?uo(e.calculatedDuration):0}get time(){return uo(this.currentTime)}set time(e){e=co(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=uo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=kU,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),t&&t();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i!=null?i:this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}function GU(n){return new xm(n)}const zT=new Set(["opacity","clipPath","filter","transform"]),HT=n=>Array.isArray(n)&&typeof n[0]=="number";function GT(n){return!!(!n||typeof n=="string"&&n in F_||HT(n)||Array.isArray(n)&&n.every(GT))}const ud=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,F_={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ud([0,.65,.55,1]),circOut:ud([.55,0,1,.45]),backIn:ud([.31,.01,.66,-.59]),backOut:ud([.33,1.53,.69,.99])};function VU(n){return VT(n)||F_.easeOut}function VT(n){if(n)return HT(n)?ud(n):Array.isArray(n)?n.map(VU):F_[n]}function WU(n,e,t,{delay:i=0,duration:r=300,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const c={[e]:t};l&&(c.offset=l);const d=VT(a);return Array.isArray(d)&&(c.easing=d),n.animate(c,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const XU=xT(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),_m=10,jU=2e4;function JU(n){return n.type==="spring"||!GT(n.ease)}function KU(n,e){const t=new xm(Ct(_e({},e),{keyframes:n,repeat:0,delay:0,isGenerator:!0}));let i={done:!1,value:n[0]};const r=[];let s=0;for(;!i.done&&sthis.onKeyframesResolved(o,a),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){var i;let{duration:r=300,times:s,ease:o,type:a,motionValue:l,name:c,startTime:d}=this.options;if(!(!((i=l.owner)===null||i===void 0)&&i.current))return!1;if(JU(this.options)){const p=this.options,{onComplete:g,onUpdate:v,motionValue:A,element:_}=p,m=Wn(p,["onComplete","onUpdate","motionValue","element"]),x=KU(e,m);e=x.keyframes,e.length===1&&(e[1]=e[0]),r=x.duration,s=x.times,o=x.ease,a="keyframes"}const h=WU(l.owner.current,c,e,Ct(_e({},this.options),{duration:r,times:s,ease:o}));return h.startTime=d!=null?d:this.calcStartTime(),this.pendingTimeline?(h.timeline=this.pendingTimeline,this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:g}=this.options;l.set(hm(e,this.options,t)),g&&g(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:s,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return uo(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return uo(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=co(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:t}=this;if(!t)return xi;const{animation:i}=t;i.timeline=e,i.onfinish=null}return xi}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.playState==="finished"&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:i,duration:r,type:s,ease:o,times:a}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const c=this.options,{motionValue:d,onUpdate:h,onComplete:p,element:g}=c,v=Wn(c,["motionValue","onUpdate","onComplete","element"]),A=new xm(Ct(_e({},v),{keyframes:i,duration:r,type:s,ease:o,times:a,isGenerator:!0})),_=co(this.time);d.setWithVelocity(A.sample(_-_m).value,A.sample(_).value,_m)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:s,damping:o,type:a}=e;return XU()&&i&&zT.has(i)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&s!=="mirror"&&o!==0&&a!=="inertia"}}function YU(n,e){let t;const i=()=>{const{currentTime:r}=e,o=(r===null?0:r.value)/100;t!==o&&n(o),t=o};return Xt.update(i,!0),()=>hs(i)}const QU=xT(()=>window.ScrollTimeline!==void 0);class qU{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i{if(QU()&&i.attachTimeline)i.attachTimeline(e);else return i.pause(),YU(r=>{i.time=i.duration*r},e)});return()=>{t.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const N_=(n,e,t,i={},r,s,o)=>a=>{const l=f_(i,n)||{},c=l.delay||i.delay||0;let{elapsed:d=0}=i;d=d-co(c);let h=Ct(_e({keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity()},l),{delay:-d,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:n,motionValue:e,element:s?void 0:r});S3(l)||(h=_e(_e({},h),A3(n,h))),h.duration&&(h.duration=co(h.duration)),h.repeatDelay&&(h.repeatDelay=co(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(p=!0)),p&&!s&&e.get()!==void 0){const g=hm(h.keyframes,l);if(g!==void 0)return Xt.update(()=>{h.onUpdate(g),h.onComplete()}),new qU([])}return!s&&WT.supports(h)?new WT(h):new xm(h)},ZU=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),$U=n=>a_(n)?n[n.length-1]||0:n;function Am(n,e){n.indexOf(e)===-1&&n.push(e)}function Sm(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class U_{constructor(){this.subscriptions=[]}add(e){return Am(this.subscriptions,e),()=>Sm(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let s=0;s!isNaN(parseFloat(n)),fd={current:void 0};class jT{constructor(e,t={}){this.version="11.5.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=fo.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=fo.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=eO(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new U_);const i=this.events[e].add(t);return e==="change"?()=>{i(),Xt.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return fd.current&&fd.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=fo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>XT)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,XT);return E_(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Os(n,e){return new jT(n,e)}function tO(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,Os(t))}function nO(n,e){let o=dm(n,e)||{},{transitionEnd:i={},transition:r={}}=o,s=Wn(o,["transitionEnd","transition"]);s=_e(_e({},s),i);for(const a in s){const l=$U(s[a]);tO(n,a,l)}}const Mm=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),JT="data-"+Mm("framerAppearId");function KT(n){return n.props[JT]}function YT(n){if(ia.has(n))return"transform";if(zT.has(n))return Mm(n)}class iO extends jT{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=YT(e);if(!t)return;const i=this.counts.get(t)||0;this.counts.set(t,i+1),i===0&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const s=this.counts.get(t)-1;this.counts.set(t,s),s===0&&(Sm(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Tn=n=>!!(n&&n.getVelocity);function rO(n){return!!(Tn(n)&&n.add)}function O_(n,e){var t;if(!n.applyWillChange)return;let i=n.getValue("willChange");if(!i&&!(!((t=n.props.style)===null||t===void 0)&&t.willChange)&&(i=new iO("auto"),n.addValue("willChange",i)),rO(i))return i.add(e)}function sO({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function QT(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var s;let h=e,{transition:o=n.getDefaultTransition(),transitionEnd:a}=h,l=Wn(h,["transition","transitionEnd"]);i&&(o=i);const c=[],d=r&&n.animationState&&n.animationState.getState()[r];for(const p in l){const g=n.getValue(p,(s=n.latestValues[p])!==null&&s!==void 0?s:null),v=l[p];if(v===void 0||d&&sO(d,p))continue;const A=_e({delay:t},f_(o||{},p));let _=!1;if(window.MotionHandoffAnimation){const x=KT(n);if(x){const S=window.MotionHandoffAnimation(x,p,Xt);S!==null&&(A.startTime=S,_=!0)}}g.start(N_(p,g,v,n.shouldReduceMotion&&ia.has(p)?{type:!1}:A,n,_,O_(n,p)));const m=g.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{Xt.update(()=>{a&&nO(n,a)})}),c}function k_(n,e,t={}){var i;const r=dm(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:s=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(s=t.transitionOverride);const o=r?()=>Promise.all(QT(n,r,t)):()=>Promise.resolve(),a=n.variantChildren&&n.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:p}=s;return oO(n,e,d+c,h,p,t)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>d())}else return Promise.all([o(),a(t.delay)])}function oO(n,e,t=0,i=0,r=1,s){const o=[],a=(n.variantChildren.size-1)*i,l=r===1?(c=0)=>c*i:(c=0)=>a-c*i;return Array.from(n.variantChildren).sort(aO).forEach((c,d)=>{c.notify("AnimationStart",e),o.push(k_(c,e,Ct(_e({},s),{delay:t+l(d)})).then(()=>c.notify("AnimationComplete",e)))}),Promise.all(o)}function aO(n,e){return n.sortNodePosition(e)}function lO(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(s=>k_(n,s,t));i=Promise.all(r)}else if(typeof e=="string")i=k_(n,e,t);else{const r=typeof e=="function"?dm(n,e,t.custom):e;i=Promise.all(QT(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const cO=[...c_].reverse(),uO=c_.length;function fO(n){return e=>Promise.all(e.map(({animation:t,options:i})=>lO(n,t,i)))}function dO(n){let e=fO(n),t=qT(),i=!0;const r=l=>(c,d)=>{var h;const p=dm(n,d,l==="exit"?(h=n.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(p){const g=p,{transition:v,transitionEnd:A}=g,_=Wn(g,["transition","transitionEnd"]);c=_e(_e(_e({},c),_),A)}return c};function s(l){e=l(n)}function o(l){const c=n.getProps(),d=n.getVariantContext(!0)||{},h=[],p=new Set;let g={},v=1/0;for(let _=0;_v&&w,B=!1;const T=Array.isArray(S)?S:[S];let F=T.reduce(r(m),{});I===!1&&(F={});const{prevResolvedValues:X={}}=x,J=_e(_e({},X),F),q=$=>{N=!0,p.has($)&&(B=!0,p.delete($)),x.needsAnimating[$]=!0;const K=n.getValue($);K&&(K.liveStyle=!1)};for(const $ in J){const K=F[$],ge=X[$];if(g.hasOwnProperty($))continue;let z=!1;a_(K)&&a_(ge)?z=!JC(K,ge):z=K!==ge,z?K!=null?q($):p.add($):K!==void 0&&p.has($)?q($):x.protectedKeys[$]=!0}x.prevProp=S,x.prevResolvedValues=F,x.isActive&&(g=_e(_e({},g),F)),i&&n.blockInitialAnimation&&(N=!1),N&&(!P||B)&&h.push(...T.map($=>({animation:$,options:{type:m}})))}if(p.size){const _={};p.forEach(m=>{const x=n.getBaseTarget(m),S=n.getValue(m);S&&(S.liveStyle=!0),_[m]=x!=null?x:null}),h.push({animation:_})}let A=!!h.length;return i&&(c.initial===!1||c.initial===c.animate)&&!n.manuallyAnimateOnMount&&(A=!1),i=!1,A?e(h):Promise.resolve()}function a(l,c){var d;if(t[l].isActive===c)return Promise.resolve();(d=n.variantChildren)===null||d===void 0||d.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,c)}),t[l].isActive=c;const h=o(l);for(const p in t)t[p].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>t,reset:()=>{t=qT(),i=!0}}}function hO(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!JC(e,n):!1}function ul(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qT(){return{animate:ul(!0),whileInView:ul(),whileHover:ul(),whileTap:ul(),whileDrag:ul(),whileFocus:ul(),exit:ul()}}class aa{constructor(e){this.isMounted=!1,this.node=e}update(){}}class pO extends aa{constructor(e){super(e),e.animationState||(e.animationState=dO(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();td(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let mO=0;class gO extends aa{constructor(){super(...arguments),this.id=mO++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const ZT={animation:{Feature:pO},exit:{Feature:gO}},$T=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1;function wm(n,e="page"){return{point:{x:n[`${e}X`],y:n[`${e}Y`]}}}const eb=n=>e=>$T(e)&&n(e,wm(e));function ho(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function ps(n,e,t,i){return ho(n,e,eb(t),i)}const tb=(n,e)=>Math.abs(n-e);function vO(n,e){const t=tb(n.x,e.x),i=tb(n.y,e.y);return Math.sqrt(j0(t,2)+j0(i,2))}class nb{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=H_(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=vO(h.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:v}=h,{timestamp:A}=si;this.history.push(Ct(_e({},v),{timestamp:A}));const{onStart:_,onMove:m}=this.handlers;p||(_&&_(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=z_(p,this.transformPagePoint),Xt.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:g,onSessionEnd:v,resumeAnimation:A}=this.handlers;if(this.dragSnapToOrigin&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=H_(h.type==="pointercancel"?this.lastMoveEventInfo:z_(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(h,_),v&&v(h,_)},!$T(e))return;this.dragSnapToOrigin=s,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const o=wm(e),a=z_(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=si;this.history=[Ct(_e({},l),{timestamp:c})];const{onSessionStart:d}=t;d&&d(e,H_(a,this.history)),this.removeListeners=Us(ps(this.contextWindow,"pointermove",this.handlePointerMove),ps(this.contextWindow,"pointerup",this.handlePointerUp),ps(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),hs(this.updatePoint)}}function z_(n,e){return e?{point:e(n.point)}:n}function ib(n,e){return{x:n.x-e.x,y:n.y-e.y}}function H_({point:n},e){return{point:n,delta:ib(n,rb(e)),offset:ib(n,yO(e)),velocity:xO(e,.1)}}function yO(n){return n[0]}function rb(n){return n[n.length-1]}function xO(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=rb(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>co(e)));)t--;if(!i)return{x:0,y:0};const s=uo(r.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const o={x:(r.x-i.x)/s,y:(r.y-i.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function sb(n){let e=null;return()=>{const t=()=>{e=null};return e===null?(e=n,t):!1}}const ob=sb("dragHorizontal"),ab=sb("dragVertical");function lb(n){let e=!1;if(n==="y")e=ab();else if(n==="x")e=ob();else{const t=ob(),i=ab();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function G_(){const n=lb(!0);return n?(n(),!1):!0}function Xc(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}const cb=1e-4,_O=1-cb,AO=1+cb,ub=.01,SO=0-ub,MO=0+ub;function Cr(n){return n.max-n.min}function wO(n,e,t){return Math.abs(n-e)<=t}function fb(n,e,t,i=.5){n.origin=i,n.originPoint=Ln(e.min,e.max,n.origin),n.scale=Cr(t)/Cr(e),n.translate=Ln(t.min,t.max,n.origin)-n.originPoint,(n.scale>=_O&&n.scale<=AO||isNaN(n.scale))&&(n.scale=1),(n.translate>=SO&&n.translate<=MO||isNaN(n.translate))&&(n.translate=0)}function dd(n,e,t,i){fb(n.x,e.x,t.x,i?i.originX:void 0),fb(n.y,e.y,t.y,i?i.originY:void 0)}function db(n,e,t){n.min=t.min+e.min,n.max=n.min+Cr(e)}function EO(n,e,t){db(n.x,e.x,t.x),db(n.y,e.y,t.y)}function hb(n,e,t){n.min=e.min-t.min,n.max=n.min+Cr(e)}function hd(n,e,t){hb(n.x,e.x,t.x),hb(n.y,e.y,t.y)}function CO(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Ln(t,n,i.max):Math.min(n,t)),n}function pb(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function TO(n,{top:e,left:t,bottom:i,right:r}){return{x:pb(n.x,t,r),y:pb(n.y,e,i)}}function mb(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=Wc(e.min,e.max-i,n.min):i>r&&(t=Wc(n.min,n.max-r,e.min)),ra(0,1,t)}function PO(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const V_=.35;function IO(n=V_){return n===!1?n=0:n===!0&&(n=V_),{x:gb(n,"left","right"),y:gb(n,"top","bottom")}}function gb(n,e,t){return{min:vb(n,e),max:vb(n,t)}}function vb(n,e){return typeof n=="number"?n:n[e]||0}const yb=()=>({translate:0,scale:1,origin:0,originPoint:0}),jc=()=>({x:yb(),y:yb()}),xb=()=>({min:0,max:0}),On=()=>({x:xb(),y:xb()});function Xr(n){return[n("x"),n("y")]}function _b({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function BO({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function LO(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function W_(n){return n===void 0||n===1}function X_({scale:n,scaleX:e,scaleY:t}){return!W_(n)||!W_(e)||!W_(t)}function fl(n){return X_(n)||Ab(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function Ab(n){return Sb(n.x)||Sb(n.y)}function Sb(n){return n&&n!=="0%"}function Em(n,e,t){const i=n-t,r=e*i;return t+r}function Mb(n,e,t,i,r){return r!==void 0&&(n=Em(n,r,i)),Em(n,t,i)+e}function j_(n,e=0,t=1,i,r){n.min=Mb(n.min,e,t,i,r),n.max=Mb(n.max,e,t,i,r)}function wb(n,{x:e,y:t}){j_(n.x,e.translate,e.scale,e.originPoint),j_(n.y,t.translate,t.scale,t.originPoint)}const Eb=.999999999999,Cb=1.0000000000001;function DO(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let s,o;for(let a=0;aEb&&(e.x=1),e.yEb&&(e.y=1)}function Jc(n,e){n.min=n.min+e,n.max=n.max+e}function Tb(n,e,t,i,r=.5){const s=Ln(n.min,n.max,r);j_(n,e,t,s,i)}function Kc(n,e){Tb(n.x,e.x,e.scaleX,e.scale,e.originX),Tb(n.y,e.y,e.scaleY,e.scale,e.originY)}function bb(n,e){return _b(LO(n.getBoundingClientRect(),e))}function FO(n,e,t){const i=bb(n,t),{scroll:r}=e;return r&&(Jc(i.x,r.offset.x),Jc(i.y,r.offset.y)),i}const Rb=({current:n})=>n?n.ownerDocument.defaultView:null,NO=new WeakMap;class UO{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=On(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(wm(d,"page").point)},s=(d,h)=>{var p;const{drag:g,dragPropagation:v,onDragStart:A}=this.getProps();if(g&&!v&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=lb(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xr(m=>{let x=this.getAxisMotionValue(m).get()||0;if(Ns.test(x)){const{projection:S}=this.visualElement;if(S&&S.layout){const w=S.layout.layoutBox[m];w&&(x=Cr(w)*(parseFloat(x)/100))}}this.originPoint[m]=x}),A&&Xt.postRender(()=>A(d,h)),(p=this.removeWillChange)===null||p===void 0||p.call(this),this.removeWillChange=O_(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},o=(d,h)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:v,onDrag:A}=this.getProps();if(!p&&!this.openGlobalLock)return;const{offset:_}=h;if(g&&this.currentDirection===null){this.currentDirection=OO(_),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",h.point,_),this.updateAxis("y",h.point,_),this.visualElement.render(),A&&A(d,h)},a=(d,h)=>this.stop(d,h),l=()=>Xr(d=>{var h;return this.getAnimationState(d)==="paused"&&((h=this.getAxisMotionValue(d).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new nb(e,{onSessionStart:r,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Rb(this.visualElement)})}stop(e,t){var i;(i=this.removeWillChange)===null||i===void 0||i.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=t;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&Xt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Cm(e,r,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(o=CO(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,s=this.constraints;t&&Xc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=TO(r.layoutBox,t):this.constraints=!1,this.elastic=IO(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Xr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=PO(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Xc(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=FO(i,r.root,this.visualElement.getTransformPagePoint());let o=bO(r.layout.layoutBox,s);if(t){const a=t(BO(o));this.hasMutatedConstraints=!!a,a&&(o=_b(a))}return o}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Xr(d=>{if(!Cm(d,t,this.currentDirection))return;let h=l&&l[d]||{};o&&(h={min:0,max:0});const p=r?200:1e6,g=r?40:1e7,v=_e(_e({type:"inertia",velocity:i?e[d]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10},s),h);return this.startAxisValueAnimation(d,v)});return Promise.all(c).then(a)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return i.start(N_(e,i,0,t,this.visualElement,!1,O_(this.visualElement,e)))}stopAnimation(){Xr(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Xr(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){Xr(t=>{const{drag:i}=this.getProps();if(!Cm(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,s=this.getAxisMotionValue(t);if(r&&r.layout){const{min:o,max:a}=r.layout.layoutBox[t];s.set(e[t]-Ln(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!Xc(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Xr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();r[o]=RO({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Xr(o=>{if(!Cm(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ln(l,c,r[o]))})}addListeners(){if(!this.visualElement.current)return;NO.set(this.visualElement,this);const e=this.visualElement.current,t=ps(e,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Xc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Xt.read(i);const o=ho(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Xr(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=l[d].translate,h.set(h.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),t(),s(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:o=V_,dragMomentum:a=!0}=e;return Ct(_e({},e),{drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:o,dragMomentum:a})}}function Cm(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function OO(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class kO extends aa{constructor(e){super(e),this.removeGroupControls=xi,this.removeListeners=xi,this.controls=new UO(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xi}unmount(){this.removeGroupControls(),this.removeListeners()}}const Pb=n=>(e,t)=>{n&&Xt.postRender(()=>n(e,t))};class zO extends aa{constructor(){super(...arguments),this.removePointerDownListener=xi}onPointerDown(e){this.session=new nb(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Rb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Pb(e),onStart:Pb(t),onMove:i,onEnd:(s,o)=>{delete this.session,r&&Xt.postRender(()=>r(s,o))}}}mount(){this.removePointerDownListener=ps(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const J_=pe.createContext(null);function HO(){const n=pe.useContext(J_);if(n===null)return[!0,null];const{isPresent:e,onExitComplete:t,register:i}=n,r=pe.useId();pe.useEffect(()=>i(r),[]);const s=pe.useCallback(()=>t&&t(r),[r,t]);return!e&&t?[!1,s]:[!0]}const Ib=pe.createContext({}),Bb=pe.createContext({}),Tm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Lb(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const pd={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(St.test(n))n=parseFloat(n);else return n;const t=Lb(n,e.target.x),i=Lb(n,e.target.y);return`${t}% ${i}%`}},GO={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=oa.parse(n);if(r.length>5)return i;const s=oa.createTransformer(n),o=typeof r[0]!="number"?1:0,a=t.x.scale*e.x,l=t.y.scale*e.y;r[0+o]/=a,r[1+o]/=l;const c=Ln(a,l,.5);return typeof r[2+o]=="number"&&(r[2+o]/=c),typeof r[3+o]=="number"&&(r[3+o]/=c),s(r)}},bm={};function VO(n){Object.assign(bm,n)}const{schedule:K_,cancel:hj}=YC(queueMicrotask,!1);class WO extends pe.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=e;VO(XO),s&&(t.group&&t.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions(Ct(_e({},s.options),{onExitComplete:()=>this.safeToRemove()}))),Tm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:s}=this.props,o=i.projection;return o&&(o.isPresent=s,r||e.layoutDependency!==t||t===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Xt.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),K_.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Db(n){const[e,t]=HO(),i=pe.useContext(Ib);return me.jsx(WO,Ct(_e({},n),{layoutGroup:i,switchLayoutGroup:pe.useContext(Bb),isPresent:e,safeToRemove:t}))}const XO={borderRadius:Ct(_e({},pd),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:pd,borderTopRightRadius:pd,borderBottomLeftRadius:pd,borderBottomRightRadius:pd,boxShadow:GO},Fb=["TopLeft","TopRight","BottomLeft","BottomRight"],jO=Fb.length,Nb=n=>typeof n=="string"?parseFloat(n):n,Ub=n=>typeof n=="number"||St.test(n);function JO(n,e,t,i,r,s){r?(n.opacity=Ln(0,t.opacity!==void 0?t.opacity:1,KO(i)),n.opacityExit=Ln(e.opacity!==void 0?e.opacity:1,0,YO(i))):s&&(n.opacity=Ln(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let o=0;oie?1:t(Wc(n,e,i))}function zb(n,e){n.min=e.min,n.max=e.max}function jr(n,e){zb(n.x,e.x),zb(n.y,e.y)}function Hb(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function Gb(n,e,t,i,r){return n-=e,n=Em(n,1/t,i),r!==void 0&&(n=Em(n,1/r,i)),n}function QO(n,e=0,t=1,i=.5,r,s=n,o=n){if(Ns.test(e)&&(e=parseFloat(e),e=Ln(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Ln(s.min,s.max,i);n===s&&(a-=e),n.min=Gb(n.min,e,t,a,r),n.max=Gb(n.max,e,t,a,r)}function Vb(n,e,[t,i,r],s,o){QO(n,e[t],e[i],e[r],e.scale,s,o)}const qO=["x","scaleX","originX"],ZO=["y","scaleY","originY"];function Wb(n,e,t,i){Vb(n.x,e,qO,t?t.x:void 0,i?i.x:void 0),Vb(n.y,e,ZO,t?t.y:void 0,i?i.y:void 0)}function Xb(n){return n.translate===0&&n.scale===1}function jb(n){return Xb(n.x)&&Xb(n.y)}function Jb(n,e){return n.min===e.min&&n.max===e.max}function $O(n,e){return Jb(n.x,e.x)&&Jb(n.y,e.y)}function Kb(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function Yb(n,e){return Kb(n.x,e.x)&&Kb(n.y,e.y)}function Qb(n){return Cr(n.x)/Cr(n.y)}function qb(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class ek{constructor(){this.members=[]}add(e){Am(this.members,e),e.scheduleRender()}remove(e){if(Sm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tk(n,e,t){let i="";const r=n.x.translate/e.x,s=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((r||s||o)&&(i=`translate3d(${r}px, ${s}px, ${o}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:c,rotate:d,rotateX:h,rotateY:p,skewX:g,skewY:v}=t;c&&(i=`perspective(${c}px) ${i}`),d&&(i+=`rotate(${d}deg) `),h&&(i+=`rotateX(${h}deg) `),p&&(i+=`rotateY(${p}deg) `),g&&(i+=`skewX(${g}deg) `),v&&(i+=`skewY(${v}deg) `)}const a=n.x.scale*e.x,l=n.y.scale*e.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const nk=(n,e)=>n.depth-e.depth;class ik{constructor(){this.children=[],this.isDirty=!1}add(e){Am(this.children,e),this.isDirty=!0}remove(e){Sm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nk),this.isDirty=!1,this.children.forEach(e)}}function md(n){const e=Tn(n)?n.get():n;return ZU(e)?e.toValue():e}function rk(n,e){const t=fo.now(),i=({timestamp:r})=>{const s=r-t;s>=e&&(hs(i),n(s-e))};return Xt.read(i,!0),()=>hs(i)}function sk(n){return n instanceof SVGElement&&n.tagName!=="svg"}function ok(n,e,t){const i=Tn(n)?n:Os(n);return i.start(N_("",i,e,t)),i.animation}const dl={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},gd=typeof window!="undefined"&&window.MotionDebug!==void 0,Y_=["","X","Y","Z"],ak={visibility:"hidden"},Zb=1e3;let lk=0;function Q_(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function $b(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=KT(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:s}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",Xt,!(r||s))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&$b(i)}function eR({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(o={},a=e==null?void 0:e()){this.id=lk++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,gd&&(dl.totalNodes=dl.resolvedTargetDeltas=dl.recalculatedProjection=0),this.nodes.forEach(fk),this.nodes.forEach(gk),this.nodes.forEach(vk),this.nodes.forEach(dk),gd&&window.MotionDebug.record(dl)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;n(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=rk(p,250),Tm.hasAnimatedSinceResize&&(Tm.hasAnimatedSinceResize=!1,this.nodes.forEach(nR))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||d.getDefaultTransition()||Sk,{onLayoutAnimationStart:_,onLayoutAnimationComplete:m}=d.getProps(),x=!this.targetLayout||!Yb(this.targetLayout,v)||g,S=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||S||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,S);const w=Ct(_e({},f_(A,"layout")),{onPlay:_,onComplete:m});(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else p||nR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,hs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yk),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$b(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const I=w/1e3;iR(h.x,o.x,I),iR(h.y,o.y,I),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(hd(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),_k(this.relativeTarget,this.relativeTargetOrigin,p,I),S&&$O(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=On()),jr(S,this.relativeTarget)),A&&(this.animationValues=d,JO(d,c,this.latestValues,I,x,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(hs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xt.update(()=>{Tm.hasAnimatedSinceResize=!0,this.currentAnimation=ok(0,Zb,Ct(_e({},o),{onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}})),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Zb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&lR(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||On();const h=Cr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const p=Cr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}jr(a,l),Kc(a,d),dd(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ek),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Q_("z",o,c,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(tR),this.root.sharedNodes.clear()}}}function ck(n){n.updateLayout()}function uk(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:s}=n.options,o=t.source!==n.layout.source;s==="size"?Xr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Cr(p);p.min=i[h].min,p.max=p.min+g}):lR(s,t.layoutBox,i)&&Xr(h=>{const p=o?t.measuredBox[h]:t.layoutBox[h],g=Cr(i[h]);p.max=p.min+g,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[h].max=n.relativeTarget[h].min+g)});const a=jc();dd(a,i,t.layoutBox);const l=jc();o?dd(l,n.applyTransform(r,!0),t.measuredBox):dd(l,i,t.layoutBox);const c=!jb(a);let d=!1;if(!n.resumeFrom){const h=n.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:g}=h;if(p&&g){const v=On();hd(v,t.layoutBox,p.layoutBox);const A=On();hd(A,i,g.layoutBox),Yb(v,A)||(d=!0),h.options.layoutRoot&&(n.relativeTarget=A,n.relativeTargetOrigin=v,n.relativeParent=h)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function fk(n){gd&&dl.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function dk(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function hk(n){n.clearSnapshot()}function tR(n){n.clearMeasurements()}function pk(n){n.isLayoutDirty=!1}function mk(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function nR(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function gk(n){n.resolveTargetDelta()}function vk(n){n.calcProjection()}function yk(n){n.resetSkewAndRotation()}function xk(n){n.removeLeadSnapshot()}function iR(n,e,t){n.translate=Ln(e.translate,0,t),n.scale=Ln(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function rR(n,e,t,i){n.min=Ln(e.min,t.min,i),n.max=Ln(e.max,t.max,i)}function _k(n,e,t,i){rR(n.x,e.x,t.x,i),rR(n.y,e.y,t.y,i)}function Ak(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const Sk={duration:.45,ease:[.4,0,.1,1]},sR=n=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),oR=sR("applewebkit/")&&!sR("chrome/")?Math.round:xi;function aR(n){n.min=oR(n.min),n.max=oR(n.max)}function Mk(n){aR(n.x),aR(n.y)}function lR(n,e,t){return n==="position"||n==="preserve-aspect"&&!wO(Qb(e),Qb(t),.2)}function wk(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const Ek=eR({attachResizeListener:(n,e)=>ho(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),q_={current:void 0},cR=eR({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!q_.current){const n=new Ek({});n.mount(window),n.setOptions({layoutScroll:!0}),q_.current=n}return q_.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),Ck={pan:{Feature:zO},drag:{Feature:kO,ProjectionNode:cR,MeasureLayout:Db}};function uR(n,e){const t=e?"pointerenter":"pointerleave",i=e?"onHoverStart":"onHoverEnd",r=(s,o)=>{if(s.pointerType==="touch"||G_())return;const a=n.getProps();n.animationState&&a.whileHover&&n.animationState.setActive("whileHover",e);const l=a[i];l&&Xt.postRender(()=>l(s,o))};return ps(n.current,t,r,{passive:!n.getProps()[i]})}class Tk extends aa{mount(){this.unmount=Us(uR(this.node,!0),uR(this.node,!1))}unmount(){}}class bk extends aa{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Us(ho(this.node.current,"focus",()=>this.onFocus()),ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const fR=(n,e)=>e?n===e?!0:fR(n,e.parentElement):!1;function Z_(n,e){if(!e)return;const t=new PointerEvent("pointer"+n);e(t,wm(t))}class Rk extends aa{constructor(){super(...arguments),this.removeStartListeners=xi,this.removeEndListeners=xi,this.removeAccessibleListeners=xi,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const i=this.node.getProps(),s=ps(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:c,onTapCancel:d,globalTapTarget:h}=this.node.getProps(),p=!h&&!fR(this.node.current,a.target)?d:c;p&&Xt.update(()=>p(a,l))},{passive:!(i.onTap||i.onPointerUp)}),o=ps(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=Us(s,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Z_("up",(l,c)=>{const{onTap:d}=this.node.getProps();d&&Xt.postRender(()=>d(l,c))})};this.removeEndListeners(),this.removeEndListeners=ho(this.node.current,"keyup",o),Z_("down",(a,l)=>{this.startPress(a,l)})},t=ho(this.node.current,"keydown",e),i=()=>{this.isPressing&&Z_("cancel",(s,o)=>this.cancelPress(s,o))},r=ho(this.node.current,"blur",i);this.removeAccessibleListeners=Us(t,r)}}startPress(e,t){this.isPressing=!0;const{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&Xt.postRender(()=>i(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!G_()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:i}=this.node.getProps();i&&Xt.postRender(()=>i(e,t))}mount(){const e=this.node.getProps(),t=ps(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),i=ho(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Us(t,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const $_=new WeakMap,eA=new WeakMap,Pk=n=>{const e=$_.get(n.target);e&&e(n)},Ik=n=>{n.forEach(Pk)};function Bk(t){var i=t,{root:n}=i,e=Wn(i,["root"]);const r=n||document;eA.has(r)||eA.set(r,{});const s=eA.get(r),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(Ik,_e({root:n},e))),s[o]}function Lk(n,e,t){const i=Bk(e);return $_.set(n,t),i.observe(n),()=>{$_.delete(n),i.unobserve(n)}}const Dk={some:0,all:1};class Fk extends aa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:s}=e,o={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:Dk[r]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=c?d:h;p&&p(l)};return Lk(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(Nk(e,t))&&this.startObserver()}unmount(){}}function Nk({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Uk={inView:{Feature:Fk},tap:{Feature:Rk},focus:{Feature:bk},hover:{Feature:Tk}},Ok={layout:{ProjectionNode:cR,MeasureLayout:Db}},Rm=pe.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"}),Pm=pe.createContext({}),tA=typeof window!="undefined",Im=tA?pe.useLayoutEffect:pe.useEffect,dR=pe.createContext({strict:!1});let hR=!1;function kk(n,e,t,i,r){var s;const{visualElement:o}=pe.useContext(Pm),a=pe.useContext(dR),l=pe.useContext(J_),c=pe.useContext(Rm).reducedMotion,d=pe.useRef();i=i||a.renderer,!d.current&&i&&(d.current=i(n,{visualState:e,parent:o,props:t,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const h=d.current,p=pe.useContext(Bb);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&Hk(d.current,t,r,p),pe.useInsertionEffect(()=>{h&&h.update(t,l)});const g=t[JT],v=pe.useRef(!!g&&!window.MotionHandoffIsComplete&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,g)));return Im(()=>{h&&(h.updateFeatures(),K_.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),pe.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current=!1,hR||(hR=!0,queueMicrotask(zk)))}),h}function zk(){window.MotionHandoffIsComplete=!0}function Hk(n,e,t,i){const{layoutId:r,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:pR(n.parent)),n.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!o||a&&Xc(a),visualElement:n,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:l,layoutRoot:c})}function pR(n){if(n)return n.options.allowProjection!==!1?n.projection:pR(n.parent)}function Gk(n,e,t){return pe.useCallback(i=>{i&&n.mount&&n.mount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):Xc(t)&&(t.current=i))},[e])}function Bm(n){return td(n.animate)||u_.some(e=>nd(n[e]))}function mR(n){return!!(Bm(n)||n.variants)}function Vk(n,e){if(Bm(n)){const{initial:t,animate:i}=n;return{initial:t===!1||nd(t)?t:void 0,animate:nd(i)?i:void 0}}return n.inherit!==!1?e:{}}function Wk(n){const{initial:e,animate:t}=Vk(n,pe.useContext(Pm));return pe.useMemo(()=>({initial:e,animate:t}),[gR(e),gR(t)])}function gR(n){return Array.isArray(n)?n.join(" "):n}const vR={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Yc={};for(const n in vR)Yc[n]={isEnabled:e=>vR[n].some(t=>!!e[t])};function Xk(n){for(const e in n)Yc[e]=_e(_e({},Yc[e]),n[e])}const jk=Symbol.for("motionComponentSymbol");function yR({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){n&&Xk(n);function s(a,l){let c;const d=Ct(_e(_e({},pe.useContext(Rm)),a),{layoutId:Jk(a)}),{isStatic:h}=d,p=Wk(a),g=i(a,h);if(!h&&tA){Kk();const v=Yk(d);c=v.MeasureLayout,p.visualElement=kk(r,g,d,e,v.ProjectionNode)}return me.jsxs(Pm.Provider,{value:p,children:[c&&p.visualElement?me.jsx(c,_e({visualElement:p.visualElement},d)):null,t(r,a,Gk(g,p.visualElement,l),g,h,p.visualElement)]})}const o=pe.forwardRef(s);return o[jk]=r,o}function Jk({layoutId:n}){const e=pe.useContext(Ib).id;return e&&n!==void 0?e+"-"+n:n}function Kk(n,e){pe.useContext(dR).strict}function Yk(n){const{drag:e,layout:t}=Yc;if(!e&&!t)return{};const i=_e(_e({},e),t);return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const Qk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function nA(n){return typeof n!="string"||n.includes("-")?!1:!!(Qk.indexOf(n)>-1||/[A-Z]/u.test(n))}function xR(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const s in t)n.style.setProperty(s,t[s])}const _R=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function AR(n,e,t,i){xR(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(_R.has(r)?r:Mm(r),e.attrs[r])}function SR(n,{layout:e,layoutId:t}){return ia.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!bm[n]||n==="opacity")}function iA(n,e,t){var i;const{style:r}=n,s={};for(const o in r)(Tn(r[o])||e.style&&Tn(e.style[o])||SR(o,n)||((i=t==null?void 0:t.getValue(o))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return t&&r&&typeof r.willChange=="string"&&(t.applyWillChange=!1),s}function MR(n,e,t){const i=iA(n,e,t);for(const r in n)if(Tn(n[r])||Tn(e[r])){const s=id.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=n[r]}return i}function Lm(n){const e=pe.useRef(null);return e.current===null&&(e.current=n()),e.current}function qk({applyWillChange:n=!1,scrapeMotionValuesFromProps:e,createRenderState:t,onMount:i},r,s,o,a){const l={latestValues:$k(r,s,o,a?!1:n,e),renderState:t()};return i&&(l.mount=c=>i(r,c,l)),l}const rA=n=>(e,t)=>{const i=pe.useContext(Pm),r=pe.useContext(J_),s=()=>qk(n,e,i,r,t);return t?s():Lm(s)};function Zk(n,e){const t=YT(e);t&&Am(n,t)}function wR(n,e,t){const i=Array.isArray(e)?e:[e];for(let s=0;s{for(const x in _){let S=_[x];if(Array.isArray(S)){const w=v?S.length-1:0;S=S[w]}S!==null&&(o[x]=S)}for(const x in m)o[x]=m[x]}),l&&(h&&d!==!1&&!td(h)&&wR(n,h,_=>{for(const m in _)Zk(a,m)}),a.length&&(o.willChange=a.join(","))),o}const sA=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),ER=()=>Ct(_e({},sA()),{attrs:{}}),CR=(n,e)=>e&&typeof n=="number"?e.transform(n):n,ez={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tz=id.length;function nz(n,e,t){let i="",r=!0;for(let s=0;stypeof n=="string"&&n.toLowerCase()==="svg",az={useVisualState:rA({scrapeMotionValuesFromProps:MR,createRenderState:ER,onMount:(n,e,{renderState:t,latestValues:i})=>{Xt.read(()=>{try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch(r){t.dimensions={x:0,y:0,width:0,height:0}}}),Xt.render(()=>{aA(t,i,lA(e.tagName),n.transformTemplate),AR(e,t)})}})},lz={useVisualState:rA({applyWillChange:!0,scrapeMotionValuesFromProps:iA,createRenderState:sA})};function bR(n,e,t){for(const i in e)!Tn(e[i])&&!SR(i,t)&&(n[i]=e[i])}function cz({transformTemplate:n},e){return pe.useMemo(()=>{const t=sA();return oA(t,e,n),Object.assign({},t.vars,t.style)},[e])}function uz(n,e){const t=n.style||{},i={};return bR(i,t,n),Object.assign(i,cz(n,e)),i}function fz(n,e){const t={},i=uz(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const dz=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Dm(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||dz.has(n)}let RR=n=>!Dm(n);function hz(n){n&&(RR=e=>e.startsWith("on")?!Dm(e):n(e))}try{hz(require("@emotion/is-prop-valid").default)}catch(n){}function PR(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(RR(r)||t===!0&&Dm(r)||!e&&!Dm(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function pz(n,e,t,i){const r=pe.useMemo(()=>{const s=ER();return aA(s,e,lA(i),n.transformTemplate),Ct(_e({},s.attrs),{style:_e({},s.style)})},[e]);if(n.style){const s={};bR(s,n.style,n),r.style=_e(_e({},s),r.style)}return r}function mz(n=!1){return(t,i,r,{latestValues:s},o)=>{const l=(nA(t)?pz:fz)(i,s,o,t),c=PR(i,typeof t=="string",n),d=t!==pe.Fragment?Ct(_e(_e({},c),l),{ref:r}):{},{children:h}=i,p=pe.useMemo(()=>Tn(h)?h.get():h,[h]);return pe.createElement(t,Ct(_e({},d),{children:p}))}}function gz(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const s=nA(i)?az:lz,o=Ct(_e({},s),{preloadedFeatures:n,useRender:mz(r),createVisualElement:e,Component:i});return yR(o)}}const cA={current:null},IR={current:!1};function vz(){if(IR.current=!0,!!tA)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>cA.current=n.matches;n.addListener(e),e()}else cA.current=!1}function yz(n,e,t){for(const i in e){const r=e[i],s=t[i];if(Tn(r))n.addValue(i,r);else if(Tn(s))n.addValue(i,Os(r,{owner:n}));else if(s!==r)if(n.hasValue(i)){const o=n.getValue(i);o.liveStyle===!0?o.jump(r):o.hasAnimated||o.set(r)}else{const o=n.getStaticValue(i);n.addValue(i,Os(o!==void 0?o:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const BR=new WeakMap,xz=[...oT,bi,oa],_z=n=>xz.find(sT(n)),LR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Az=u_.length;class DR{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:s,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=y_,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Xt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=o;this.latestValues=l,this.baseTarget=_e({},l),this.initialValues=t.initial?_e({},l):{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Bm(t),this.isVariantNode=mR(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const p=this.scrapeMotionValuesFromProps(t,{},this),{willChange:d}=p,h=Wn(p,["willChange"]);for(const g in h){const v=h[g];l[g]!==void 0&&Tn(v)&&v.set(l[g],!1)}}mount(e){this.current=e,BR.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),IR.current||vz(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cA.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){BR.delete(this.current),this.projection&&this.projection.unmount(),hs(this.notifyUpdate),hs(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=ia.has(e),r=t.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Xt.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),s(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Yc){const t=Yc[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):On()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;it.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=Os(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(qC(r)||QC(r))?r=parseFloat(r):!_z(r)&&oa.test(t)&&(r=vT(e,t)),this.setBaseTarget(e,Tn(r)?r.get():r)),Tn(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const o=l_(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);o&&(r=o[e])}if(i&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Tn(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new U_),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class FR extends DR{constructor(){super(...arguments),this.KeyframeResolver=yT}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}}function Sz(n){return window.getComputedStyle(n)}class Mz extends FR{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=xR}readValueFromInstance(e,t){if(ia.has(t)){const i=w_(t);return i&&i.default||0}else{const i=Sz(e),r=($C(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return bb(e,t)}build(e,t,i){oA(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return iA(e,t,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Tn(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class wz extends FR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=On}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ia.has(t)){const i=w_(t);return i&&i.default||0}return t=_R.has(t)?t:Mm(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return MR(e,t,i)}build(e,t,i){aA(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){AR(e,t,i,r)}mount(e){this.isSVGTag=lA(e.tagName),super.mount(e)}}const Ez=(n,e)=>nA(n)?new wz(e):new Mz(e,{allowProjection:n!==pe.Fragment}),Cz=gz(_e(_e(_e(_e({},ZT),Uk),Ck),Ok),Ez),Xi=g3(Cz);function NR(n){const e=Lm(()=>Os(n)),{isStatic:t}=pe.useContext(Rm);if(t){const[,i]=pe.useState(n);pe.useEffect(()=>e.on("change",i),[])}return e}function UR(n,e){const t=NR(e()),i=()=>t.set(e());return i(),Im(()=>{const r=()=>Xt.preRender(i,!1,!0),s=n.map(o=>o.on("change",r));return()=>{s.forEach(o=>o()),hs(i)}}),t}const Tz=n=>n&&typeof n=="object"&&n.mix,bz=n=>Tz(n)?n.mix:void 0;function Rz(...n){const e=!Array.isArray(n[0]),t=e?0:-1,i=n[0+t],r=n[1+t],s=n[2+t],o=n[3+t],a=D_(r,s,_e({mixer:bz(s[0])},o));return e?a(i):a}function Pz(n){fd.current=[],n();const e=UR(fd.current,n);return fd.current=void 0,e}function lr(n,e,t,i){if(typeof n=="function")return Pz(n);const r=typeof e=="function"?e:Rz(e,t,i);return Array.isArray(n)?OR(n,r):OR([n],([s])=>r(s))}function OR(n,e){const t=Lm(()=>[]);return UR(n,()=>{t.length=0;const i=n.length;for(let r=0;r{}),a=()=>{const c=i.current;c&&c.time===0&&c.sample(si.delta),l(),i.current=GU(Ct(_e({keyframes:[r.get(),s.current],velocity:r.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01},e),{onUpdate:o.current}))},l=()=>{i.current&&i.current.stop()};return pe.useInsertionEffect(()=>r.attach((c,d)=>t?d(c):(s.current=c,o.current=d,Xt.update(a),r.get()),l),[JSON.stringify(e)]),Im(()=>{if(Tn(n))return n.on("change",c=>r.set(kR(c)))},[r]),r}function Iz(n,e,t){return typeof n=="string"?n=document.querySelectorAll(n):n instanceof Element&&(n=[n]),Array.from(n||[])}const Nm=new WeakMap;let la;function Bz(n,e){if(e){const{inlineSize:t,blockSize:i}=e[0];return{width:t,height:i}}else return n instanceof SVGElement&&"getBBox"in n?n.getBBox():{width:n.offsetWidth,height:n.offsetHeight}}function Lz({target:n,contentRect:e,borderBoxSize:t}){var i;(i=Nm.get(n))===null||i===void 0||i.forEach(r=>{r({target:n,contentSize:e,get size(){return Bz(n,t)}})})}function Dz(n){n.forEach(Lz)}function Fz(){typeof ResizeObserver!="undefined"&&(la=new ResizeObserver(Dz))}function Nz(n,e){la||Fz();const t=Iz(n);return t.forEach(i=>{let r=Nm.get(i);r||(r=new Set,Nm.set(i,r)),r.add(e),la==null||la.observe(i)}),()=>{t.forEach(i=>{const r=Nm.get(i);r==null||r.delete(e),r!=null&&r.size||la==null||la.unobserve(i)})}}const Um=new Set;let vd;function Uz(){vd=()=>{const n={width:window.innerWidth,height:window.innerHeight},e={target:window,size:n,contentSize:n};Um.forEach(t=>t(e))},window.addEventListener("resize",vd)}function Oz(n){return Um.add(n),vd||Uz(),()=>{Um.delete(n),!Um.size&&vd&&(vd=void 0)}}function kz(n,e){return typeof n=="function"?Oz(n):Nz(n,e)}const zz=50,zR=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Hz=()=>({time:0,x:zR(),y:zR()}),Gz={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function HR(n,e,t,i){const r=t[e],{length:s,position:o}=Gz[e],a=r.current,l=t.time;r.current=n[`scroll${o}`],r.scrollLength=n[`scroll${s}`]-n[`client${s}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Wc(0,r.scrollLength,r.current);const c=i-l;r.velocity=c>zz?0:E_(r.current-a,c)}function Vz(n,e,t){HR(n,"x",e,t),HR(n,"y",e,t),e.time=t}function Wz(n,e){const t={x:0,y:0};let i=n;for(;i&&i!==e;)if(i instanceof HTMLElement)t.x+=i.offsetLeft,t.y+=i.offsetTop,i=i.offsetParent;else if(i.tagName==="svg"){const r=i.getBoundingClientRect();i=i.parentElement;const s=i.getBoundingClientRect();t.x+=r.left-s.left,t.y+=r.top-s.top}else if(i instanceof SVGGraphicsElement){const{x:r,y:s}=i.getBBox();t.x+=r,t.y+=s;let o=null,a=i.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=i.parentNode;i=o}else break;return t}const Xz={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},uA={start:0,center:.5,end:1};function GR(n,e,t=0){let i=0;if(n in uA&&(n=uA[n]),typeof n=="string"){const r=parseFloat(n);n.endsWith("px")?i=r:n.endsWith("%")?n=r/100:n.endsWith("vw")?i=r/100*document.documentElement.clientWidth:n.endsWith("vh")?i=r/100*document.documentElement.clientHeight:n=r}return typeof n=="number"&&(i=e*n),t+i}const jz=[0,0];function Jz(n,e,t,i){let r=Array.isArray(n)?n:jz,s=0,o=0;return typeof n=="number"?r=[n,n]:typeof n=="string"&&(n=n.trim(),n.includes(" ")?r=n.split(" "):r=[n,uA[n]?n:"0"]),s=GR(r[0],t,i),o=GR(r[1],e),s-o}const Kz={x:0,y:0};function Yz(n){return"getBBox"in n&&n.tagName!=="svg"?n.getBBox():{width:n.clientWidth,height:n.clientHeight}}function Qz(n,e,t){const{offset:i=Xz.All}=t,{target:r=n,axis:s="y"}=t,o=s==="y"?"height":"width",a=r!==n?Wz(r,n):Kz,l=r===n?{width:n.scrollWidth,height:n.scrollHeight}:Yz(r),c={width:n.clientWidth,height:n.clientHeight};e[s].offset.length=0;let d=!e[s].interpolate;const h=i.length;for(let p=0;pqz(n,i.target,t),update:r=>{Vz(n,t,r),(i.offset||i.target)&&Qz(n,t,i)},notify:()=>e(t)}}const yd=new WeakMap,VR=new WeakMap,fA=new WeakMap,WR=n=>n===document.documentElement?window:n;function $z(n,i={}){var r=i,{container:e=document.documentElement}=r,t=Wn(r,["container"]);let s=fA.get(e);s||(s=new Set,fA.set(e,s));const o=Hz(),a=Zz(e,n,o,t);if(s.add(a),!yd.has(e)){const c=()=>{for(const v of s)v.measure()},d=()=>{for(const v of s)v.update(si.timestamp)},h=()=>{for(const v of s)v.notify()},p=()=>{Xt.read(c,!1,!0),Xt.read(d,!1,!0),Xt.update(h,!1,!0)};yd.set(e,p);const g=WR(e);window.addEventListener("resize",p,{passive:!0}),e!==document.documentElement&&VR.set(e,kz(e,p)),g.addEventListener("scroll",p,{passive:!0})}const l=yd.get(e);return Xt.read(l,!1,!0),()=>{var c;hs(l);const d=fA.get(e);if(!d||(d.delete(a),d.size))return;const h=yd.get(e);yd.delete(e),h&&(WR(e).removeEventListener("scroll",h),(c=VR.get(e))===null||c===void 0||c(),window.removeEventListener("resize",h))}}function XR(n,e){b3(!!(!e||e.current))}const eH=()=>({scrollX:Os(0),scrollY:Os(0),scrollXProgress:Os(0),scrollYProgress:Os(0)});function jR(r={}){var s=r,{container:n,target:e,layoutEffect:t=!0}=s,i=Wn(s,["container","target","layoutEffect"]);const o=Lm(eH);return(t?Im:pe.useEffect)(()=>(XR("target",e),XR("container",n),$z(({x:l,y:c})=>{o.scrollX.set(l.current),o.scrollXProgress.set(l.progress),o.scrollY.set(c.current),o.scrollYProgress.set(c.progress)},Ct(_e({},i),{container:(n==null?void 0:n.current)||void 0,target:(e==null?void 0:e.current)||void 0}))),[n,e,JSON.stringify(i.offset)]),o}let dA=class extends pe.Component{constructor(){super(...arguments);jD(this,"state",{hasError:!1})}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,i){console.error("Uncaught error:",t,i)}render(){return this.state.hasError?this.props.fallback:this.props.children}};const Jr=(n,e,t,i)=>{const r=n.target,s={event:"custEv_contentClick",blade:{id:e,name:"sf/open",source:"www",variant:"dc-overview-refresh",position:i||1,state:"rendered",module:{id:e,name:t,link:{url:r.getAttribute("href"),text:r.innerText,elementType:r.tagName}}}};console.log("-- CLICK TRACKING QA --"),console.log(s),window.dataLayer.push(_e({},s))},JR=({position:n,x:e})=>n==="right"?me.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},style:{x:e},className:"data-dust absolute right-[8%] top-[-8%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})}):me.jsx(Xi.div,{initial:{opacity:0},animate:{opacity:1},style:{x:e},className:"data-dust absolute visible left-[2%] top-[22%] z-30 w-[60px] sm:w-[160px] max-sm:hidden",children:me.jsx("img",{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/3D-DataDust-1.png?w=100",alt:""})});var KR={exports:{}};(function(n,e){(function(i,r){n.exports=r()})(window,function(){return function(t){var i={};function r(s){if(i[s])return i[s].exports;var o=i[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=i,r.d=function(s,o,a){r.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},r.r=function(s){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,o){if(o&1&&(s=r(s)),o&8||o&4&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),o&2&&typeof s!="string")for(var l in s)r.d(a,l,function(c){return s[c]}.bind(null,l));return a},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="",r(r.s=6)}([function(t,i){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(s){typeof window=="object"&&(r=window)}t.exports=r},function(t,i,r){function s(){return s=Object.assign||function(w){for(var I=1;I-1&&(_=_.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var m=_.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),x=this.extractLocation(m.pop()),S=m.join(" ")||void 0,w=["eval",""].indexOf(x[0])>-1?void 0:x[0];return new c({functionName:S,fileName:w,lineNumber:x[1],columnNumber:x[2],source:_})},this)},parseFFOrSafari:function(v){var A=v.stack.split(` `).filter(function(_){return!_.match(p)},this);return A.map(function(_){if(_.indexOf(" > eval")>-1&&(_=_.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),_.indexOf("@")===-1&&_.indexOf(":")===-1)return new c({functionName:_});var m=/((.*".+"[^@]*)?[^@]*)(?:@)/,x=_.match(m),S=x&&x[1]?x[1]:void 0,w=this.extractLocation(_.replace(m,""));return new c({functionName:S,fileName:w[0],lineNumber:w[1],columnNumber:w[2],source:_})},this)},parseOpera:function(v){return!v.stacktrace||v.message.indexOf(` `)>-1&&v.message.split(` `).length>v.stacktrace.split(` `).length?this.parseOpera9(v):v.stack?this.parseOpera11(v):this.parseOpera10(v)},parseOpera9:function(v){for(var A=/Line (\d+).*script (?:in )?(\S+)/i,_=v.message.split(` `),m=[],x=2,S=_.length;x/,"$2").replace(/\([^\)]*\)/g,"")||void 0,I;S.match(/\(([^\)]*)\)/)&&(I=S.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var P=I===void 0||I==="[arguments not available]"?void 0:I.split(",");return new c({functionName:w,args:P,fileName:x[0],lineNumber:x[1],columnNumber:x[2],source:_})},this)}}})},function(t,i,r){Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function o(a){var l=a===void 0?{emit:!1,logger:console.log}:a,c=l.emit,d=l.logger;this.emit=c,this.externalLogger=d,this.buffer=[],this.customLevel={},this.error=this.setLevel(1),this.warn=this.setLevel(2),this.info=this.setLevel(3),this.log=this.setLevel(4)}return o.prototype.getLogs=function(a){return typeof a=="function"?this.buffer.filter(function(l){return l.level===a.level}):a?this.buffer.filter(function(l){return l.level===a}):this.buffer},o.prototype.setLevel=function(a){var l=this,c=function(){for(var d=[],h=0;h '+k+" ":k};return'
'+L('')+"
"},Ke=function(b){var C=document.createElement("script");return C.type="application/ld+json",C.text=JSON.stringify(b),C},kt=function(b){return new c(function(C,L){return Y({error:L,success:C,url:""+wt()+b+Me,uuid:"style_"+b})})},Et=function(b){return new c(function(C,L){return Y({error:L,success:C,url:""+wt()+b+fe,uuid:"integrations_"+b})})},et=function(b){return new c(function(C,L){return Y({error:L,success:C,url:""+wt()+b+re,uuid:"details_"+b})})},Tt=function(b,C){return new c(function(L,k){var j=encodeURIComponent(C),ce=""+wt()+b+"/contact/"+j+"/marketoContact.js";Y({error:k,success:L,url:ce,uuid:"marketoContact_"+b})})},Ft=function(b){var C=b.error,L=b.url,k=b.requestUuid,j=document.createElement("script");return j.type="application/javascript",j.onerror=C,j.src=L+"?callback=window.VidyardV4.jsonp."+k+".done",j.setAttribute("data-playbackurl",$e()),document.body.appendChild(j),j},sn={},Y=function(b){var C=b.url,L=b.uuid,k=b.success,j=b.error,ce=L.replace(/-/g,""),de=Ft({error:j,url:C,requestUuid:ce}),Fe=I(function(Je){k(Je),de.parentNode.removeChild(de)});sn[ce]=sn[ce]||[],sn[ce].push(Fe),window.VidyardV4.jsonp[ce]={done:function(Je){sn[ce].forEach(function(gt){return gt(Je)})}}},Le={errors:{placeholder:"Cannot render the player, check the placeholder Image"}},xe=function(b,C){var L={};for(var k in b)Object.prototype.hasOwnProperty.call(b,k)&&C.indexOf(k)<0&&(L[k]=b[k]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,k=Object.getOwnPropertySymbols(b);j=ot*2;z(L.container,"playlist-open",pt)}k("getStyle sent"),kt(L.uuid).then(function(pt){k("getStyle received: "+JSON.stringify(pt));var Nn=pt.pl===1&&C.playlist_always_open!=="0"||C.playlist_always_open==="1";Nn?(L.iframe.parentElement.setAttribute("data-pl","true"),d("resize","onresize",gt),gt()):L.iframe.parentElement.setAttribute("data-pl","false")}).catch(function(pt){k("getStyle failed, likely a network error")})},wn=Vt,Kn=function(b){b===void 0&&(b=document.body);for(var C=0,L=Array.from(b.children);C=0}).sort(ne)},Xe=["button:enabled:not([readonly])","select:enabled:not([readonly])","textarea:enabled:not([readonly])","input:enabled:not([readonly])","a[href]","area[href]","iframe","object","embed","[tabindex]","[contenteditable]","[autofocus]"],nt=Xe.join(","),Ze=function(C,L){return C.reduce(function(k,j){return k.concat(Gn(j.querySelectorAll(nt)),j.parentNode?Gn(j.parentNode.querySelectorAll(Xe.join(","))).filter(function(ce){return ce===j}):[])},[])},ht=function(C){var L=C.querySelectorAll("["+Ra+"]");return Gn(L).map(function(k){return Ze([k])}).reduce(function(k,j){return k.concat(j)},[])},yt=function(C){return!C||!C.getPropertyValue?!1:C.getPropertyValue("display")==="none"||C.getPropertyValue("visibility")==="hidden"},ft=function b(C){return!C||C===document||C.nodeType===Node.DOCUMENT_NODE||!yt(window.getComputedStyle(C,null))&&b(C.parentNode)},Yt=function(C){return!((C.tagName==="INPUT"||C.tagName==="BUTTON")&&(C.type==="hidden"||C.disabled))},ln=function b(C){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return L.push(C),C.parentNode&&b(C.parentNode,L),L},en=function(C,L){for(var k=ln(C),j=ln(L),ce=0;ce=0)return de}return!1},xn=function(C){return Gn(C).filter(function(L){return ft(L)}).filter(function(L){return Yt(L)})},st=function(C,L){return De(xn(Ze(C)),!0)},Ue=function(C){return De(xn(Ze(C)),!1)},fn=function(C){return xn(ht(C))},At=function(C){return C.tagName==="INPUT"&&C.type==="radio"},cn=function(C,L){return L.filter(At).filter(function(k){return k.name===C.name}).filter(function(k){return k.checked})[0]||C},Ui=function(C){return C[0]&&C.length>1&&At(C[0])&&C[0].name?cn(C[0],C):C[0]},Fn=function(C,L){return C.length>1&&At(C[L])&&C[L].name?C.indexOf(cn(C[L],C)):L},Yn=Ui,hn=function(C){return function(L){return!!L.autofocus||L.dataset&&!!L.dataset.autofocus||C.indexOf(L)>=0}},dr=function(C){return C&&C.dataset&&C.dataset.focusGuard},Xs=function(C){return!dr(C)},ui=function(C,L,k,j,ce){var de=C.length,Fe=C[0],Je=C[de-1],gt=dr(k);if(!(C.indexOf(k)>=0)){var pt=L.indexOf(k),Nn=L.indexOf(j||pt),Vn=C.indexOf(j),qt=pt-Nn,Ps=L.indexOf(Fe),Ge=L.indexOf(Je),at=Fn(C,0),bt=Fn(C,de-1);if(pt===-1||Vn===-1)return C.indexOf(ce&&ce.length?Yn(ce):Yn(C));if(!qt&&Vn>=0)return Vn;if(pt<=Ps&>&&Math.abs(qt)>1)return bt;if(pt>=Ps&>&&Math.abs(qt)>1)return at;if(qt&&Math.abs(qt)>1)return Vn;if(pt<=Ps)return bt;if(pt>Ge)return at;if(qt)return Math.abs(qt)>1?Vn:(de+Vn+qt)%de}},Ia=function(C,L,k){var j=Dr(C),ce=Dr(L),de=j[0],Fe=null;return ce.filter(Boolean).forEach(function(Je){Fe=en(Fe||Je,Je)||Fe,k.filter(Boolean).forEach(function(gt){var pt=en(de,gt);pt&&(!Fe||pt.contains(Fe)?Fe=pt:Fe=en(pt,Fe))})}),Fe},qi=function(C){return C.reduce(function(L,k){return L.concat(fn(k))},[])},Yu=function(C,L){var k=new Map;return L.forEach(function(j){return k.set(j.node,j)}),C.map(function(j){return k.get(j)}).filter(Boolean)},F1=function(C,L){var k=document&&document.activeElement,j=Ku(C).filter(Xs),ce=Ia(k||C,C,j),de=st(j).filter(function(Nn){var Vn=Nn.node;return Xs(Vn)});if(!(!de[0]&&(de=Ue(j).filter(function(Nn){var Vn=Nn.node;return Xs(Vn)}),!de[0]))){var Fe=st([ce]).map(function(Nn){var Vn=Nn.node;return Vn}),Je=Yu(Fe,de),gt=Je.map(function(Nn){var Vn=Nn.node;return Vn}),pt=ui(gt,Fe,k,L,gt.filter(hn(qi(j))));return pt===void 0?pt:Je[pt]}},N1=F1,Qu=function(C){C.focus(),C.contentWindow&&C.contentWindow.focus()},Ba=0,Bo=!1,qu=function(b,C){var L=N1(b,C);if(!Bo&&L){if(Ba>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Bo=!0,setTimeout(function(){Bo=!1},1);return}Ba++,Qu(L.node),Ba--}},U1=qu,Mh=0,Zu=null,wh=function(){return document&&document.activeElement===document.body},$l=function(){return wh()||Pa()},O1=function(){var C=!1;if(Mh){var L=Mh;$l()||(L&&!le(L)&&(C=U1(L,Zu)),Zu=document.activeElement)}return C},Eh=function(C){return C.filter(function(L){return L}).slice(-1)[0]},Qt=function(C){Mh=C,C&&O1()},js=[],La=function(C){return Qt(Eh(js))?(C&&C.preventDefault(),!0):!1},t0=function(){document.addEventListener("focusin",La)},k1=function(){document.removeEventListener("focusin",La)},z1={on:function(C){js.length===0&&t0(),js.indexOf(C)<0&&(js.push(C),La())},off:function(C){js=js.filter(function(L){return L!==C}),La(),js.length===0&&k1()}},Qn=z1,Ch=r(1),n0=r.n(Ch);function Th(b,C,L){var k=V1(b),j=$r(L),ce=es(C),de=document.createElement("div");return de.id="vidyard-focusable-element",de.tabIndex=0,j.popbox.appendChild(k.backerElement),j.popbox.appendChild(k.containingDiv),j.popbox.appendChild(ce),Qi.ios()&&Kn(),document.body.appendChild(j.overlayWrapper),document.body.appendChild(de),j.closeContainer.focus(),Qn.on(j.overlayWrapper),n0.a.trap(j.overlayWrapper),setTimeout(function(){j.overlayWrapper.style.opacity="1",j.overlayWrapper.style.filter="alpha(opacity=100)"},0),{container:k,lightbox:j}}function H1(b){var C=document.getElementById("vidyard-content-fixed"),L=document.getElementById("vidyard-focusable-element"),k=document.getElementById("vidyard-overlay"),j=document.getElementById("vidyard-overlay-wrapper"),ce=document.getElementById("vidyard-popbox");if(!(!C||!k||!j||!ce)){L&&L.parentNode.removeChild(L),Qn.off(j),n0.a.untrap(j),j.style.opacity="0",j.style.filter="alpha(opacity=0)";var de=function(){j.parentNode.removeChild(j)};Qi.ios()&&Jt(),setTimeout(de,Ce*1e3)}}function $u(b){b.style.opacity="1"}function $r(b){var C=document.createElement("div"),L=document.createElement("div"),k=document.createElement("div"),j=document.createElement("div"),ce=G1().closeContainer;return C.id="vidyard-overlay",C.setAttribute("aria-hidden","true"),C.style.display="block",L.id="vidyard-content-fixed",L.setAttribute("aria-label","media player lightbox"),L.setAttribute("role","dialog"),L.style.display="block",k.id="vidyard-popbox",j.id="vidyard-overlay-wrapper",j.style.display="block",L.appendChild(k),j.appendChild(C),j.appendChild(ce),j.appendChild(L),b&&(C.style.zIndex=""+b,L.style.zIndex=""+(b+2),ce.style.zIndex=""+(b+1)),{closeContainer:ce,contentFixed:L,overlay:C,overlayWrapper:j,popbox:k}}function G1(){var b=document.createElement("div"),C=document.createElement("div");return b.className="vidyard-close-container",b.setAttribute("aria-label","Close Player"),b.setAttribute("role","button"),b.setAttribute("tabindex","0"),C.className="vidyard-close-x",document.documentMode<9&&(C.className+=" simple-close",C.innerHTML="×"),b.appendChild(C),{closeButton:C,closeContainer:b}}function V1(b){var C=document.createElement("div");C.className="vidyard-lightbox-content-backer";var L=document.createElement("div");L.innerHTML=b;var k=L.getElementsByTagName("div")[0];k.style.position="absolute",k.style.height="100%",k.style.width="100%",k.style.zIndex="2";var j=L.getElementsByTagName("iframe")[0],ce=j.parentNode;return ce.style.position="static",ce.style.paddingBottom="0",j.style.opacity="1",setTimeout(function(){C.style.opacity="1",C.style.filter="alpha(opacity=100)"},0),{backerElement:C,containerElement:L,containingDiv:k,iframe:j}}function es(b){var C=_("vidyard-lightbox-image","img",b)[0].cloneNode();return C.className="",C.id="vidyard-popbox-constraint",C.alt="",C.setAttribute("aria-hidden","true"),C}var Fr,hr={};function bh(b){var C=_("vidyard-lightbox-centering","div",b.container)[0];b.player.showLightbox=function(){ve.setLevel(b.player.uuid)("show lightbox"),i0({container:b.container,iframe:b.iframe,overlayZindex:b.overlayZindex,player:b.player})},b.player.hideLightbox=function(){return Ai(b.player)},d("click","onclick",b.player.showLightbox,C),d("keydown","onkeydown",P(function(L){L.preventDefault(),b.player.showLightbox(L)}),C)}function i0(b){if(!(!b.iframe||document.getElementById("vidyard-overlay"))){Fr=document.activeElement;var C=Th(b.iframe,b.container,b.overlayZindex);b.player.iframe=C.container.iframe,b.player.on("metadata",function de(Fe){var Je=Fe[0];b.player.iframe.title=Je.name,b.player.off("metadata",de)});var L=b.player.uuid,k=C.container.iframe,j=ef(k,L,b.player),ce=X1(k,L);hr.iframeLoaded=d("load","onload",j,C.container.iframe),hr.messageHandler=d("message","onmessage",H(function(de){j(),ce(),W1(de,b.player)}),window),hr.overlayClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.overlayWrapper),hr.fixedClick=d("click","onclick",function(){return Ai(b.player)},C.lightbox.contentFixed),hr.closeKeyPress=d("keydown","onkeydown",P(function(){return Ai(b.player)}),C.lightbox.closeContainer),hr.responsivePlayerSize=d("resize","onresize",r0,window)}}function r0(){var b=document.getElementById("vidyard-popbox-constraint"),C=parseFloat((window.innerHeight/window.innerWidth*100).toFixed(2)),L=parseFloat(m(b)),k=C
video thumbnail
'}var Ph=function(b){var C=b.dataParams,L=b.player,k=ve.setLevel(C.uuid);k("injecting lighbox embed"),L.placeholder.style.display="none";var j={ratio:m(L.placeholder)},ce=Pe(C,j),de={maxHeight:C.height?parseInt(C.height,10):null,maxWidth:C.width?parseInt(C.width,10):null,ratio:m(L.placeholder)};tf(L.container,C,de),bh({container:L.container,iframe:ce,overlayZindex:C.overlayZindex,player:L}),k("getStyle sent"),kt(L.uuid).then(function(Fe){k("getStyle received: "+JSON.stringify(Fe)),Da(Fe,L.container)}).catch(function(Fe){k("getStyle failed, likely a network error")})},s0=Ph,Ih=/(vidyard|vystaging|hubspot)\.com$/,Bh=function(b,C,L){if(L===void 0&&(L=!1),!(!L&&(!C||!C.hasBacklink||Ih.test(document.location.host)))){var k=document.createElement("a"),j=document.createElement("span"),ce=document.createElement("img");ce.src="https://cdn.vidyard.com/client-logos/vidyard.png",ce.id="backlink-icon",ce.alt="Vidyard Logo",j.id="backlink-text",j.textContent="Powered by Vidyard",k.id="backlink",k.appendChild(ce),k.appendChild(j),k.href=C.backlinkURL,k.rel="nofollow",k.target="_blank",k.setAttribute("aria-label","Link to Vidyard"),k.dataset.testid="backlink",d("click","onclick",function(){var de={data:{event:"Acquisition - Clicked the Backlink"},event:"sendMetricsEvent",uuid:b.uuid};Mt(de,"https://"+$e(),b.iframe)},k),b.container.appendChild(k)}},Fa=Bh;function pr(b){var C=window.VidyardV4.integrations,L=ve.setLevel(b.uuid),k=C.getCookie("marketo");k&&(L("getMarketoLead sent"),Tt(b.uuid,k).then(F).then(function(j){L("getMarketoLead received: "+j),b.on("ready",function(){C.addKnownVisitor("marketo",j,b.org)})}).catch(function(){ve.warn("Invalid Marketo cookie")})),L("getIntegrations"),Et(b.uuid).then(function(j){L("getIntegrations received: "+JSON.stringify(j)),b.on("ready",function(){b._tmpOrg=j,C.updatePlayer(b)})}).catch(function(j){L("getIntegrations failed, likely a network error")})}function ts(b){var C=ve.setLevel(b);return C("getSEO sent"),et(b).then(function(L){if(C("getSEO: "+JSON.stringify(L)),!g(L)){var k=Ke(L);document.getElementsByTagName("head")[0].appendChild(k)}return L}).catch(function(L){C("getSEO failed, likely a network error")})}var Js=function(b,C){var L=document.createElement("div");L.className="vidyard-player-container",L.setAttribute("uuid",b);var k=L.style;return k.margin="auto",k.width="100%",k.height="auto",k.overflow="hidden",k.display="block",C.type==="inline"&&(k.maxWidth=C.width?C.width+"px":"",k.maxHeight=C.height?C.height+"px":""),L},Lh=Js,o0=function(){function b(C){var L=this;this.disable_popouts=1;var k=ge(q(C));Object.keys(k).forEach(function(de){L[de]=k[de]}),this.type!=="inline"&&this.type!=="lightbox"&&(x("Invalid Vidyard player embed type, defaulting to inline.","warn"),this.type="inline"),this.v=te,this.disable_popouts=1,this.custom_id=this.custom_id||$("vycustom_id"),this.vyemail=this.vyemail||$("vyemail"),this.vysfid=this.vysfid||$("vysfid"),this.vyetoken=this.vyetoken||$("vyetoken");var j=$("vyac"),ce=$("vyplayer");j&&ce&&ce===this.uuid?this.access_code=j:j&&ce&&x("Invalid Vidyard player access code.","warn")}return b.prototype.toQueryString=function(){var C="?",L;for(L in this)this.hasOwnProperty(L)&&(L==="height"||L==="uuid"||L==="width"||this[L]!==void 0&&(C+=C!=="?"?"&":"",C+=encodeURIComponent(L)+"="+encodeURIComponent(this[L])));return C==="?"?"":C},b}(),ns=o0;function Ks(b){b===void 0&&(b=_("vidyard-player-embed","img"));for(var C=0,L=b;C-1&&this._callbackStore[C].splice(j,1)}else this._callbackStore[C]=[]},b.prototype.ready=function(){return this._ready},b.prototype.play=function(){this._message({event:"play"})},b.prototype.pause=function(){this._message({event:"pause"})},b.prototype.resume=function(){this._message({event:"resume"})},b.prototype.seek=function(C){this._message({event:"seek",position:C})},b.prototype.setVolume=function(C){this._message({event:"setVolume",newVolume:C})},b.prototype.setPlaybackSpeed=function(C){this._message({event:"setPlaybackSpeed",speed:C})},b.prototype.playChapter=function(C){x("playChapter() is deprecated. We recommend to use playVideoAtIndex() instead."),this.playVideoAtIndex(C)},b.prototype.playVideoAtIndex=function(C){this._message({chapter_index:C,event:"playChapter"})},b.prototype.setAudioTrack=function(C){this._message({audioTrackId:C,event:"setAudioTrack"})},b.prototype.enableCaption=function(C,L){this._message({event:"enableCaption",label:C,language:L})},b.prototype.disableCaption=function(C,L){this._message({event:"disableCaption",label:C,language:L})},b.prototype.consentToGDPR=function(C){this._message({consent:C,event:"consentToGDPR"})},b.prototype.createCta=function(C){this._message({attributes:A({display_once:!1,duration:10,fullscreen:!1,html:"",opacity:1,start:0,width:300},C),event:"createCta"})},b.prototype.updateCta=function(C,L){this._message({attributes:L,event:"updateCta",id:C})},b.prototype.createVideoSection=function(C,L){this._message({event:"createVideoSection",title:C,milliseconds:L})},b.prototype.updateVideoSection=function(C,L,k){this._message({event:"updateVideoSection",index:C,title:L,milliseconds:k})},b.prototype.deleteVideoSection=function(C){this._message({event:"deleteVideoSection",index:C})},b.prototype.addEvent=function(C){var L=C.start,k=L===void 0?0:L,j=C.duration,ce=j===void 0?1:j,de=C.videoIndex,Fe=C.chapterIndex,Je=C.eventId;if(!Je){x("Missing arguments. Need eventId");return}Fe>=0&&x("Parameter chapterIndex is deprecated. We recommend to use videoIndex instead.");var gt=0;gt=Fe||gt,gt=de||gt,this._message({chapterIndex:gt,duration:ce,event:"addEvent",id:Je,start:k})},b.prototype.getCurrentChapter=function(){return x("getCurrentChapter() is deprecated. We recommend to use getCurrentVideoIndex() instead."),this.getCurrentVideoIndex()},b.prototype.getCurrentVideoIndex=function(){return this.status===null?null:this.status.chapterIndex},b.prototype.currentTime=function(){return this.status===null?null:this.status.currentTime},b.prototype.scrubbing=function(){return this.status===null?null:this.status.scrubbing},b.prototype.toggleFullscreen=function(){var C=this,L=J();if(L){var k=this.iframe[L.requestFullscreen]();k?k.then(function(){C._message({event:"toggleFullscreen"})}):this._message({event:"toggleFullscreen"}),d(L.fullscreenchange,"MSFullscreenChange",function(){document[L.fullscreenElement]||C._message({event:"exitFullscreen"})}),d("message","onmessage",H(function(j){j.event==="fullScreenChange"&&j.params===!1&&document[L.fullscreenElement]&&document[L.exitFullscreen]()}))}else this._message({event:"toggleFullscreen"})},b.prototype.resetPlayer=function(){this._message({event:"resetPlayer"})},b.prototype._message=function(C){if(this.ready()!==!0){x("Player is not ready yet! No messages can be recieved.","error");return}Mt(a0({},C,{uuid:this.uuid}),"https://"+$e(),this.iframe)},b.prototype._updateStatus=function(C){if(typeof C.status=="object"&&(this.status=C.status),typeof C.metadata=="object"&&(this.metadata=C.metadata,this.trigger("metadata",C.metadata)),this.status){if(this.status.currentTime!==this._previousTime&&this._callbackStore.timeupdate)for(var L=0,k=this._callbackStore.timeupdate;Lk?1:0});for(var C=0;C1)){C>=1&&(k.partOfVideoWatched[Math.floor(C)]=1),k.timeWatched=Object.keys(k.partOfVideoWatched).length;for(var ce=k.player.metadata.chapters_attributes[L].video_attributes.length_in_milliseconds,de=Math.floor(ce/1e3),Fe=k.timeWatched/de*100;Fe>=k.thresholds[k.thresholds.length-1];)k.callback({chapter:L,event:k.thresholds.pop(),player:b,videoIndex:L})}}}function h0(b,C,L){mr(b,C,L);var k=function(j){return Do(b,j)};return b.on("timeupdate",k),{player:b,removeEventListeners:function(){b.off("timeupdate",k),Rs(b)}}}function Fh(b,C,L){var k;C===void 0&&(C=[1,25,50,75,90]);var j=[],ce=L?(k={},k[L.uuid]=L,k):Nh(),de=Ua(C),Fe=function(gt){if(ce.hasOwnProperty(gt)&>.length>0&&ce[gt]!==""){var pt=h0(ce[gt],b,de);j.push(pt)}else x(function(){return console.error("Could not attach Progress Events to player "+gt+", make sure to load the Vidyard Player API")})};for(var Je in ce)Fe(Je);return j.length===0&&x(function(){return console.warn("No Vidyard Players found. (include this script below player embed codes)")}),j}function Nh(){try{return window.Vidyard.players()}catch(b){return x(function(){return console.error("The Vidyard Player API must be loaded before this script can execute")}),{}}}function Zi(){for(var b=[],C=0;C=0&&p.splice(F,1)}function x(T){var F=document.createElement("style");return T.attrs.type===void 0&&(T.attrs.type="text/css"),w(F,T.attrs),_(T,F),F}function S(T){var F=document.createElement("link");return T.attrs.type===void 0&&(T.attrs.type="text/css"),T.attrs.rel="stylesheet",w(F,T.attrs),_(T,F),F}function w(T,F){Object.keys(F).forEach(function(X){T.setAttribute(X,F[X])})}function I(T,F){var X,J,q,$;if(F.transform&&T.css)if($=F.transform(T.css),$)T.css=$;else return function(){};if(F.singleton){var K=h++;X=d||(d=x(F)),J=D.bind(null,X,K,!1),q=D.bind(null,X,K,!0)}else T.sourceMap&&typeof URL=="function"&&typeof URL.createObjectURL=="function"&&typeof URL.revokeObjectURL=="function"&&typeof Blob=="function"&&typeof btoa=="function"?(X=S(F),J=B.bind(null,X,F),q=function(){m(X),X.href&&URL.revokeObjectURL(X.href)}):(X=x(F),J=N.bind(null,X),q=function(){m(X)});return J(T),function(z){if(z){if(z.css===T.css&&z.media===T.media&&z.sourceMap===T.sourceMap)return;J(T=z)}else q()}}var P=function(){var T=[];return function(F,X){return T[F]=X,T.filter(Boolean).join(` `)}}();function D(T,F,X,J){var q=X?"":J.css;if(T.styleSheet)T.styleSheet.cssText=P(F,q);else{var $=document.createTextNode(q),K=T.childNodes;K[F]&&T.removeChild(K[F]),K.length?T.insertBefore($,K[F]):T.appendChild($)}}function N(T,F){var X=F.css,J=F.media;if(J&&T.setAttribute("media",J),T.styleSheet)T.styleSheet.cssText=X;else{for(;T.firstChild;)T.removeChild(T.firstChild);T.appendChild(document.createTextNode(X))}}function B(T,F,X){var J=X.css,q=X.sourceMap,$=F.convertToAbsoluteUrls===void 0&&q;(F.convertToAbsoluteUrls||$)&&(J=g(J)),q&&(J+=` /*# sourceMappingURL=data:application/json;base64,`+btoa(unescape(encodeURIComponent(JSON.stringify(q))))+" */");var K=new Blob([J],{type:"text/css"}),ge=T.href;T.href=URL.createObjectURL(K),ge&&URL.revokeObjectURL(ge)}},function(t,i){t.exports=function(o){var a=[];return a.toString=function(){return this.map(function(c){var d=r(c,o);return c[2]?"@media "+c[2]+"{"+d+"}":d}).join("")},a.i=function(l,c){typeof l=="string"&&(l=[[null,l,""]]);for(var d={},h=0;h1&&arguments[1]!==void 0?arguments[1]:[],_=v.previousSibling;return _?(A.push(_),l(_,A)):A}function c(v){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=v.nextSibling;return _?(A.push(_),c(_,A)):A}function d(v){var A=l(v).concat(c(v));return A.filter(o)}function h(v){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_=v.parentNode;return _?(A.push(_),h(_,A)):A}function p(v){return h(v).filter(s)}function g(v){return p(v).map(function(A){return d(A)}).reduce(a,[])}t.exports={getSiblings:d,getAncestors:p,getSiblingsOfAncestors:g}},function(t,i,r){(function(s){var o=s.CustomEvent;function a(){try{var l=new o("cat",{detail:{foo:"bar"}});return l.type==="cat"&&l.detail.foo==="bar"}catch(c){}return!1}t.exports=a()?o:typeof document!="undefined"&&typeof document.createEvent=="function"?function(c,d){var h=document.createEvent("CustomEvent");return d?h.initCustomEvent(c,d.bubbles,d.cancelable,d.detail):h.initCustomEvent(c,!1,!1,void 0),h}:function(c,d){var h=document.createEventObject();return h.type=c,d?(h.bubbles=!!d.bubbles,h.cancelable=!!d.cancelable,h.detail=d.detail):(h.bubbles=!1,h.cancelable=!1,h.detail=void 0),h}}).call(this,r(0))},,function(t,i){var r=t.exports={},s,o;function a(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=a}catch(S){s=a}try{typeof clearTimeout=="function"?o=clearTimeout:o=l}catch(S){o=l}})();function c(S){if(s===setTimeout)return setTimeout(S,0);if((s===a||!s)&&setTimeout)return s=setTimeout,setTimeout(S,0);try{return s(S,0)}catch(w){try{return s.call(null,S,0)}catch(I){return s.call(this,S,0)}}}function d(S){if(o===clearTimeout)return clearTimeout(S);if((o===l||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(S);try{return o(S)}catch(w){try{return o.call(null,S)}catch(I){return o.call(this,S)}}}var h=[],p=!1,g,v=-1;function A(){!p||!g||(p=!1,g.length?h=g.concat(h):v=-1,h.length&&_())}function _(){if(!p){var S=c(A);p=!0;for(var w=h.length;w;){for(g=h,h=[];++v1)for(var I=1;I=0&&(c._idleTimeoutId=setTimeout(function(){c._onTimeout&&c._onTimeout()},d))},r(17),i.setImmediate=typeof self!="undefined"&&self.setImmediate||typeof s!="undefined"&&s.setImmediate||this&&this.setImmediate,i.clearImmediate=typeof self!="undefined"&&self.clearImmediate||typeof s!="undefined"&&s.clearImmediate||this&&this.clearImmediate}).call(this,r(0))}])})})(KR);var Om=KR.exports;const tH=({api:n,aspect:e,maxHeight:t,maxWidth:i,params:r,playbackUrl:s,type:o,uuid:a})=>{const[l,c]=pe.useState(!1),[d,h]=pe.useState(!0),p=pe.useRef(null),g=pe.useRef(void 0),v=pe.useRef(!1);return pe.useEffect(()=>{if(!(!p.current||v.current))return v.current=!0,s&&Om._debug.setPlaybackURL(s),Om.api.renderPlayer(_e({aspect:e,container:p.current,height:t,type:o,uuid:a,width:i},r)).then(A=>{g.current=A,h(!1),typeof n=="function"&&n(A,Om.api)}).catch(A=>{c(!0),console.warn(A.message)}),()=>{g.current&&(Om.api.destroyPlayer(g.current),g.current=void 0,v.current=!1)}},[n,e,t,i,r,s,o,a]),me.jsx(dA,{fallback:l,children:me.jsx("div",{className:"video-loaded aspect-video sm:max-w-[940px] m-auto bg-sfnavy overflow-hidden rounded-2xl z-10 mb-10 sm:mb-20",style:{margin:"auto",width:"100%",height:"auto",overflow:"hidden",zIndex:10,maxWidth:"940px",maxHeight:"506px"},ref:p,children:d?me.jsx("img",{rel:"preload",className:"object-cover aspect-video absolute top-0 w-full m-auto overflow-hidden h-auto sm:min-h-[506px] z-10 max-w-[940px] rounded-2xl",style:{margin:"auto",width:"100%",height:"auto",overflow:"hidden",maxWidth:"940px",maxHeight:"506px",zIndex:1},src:`https://play.vidyard.com/${a}.jpg`,width:"940",height:"506"}):null})})},nH=({attributes:n,blade_id:e,blade_position:t})=>{var N,B;const{headline:i="",description:r="",link_1:s,link_2:o,media:a}=n!=null?n:{},l=pe.useRef(null),{scrollYProgress:c}=jR({target:l,offset:["start start","end start"]}),d=Fm(c,{stiffness:140,damping:30,restDelta:.001}),h=Fm(c,{stiffness:220,damping:100,restDelta:.002}),p=Fm(c,{stiffness:200,damping:30}),g=lr(c,[0,1],["0%","300%"]),v=lr(c,[0,1],["0%","100%"]),A=lr(p,[0,1],["0%","350%"]),_=lr(p,[.18,.25],["100%","0%"]),m=lr(d,[0,.6],["0px","200px"]),x=lr(d,[0,.7],["0px","400px"]),S=lr(d,[0,.5],["0px","300px"]),w=lr(h,[0,.8],["0px","-200px"]),I=lr(h,[0,.7],["0px","-400px"]),P=lr(h,[0,.5],["0px","-300px"]),D=pe.lazy(()=>Promise.resolve().then(()=>bX));return me.jsxs("div",{ref:l,className:"relative grid min-h-screen w-screen place-items-center overflow-hidden mb-16",children:[me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-back.png?w=500')",backgroundSize:"120%",backgroundPositionY:v,backgroundPosition:"bottom"},className:"bg-blur absolute inset-0 z-0 opacity-20"}),me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-front.png?w=500')",backgroundSize:"120%",backgroundPositionY:g,backgroundPosition:"bottom"},className:"bg-blur visible absolute inset-0 z-0 opacity-20 max-sm:hidden"}),me.jsx(Xi.div,{style:{backgroundImage:"url('https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/07/marquee-bg-middle.png?w=1200')",backgroundSize:"120%",backgroundPositionY:v,backgroundPosition:"bottom",backgroundRepeat:"no-repeat"},className:"bg-blur z-1 visible absolute inset-0 opacity-20"}),me.jsxs("div",{className:"container relative flex flex-col items-center justify-start gap-10",children:[me.jsx(dA,{fallback:null,children:me.jsxs(pe.Suspense,{fallback:me.jsx(JR,{position:"left",x:w}),children:[me.jsx(Xi.div,{style:{x:w},className:"data-dust absolute visible left-[2%] top-[20%] z-30 w-[60px] sm:w-[160px] max-sm:hidden",children:me.jsx(D,{progress:c,direction:"left",size:"lg"})}),me.jsx(Xi.div,{style:{x:P},className:"data-dust absolute left-[-1%] top-[30%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:me.jsx(D,{progress:c,direction:"right",size:"md"})}),me.jsx(Xi.div,{style:{x:I},className:"data-dust absolute left-[5%] top-[28%] z-30 w-[60px] sm:w-[160px] visible max-sm:hidden",children:me.jsx(D,{progress:c,direction:"right",size:"sm"})})]})}),me.jsxs(Xi.div,{className:"flex flex-col items-center justify-center max-sm:px-1",style:{y:A,opacity:_},children:[me.jsx("h1",{className:"marquee__accent antialiased z-0 mx-2 mt-8 text-center font-display text-[2.4rem] text-white sm:text-[3rem] md:text-[4rem] lg:text-[5rem]",dangerouslySetInnerHTML:{__html:i}}),me.jsx("p",{className:"mt-8 text-center font-sans text-[1rem] text-white sm:text-[1.3rem]",dangerouslySetInnerHTML:{__html:r}}),me.jsxs("div",{className:"flex items-center justify-center gap-4 mt-10",children:[(s==null?void 0:s.label)&&me.jsx("a",{href:s==null?void 0:s.url,className:"inline-flex w-auto items-center justify-center font-sans text-[1.1rem] rounded-[4px] bg-sfnavy px-[32px] py-4 font-semibold text-white antialiased hover:bg-sfprimary hover:text-white",onClick:T=>{var F,X,J;return Jr(T,e,(J=(X=n==null?void 0:n.headline)!=null?X:(F=n==null?void 0:n.link_1)==null?void 0:F.label)!=null?J:"missing headline",t)},target:s==null?void 0:s.target,"aria-label":s==null?void 0:s.ariaLabel,children:s==null?void 0:s.label}),(o==null?void 0:o.label)&&me.jsx("a",{href:o==null?void 0:o.url,className:"inline-flex w-auto items-center justify-center font-sans text-[1.1rem] rounded-[4px] bg-white px-[32px] py-4 font-semibold text-sfnavy antialiased hover:bg-sfprimary hover:text-white",onClick:T=>{var F,X,J;return Jr(T,e,(J=(X=n==null?void 0:n.headline)!=null?X:(F=n==null?void 0:n.link_1)==null?void 0:F.label)!=null?J:"missing headline",t)},target:o==null?void 0:o.target,"aria-label":o==null?void 0:o.ariaLabel,children:o==null?void 0:o.label})]})]}),me.jsxs("div",{className:"video-wrapper w-full relative",children:[me.jsx(dA,{children:me.jsxs(pe.Suspense,{fallback:me.jsx(JR,{position:"right",x:S}),children:[me.jsx(Xi.div,{style:{x:m},className:"data-dust absolute right-[8%] top-[-8%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:c,direction:"right",size:"lg"})}),me.jsx(Xi.div,{style:{x},className:"data-dust absolute right-[5%] top-[10%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:c,direction:"left",size:"md"})}),me.jsx(Xi.div,{style:{x:S},className:"data-dust absolute right-[1%] top-[1%] z-30 w-[50px] sm:w-[150px] visible max-sm:hidden",children:me.jsx(D,{progress:c,direction:"left",size:"sm"})})]})}),me.jsx("div",{className:"w-full sm:max-w-[900px] m-auto bg-sfnavy overflow-hidden rounded-2xl z-10 mb-10 sm:mb-20",children:((N=a==null?void 0:a.video)==null?void 0:N.uuid)!==void 0?me.jsx(tH,{uuid:(B=a==null?void 0:a.video)==null?void 0:B.uuid,maxWidth:"940px",maxHeight:"506px",type:"inline"}):null})]})]})]})},iH=({attributes:n,blade_id:e,media_items:t,blade_position:i})=>{var s,o;const r={transition:{duration:.3,ease:[.45,.14,.1,.97]}};return me.jsxs("section",{className:"container mx-auto px-8 mt-12 py-8 text-white rounded-2xl max-w-[1280px]",children:[me.jsxs("div",{className:"text-center mb-12 mx-auto ",children:[me.jsx("h2",{className:"text-3xl sm:text-5xl font-display text-white mx-0 sm:mx-6",children:n==null?void 0:n.headline}),me.jsx("p",{className:"mt-4 text-lg font-sans",children:n==null?void 0:n.description}),(n==null?void 0:n.link_1)&&me.jsx("a",{href:(s=n==null?void 0:n.link_1)==null?void 0:s.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:a=>{var l,c,d;return Jr(a,e,(d=(c=n.headline)!=null?c:(l=n==null?void 0:n.link_1)==null?void 0:l.label)!=null?d:"missing headline",i)},children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex hover:bg-white/10",children:n.link_1.label})}),(n==null?void 0:n.link_2)&&me.jsx("a",{href:(o=n==null?void 0:n.link_2)==null?void 0:o.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:a=>{var l,c,d;return Jr(a,e,(d=(c=n.headline)!=null?c:(l=n==null?void 0:n.link_2)==null?void 0:l.label)!=null?d:"missing headline",i)},children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex",children:n.link_2.label})})]}),me.jsx("div",{className:"grid gap-8 grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3",children:t==null?void 0:t.map((a,l)=>{var d,h,p,g,v;const c=a;return me.jsxs(Xi.div,{className:"bg-white flex flex-col rounded-2xl overflow-hidden text-left shadow-2xl",transition:r,initial:{scale:.9,opacity:0},whileInView:{scale:1,opacity:1,transition:{duration:.3,ease:[.45,.14,.1,.97],delay:l*.1}},children:[me.jsx("img",{src:(d=c.image)==null?void 0:d.src,alt:(h=c.image)==null?void 0:h.alt,className:"w-full object-cover aspect-video"}),me.jsxs("div",{className:"flex flex-col h-full gap-4 px-8 py-8",children:[me.jsx("a",{href:c.link_1.url,"aria-label":c.headline,target:c.link_1.target,onClick:A=>Jr(A,e,c.headline,i),children:me.jsx("h3",{className:"text-2xl font-display font-semibold mb-2 text-left text-sfnavy",children:c.headline})}),me.jsx("p",{className:"font-sans mb-4 text-left text-sfdarkgrey",dangerouslySetInnerHTML:{__html:(p=c.description)!=null?p:""}}),((g=c.link_1)==null?void 0:g.url)&&me.jsx("a",{href:c.link_1.url,"aria-label":(v=c.link_1.ariaLabel)!=null?v:`${c.link_1.label} : ${c.headline}`,target:c.link_1.target,className:"text-sfnavy mt-auto hover:text-sfprimary hover:no-underline underline-offset-2 font-sans font-bold underline",onClick:A=>Jr(A,e,c.headline,i),children:c.link_1.label})]})]},l)})})]})},rH=({i:n,attributes:e,progress:t,targetScale:i,range:r,id:s,blade_position:o})=>{var m,x,S,w;const a=pe.useRef(null),l=s;Fm(t,{stiffness:300,damping:50,restDelta:.001});const c=lr(t,r,[1,i]),{headline:d,link_1:h,link_2:p,eyebrow:g,description:v,media:A,blade_layout:_}=e||{};return me.jsx(Xi.section,{ref:a,style:{scale:c},className:"card-section relative sm:sticky sm:top-[72px] mx-auto flex sm:min-h-[70vh] w-full",children:me.jsxs("div",{className:`card-container h-auto sm:max-h-[90vh] p-6 sm:p-16 w-full relative flex max-sm:flex-col-reverse flex-col overflow-hidden items-start justify-end gap-6 sm:rounded-[5rem] sm:items-start sm:gap-12 rounded-[3rem] shadow-2xl ${`bg-${(m=g==null?void 0:g.label)==null?void 0:m.toLocaleLowerCase()}-gradient`} ${_==="right"?"sm:flex-row":"sm:flex-row-reverse"}`,children:[me.jsx("div",{className:"w-full flex items-center justify-center sm:w-1/2",children:me.jsx("img",{className:"object-contain w-full h-full max-h-[300px] sm:max-h-[500px]",src:(x=A==null?void 0:A.image)==null?void 0:x.src,alt:((S=A==null?void 0:A.image)==null?void 0:S.alt)||""})}),me.jsxs("div",{className:"copy flex w-full flex-col items-start justify-center gap-3 sm:gap-6 sm:w-1/2",children:[me.jsxs("div",{className:"pill rounded-full bg-white px-5 py-3 flex items-center justify-center gap-2 font-display text-sm text-sfnavy sm:text-lg",children:[me.jsx("img",{src:(w=g==null?void 0:g.image)==null?void 0:w.src,alt:"",className:"w-6 h-6"}),g==null?void 0:g.label]}),me.jsx("h2",{className:"font-display text-2xl sm:text-clamp text-white",children:d}),me.jsx("div",{className:"stacking-card__desc font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:v||""}}),me.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[h&&me.jsx("a",{href:h==null?void 0:h.url,className:"cta-button lg:my-8 my-2 rounded bg-white px-6 py-4 font-sans text-[1rem] font-semibold text-sfnavy","data-variant":h==null?void 0:h.variant,"aria-label":h==null?void 0:h.ariaLabel,onClick:I=>{var P;return Jr(I,l,(P=d!=null?d:h.label)!=null?P:"missing headline",o)},children:h==null?void 0:h.label}),p&&me.jsx("a",{href:p==null?void 0:p.url,className:'cta-button data-[variant="secondary"]:border-2 bg-black/50 my-8 rounded text-white px-6 py-4 font-sans text-[1rem] font-semibold underline underline-offset-2 hover:no-underline',"data-variant":p==null?void 0:p.variant,"aria-label":p==null?void 0:p.ariaLabel,onClick:I=>{var P;return Jr(I,l,(P=d!=null?d:p.label)!=null?P:"missing headline",o)},children:p==null?void 0:p.label})]})]})]})},n)},sH=({attributes:n,progress:e,blade_id:t,blade_position:i})=>{const{headline:r,description:s,blade_layout:o}=n||{},a=lr(e,[.67,.69],["100%","0%"]),l=lr(e,[.67,.69],["0px","-30px"]);return n?me.jsxs(Xi.div,{className:`text-${o} w-full mb-16`,style:{opacity:a,zIndex:0,y:l},children:[me.jsx("h2",{className:"text-white text-4xl sm:text-5xl font-semibold mx-4 mb-4 font-display",children:r}),me.jsx("div",{className:"text-white text-base sm:text-2xl mx-4 font-bold font-sans leading-[43.20px]",dangerouslySetInnerHTML:{__html:s}}),n.link_1&&me.jsx("a",{href:n.link_1.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:c=>Jr(c,t,n.headline,i),"aria-label":n.link_1.ariaLabel,children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex hover:bg-white/10",children:n.link_1.label})}),n.link_2&&me.jsx("a",{href:n.link_2.url,className:"text-white text-base font-bold font-sans leading-normal mr-4",onClick:c=>Jr(c,t,n.headline,i),"aria-label":n.link_2.ariaLabel,children:me.jsx("div",{className:"h-[54px] px-8 py-[15px] rounded border border-white justify-center items-center gap-2 inline-flex",children:n.link_2.label})})]}):null},oH=({attributes:n,blade_id:e,blade_position:t})=>{const{headline:i,link_1:r,link_2:s,description:o,image:a,blade_layout:l}=n||{};return me.jsxs("div",{className:`px-8 mb-16 sm:px-16 gap-6 sm:gap-24 container mx-auto flex items-center justify-center flex-col ${l==="right"?"sm:flex-row":"sm:flex-row-reverse"}`,children:[me.jsxs("div",{className:"max-sm:w-full sm:w-2/3 flex flex-col gap-4",children:[me.jsx("h2",{className:"font-display text-4xl sm:text-5xl text-white",children:i}),me.jsx("div",{className:"blade__description font-sans text-base text-white sm:text-[1.2rem]",dangerouslySetInnerHTML:{__html:o!=null?o:""}}),me.jsxs("div",{className:"flex w-full items-center justify-start gap-6",children:[r!==void 0?me.jsx("a",{href:r==null?void 0:r.url,className:"cta-button my-8 rounded bg-white px-6 py-4 font-sans text-[1rem] font-semibold text-sfnavy","data-variant":r==null?void 0:r.variant,"aria-label":r==null?void 0:r.ariaLabel,onClick:c=>Jr(c,e,i!=null?i:"missing headline",t),children:r==null?void 0:r.label}):null,s!==void 0?me.jsx("a",{href:s==null?void 0:s.url,className:'cta-button data-[variant="secondary"]:border-2 bg-black/50 my-8 rounded text-white px-6 py-4 font-sans text-[1rem] font-semibold underline underline-offset-2 hover:no-underline',"data-variant":s==null?void 0:s.variant,"aria-label":s==null?void 0:s.ariaLabel,onClick:c=>Jr(c,e,i!=null?i:"missing headline",t),children:s==null?void 0:s.label}):null]})]}),me.jsx("div",{className:"max-sm:w-full sm:md:w-1/3 flex flex-col",children:me.jsx("img",{className:"object-contain w-full h-full max-h-[300px] sm:max-h-[500px]",src:a==null?void 0:a.src,alt:a==null?void 0:a.alt})})]})},aH={nav:{showSearch:!0,showRegion:!0,showContact:!0,showAccount:!0,showCustomerOffer:!0,showProspectOffer:!0},blades:[{id:"1722428758072_wvf",name:"sf/marquee",attributes:{blade_layout:"center",two_column_spacing:"standard",audience_segment:["customer","prospect"],image_overflow:!1,experiment_type:"content",headline:"Deliver exceptional customer experiences with Data Cloud.",headline_size:"standard",description:`

The only hyperscale data engine native to Salesforce.

`,link_1:{variant:"primary",label:"Watch demo",source:"standard-link",url:"https://www.salesforce.com/form/demo/data-cloud-demo/",target:"_blank"},link_2:{variant:"secondary",label:"Get started",source:"standard-link",url:"https://www.salesforce.com/data/next-steps/",target:"_self"},media:{video:{uuid:"YVvGNzrDjF22noY2vHoN11",label:"Data Cloud Video Label",video_type:"vidyard"}},theme_variant:"light",blade_background_type:{kind:"standard_background",blade_background_color:"255, 255, 255"}}},{id:"1726197367914_eed",name:"sf/promotion",attributes:{blade_layout:"float_image",audience_segment:["prospect","customer"],experiment_type:"content",headline:"Your Agentforce journey begins with Data Cloud.",description:`

Agents need the right data to work. With Data Cloud, you can create the most intelligent agents possible, giving them access to the exact data they need to deliver any employee or customer experience. Use any data in your organization with Agentforce in a safe and secure manner thanks to the Einstein 1 Trust Layer.

`,image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/agentforce-vignette-min.png?w=1024",alt:"",title:"2024/09/agentforce-vignette-min.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/agentforce-vignette-min.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/agentforce-vignette-min.png?resize=300,251",width:300,height:251},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/agentforce-vignette-min.png?resize=768,643",width:768,height:643},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/agentforce-vignette-min.png?resize=1024,857",width:1024,height:857}],width:1024,height:857,image_alignment:"right"},link_1:{variant:"primary",label:"Learn more",source:"standard-link",url:"https://www.salesforce.com/agentforce/"}}},{id:"1723730041037_ih7",name:"sf/text",attributes:{blade_layout:"center",audience_segment:["customer","prospect"],experiment_type:"content",headline:"Data Cloud makes every cloud better.",description:"",blade_background_type:{blade_background_color:"255, 255, 255"},headline_size:"large",column_grid:"one"}},{id:"1722380576054_yva",name:"sf/oneup",attributes:{blade_layout:"right",audience_segment:["customer","prospect"],experiment_type:"content",eyebrow:{label:"Sales",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/06/icon-sales.svg?w=1024",alt:null,title:null,sizes:[],width:"1024",height:"1024"}},headline:"Find the hottest leads. Close more deals.",description:`
  • Automate prospecting based on buyer intent.
  • Grow wallet share with new upsell and cross-sell opportunities.
  • Boost seller productivity by leveraging customer intent and engagement data.
`,link_1:{variant:"secondary",label:"Learn more",source:"standard-link",url:"https://www.salesforce.com/data/solutions/sales-teams/",ariaLabel:"Learn more about Data Cloud for Sales Teams"},media:{image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/datacloud-sales-update-sept-min.png?w=960",alt:"A visual representation of data cloud for Sales",title:"2024/09/datacloud-sales-update-sept-min.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/datacloud-sales-update-sept-min.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/datacloud-sales-update-sept-min.png?resize=300,300",width:300,height:300},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/datacloud-sales-update-sept-min.png?resize=768,768",width:768,height:768}],width:960,height:960}},blade_background_type:{blade_background_color:"222, 249, 243",kind:"standard_background"}}},{id:"1722428372592_jpq",name:"sf/oneup",attributes:{blade_layout:"left",audience_segment:["customer","prospect"],experiment_type:"content",eyebrow:{label:"Service",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/06/icon-service.svg?w=1024",alt:null,title:null,sizes:[],width:"1024",height:"1024"}},headline:"Solve more cases, faster, with proactive service.",description:`
  • Reduce churn with early warning signals for at-risk customers.
  • Turn service cases into revenue with insights that highlight upsell and cross-sell opportunities.
  • Deliver personalized onboarding journeys using data from external systems and applications.
`,link_1:{variant:"secondary",label:"Learn more",source:"standard-link",url:"https://www.salesforce.com/data/solutions/service-teams/",ariaLabel:"Learn more about Data Cloud for Service Teams"},media:{image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-service.png?w=960",alt:"A visual representation of data cloud for Service",title:"2024/08/dc-overview-service.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-service.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-service.png?resize=300,300",width:300,height:300},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-service.png?resize=768,768",width:768,height:768}],width:960,height:960}},blade_background_type:{blade_background_color:"254, 240, 243",kind:"standard_background"}}},{id:"1722428505891_cxj",name:"sf/oneup",attributes:{blade_layout:"right",audience_segment:["customer","prospect"],experiment_type:"content",eyebrow:{label:"Marketing",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/06/icon-marketing.svg?w=1024",alt:null,title:null,sizes:[],width:"1024",height:"1024"}},headline:"Personalize messaging with targeted segments and intelligent insights.",description:`
  • Reduce churn with early warning signals for at-risk customers.
  • Deliver dynamic personalization using automated journeys for every customer.
  • Optimize performance and spend with a single view of audience and activation performance.
`,link_1:{variant:"secondary",label:"Learn more",source:"standard-link",url:"https://www.salesforce.com/marketing/data/",ariaLabel:"Learn more about Data Cloud for Marketing"},media:{image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-marketing.png?w=960",alt:"A visual representation of data cloud for Marketing",title:"2024/08/dc-overview-marketing.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-marketing.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-marketing.png?resize=300,300",width:300,height:300},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-marketing.png?resize=768,768",width:768,height:768}],width:960,height:960}},blade_background_type:{blade_background_color:"254, 241, 237",kind:"standard_background"}}},{id:"1722428504164_19kk",name:"sf/oneup",attributes:{blade_layout:"left",audience_segment:["customer","prospect"],experiment_type:"content",eyebrow:{label:"Commerce",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/06/icon-commerce.svg?w=1024",alt:null,title:null,sizes:[],width:"1024",height:"1024"}},headline:"Grow sales. Automate alerts. All with unified data.",description:`
  • Personalize the shopping experience using commerce, marketing, and web engagement data.
  • Automate merchandising with connected data from CRM, inventory, and order management.
  • Make smarter decisions based on integrated data.
`,link_1:{variant:"secondary",label:"Learn more",source:"standard-link",url:"https://www.salesforce.com/data/solutions/commerce-teams/",ariaLabel:"Learn more about Data Cloud for Commerce Teams"},media:{image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-commerce.png?w=960",alt:"A visual representation of data cloud for Commerce",title:"2024/08/dc-overview-commerce.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-commerce.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-commerce.png?resize=300,300",width:300,height:300},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/08/dc-overview-commerce.png?resize=768,768",width:768,height:768}],width:960,height:960}},blade_background_type:{blade_background_color:"205, 239, 196",kind:"standard_background"}}},{id:"1723834272942_gs",name:"sf/nup",attributes:{link_location:"below",audience_segment:["prospect","customer"],minimize_blade_spacing_bottom:!1,experiment_type:"content",card_type:"sf/resource",card_layout:"Standard",card_description_visibility:!0,card_image:!0,card_eyebrow_visibility:!1,card_link_visibility:!0,headline:"A different kind of data platform, purpose built for Salesforce.",link_1:{variant:"primary",label:"See how it works",source:"standard-link",url:"https://www.salesforce.com/data/how-it-works/",ariaLabel:"Build a foundation of unified data, native to Salesforce",target:"_blank"},blade_background_type:{blade_background_color:"255, 255, 255"}},media_items:[{content_source_type:"manual-content",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?w=1024",alt:"",title:"2024/09/connect-1.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?resize=300,169",width:300,height:169},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?resize=768,432",width:768,height:432},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?resize=1024,576",width:1024,height:576},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/connect-1.png?resize=1536,864",width:1536,height:864}],width:1024,height:576},headline:"Build a foundation of unified data, native to Salesforce.",description:`

Data Cloud eliminates data silos, creating a single platform to access and leverage all your enterprise data. Seamlessly integrate structured and unstructured data (PDFs, emails, call transcripts) into Salesforce with our library of connectors that leverage zero-copy integrations from Snowflake, Redshift, BigQuery, and Databricks.

`,link_1:{label:"Learn more",variant:"text",url:"https://www.salesforce.com/data/connectivity/",ariaLabel:"Learn more: Connect any data through zero copy.",target:"_blank"},kind:"card_resource",id:"1723834273004_fun"},{content_source_type:"manual-content",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?w=1024",alt:"",title:"2024/09/activate-1.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?resize=300,169",width:300,height:169},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?resize=768,432",width:768,height:432},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?resize=1024,576",width:1024,height:576},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/activate-1.png?resize=1536,864",width:1536,height:864}],width:1024,height:576},headline:"Activate connected, Customer 360, experiences everywhere.",description:`

Turn all your external data into native Salesforce objects and fields, enabling teams to easily activate it across every CRM app and workflow. Leverage low-code tools like Flow for automations to simplify how business teams put your data to work to impact every step of the customer journey.

`,link_1:{label:"Learn more",variant:"text",url:"https://www.salesforce.com/data/how-it-works/",ariaLabel:"Learn more: about activating data-driven experiences."},kind:"card_resource",id:"1723834287020_70z"},{content_source_type:"manual-content",image:{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?w=1024",alt:"",title:"2024/09/ai-1.png",sizes:[{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=150,150",width:150,height:150},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=300,169",width:300,height:169},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=768,432",width:768,height:432},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=1024,576",width:1024,height:576},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=1536,864",width:1536,height:864},{src:"https://wp.salesforce.com/en-us/wp-content/uploads/sites/4/2024/09/ai-1.png?resize=2048,1152",width:2048,height:1152}],width:1024,height:576},headline:"Ground AI agents in all your data and metadata.",description:`

Data Cloud unlocks the power of generative AI, grounded with your company's data, delivering trusted, secure, and relevant outcomes without expensive model training. Plus, it seamlessly integrates external predictive models with Bring Your Own Model for enhanced workflows and insights.

`,link_1:{label:"Learn more",variant:"text",url:"https://www.salesforce.com/agentforce/",ariaLabel:"Learn more: about Agentforce"},kind:"card_resource",id:"1723834293219_ykm"}]}],id:56308,pageAttrs:{livechat:{enabled:!0},content_type:"page"},taxonomy:{pageTagsManual:[],pageTagsAuto:[]},templateId:"open-template",templateName:"Open Template",globalNavEnabled:!0,footerEnabled:!0},lH=pe.lazy(()=>Promise.resolve().then(()=>RX));function cH(){var p,g,v;const[n,e]=pe.useState(aH),[t,i]=pe.useState(!1),r=n==null?void 0:n.blades.map((A,_)=>Ct(_e({},A),{blade_position:_,blade_id:A.id})),s=(p=r==null?void 0:r.filter(A=>A.name==="sf/oneup"))!=null?p:[],o=r==null?void 0:r.find(A=>A.name==="sf/marquee"),a=r==null?void 0:r.find(A=>A.name==="sf/promotion"),l=r==null?void 0:r.find(A=>A.name==="sf/text"),c=r==null?void 0:r.find(A=>A.name==="sf/nup"),d=pe.useRef(null),{scrollYProgress:h}=jR({target:d,offset:["start start","end end"]});return me.jsx("div",{className:"gt-dark-bg min-h-screen sm:rounded-b-[5rem] rounded-b-[3rem]",children:t?me.jsx(lH,{}):me.jsxs(me.Fragment,{children:[me.jsx(nH,{attributes:o==null?void 0:o.attributes,blade_id:o.blade_id,blade_position:o.blade_position}),me.jsxs(pe.Suspense,{fallback:me.jsx("div",{children:"Loading..."}),children:[me.jsx(oH,{attributes:a==null?void 0:a.attributes,blade_id:(g=a==null?void 0:a.id)!=null?g:"",blade_position:a==null?void 0:a.blade_position}),me.jsxs("div",{ref:d,className:"parallax-section relative",children:[me.jsx(sH,{attributes:l.attributes,blade_id:l.blade_id,blade_position:l.blade_position,progress:h}),s==null?void 0:s.map((A,_)=>me.jsx(rH,{attributes:A.attributes,blade_id:A.id,i:_,range:[_*.25,1],progress:h,blade_position:A.blade_position,targetScale:1},_))]}),me.jsx("div",{className:"relative pb-10",children:me.jsx(iH,{attributes:c.attributes,blade_id:c.blade_id,media_items:c.media_items,blade_position:(v=c.blade_position)!=null?v:0})})]})]})})}$0.createRoot(document.getElementById("wps-dc-overview-ws")).render(me.jsx(rF.StrictMode,{children:me.jsx(cH,{})}));function uH(n,{whileHover:e,onHoverStart:t,onHoverEnd:i,onPointerOver:r,onPointerOut:s},o){return n||!o||!(e||t||i)?{}:{onPointerOver:l=>{var c;(c=o.animationState)===null||c===void 0||c.setActive("whileHover",!0),r&&r(l)},onPointerOut:l=>{var c;(c=o.animationState)===null||c===void 0||c.setActive("whileHover",!1),s&&s(l)}}}function fH(n,{whileTap:e,onTapStart:t,onTap:i,onTapCancel:r,onPointerDown:s},o){const a=i||t||r||e,l=pe.useRef(!1),c=pe.useRef(null);if(n||!o||!a)return{};function d(){var v;(v=c.current)===null||v===void 0||v.call(c),c.current=null}function h(){var v;return d(),l.current=!1,(v=o.animationState)===null||v===void 0||v.setActive("whileTap",!1),!G_()}function p(v,A){h()&&(i==null||i(v,A))}function g(v,A){h()&&(r==null||r(v,A))}return{onPointerDown:eb((v,A)=>{var _;if(d(),l.current)return;l.current=!0;const m={passive:!(t||i||r||s)};c.current=Us(ps(window,"pointerup",p,m),ps(window,"pointercancel",g,m)),(_=o.animationState)===null||_===void 0||_.setActive("whileTap",!0),s==null||s(v),t==null||t(v,A)})}}const dH=(n,e,t,i,r,s)=>{const o=hH(e);return pe.createElement(n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ref:t},PR(e,!1,!1)),o),{onUpdate:e.onInstanceUpdate}),uH(r,e,s)),fH(r,e,s)))};function hH(n){return pe.useMemo(()=>{const e={};for(const t in n){const i=n[t];Tn(i)?e[t]=i.get():Array.isArray(i)&&i.includes(Tn)&&(e[t]=i.map(md))}return e},[])}/** * @license * Copyright 2010-2024 Three.js Authors * SPDX-License-Identifier: MIT */const xd="167",pH={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},mH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},YR=0,hA=1,QR=2,gH=3,qR=0,km=1,_d=2,ms=3,ks=0,ji=1,gs=2,po=0,hl=1,pA=2,mA=3,gA=4,ZR=5,ca=100,$R=101,eP=102,tP=103,nP=104,iP=200,rP=201,sP=202,oP=203,zm=204,Hm=205,aP=206,lP=207,cP=208,uP=209,fP=210,dP=211,hP=212,pP=213,mP=214,gP=0,vP=1,yP=2,Ad=3,xP=4,_P=5,AP=6,SP=7,Sd=0,MP=1,wP=2,zs=0,EP=1,CP=2,TP=3,vA=4,bP=5,RP=6,PP=7,yA="attached",IP="detached",Gm=300,mo=301,ua=302,Md=303,wd=304,Qc=306,fa=1e3,Tr=1001,qc=1002,oi=1003,Vm=1004,vH=1004,pl=1005,yH=1005,kn=1006,Zc=1007,xH=1007,Kr=1008,_H=1008,vs=1009,xA=1010,_A=1011,$c=1012,Wm=1013,go=1014,cr=1015,eu=1016,Xm=1017,jm=1018,ml=1020,AA=35902,SA=1021,MA=1022,Ri=1023,wA=1024,EA=1025,gl=1026,vl=1027,Jm=1028,Ed=1029,CA=1030,Km=1031,AH=1032,Ym=1033,Cd=33776,Td=33777,bd=33778,Rd=33779,Qm=35840,qm=35841,Zm=35842,$m=35843,eg=36196,tg=37492,ng=37496,ig=37808,rg=37809,sg=37810,og=37811,ag=37812,lg=37813,cg=37814,ug=37815,fg=37816,dg=37817,hg=37818,pg=37819,mg=37820,gg=37821,Pd=36492,vg=36494,yg=36495,TA=36283,xg=36284,_g=36285,Ag=36286,BP=2200,LP=2201,DP=2202,tu=2300,nu=2301,Sg=2302,yl=2400,xl=2401,Id=2402,Mg=2500,bA=2501,FP=0,RA=1,wg=2,NP=3200,UP=3201,SH=3202,MH=3203,da=0,OP=1,vo="",Yr="srgb",yo="srgb-linear",Eg="display-p3",Bd="display-p3-linear",Ld="linear",vn="srgb",Dd="rec709",Fd="p3",wH=0,_l=7680,EH=7681,CH=7682,TH=7683,bH=34055,RH=34056,PH=5386,IH=512,BH=513,LH=514,DH=515,FH=516,NH=517,UH=518,PA=519,kP=512,zP=513,HP=514,IA=515,GP=516,VP=517,WP=518,XP=519,Nd=35044,OH=35048,kH=35040,zH=35045,HH=35049,GH=35041,VH=35046,WH=35050,XH=35042,jH="100",BA="300 es",Hs=2e3,Ud=2001;class xo{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+Pi[n>>16&255]+Pi[n>>24&255]+"-"+Pi[e&255]+Pi[e>>8&255]+"-"+Pi[e>>16&15|64]+Pi[e>>24&255]+"-"+Pi[t&63|128]+Pi[t>>8&255]+"-"+Pi[t>>16&255]+Pi[t>>24&255]+Pi[i&255]+Pi[i>>8&255]+Pi[i>>16&255]+Pi[i>>24&255]).toLowerCase()}function zn(n,e,t){return Math.max(e,Math.min(t,n))}function LA(n,e){return(n%e+e)%e}function JH(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function KH(n,e,t){return n!==e?(t-n)/(e-n):0}function Od(n,e,t){return(1-t)*n+t*e}function YH(n,e,t,i){return Od(n,e,1-Math.exp(-t*i))}function QH(n,e=1){return e-Math.abs(LA(n,e*2)-e)}function qH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function ZH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function $H(n,e){return n+Math.floor(Math.random()*(e-n+1))}function e4(n,e){return n+Math.random()*(e-n)}function t4(n){return n*(.5-Math.random())}function n4(n){n!==void 0&&(jP=n);let e=jP+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function i4(n){return n*Al}function r4(n){return n*iu}function s4(n){return(n&n-1)===0&&n!==0}function o4(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function a4(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function l4(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+i)/2),d=o((e+i)/2),h=s((e-i)/2),p=o((e-i)/2),g=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*d,l*h,l*p,a*c);break;case"YZY":n.set(l*p,a*d,l*h,a*c);break;case"ZXZ":n.set(l*h,l*p,a*d,a*c);break;case"XZX":n.set(a*d,l*v,l*g,a*c);break;case"YXY":n.set(l*g,a*d,l*v,a*c);break;case"ZYZ":n.set(l*v,l*g,a*d,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Ji(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Lt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const JP={DEG2RAD:Al,RAD2DEG:iu,generateUUID:br,clamp:zn,euclideanModulo:LA,mapLinear:JH,inverseLerp:KH,lerp:Od,damp:YH,pingpong:QH,smoothstep:qH,smootherstep:ZH,randInt:$H,randFloat:e4,randFloatSpread:t4,seededRandom:n4,degToRad:i4,radToDeg:r4,isPowerOfTwo:s4,ceilPowerOfTwo:o4,floorPowerOfTwo:a4,setQuaternionFromProperEuler:l4,normalize:Lt,denormalize:Ji};class Ae{constructor(e=0,t=0){Ae.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 new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){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){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,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){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(e,t,i,r,s,o,a,l,c){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c)}set(e,t,i,r,s,o,a,l,c){const d=this.elements;return d[0]=e,d[1]=r,d[2]=a,d[3]=t,d[4]=s,d[5]=l,d[6]=i,d[7]=o,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],c=i[1],d=i[4],h=i[7],p=i[2],g=i[5],v=i[8],A=r[0],_=r[3],m=r[6],x=r[1],S=r[4],w=r[7],I=r[2],P=r[5],D=r[8];return s[0]=o*A+a*x+l*I,s[3]=o*_+a*S+l*P,s[6]=o*m+a*w+l*D,s[1]=c*A+d*x+h*I,s[4]=c*_+d*S+h*P,s[7]=c*m+d*w+h*D,s[2]=p*A+g*x+v*I,s[5]=p*_+g*S+v*P,s[8]=p*m+g*w+v*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8];return t*o*d-t*a*c-i*s*d+i*a*l+r*s*c-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],h=d*o-a*c,p=a*l-d*s,g=c*s-o*l,v=t*h+i*p+r*g;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const A=1/v;return e[0]=h*A,e[1]=(r*c-d*i)*A,e[2]=(a*i-r*o)*A,e[3]=p*A,e[4]=(d*t-r*l)*A,e[5]=(r*s-a*t)*A,e[6]=g*A,e[7]=(i*l-c*t)*A,e[8]=(o*t-i*s)*A,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(i*l,i*c,-i*(l*o+c*a)+o+e,-r*c,r*l,-r*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(DA.makeScale(e,t)),this}rotate(e){return this.premultiply(DA.makeRotation(-e)),this}translate(e,t){return this.premultiply(DA.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){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const DA=new Dt;function KP(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const c4={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ru(n,e){return new c4[n](e)}function kd(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function YP(){const n=kd("canvas");return n.style.display="block",n}const QP={};function su(n){n in QP||(QP[n]=!0,console.warn(n))}function u4(n,e,t){return new Promise(function(i,r){function s(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:i()}}setTimeout(s,t)})}const qP=new Dt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),ZP=new Dt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zd={[yo]:{transfer:Ld,primaries:Dd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n,fromReference:n=>n},[Yr]:{transfer:vn,primaries:Dd,luminanceCoefficients:[.2126,.7152,.0722],toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[Bd]:{transfer:Ld,primaries:Fd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.applyMatrix3(ZP),fromReference:n=>n.applyMatrix3(qP)},[Eg]:{transfer:vn,primaries:Fd,luminanceCoefficients:[.2289,.6917,.0793],toReference:n=>n.convertSRGBToLinear().applyMatrix3(ZP),fromReference:n=>n.applyMatrix3(qP).convertLinearToSRGB()}},f4=new Set([yo,Bd]),tn={enabled:!0,_workingColorSpace:yo,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!f4.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=zd[e].toReference,r=zd[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return zd[n].primaries},getTransfer:function(n){return n===vo?Ld:zd[n].transfer},getLuminanceCoefficients:function(n,e=this._workingColorSpace){return n.fromArray(zd[e].luminanceCoefficients)}};function ou(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function FA(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let au;class $P{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement=="undefined")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{au===void 0&&(au=kd("canvas")),au.width=e.width,au.height=e.height;const i=au.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=au}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap){const t=kd("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Gm)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case fa:e.x=e.x-Math.floor(e.x);break;case Tr:e.x=e.x<0?0:1;break;case qc:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case fa:e.y=e.y-Math.floor(e.y);break;case Tr:e.y=e.y<0?0:1;break;case qc:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Mn.DEFAULT_IMAGE=null,Mn.DEFAULT_MAPPING=Gm,Mn.DEFAULT_ANISOTROPY=1;class on{constructor(e=0,t=0,i=0,r=1){on.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,c=l[0],d=l[4],h=l[8],p=l[1],g=l[5],v=l[9],A=l[2],_=l[6],m=l[10];if(Math.abs(d-p)<.01&&Math.abs(h-A)<.01&&Math.abs(v-_)<.01){if(Math.abs(d+p)<.1&&Math.abs(h+A)<.1&&Math.abs(v+_)<.1&&Math.abs(c+g+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const S=(c+1)/2,w=(g+1)/2,I=(m+1)/2,P=(d+p)/4,D=(h+A)/4,N=(v+_)/4;return S>w&&S>I?S<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(S),r=P/i,s=D/i):w>I?w<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(w),i=P/r,s=N/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=D/s,r=N/s),this.set(i,r,s,t),this}let x=Math.sqrt((_-v)*(_-v)+(h-A)*(h-A)+(p-d)*(p-d));return Math.abs(x)<.001&&(x=1),this.x=(_-v)/x,this.y=(h-A)/x,this.z=(p-d)/x,this.w=Math.acos((c+g+m-1)/2),this}setFromMatrixPosition(e){const 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=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,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 eI extends xo{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new on(0,0,e,t),this.scissorTest=!1,this.viewport=new on(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:kn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},i);const s=new Mn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,S=1-m*m;if(S>Number.EPSILON){const I=Math.sqrt(S),P=Math.atan2(I,m*x);_=Math.sin(_*P)/I,a=Math.sin(a*P)/I}const w=a*x;if(l=l*_+p*w,c=c*_+g*w,d=d*_+v*w,h=h*_+A*w,_===1-a){const I=1/Math.sqrt(l*l+c*c+d*d+h*h);l*=I,c*=I,d*=I,h*=I}}e[t]=l,e[t+1]=c,e[t+2]=d,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],c=i[r+2],d=i[r+3],h=s[o],p=s[o+1],g=s[o+2],v=s[o+3];return e[t]=a*v+d*h+l*g-c*p,e[t+1]=l*v+d*p+c*h-a*g,e[t+2]=c*v+d*g+a*p-l*h,e[t+3]=d*v-a*h-l*p-c*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(i/2),d=a(r/2),h=a(s/2),p=l(i/2),g=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=p*d*h+c*g*v,this._y=c*g*h-p*d*v,this._z=c*d*v+p*g*h,this._w=c*d*h-p*g*v;break;case"YXZ":this._x=p*d*h+c*g*v,this._y=c*g*h-p*d*v,this._z=c*d*v-p*g*h,this._w=c*d*h+p*g*v;break;case"ZXY":this._x=p*d*h-c*g*v,this._y=c*g*h+p*d*v,this._z=c*d*v+p*g*h,this._w=c*d*h-p*g*v;break;case"ZYX":this._x=p*d*h-c*g*v,this._y=c*g*h+p*d*v,this._z=c*d*v-p*g*h,this._w=c*d*h+p*g*v;break;case"YZX":this._x=p*d*h+c*g*v,this._y=c*g*h+p*d*v,this._z=c*d*v-p*g*h,this._w=c*d*h-p*g*v;break;case"XZY":this._x=p*d*h-c*g*v,this._y=c*g*h-p*d*v,this._z=c*d*v+p*g*h,this._w=c*d*h+p*g*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],d=t[6],h=t[10],p=i+a+h;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-l)*g,this._y=(s-c)*g,this._z=(o-r)*g}else if(i>a&&i>h){const g=2*Math.sqrt(1+i-a-h);this._w=(d-l)/g,this._x=.25*g,this._y=(r+o)/g,this._z=(s+c)/g}else if(a>h){const g=2*Math.sqrt(1+a-i-h);this._w=(s-c)/g,this._x=(r+o)/g,this._y=.25*g,this._z=(l+d)/g}else{const g=2*Math.sqrt(1+h-i-a);this._w=(o-r)/g,this._x=(s+c)/g,this._y=(l+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(zn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(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){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,d=t._w;return this._x=i*d+o*a+r*c-s*l,this._y=r*d+o*l+s*a-i*c,this._z=s*d+o*c+i*l-r*a,this._w=o*d-i*a-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*i+t*this._x,this._y=g*r+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const c=Math.sqrt(l),d=Math.atan2(c,a),h=Math.sin((1-t)*d)/c,p=Math.sin(t*d)/c;return this._w=o*h+this._w*p,this._x=i*h+this._x*p,this._y=r*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*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()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){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(tI.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(tI.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=2*(o*r-a*i),d=2*(a*t-s*r),h=2*(s*i-o*t);return this.x=t+l*c+o*h-a*d,this.y=i+l*d+a*c-s*h,this.z=r+l*h+s*d-o*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}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}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return OA.copy(this).projectOnVector(e),this.sub(OA)}reflect(e){return this.sub(OA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(zn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const OA=new G,tI=new Ii;class Bi{constructor(e=new G(1/0,1/0,1/0),t=new G(-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,i=e.length;t=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,xs),xs.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Hd),bg.subVectors(this.max,Hd),lu.subVectors(e.a,Hd),cu.subVectors(e.b,Hd),uu.subVectors(e.c,Hd),ha.subVectors(cu,lu),pa.subVectors(uu,cu),Ml.subVectors(lu,uu);let t=[0,-ha.z,ha.y,0,-pa.z,pa.y,0,-Ml.z,Ml.y,ha.z,0,-ha.x,pa.z,0,-pa.x,Ml.z,0,-Ml.x,-ha.y,ha.x,0,-pa.y,pa.x,0,-Ml.y,Ml.x,0];return!kA(t,lu,cu,uu,bg)||(t=[1,0,0,0,1,0,0,0,1],!kA(t,lu,cu,uu,bg))?!1:(Rg.crossVectors(ha,pa),t=[Rg.x,Rg.y,Rg.z],kA(t,lu,cu,uu,bg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,xs).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(xs).length()*.5),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()?this:(_o[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_o[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_o[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_o[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_o[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_o[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_o[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_o[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_o),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _o=[new G,new G,new G,new G,new G,new G,new G,new G],xs=new G,Tg=new Bi,lu=new G,cu=new G,uu=new G,ha=new G,pa=new G,Ml=new G,Hd=new G,bg=new G,Rg=new G,wl=new G;function kA(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){wl.fromArray(n,s);const a=r.x*Math.abs(wl.x)+r.y*Math.abs(wl.y)+r.z*Math.abs(wl.z),l=e.dot(wl),c=t.dot(wl),d=i.dot(wl);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>a)return!1}return!0}const g4=new Bi,Gd=new G,zA=new G;class _i{constructor(e=new G,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){const i=this.center;t!==void 0?i.copy(t):g4.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Gd.subVectors(e,this.center);const t=Gd.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Gd,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(zA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Gd.copy(e.center).add(zA)),this.expandByPoint(Gd.copy(e.center).sub(zA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ao=new G,HA=new G,Pg=new G,ma=new G,GA=new G,Ig=new G,VA=new G;class fu{constructor(e=new G,t=new G(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,Ao)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ao.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ao.copy(this.origin).addScaledVector(this.direction,t),Ao.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){HA.copy(e).add(t).multiplyScalar(.5),Pg.copy(t).sub(e).normalize(),ma.copy(this.origin).sub(HA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Pg),a=ma.dot(this.direction),l=-ma.dot(Pg),c=ma.lengthSq(),d=Math.abs(1-o*o);let h,p,g,v;if(d>0)if(h=o*l-a,p=o*a-l,v=s*d,h>=0)if(p>=-v)if(p<=v){const A=1/d;h*=A,p*=A,g=h*(h+o*p+2*a)+p*(o*h+p+2*l)+c}else p=s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+c;else p=-s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+c;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),g=-h*h+p*(p+2*l)+c):p<=v?(h=0,p=Math.min(Math.max(-s,-l),s),g=p*(p+2*l)+c):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),g=-h*h+p*(p+2*l)+c);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),g=-h*h+p*(p+2*l)+c;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(HA).addScaledVector(Pg,p),g}intersectSphere(e,t){Ao.subVectors(e.center,this.origin);const i=Ao.dot(this.direction),r=Ao.dot(Ao)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const c=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Ao)!==null}intersectTriangle(e,t,i,r,s){GA.subVectors(t,e),Ig.subVectors(i,e),VA.crossVectors(GA,Ig);let o=this.direction.dot(VA),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;ma.subVectors(this.origin,e);const l=a*this.direction.dot(Ig.crossVectors(ma,Ig));if(l<0)return null;const c=a*this.direction.dot(GA.cross(ma));if(c<0||l+c>o)return null;const d=-a*ma.dot(VA);return d<0?null:this.at(d/o,s)}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 mt{constructor(e,t,i,r,s,o,a,l,c,d,h,p,g,v,A,_){mt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,c,d,h,p,g,v,A,_)}set(e,t,i,r,s,o,a,l,c,d,h,p,g,v,A,_){const m=this.elements;return m[0]=e,m[4]=t,m[8]=i,m[12]=r,m[1]=s,m[5]=o,m[9]=a,m[13]=l,m[2]=c,m[6]=d,m[10]=h,m[14]=p,m[3]=g,m[7]=v,m[11]=A,m[15]=_,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 mt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/du.setFromMatrixColumn(e,0).length(),s=1/du.setFromMatrixColumn(e,1).length(),o=1/du.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),c=Math.sin(r),d=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*h,v=a*d,A=a*h;t[0]=l*d,t[4]=-l*h,t[8]=c,t[1]=g+v*c,t[5]=p-A*c,t[9]=-a*l,t[2]=A-p*c,t[6]=v+g*c,t[10]=o*l}else if(e.order==="YXZ"){const p=l*d,g=l*h,v=c*d,A=c*h;t[0]=p+A*a,t[4]=v*a-g,t[8]=o*c,t[1]=o*h,t[5]=o*d,t[9]=-a,t[2]=g*a-v,t[6]=A+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*d,g=l*h,v=c*d,A=c*h;t[0]=p-A*a,t[4]=-o*h,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*d,t[9]=A-p*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*d,g=o*h,v=a*d,A=a*h;t[0]=l*d,t[4]=v*c-g,t[8]=p*c+A,t[1]=l*h,t[5]=A*c+p,t[9]=g*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,g=o*c,v=a*l,A=a*c;t[0]=l*d,t[4]=A-p*h,t[8]=v*h+g,t[1]=h,t[5]=o*d,t[9]=-a*d,t[2]=-c*d,t[6]=g*h+v,t[10]=p-A*h}else if(e.order==="XZY"){const p=o*l,g=o*c,v=a*l,A=a*c;t[0]=l*d,t[4]=-h,t[8]=c*d,t[1]=p*h+A,t[5]=o*d,t[9]=g*h-v,t[2]=v*h-g,t[6]=a*d,t[10]=A*h+p}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(v4,e,y4)}lookAt(e,t,i){const r=this.elements;return Rr.subVectors(e,t),Rr.lengthSq()===0&&(Rr.z=1),Rr.normalize(),ga.crossVectors(i,Rr),ga.lengthSq()===0&&(Math.abs(i.z)===1?Rr.x+=1e-4:Rr.z+=1e-4,Rr.normalize(),ga.crossVectors(i,Rr)),ga.normalize(),Bg.crossVectors(Rr,ga),r[0]=ga.x,r[4]=Bg.x,r[8]=Rr.x,r[1]=ga.y,r[5]=Bg.y,r[9]=Rr.y,r[2]=ga.z,r[6]=Bg.z,r[10]=Rr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],c=i[12],d=i[1],h=i[5],p=i[9],g=i[13],v=i[2],A=i[6],_=i[10],m=i[14],x=i[3],S=i[7],w=i[11],I=i[15],P=r[0],D=r[4],N=r[8],B=r[12],T=r[1],F=r[5],X=r[9],J=r[13],q=r[2],$=r[6],K=r[10],ge=r[14],z=r[3],te=r[7],ie=r[11],fe=r[15];return s[0]=o*P+a*T+l*q+c*z,s[4]=o*D+a*F+l*$+c*te,s[8]=o*N+a*X+l*K+c*ie,s[12]=o*B+a*J+l*ge+c*fe,s[1]=d*P+h*T+p*q+g*z,s[5]=d*D+h*F+p*$+g*te,s[9]=d*N+h*X+p*K+g*ie,s[13]=d*B+h*J+p*ge+g*fe,s[2]=v*P+A*T+_*q+m*z,s[6]=v*D+A*F+_*$+m*te,s[10]=v*N+A*X+_*K+m*ie,s[14]=v*B+A*J+_*ge+m*fe,s[3]=x*P+S*T+w*q+I*z,s[7]=x*D+S*F+w*$+I*te,s[11]=x*N+S*X+w*K+I*ie,s[15]=x*B+S*J+w*ge+I*fe,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],d=e[2],h=e[6],p=e[10],g=e[14],v=e[3],A=e[7],_=e[11],m=e[15];return v*(+s*l*h-r*c*h-s*a*p+i*c*p+r*a*g-i*l*g)+A*(+t*l*g-t*c*p+s*o*p-r*o*g+r*c*d-s*l*d)+_*(+t*c*h-t*a*g-s*o*h+i*o*g+s*a*d-i*c*d)+m*(-r*a*d-t*l*h+t*a*p+r*o*h-i*o*p+i*l*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],d=e[8],h=e[9],p=e[10],g=e[11],v=e[12],A=e[13],_=e[14],m=e[15],x=h*_*c-A*p*c+A*l*g-a*_*g-h*l*m+a*p*m,S=v*p*c-d*_*c-v*l*g+o*_*g+d*l*m-o*p*m,w=d*A*c-v*h*c+v*a*g-o*A*g-d*a*m+o*h*m,I=v*h*l-d*A*l-v*a*p+o*A*p+d*a*_-o*h*_,P=t*x+i*S+r*w+s*I;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/P;return e[0]=x*D,e[1]=(A*p*s-h*_*s-A*r*g+i*_*g+h*r*m-i*p*m)*D,e[2]=(a*_*s-A*l*s+A*r*c-i*_*c-a*r*m+i*l*m)*D,e[3]=(h*l*s-a*p*s-h*r*c+i*p*c+a*r*g-i*l*g)*D,e[4]=S*D,e[5]=(d*_*s-v*p*s+v*r*g-t*_*g-d*r*m+t*p*m)*D,e[6]=(v*l*s-o*_*s-v*r*c+t*_*c+o*r*m-t*l*m)*D,e[7]=(o*p*s-d*l*s+d*r*c-t*p*c-o*r*g+t*l*g)*D,e[8]=w*D,e[9]=(v*h*s-d*A*s-v*i*g+t*A*g+d*i*m-t*h*m)*D,e[10]=(o*A*s-v*a*s+v*i*c-t*A*c-o*i*m+t*a*m)*D,e[11]=(d*a*s-o*h*s-d*i*c+t*h*c+o*i*g-t*a*g)*D,e[12]=I*D,e[13]=(d*A*r-v*h*r+v*i*p-t*A*p-d*i*_+t*h*_)*D,e[14]=(v*a*r-o*A*r-v*i*l+t*A*l+o*i*_-t*a*_)*D,e[15]=(o*h*r-d*a*r+d*i*l-t*h*l-o*i*p+t*a*p)*D,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,c=s*o,d=s*a;return this.set(c*o+i,c*a-r*l,c*l+r*a,0,c*a+r*l,d*a+i,d*l-r*o,0,c*l-r*a,d*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,d=o+o,h=a+a,p=s*c,g=s*d,v=s*h,A=o*d,_=o*h,m=a*h,x=l*c,S=l*d,w=l*h,I=i.x,P=i.y,D=i.z;return r[0]=(1-(A+m))*I,r[1]=(g+w)*I,r[2]=(v-S)*I,r[3]=0,r[4]=(g-w)*P,r[5]=(1-(p+m))*P,r[6]=(_+x)*P,r[7]=0,r[8]=(v+S)*D,r[9]=(_-x)*D,r[10]=(1-(p+A))*D,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=du.set(r[0],r[1],r[2]).length();const o=du.set(r[4],r[5],r[6]).length(),a=du.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],_s.copy(this);const c=1/s,d=1/o,h=1/a;return _s.elements[0]*=c,_s.elements[1]*=c,_s.elements[2]*=c,_s.elements[4]*=d,_s.elements[5]*=d,_s.elements[6]*=d,_s.elements[8]*=h,_s.elements[9]*=h,_s.elements[10]*=h,t.setFromRotationMatrix(_s),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=Hs){const l=this.elements,c=2*s/(t-e),d=2*s/(i-r),h=(t+e)/(t-e),p=(i+r)/(i-r);let g,v;if(a===Hs)g=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Ud)g=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=Hs){const l=this.elements,c=1/(t-e),d=1/(i-r),h=1/(o-s),p=(t+e)*c,g=(i+r)*d;let v,A;if(a===Hs)v=(o+s)*h,A=-2*h;else if(a===Ud)v=s*h,A=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=A,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const du=new G,_s=new mt,v4=new G(0,0,0),y4=new G(1,1,1),ga=new G,Bg=new G,Rr=new G,nI=new mt,iI=new Ii;class ur{constructor(e=0,t=0,i=0,r=ur.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,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,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],c=r[5],d=r[9],h=r[2],p=r[6],g=r[10];switch(t){case"XYZ":this._y=Math.asin(zn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-zn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(a,g),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(zn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,g),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-zn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(zn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,g));break;case"XZY":this._z=Math.asin(-zn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return nI.makeRotationFromQuaternion(e),this.setFromRotationMatrix(nI,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return iI.setFromEuler(this),this.setFromQuaternion(iI,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],e[3]!==void 0&&(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}}ur.DEFAULT_ORDER="XYZ";class El{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,d=l.length;c0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),c.length>0&&(i.textures=c),d.length>0&&(i.images=d),h.length>0&&(i.shapes=h),p.length>0&&(i.skeletons=p),g.length>0&&(i.animations=g),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const c in a){const d=a[c];delete d.metadata,l.push(d)}return l}}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)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){As.subVectors(r,t),Mo.subVectors(i,t),XA.subVectors(e,t);const o=As.dot(As),a=As.dot(Mo),l=As.dot(XA),c=Mo.dot(Mo),d=Mo.dot(XA),h=o*c-a*a;if(h===0)return s.set(0,0,0),null;const p=1/h,g=(c*l-a*d)*p,v=(o*d-a*l)*p;return s.set(1-g-v,v,g)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,wo)===null?!1:wo.x>=0&&wo.y>=0&&wo.x+wo.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,wo)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,wo.x),l.addScaledVector(o,wo.y),l.addScaledVector(a,wo.z),l)}static isFrontFacing(e,t,i,r){return As.subVectors(i,t),Mo.subVectors(e,t),As.cross(Mo).dot(r)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,i,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return As.subVectors(this.c,this.b),Mo.subVectors(this.a,this.b),As.cross(Mo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Pr.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Pr.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return Pr.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return Pr.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Pr.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;mu.subVectors(r,i),gu.subVectors(s,i),jA.subVectors(e,i);const l=mu.dot(jA),c=gu.dot(jA);if(l<=0&&c<=0)return t.copy(i);JA.subVectors(e,r);const d=mu.dot(JA),h=gu.dot(JA);if(d>=0&&h<=d)return t.copy(r);const p=l*h-d*c;if(p<=0&&l>=0&&d<=0)return o=l/(l-d),t.copy(i).addScaledVector(mu,o);KA.subVectors(e,s);const g=mu.dot(KA),v=gu.dot(KA);if(v>=0&&g<=v)return t.copy(s);const A=g*c-l*v;if(A<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(i).addScaledVector(gu,a);const _=d*v-g*h;if(_<=0&&h-d>=0&&g-v>=0)return cI.subVectors(s,r),a=(h-d)/(h-d+(g-v)),t.copy(r).addScaledVector(cI,a);const m=1/(_+A+p);return o=A*m,a=p*m,t.copy(i).addScaledVector(mu,o).addScaledVector(gu,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const uI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},va={h:0,s:0,l:0},Dg={h:0,s:0,l:0};function YA(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*6*(2/3-t):n}class ke{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Yr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,tn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=tn.workingColorSpace){return this.r=e,this.g=t,this.b=i,tn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=tn.workingColorSpace){if(e=LA(e,1),t=zn(t,0,1),i=zn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=YA(o,s,e+1/3),this.g=YA(o,s,e),this.b=YA(o,s,e-1/3)}return tn.toWorkingColorSpace(this,r),this}setStyle(e,t=Yr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Yr){const i=uI[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ou(e.r),this.g=ou(e.g),this.b=ou(e.b),this}copyLinearToSRGB(e){return this.r=FA(e.r),this.g=FA(e.g),this.b=FA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Yr){return tn.fromWorkingColorSpace(Li.copy(this),e),Math.round(zn(Li.r*255,0,255))*65536+Math.round(zn(Li.g*255,0,255))*256+Math.round(zn(Li.b*255,0,255))}getHexString(e=Yr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=tn.workingColorSpace){tn.fromWorkingColorSpace(Li.copy(this),t);const i=Li.r,r=Li.g,s=Li.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,c;const d=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=d<=.5?h/(o+a):h/(2-o-a),o){case i:l=(r-s)/h+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==hl&&(i.blending=this.blending),this.side!==ks&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==zm&&(i.blendSrc=this.blendSrc),this.blendDst!==Hm&&(i.blendDst=this.blendDst),this.blendEquation!==ca&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==Ad&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==PA&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==_l&&(i.stencilFail=this.stencilFail),this.stencilZFail!==_l&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==_l&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}onBeforeRender(){console.warn("Material: onBeforeRender() has been removed.")}}class Ir extends $n{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ke(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ur,this.combine=Sd,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}}const Eo=w4();function w4(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(i[l]=1024>>-c-14,i[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(i[l]=c+15<<10,i[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,d=0;for(;!(c&8388608);)c<<=1,d-=8388608;c&=-8388609,d+=947912704,s[l]=c|d}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function fr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=zn(n,-65504,65504),Eo.floatView[0]=n;const e=Eo.uint32View[0],t=e>>23&511;return Eo.baseTable[t]+((e&8388607)>>Eo.shiftTable[t])}function Wd(n){const e=n>>10;return Eo.uint32View[0]=Eo.mantissaTable[Eo.offsetTable[e]+(n&1023)]+Eo.exponentTable[e],Eo.floatView[0]}const E4={toHalfFloat:fr,fromHalfFloat:Wd},ei=new G,Fg=new Ae;class $t{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=cr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return su("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const c=i[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],d=[];for(let h=0,p=c.length;h0&&(r[l]=d,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),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;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const c in r){const d=r[c];this.setAttribute(c,d.clone(t))}const s=e.morphAttributes;for(const c in s){const d=[],h=s[c];for(let p=0,g=h.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sj0(e.far-e.near,2)))&&(fI.copy(s).invert(),Cl.copy(e.ray).applyMatrix4(fI),!(i.boundingBox!==null&&Cl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Cl)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,d=s.attributes.uv1,h=s.attributes.normal,p=s.groups,g=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,A=p.length;vt.far?null:{distance:c,point:Gg.clone(),object:n}}function Vg(n,e,t,i,r,s,o,a,l,c){n.getVertexPosition(a,yu),n.getVertexPosition(l,xu),n.getVertexPosition(c,_u);const d=L4(n,e,t,i,yu,xu,_u,Hg);if(d){r&&(Og.fromBufferAttribute(r,a),kg.fromBufferAttribute(r,l),zg.fromBufferAttribute(r,c),d.uv=Pr.getInterpolation(Hg,yu,xu,_u,Og,kg,zg,new Ae)),s&&(Og.fromBufferAttribute(s,a),kg.fromBufferAttribute(s,l),zg.fromBufferAttribute(s,c),d.uv1=Pr.getInterpolation(Hg,yu,xu,_u,Og,kg,zg,new Ae)),o&&(hI.fromBufferAttribute(o,a),pI.fromBufferAttribute(o,l),mI.fromBufferAttribute(o,c),d.normal=Pr.getInterpolation(Hg,yu,xu,_u,hI,pI,mI,new G),d.normal.dot(i.direction)>0&&d.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new G,materialIndex:0};Pr.getNormal(yu,xu,_u,h.normal),d.face=h}return d}class Tl extends Pt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],d=[],h=[];let p=0,g=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new rt(c,3)),this.setAttribute("normal",new rt(d,3)),this.setAttribute("uv",new rt(h,2));function v(A,_,m,x,S,w,I,P,D,N,B){const T=w/D,F=I/N,X=w/2,J=I/2,q=P/2,$=D+1,K=N+1;let ge=0,z=0;const te=new G;for(let ie=0;ie0?1:-1,d.push(te.x,te.y,te.z),h.push(Ce/D),h.push(1-ie/N),ge+=1}}for(let ie=0;ie0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class jd extends jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new mt,this.projectionMatrix=new mt,this.projectionMatrixInverse=new mt,this.coordinateSystem=Hs}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)}}const ya=new G,yI=new Ae,xI=new Ae;class ai extends jd{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=r,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=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=iu*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Al*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return iu*2*Math.atan(Math.tan(Al*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){ya.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(ya.x,ya.y).multiplyScalar(-e/ya.z),ya.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(ya.x,ya.y).multiplyScalar(-e/ya.z)}getViewSize(e,t){return this.getViewBounds(e,yI,xI),t.subVectors(xI,yI)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Al*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/c,r*=o.width/l,i*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Su=-90,Mu=1;class _I extends jt{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new ai(Su,Mu,e,t);r.layers=this.layers,this.add(r);const s=new ai(Su,Mu,e,t);s.layers=this.layers,this.add(s);const o=new ai(Su,Mu,e,t);o.layers=this.layers,this.add(o);const a=new ai(Su,Mu,e,t);a.layers=this.layers,this.add(a);const l=new ai(Su,Mu,e,t);l.layers=this.layers,this.add(l);const c=new ai(Su,Mu,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===Hs)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ud)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,c,d]=this.children,h=e.getRenderTarget(),p=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const A=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,c),i.texture.generateMipmaps=A,e.setRenderTarget(i,5,r),e.render(t,d),e.setRenderTarget(h,p,g),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class Jd extends Mn{constructor(e,t,i,r,s,o,a,l,c,d){e=e!==void 0?e:[],t=t!==void 0?t:mo,super(e,t,i,r,s,o,a,l,c,d),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class AI extends ys{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Jd(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:kn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include } `,fragmentShader:` uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); } `},r=new Tl(5,5,5),s=new Ss({name:"CubemapFromEquirect",uniforms:Au(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:ji,blending:po});s.uniforms.tEquirect.value=t;const o=new jn(r,s),a=t.minFilter;return t.minFilter===Kr&&(t.minFilter=kn),new _I(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const eS=new G,U4=new G,O4=new Dt;class xa{constructor(e=new G(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,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=eS.subVectors(i,t).cross(U4.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const 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){const i=e.delta(eS),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||O4.getNormalMatrix(e),r=this.coplanarPoint(eS).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),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)}}const bl=new _i,Wg=new G;class Kd{constructor(e=new xa,t=new xa,i=new xa,r=new xa,s=new xa,o=new xa){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Hs){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],p=r[7],g=r[8],v=r[9],A=r[10],_=r[11],m=r[12],x=r[13],S=r[14],w=r[15];if(i[0].setComponents(l-s,p-c,_-g,w-m).normalize(),i[1].setComponents(l+s,p+c,_+g,w+m).normalize(),i[2].setComponents(l+o,p+d,_+v,w+x).normalize(),i[3].setComponents(l-o,p-d,_-v,w-x).normalize(),i[4].setComponents(l-a,p-h,_-A,w-S).normalize(),t===Hs)i[5].setComponents(l+a,p+h,_+A,w+S).normalize();else if(t===Ud)i[5].setComponents(a,h,A,S).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),bl.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),bl.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(bl)}intersectsSprite(e){return bl.center.set(0,0,0),bl.radius=.7071067811865476,bl.applyMatrix4(e.matrixWorld),this.intersectsSphere(bl)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Wg.y=r.normal.y>0?e.max.y:e.min.y,Wg.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function SI(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function k4(n){const e=new WeakMap;function t(a,l){const c=a.array,d=a.usage,h=c.byteLength,p=n.createBuffer();n.bindBuffer(l,p),n.bufferData(l,c,d),a.onUploadCallback();let g;if(c instanceof Float32Array)g=n.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?g=n.HALF_FLOAT:g=n.UNSIGNED_SHORT;else if(c instanceof Int16Array)g=n.SHORT;else if(c instanceof Uint32Array)g=n.UNSIGNED_INT;else if(c instanceof Int32Array)g=n.INT;else if(c instanceof Int8Array)g=n.BYTE;else if(c instanceof Uint8Array)g=n.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)g=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:p,type:g,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:h}}function i(a,l,c){const d=l.array,h=l._updateRange,p=l.updateRanges;if(n.bindBuffer(c,a),h.count===-1&&p.length===0&&n.bufferSubData(c,0,d),p.length!==0){for(let g=0,v=p.length;g 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; float clipOpacity = 1.0; #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); if ( clipOpacity == 0.0 ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES float unionClipOpacity = 1.0; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; distanceGradient = fwidth( distanceToPlane ) / 2.0; unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); } #pragma unroll_loop_end clipOpacity *= 1.0 - unionClipOpacity; #endif diffuseColor.a *= clipOpacity; if ( diffuseColor.a == 0.0 ) discard; #else #pragma unroll_loop_start for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; } #pragma unroll_loop_end #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES bool clipped = true; #pragma unroll_loop_start for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { plane = clippingPlanes[ i ]; clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; } #pragma unroll_loop_end if ( clipped ) discard; #endif #endif #endif`,nG=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,iG=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,rG=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,sG=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,oG=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,aG=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec3 vColor; #endif`,lG=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec3( 1.0 ); #endif #ifdef USE_COLOR vColor *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; #endif #ifdef USE_BATCHING_COLOR vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) ); vColor.xyz *= batchingColor.xyz; #endif`,cG=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 #define RECIPROCAL_PI2 0.15915494309189535 #define EPSILON 1e-6 #ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif #define whiteComplement( a ) ( 1.0 - saturate( a ) ) float pow2( const in float x ) { return x*x; } vec3 pow2( const in vec3 x ) { return x*x; } float pow3( const in float x ) { return x*x*x; } float pow4( const in float x ) { float x2 = x*x; return x2*x2; } float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } highp float rand( const in vec2 uv ) { const highp float a = 12.9898, b = 78.233, c = 43758.5453; highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); return fract( sin( sn ) * c ); } #ifdef HIGH_PRECISION float precisionSafeLength( vec3 v ) { return length( v ); } #else float precisionSafeLength( vec3 v ) { float maxComponent = max3( abs( v ) ); return length( v / maxComponent ) * maxComponent; } #endif struct IncidentLight { vec3 color; vec3 direction; bool visible; }; struct ReflectedLight { vec3 directDiffuse; vec3 directSpecular; vec3 indirectDiffuse; vec3 indirectSpecular; }; #ifdef USE_ALPHAHASH varying vec3 vPosition; #endif vec3 transformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); } vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); } mat3 transposeMat3( const in mat3 m ) { mat3 tmp; tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); return tmp; } bool isPerspectiveMatrix( mat4 m ) { return m[ 2 ][ 3 ] == - 1.0; } vec2 equirectUv( in vec3 dir ) { float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; return vec2( u, v ); } vec3 BRDF_Lambert( const in vec3 diffuseColor ) { return RECIPROCAL_PI * diffuseColor; } vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); } // validated`,uG=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { vec3 absDirection = abs( direction ); float face = - 1.0; if ( absDirection.x > absDirection.z ) { if ( absDirection.x > absDirection.y ) face = direction.x > 0.0 ? 0.0 : 3.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } else { if ( absDirection.z > absDirection.y ) face = direction.z > 0.0 ? 2.0 : 5.0; else face = direction.y > 0.0 ? 1.0 : 4.0; } return face; } vec2 getUV( vec3 direction, float face ) { vec2 uv; if ( face == 0.0 ) { uv = vec2( direction.z, direction.y ) / abs( direction.x ); } else if ( face == 1.0 ) { uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); } else if ( face == 2.0 ) { uv = vec2( - direction.x, direction.y ) / abs( direction.z ); } else if ( face == 3.0 ) { uv = vec2( - direction.z, direction.y ) / abs( direction.x ); } else if ( face == 4.0 ) { uv = vec2( - direction.x, direction.z ) / abs( direction.y ); } else { uv = vec2( direction.x, direction.y ) / abs( direction.z ); } return 0.5 * ( uv + 1.0 ); } vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { float face = getFace( direction ); float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); mipInt = max( mipInt, cubeUV_minMipLevel ); float faceSize = exp2( mipInt ); highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; if ( face > 2.0 ) { uv.y += faceSize; face -= 3.0; } uv.x += face * faceSize; uv.x += filterInt * 3.0 * cubeUV_minTileSize; uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); uv.x *= CUBEUV_TEXEL_WIDTH; uv.y *= CUBEUV_TEXEL_HEIGHT; #ifdef texture2DGradEXT return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; #else return texture2D( envMap, uv ).rgb; #endif } #define cubeUV_r0 1.0 #define cubeUV_m0 - 2.0 #define cubeUV_r1 0.8 #define cubeUV_m1 - 1.0 #define cubeUV_r4 0.4 #define cubeUV_m4 2.0 #define cubeUV_r5 0.305 #define cubeUV_m5 3.0 #define cubeUV_r6 0.21 #define cubeUV_m6 4.0 float roughnessToMip( float roughness ) { float mip = 0.0; if ( roughness >= cubeUV_r1 ) { mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; } else if ( roughness >= cubeUV_r4 ) { mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; } else if ( roughness >= cubeUV_r5 ) { mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; } else if ( roughness >= cubeUV_r6 ) { mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; } else { mip = - 2.0 * log2( 1.16 * roughness ); } return mip; } vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); float mipF = fract( mip ); float mipInt = floor( mip ); vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); if ( mipF == 0.0 ) { return vec4( color0, 1.0 ); } else { vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); return vec4( mix( color0, color1, mipF ), 1.0 ); } } #endif`,fG=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif #ifdef USE_BATCHING mat3 bm = mat3( batchingMatrix ); transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); transformedNormal = bm * transformedNormal; #ifdef USE_TANGENT transformedTangent = bm * transformedTangent; #endif #endif #ifdef USE_INSTANCING mat3 im = mat3( instanceMatrix ); transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); transformedNormal = im * transformedNormal; #ifdef USE_TANGENT transformedTangent = im * transformedTangent; #endif #endif transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedNormal = - transformedNormal; #endif #ifdef USE_TANGENT transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif #endif`,dG=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,hG=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,pG=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; #endif`,mG=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,gG="gl_FragColor = linearToOutputTexel( gl_FragColor );",vG=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), vec3( 0.0170827, 0.0723974, 0.9105199 ) ); const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( vec3( 1.2249401, - 0.2249404, 0.0 ), vec3( - 0.0420569, 1.0420571, 0.0 ), vec3( - 0.0196376, - 0.0786361, 1.0982735 ) ); vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); } vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); } vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferOETF( in vec4 value ) { 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 ); }`,yG=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToFrag = normalize( vWorldPosition - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vec3 reflectVec = reflect( cameraToFrag, worldNormal ); #else vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); #endif #else vec3 reflectVec = vReflect; #endif #ifdef ENVMAP_TYPE_CUBE vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); #else vec4 envColor = vec4( 0.0 ); #endif #ifdef ENVMAP_BLENDING_MULTIPLY outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_MIX ) outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif #endif`,xG=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,_G=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; uniform float refractionRatio; #else varying vec3 vReflect; #endif #endif`,AG=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif #ifdef ENV_WORLDPOS varying vec3 vWorldPosition; #else varying vec3 vReflect; uniform float refractionRatio; #endif #endif`,SG=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else vec3 cameraToVertex; if ( isOrthographic ) { cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); } else { cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); } vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,MG=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,wG=`#ifdef USE_FOG varying float vFogDepth; #endif`,EG=`#ifdef USE_FOG #ifdef FOG_EXP2 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); #else float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); #endif gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); #endif`,CG=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,TG=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { float dotNL = dot( normal, lightDirection ); vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); #ifdef USE_GRADIENTMAP return vec3( texture2D( gradientMap, coord ).r ); #else vec2 fw = fwidth( coord ) * 0.5; return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); #endif }`,bG=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,RG=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,PG=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; }; void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert #define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,IG=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; #endif vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { float x = normal.x, y = normal.y, z = normal.z; vec3 result = shCoefficients[ 0 ] * 0.886227; result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); return result; } vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); return irradiance; } vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { vec3 irradiance = ambientLightColor; return irradiance; } float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); if ( cutoffDistance > 0.0 ) { distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); } return distanceFalloff; } float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { return smoothstep( coneCosine, penumbraCosine, angleCosine ); } #if NUM_DIR_LIGHTS > 0 struct DirectionalLight { vec3 direction; vec3 color; }; uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { light.color = directionalLight.color; light.direction = directionalLight.direction; light.visible = true; } #endif #if NUM_POINT_LIGHTS > 0 struct PointLight { vec3 position; vec3 color; float distance; float decay; }; uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = pointLight.position - geometryPosition; light.direction = normalize( lVector ); float lightDistance = length( lVector ); light.color = pointLight.color; light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } #endif #if NUM_SPOT_LIGHTS > 0 struct SpotLight { vec3 position; vec3 direction; vec3 color; float distance; float decay; float coneCos; float penumbraCos; }; uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { vec3 lVector = spotLight.position - geometryPosition; light.direction = normalize( lVector ); float angleCos = dot( light.direction, spotLight.direction ); float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); if ( spotAttenuation > 0.0 ) { float lightDistance = length( lVector ); light.color = spotLight.color * spotAttenuation; light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); light.visible = ( light.color != vec3( 0.0 ) ); } else { light.color = vec3( 0.0 ); light.visible = false; } } #endif #if NUM_RECT_AREA_LIGHTS > 0 struct RectAreaLight { vec3 color; vec3 position; vec3 halfWidth; vec3 halfHeight; }; uniform sampler2D ltc_1; uniform sampler2D ltc_2; uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; #endif #if NUM_HEMI_LIGHTS > 0 struct HemisphereLight { vec3 direction; vec3 skyColor; vec3 groundColor; }; uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { float dotNL = dot( normal, hemiLight.direction ); float hemiDiffuseWeight = 0.5 * dotNL + 0.5; vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } #endif`,BG=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); return PI * envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 reflectVec = reflect( - viewDir, normal ); reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); return envMapColor.rgb * envMapIntensity; #else return vec3( 0.0 ); #endif } #ifdef USE_ANISOTROPY vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 bentNormal = cross( bitangent, viewDir ); bentNormal = normalize( cross( bentNormal, bitangent ) ); bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); return getIBLRadiance( viewDir, bentNormal, roughness ); #else return vec3( 0.0 ); #endif } #endif #endif`,LG=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,DG=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; void 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 ) { vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,FG=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,NG=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; float specularShininess; float specularStrength; }; void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong #define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,UG=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; material.roughness = min( material.roughness, 1.0 ); #ifdef IOR material.ior = ior; #ifdef USE_SPECULAR float specularIntensityFactor = specularIntensity; vec3 specularColorFactor = specularColor; #ifdef USE_SPECULAR_COLORMAP specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; #endif #ifdef USE_SPECULAR_INTENSITYMAP specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; #endif material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); #else float specularIntensityFactor = 1.0; vec3 specularColorFactor = vec3( 1.0 ); material.specularF90 = 1.0; #endif material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); material.specularF90 = 1.0; #endif #ifdef USE_CLEARCOAT material.clearcoat = clearcoat; material.clearcoatRoughness = clearcoatRoughness; material.clearcoatF0 = vec3( 0.04 ); material.clearcoatF90 = 1.0; #ifdef USE_CLEARCOATMAP material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; #endif material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); material.clearcoatRoughness += geometryRoughness; material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); #endif #ifdef USE_DISPERSION material.dispersion = dispersion; #endif #ifdef USE_IRIDESCENCE material.iridescence = iridescence; material.iridescenceIOR = iridescenceIOR; #ifdef USE_IRIDESCENCEMAP material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; #else material.iridescenceThickness = iridescenceThicknessMaximum; #endif #endif #ifdef USE_SHEEN material.sheenColor = sheenColor; #ifdef USE_SHEEN_COLORMAP material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; #endif material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); #ifdef USE_SHEEN_ROUGHNESSMAP material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; #endif #endif #ifdef USE_ANISOTROPY #ifdef USE_ANISOTROPYMAP mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; #else vec2 anisotropyV = anisotropyVector; #endif material.anisotropy = length( anisotropyV ); if( material.anisotropy == 0.0 ) { anisotropyV = vec2( 1.0, 0.0 ); } else { anisotropyV /= material.anisotropy; material.anisotropy = saturate( material.anisotropy ); } material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; #endif`,OG=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; float specularF90; float dispersion; #ifdef USE_CLEARCOAT float clearcoat; float clearcoatRoughness; vec3 clearcoatF0; float clearcoatF90; #endif #ifdef USE_IRIDESCENCE float iridescence; float iridescenceIOR; float iridescenceThickness; vec3 iridescenceFresnel; vec3 iridescenceF0; #endif #ifdef USE_SHEEN vec3 sheenColor; float sheenRoughness; #endif #ifdef IOR float ior; #endif #ifdef USE_TRANSMISSION float transmission; float transmissionAlpha; float thickness; float attenuationDistance; vec3 attenuationColor; #endif #ifdef USE_ANISOTROPY float anisotropy; float alphaT; vec3 anisotropyT; vec3 anisotropyB; #endif }; vec3 clearcoatSpecularDirect = vec3( 0.0 ); vec3 clearcoatSpecularIndirect = vec3( 0.0 ); vec3 sheenSpecularDirect = vec3( 0.0 ); vec3 sheenSpecularIndirect = vec3(0.0 ); vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); float x2 = x * x; float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); } float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { float a2 = pow2( alpha ); float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); return 0.5 / max( gv + gl, EPSILON ); } float D_GGX( const in float alpha, const in float dotNH ) { float a2 = pow2( alpha ); float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; return RECIPROCAL_PI * a2 / pow2( denom ); } #ifdef USE_ANISOTROPY 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 ) { float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); float v = 0.5 / ( gv + gl ); return saturate(v); } float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { float a2 = alphaT * alphaB; highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); highp float v2 = dot( v, v ); float w2 = a2 / v2; return RECIPROCAL_PI * a2 * pow2 ( w2 ); } #endif #ifdef USE_CLEARCOAT vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { vec3 f0 = material.clearcoatF0; float f90 = material.clearcoatF90; float roughness = material.clearcoatRoughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); return F * ( V * D ); } #endif vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 f0 = material.specularColor; float f90 = material.specularF90; float roughness = material.roughness; float alpha = pow2( roughness ); vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float dotVH = saturate( dot( viewDir, halfDir ) ); vec3 F = F_Schlick( f0, f90, dotVH ); #ifdef USE_IRIDESCENCE F = mix( F, material.iridescenceFresnel, material.iridescence ); #endif #ifdef USE_ANISOTROPY float dotTL = dot( material.anisotropyT, lightDir ); float dotTV = dot( material.anisotropyT, viewDir ); float dotTH = dot( material.anisotropyT, halfDir ); float dotBL = dot( material.anisotropyB, lightDir ); float dotBV = dot( material.anisotropyB, viewDir ); float dotBH = dot( material.anisotropyB, halfDir ); float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); #else float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); float D = D_GGX( alpha, dotNH ); #endif return F * ( V * D ); } vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { const float LUT_SIZE = 64.0; const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; const float LUT_BIAS = 0.5 / LUT_SIZE; float dotNV = saturate( dot( N, V ) ); vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); uv = uv * LUT_SCALE + LUT_BIAS; return uv; } float LTC_ClippedSphereFormFactor( const in vec3 f ) { float l = length( f ); return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); } vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { float x = dot( v1, v2 ); float y = abs( x ); float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; float b = 3.4175940 + ( 4.1616724 + y ) * y; float v = a / b; float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; return cross( v1, v2 ) * theta_sintheta; } vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; vec3 lightNormal = cross( v1, v2 ); if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); vec3 T1, T2; T1 = normalize( V - N * dot( V, N ) ); T2 = - cross( N, T1 ); mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); vec3 coords[ 4 ]; coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); coords[ 0 ] = normalize( coords[ 0 ] ); coords[ 1 ] = normalize( coords[ 1 ] ); coords[ 2 ] = normalize( coords[ 2 ] ); coords[ 3 ] = normalize( coords[ 3 ] ); vec3 vectorFormFactor = vec3( 0.0 ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); return vec3( result ); } #if defined( USE_SHEEN ) float D_Charlie( float roughness, float dotNH ) { float alpha = pow2( roughness ); float invAlpha = 1.0 / alpha; float cos2h = dotNH * dotNH; float sin2h = max( 1.0 - cos2h, 0.0078125 ); return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); } float V_Neubelt( float dotNV, float dotNL ) { return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); } vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { vec3 halfDir = normalize( lightDir + viewDir ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); float dotNH = saturate( dot( normal, halfDir ) ); float D = D_Charlie( sheenRoughness, dotNH ); float V = V_Neubelt( dotNV, dotNL ); return sheenColor * ( D * V ); } #endif float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); float r2 = roughness * roughness; float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); return saturate( DG * RECIPROCAL_PI ); } vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); vec4 r = roughness * c0 + c1; float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; return fab; } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { vec2 fab = DFGApprox( normal, viewDir, roughness ); return specularColor * fab.x + specularF90 * fab.y; } #ifdef USE_IRIDESCENCE void 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 ) { #else void 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 ) { #endif vec2 fab = DFGApprox( normal, viewDir, roughness ); #ifdef USE_IRIDESCENCE vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); #else vec3 Fr = specularColor; #endif vec3 FssEss = Fr * fab.x + specularF90 * fab.y; float Ess = fab.x + fab.y; float Ems = 1.0 - Ess; vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); singleScatter += FssEss; multiScatter += Fms * Ems; } #if NUM_RECT_AREA_LIGHTS > 0 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 ) { vec3 normal = geometryNormal; vec3 viewDir = geometryViewDir; vec3 position = geometryPosition; vec3 lightPos = rectAreaLight.position; vec3 halfWidth = rectAreaLight.halfWidth; vec3 halfHeight = rectAreaLight.halfHeight; vec3 lightColor = rectAreaLight.color; float roughness = material.roughness; vec3 rectCoords[ 4 ]; rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; vec2 uv = LTC_Uv( normal, viewDir, roughness ); vec4 t1 = texture2D( ltc_1, uv ); vec4 t2 = texture2D( ltc_2, uv ); mat3 mInv = mat3( vec3( t1.x, 0, t1.y ), vec3( 0, 1, 0 ), vec3( t1.z, 0, t1.w ) ); vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); } #endif void 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 ) { float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); vec3 irradiance = dotNL * directLight.color; #ifdef USE_CLEARCOAT float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); vec3 ccIrradiance = dotNLcc * directLight.color; clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); #endif #ifdef USE_SHEEN sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); #endif reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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 ) { reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } void 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) { #ifdef USE_CLEARCOAT clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); #endif #ifdef USE_SHEEN sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); #endif vec3 singleScattering = vec3( 0.0 ); vec3 multiScattering = vec3( 0.0 ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); #endif vec3 totalScattering = singleScattering + multiScattering; vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); reflectedLight.indirectSpecular += radiance * singleScattering; reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; } #define RE_Direct RE_Direct_Physical #define RE_Direct_RectArea RE_Direct_RectArea_Physical #define RE_IndirectDiffuse RE_IndirectDiffuse_Physical #define RE_IndirectSpecular RE_IndirectSpecular_Physical float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); }`,kG=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); vec3 geometryClearcoatNormal = vec3( 0.0 ); #ifdef USE_CLEARCOAT geometryClearcoatNormal = clearcoatNormal; #endif #ifdef USE_IRIDESCENCE float dotNVi = saturate( dot( normal, geometryViewDir ) ); if ( material.iridescenceThickness == 0.0 ) { material.iridescence = 0.0; } else { material.iridescence = saturate( material.iridescence ); } if ( material.iridescence > 0.0 ) { material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); } #endif IncidentLight directLight; #if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) PointLight pointLight; #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { pointLight = pointLights[ i ]; getPointLightInfo( pointLight, geometryPosition, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) pointLightShadow = pointLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) SpotLight spotLight; vec4 spotColor; vec3 spotLightCoord; bool inSpotLightMap; #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { spotLight = spotLights[ i ]; getSpotLightInfo( spotLight, geometryPosition, directLight ); #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS #else #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) #endif #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; #endif #undef SPOT_LIGHT_MAP_INDEX #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) spotLightShadow = spotLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) DirectionalLight directionalLight; #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLightShadow; #endif #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { directionalLight = directionalLights[ i ]; getDirectionalLightInfo( directionalLight, directLight ); #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) directionalLightShadow = directionalLightShadows[ i ]; directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; #endif RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) RectAreaLight rectAreaLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { rectAreaLight = rectAreaLights[ i ]; RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); } #pragma unroll_loop_end #endif #if defined( RE_IndirectDiffuse ) vec3 iblIrradiance = vec3( 0.0 ); vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); #if defined( USE_LIGHT_PROBES ) irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); #endif #if ( NUM_HEMI_LIGHTS > 0 ) #pragma unroll_loop_start for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); } #pragma unroll_loop_end #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,zG=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; irradiance += lightMapIrradiance; #endif #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #endif #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) #ifdef USE_ANISOTROPY radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); #else radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); #endif #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif #endif`,HG=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif`,GG=`#if defined( USE_LOGDEPTHBUF ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,VG=`#if defined( USE_LOGDEPTHBUF ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,WG=`#ifdef USE_LOGDEPTHBUF varying float vFragDepth; varying float vIsPerspective; #endif`,XG=`#ifdef USE_LOGDEPTHBUF vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,jG=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; #endif`,JG=`#ifdef USE_MAP uniform sampler2D map; #endif`,KG=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; #endif #endif #ifdef USE_MAP diffuseColor *= texture2D( map, uv ); #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; #endif`,YG=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) uniform mat3 uvTransform; #endif #endif #ifdef USE_MAP uniform sampler2D map; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; #endif`,QG=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,qG=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,ZG=`#ifdef USE_INSTANCING_MORPH float morphTargetInfluences[ MORPHTARGETS_COUNT ]; float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; } #endif`,$G=`#if defined( USE_MORPHCOLORS ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; #elif defined( USE_COLOR ) if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } #endif`,eV=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; } #endif`,tV=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; #endif uniform sampler2DArray morphTargetsTexture; uniform ivec2 morphTargetsTextureSize; vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; int y = texelIndex / morphTargetsTextureSize.x; int x = texelIndex - y * morphTargetsTextureSize.x; ivec3 morphUV = ivec3( x, y, morphTargetIndex ); return texelFetch( morphTargetsTexture, morphUV, 0 ); } #endif`,nV=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; } #endif`,iV=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); vec3 normal = normalize( cross( fdx, fdy ) ); #else vec3 normal = normalize( vNormal ); #ifdef DOUBLE_SIDED normal *= faceDirection; #endif #endif #if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) #ifdef USE_TANGENT mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn = getTangentFrame( - vViewPosition, normal, #if defined( USE_NORMALMAP ) vNormalMapUv #elif defined( USE_CLEARCOAT_NORMALMAP ) vClearcoatNormalMapUv #else vUv #endif ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn[0] *= faceDirection; tbn[1] *= faceDirection; #endif #endif #ifdef USE_CLEARCOAT_NORMALMAP #ifdef USE_TANGENT mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); #else mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); #endif #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,rV=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; #endif #ifdef DOUBLE_SIDED normal = normal * faceDirection; #endif normal = normalize( normalMatrix * normal ); #elif defined( USE_NORMALMAP_TANGENTSPACE ) vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,sV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,oV=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,aV=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif #endif`,lV=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif #ifdef USE_NORMALMAP_OBJECTSPACE uniform mat3 normalMatrix; #endif #if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { vec3 q0 = dFdx( eye_pos.xyz ); vec3 q1 = dFdy( eye_pos.xyz ); vec2 st0 = dFdx( uv.st ); vec2 st1 = dFdy( uv.st ); vec3 N = surf_norm; vec3 q1perp = cross( q1, N ); vec3 q0perp = cross( N, q0 ); vec3 T = q1perp * st0.x + q0perp * st1.x; vec3 B = q1perp * st0.y + q0perp * st1.y; float det = max( dot( T, T ), dot( B, B ) ); float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } #endif`,cV=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,uV=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,fV=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform sampler2D clearcoatNormalMap; uniform vec2 clearcoatNormalScale; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; #endif`,dV=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,hV=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,pV=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; const float Inv255 = 1. / 255.; const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); vec4 packDepthToRGBA( const in float v ) { if( v <= 0.0 ) return vec4( 0., 0., 0., 0. ); if( v >= 1.0 ) return vec4( 1., 1., 1., 1. ); float vuf; float af = modf( v * PackFactors.a, vuf ); float bf = modf( vuf * ShiftRight8, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); } vec3 packDepthToRGB( const in float v ) { if( v <= 0.0 ) return vec3( 0., 0., 0. ); if( v >= 1.0 ) return vec3( 1., 1., 1. ); float vuf; float bf = modf( v * PackFactors.b, vuf ); float gf = modf( vuf * ShiftRight8, vuf ); return vec3( vuf * Inv255, gf * PackUpscale, bf ); } vec2 packDepthToRG( const in float v ) { if( v <= 0.0 ) return vec2( 0., 0. ); if( v >= 1.0 ) return vec2( 1., 1. ); float vuf; float gf = modf( v * 256., vuf ); return vec2( vuf * Inv255, gf ); } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors4 ); } float unpackRGBToDepth( const in vec3 v ) { return dot( v, UnpackFactors3 ); } float unpackRGToDepth( const in vec2 v ) { return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; } vec4 pack2HalfToRGBA( const in vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); } vec2 unpackRGBATo2Half( const in vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { return depth * ( near - far ) - near; } float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); }`,mV=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,gV=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,vV=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,yV=`#ifdef DITHERING vec3 dithering( vec3 color ) { float grid_position = rand( gl_FragCoord.xy ); vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); return color + dither_shift_RGB; } #endif`,xV=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,_V=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,AV=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); } vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { return unpackRGBATo2Half( texture2D( shadow, uv ) ); } float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ float occlusion = 1.0; vec2 distribution = texture2DDistribution( shadow, uv ); float hard_shadow = step( compare , distribution.x ); if (hard_shadow != 1.0 ) { float distance = compare - distribution.x ; float variance = max( 0.00000, distribution.y * distribution.y ); float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); } return occlusion; } float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; shadowCoord.z += shadowBias; bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; bool frustumTest = inFrustum && shadowCoord.z <= 1.0; if ( frustumTest ) { #if defined( SHADOWMAP_TYPE_PCF ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx0 = - texelSize.x * shadowRadius; float dy0 = - texelSize.y * shadowRadius; float dx1 = + texelSize.x * shadowRadius; float dy1 = + texelSize.y * shadowRadius; float dx2 = dx0 / 2.0; float dy2 = dy0 / 2.0; float dx3 = dx1 / 2.0; float dy3 = dy1 / 2.0; shadow = ( texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) ) * ( 1.0 / 17.0 ); #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float dx = texelSize.x; float dy = texelSize.y; vec2 uv = shadowCoord.xy; vec2 f = fract( uv * shadowMapSize + 0.5 ); uv -= f * texelSize; shadow = ( texture2DCompare( shadowMap, uv, shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), f.x ) + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), f.y ) + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), f.x ), mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), f.x ), f.y ) ) * ( 1.0 / 9.0 ); #elif defined( SHADOWMAP_TYPE_VSM ) shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); #else shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); #endif } return mix( 1.0, shadow, shadowIntensity ); } vec2 cubeToUV( vec3 v, float texelSizeY ) { vec3 absV = abs( v ); float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); absV *= scaleToCube; v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); vec2 planar = v.xy; float almostATexel = 1.5 * texelSizeY; float almostOne = 1.0 - almostATexel; if ( absV.z >= almostOne ) { if ( v.z > 0.0 ) planar.x = 4.0 - v.x; } else if ( absV.x >= almostOne ) { float signX = sign( v.x ); planar.x = v.z * signX + 2.0 * signX; } else if ( absV.y >= almostOne ) { float signY = sign( v.y ); planar.x = v.x + 2.0 * signY + 2.0; planar.y = v.z * signY - 2.0; } return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); } float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { float shadow = 1.0; vec3 lightToPosition = shadowCoord.xyz; float lightToPositionLength = length( lightToPosition ); if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) { float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; shadow = ( texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) ) * ( 1.0 / 9.0 ); #else shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } return mix( 1.0, shadow, shadowIntensity ); } #endif`,SV=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; struct DirectionalLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 struct SpotLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; }; uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; #endif #if NUM_POINT_LIGHT_SHADOWS > 0 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; struct PointLightShadow { float shadowIntensity; float shadowBias; float shadowNormalBias; float shadowRadius; vec2 shadowMapSize; float shadowCameraNear; float shadowCameraFar; }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif #endif`,MV=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif #if defined( USE_SHADOWMAP ) #if NUM_DIR_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif #endif #if NUM_SPOT_LIGHT_COORDS > 0 #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { shadowWorldPosition = worldPosition; #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; #endif vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end #endif`,wV=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 DirectionalLightShadow directionalLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { directionalLight = directionalLightShadows[ i ]; shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_SPOT_LIGHT_SHADOWS > 0 SpotLightShadow spotLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { spotLight = spotLightShadows[ i ]; shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; } #pragma unroll_loop_end #endif #if NUM_POINT_LIGHT_SHADOWS > 0 PointLightShadow pointLight; #pragma unroll_loop_start for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { pointLight = pointLightShadows[ i ]; shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; } #pragma unroll_loop_end #endif #endif return shadow; }`,EV=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,CV=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; mat4 getBoneMatrix( const in float i ) { int size = textureSize( boneTexture, 0 ).x; int j = int( i ) * 4; int x = j % size; int y = j / size; vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } #endif`,TV=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; skinned += boneMatY * skinVertex * skinWeight.y; skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; #endif`,bV=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; skinMatrix += skinWeight.z * boneMatZ; skinMatrix += skinWeight.w * boneMatW; skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif #endif`,RV=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,PV=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,IV=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,BV=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; vec3 LinearToneMapping( vec3 color ) { return saturate( toneMappingExposure * color ); } vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } vec3 OptimizedCineonToneMapping( vec3 color ) { color *= toneMappingExposure; color = max( vec3( 0.0 ), color - 0.004 ); return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); } vec3 RRTAndODTFit( vec3 v ) { vec3 a = v * ( v + 0.0245786 ) - 0.000090537; vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; return a / b; } vec3 ACESFilmicToneMapping( vec3 color ) { const mat3 ACESInputMat = mat3( vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), vec3( 0.04823, 0.01566, 0.83777 ) ); const mat3 ACESOutputMat = mat3( vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), vec3( -0.07367, -0.00605, 1.07602 ) ); color *= toneMappingExposure / 0.6; color = ACESInputMat * color; color = RRTAndODTFit( color ); color = ACESOutputMat * color; return saturate( color ); } const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( vec3( 1.6605, - 0.1246, - 0.0182 ), vec3( - 0.5876, 1.1329, - 0.1006 ), vec3( - 0.0728, - 0.0083, 1.1187 ) ); const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( vec3( 0.6274, 0.0691, 0.0164 ), vec3( 0.3293, 0.9195, 0.0880 ), vec3( 0.0433, 0.0113, 0.8956 ) ); vec3 agxDefaultContrastApprox( vec3 x ) { vec3 x2 = x * x; vec3 x4 = x2 * x2; return + 15.5 * x4 * x2 - 40.14 * x4 * x + 31.96 * x4 - 6.868 * x2 * x + 0.4298 * x2 + 0.1191 * x - 0.00232; } vec3 AgXToneMapping( vec3 color ) { const mat3 AgXInsetMatrix = mat3( vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) ); const mat3 AgXOutsetMatrix = mat3( vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) ); const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; color *= toneMappingExposure; color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; color = AgXInsetMatrix * color; color = max( color, 1e-10 ); color = log2( color ); color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); color = clamp( color, 0.0, 1.0 ); color = agxDefaultContrastApprox( color ); color = AgXOutsetMatrix * color; color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); color = LINEAR_REC2020_TO_LINEAR_SRGB * color; color = clamp( color, 0.0, 1.0 ); return color; } vec3 NeutralToneMapping( vec3 color ) { const float StartCompression = 0.8 - 0.04; const float Desaturation = 0.15; color *= toneMappingExposure; float x = min( color.r, min( color.g, color.b ) ); float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; color -= offset; float peak = max( color.r, max( color.g, color.b ) ); if ( peak < StartCompression ) return color; float d = 1. - StartCompression; float newPeak = 1. - d * d / ( peak + d - StartCompression ); color *= newPeak / peak; float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); return mix( color, vec3( newPeak ), g ); } vec3 CustomToneMapping( vec3 color ) { return color; }`,LV=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; material.attenuationDistance = attenuationDistance; material.attenuationColor = attenuationColor; #ifdef USE_TRANSMISSIONMAP material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; #endif #ifdef USE_THICKNESSMAP material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; #endif vec3 pos = vWorldPosition; vec3 v = normalize( cameraPosition - pos ); vec3 n = inverseTransformDirection( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); #endif`,DV=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; uniform vec3 attenuationColor; #ifdef USE_TRANSMISSIONMAP uniform sampler2D transmissionMap; #endif #ifdef USE_THICKNESSMAP uniform sampler2D thicknessMap; #endif uniform vec2 transmissionSamplerSize; uniform sampler2D transmissionSamplerMap; uniform mat4 modelMatrix; uniform mat4 projectionMatrix; varying vec3 vWorldPosition; float w0( float a ) { return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); } float w1( float a ) { return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); } float w2( float a ){ return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); } float w3( float a ) { return ( 1.0 / 6.0 ) * ( a * a * a ); } float g0( float a ) { return w0( a ) + w1( a ); } float g1( float a ) { return w2( a ) + w3( a ); } float h0( float a ) { return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); } float h1( float a ) { return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); } vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { uv = uv * texelSize.zw + 0.5; vec2 iuv = floor( uv ); vec2 fuv = fract( uv ); float g0x = g0( fuv.x ); float g1x = g1( fuv.x ); float h0x = h0( fuv.x ); float h1x = h1( fuv.x ); float h0y = h0( fuv.y ); float h1y = h1( fuv.y ); vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); } vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); vec2 fLodSizeInv = 1.0 / fLodSize; vec2 cLodSizeInv = 1.0 / cLodSize; vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); return mix( fSample, cSample, fract( lod ) ); } vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); vec3 modelScale; modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); return normalize( refractionVector ) * thickness * modelScale; } float applyIorToRoughness( const in float roughness, const in float ior ) { return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); } vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); } vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { if ( isinf( attenuationDistance ) ) { return vec3( 1.0 ); } else { vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; } } vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, const in vec3 attenuationColor, const in float attenuationDistance ) { vec4 transmittedLight; vec3 transmittance; #ifdef USE_DISPERSION float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); for ( int i = 0; i < 3; i ++ ) { vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); transmittedLight[ i ] = transmissionSample[ i ]; transmittedLight.a += transmissionSample.a; transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; } transmittedLight.a /= 3.0; #else vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); vec3 refractedRayExit = position + transmissionRay; vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); vec2 refractionCoords = ndcPos.xy / ndcPos.w; refractionCoords += 1.0; refractionCoords /= 2.0; transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); #endif vec3 attenuatedColor = transmittance * transmittedLight.rgb; vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } #endif`,FV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP varying vec2 vNormalMapUv; #endif #ifdef USE_EMISSIVEMAP varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SHEEN_COLORMAP varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_SPECULARMAP varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,NV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP uniform mat3 mapTransform; varying vec2 vMapUv; #endif #ifdef USE_ALPHAMAP uniform mat3 alphaMapTransform; varying vec2 vAlphaMapUv; #endif #ifdef USE_LIGHTMAP uniform mat3 lightMapTransform; varying vec2 vLightMapUv; #endif #ifdef USE_AOMAP uniform mat3 aoMapTransform; varying vec2 vAoMapUv; #endif #ifdef USE_BUMPMAP uniform mat3 bumpMapTransform; varying vec2 vBumpMapUv; #endif #ifdef USE_NORMALMAP uniform mat3 normalMapTransform; varying vec2 vNormalMapUv; #endif #ifdef USE_DISPLACEMENTMAP uniform mat3 displacementMapTransform; varying vec2 vDisplacementMapUv; #endif #ifdef USE_EMISSIVEMAP uniform mat3 emissiveMapTransform; varying vec2 vEmissiveMapUv; #endif #ifdef USE_METALNESSMAP uniform mat3 metalnessMapTransform; varying vec2 vMetalnessMapUv; #endif #ifdef USE_ROUGHNESSMAP uniform mat3 roughnessMapTransform; varying vec2 vRoughnessMapUv; #endif #ifdef USE_ANISOTROPYMAP uniform mat3 anisotropyMapTransform; varying vec2 vAnisotropyMapUv; #endif #ifdef USE_CLEARCOATMAP uniform mat3 clearcoatMapTransform; varying vec2 vClearcoatMapUv; #endif #ifdef USE_CLEARCOAT_NORMALMAP uniform mat3 clearcoatNormalMapTransform; varying vec2 vClearcoatNormalMapUv; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform mat3 clearcoatRoughnessMapTransform; varying vec2 vClearcoatRoughnessMapUv; #endif #ifdef USE_SHEEN_COLORMAP uniform mat3 sheenColorMapTransform; varying vec2 vSheenColorMapUv; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform mat3 sheenRoughnessMapTransform; varying vec2 vSheenRoughnessMapUv; #endif #ifdef USE_IRIDESCENCEMAP uniform mat3 iridescenceMapTransform; varying vec2 vIridescenceMapUv; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform mat3 iridescenceThicknessMapTransform; varying vec2 vIridescenceThicknessMapUv; #endif #ifdef USE_SPECULARMAP uniform mat3 specularMapTransform; varying vec2 vSpecularMapUv; #endif #ifdef USE_SPECULAR_COLORMAP uniform mat3 specularColorMapTransform; varying vec2 vSpecularColorMapUv; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform mat3 specularIntensityMapTransform; varying vec2 vSpecularIntensityMapUv; #endif #ifdef USE_TRANSMISSIONMAP uniform mat3 transmissionMapTransform; varying vec2 vTransmissionMapUv; #endif #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; #endif`,UV=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; #endif #ifdef USE_ALPHAMAP vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; #endif #ifdef USE_LIGHTMAP vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; #endif #ifdef USE_AOMAP vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; #endif #ifdef USE_BUMPMAP vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; #endif #ifdef USE_NORMALMAP vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_DISPLACEMENTMAP vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; #endif #ifdef USE_EMISSIVEMAP vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; #endif #ifdef USE_METALNESSMAP vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ROUGHNESSMAP vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_ANISOTROPYMAP vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOATMAP vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_NORMALMAP vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCEMAP vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_COLORMAP vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SHEEN_ROUGHNESSMAP vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULARMAP vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_COLORMAP vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; #endif #ifdef USE_SPECULAR_INTENSITYMAP vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; #endif #ifdef USE_TRANSMISSIONMAP vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; #endif`,OV=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 vec4 worldPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING worldPosition = batchingMatrix * worldPosition; #endif #ifdef USE_INSTANCING worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; #endif`;const Nt={alphahash_fragment:z4,alphahash_pars_fragment:H4,alphamap_fragment:G4,alphamap_pars_fragment:V4,alphatest_fragment:W4,alphatest_pars_fragment:X4,aomap_fragment:j4,aomap_pars_fragment:J4,batching_pars_vertex:K4,batching_vertex:Y4,begin_vertex:Q4,beginnormal_vertex:q4,bsdfs:Z4,iridescence_fragment:$4,bumpmap_pars_fragment:eG,clipping_planes_fragment:tG,clipping_planes_pars_fragment:nG,clipping_planes_pars_vertex:iG,clipping_planes_vertex:rG,color_fragment:sG,color_pars_fragment:oG,color_pars_vertex:aG,color_vertex:lG,common:cG,cube_uv_reflection_fragment:uG,defaultnormal_vertex:fG,displacementmap_pars_vertex:dG,displacementmap_vertex:hG,emissivemap_fragment:pG,emissivemap_pars_fragment:mG,colorspace_fragment:gG,colorspace_pars_fragment:vG,envmap_fragment:yG,envmap_common_pars_fragment:xG,envmap_pars_fragment:_G,envmap_pars_vertex:AG,envmap_physical_pars_fragment:BG,envmap_vertex:SG,fog_vertex:MG,fog_pars_vertex:wG,fog_fragment:EG,fog_pars_fragment:CG,gradientmap_pars_fragment:TG,lightmap_pars_fragment:bG,lights_lambert_fragment:RG,lights_lambert_pars_fragment:PG,lights_pars_begin:IG,lights_toon_fragment:LG,lights_toon_pars_fragment:DG,lights_phong_fragment:FG,lights_phong_pars_fragment:NG,lights_physical_fragment:UG,lights_physical_pars_fragment:OG,lights_fragment_begin:kG,lights_fragment_maps:zG,lights_fragment_end:HG,logdepthbuf_fragment:GG,logdepthbuf_pars_fragment:VG,logdepthbuf_pars_vertex:WG,logdepthbuf_vertex:XG,map_fragment:jG,map_pars_fragment:JG,map_particle_fragment:KG,map_particle_pars_fragment:YG,metalnessmap_fragment:QG,metalnessmap_pars_fragment:qG,morphinstance_vertex:ZG,morphcolor_vertex:$G,morphnormal_vertex:eV,morphtarget_pars_vertex:tV,morphtarget_vertex:nV,normal_fragment_begin:iV,normal_fragment_maps:rV,normal_pars_fragment:sV,normal_pars_vertex:oV,normal_vertex:aV,normalmap_pars_fragment:lV,clearcoat_normal_fragment_begin:cV,clearcoat_normal_fragment_maps:uV,clearcoat_pars_fragment:fV,iridescence_pars_fragment:dV,opaque_fragment:hV,packing:pV,premultiplied_alpha_fragment:mV,project_vertex:gV,dithering_fragment:vV,dithering_pars_fragment:yV,roughnessmap_fragment:xV,roughnessmap_pars_fragment:_V,shadowmap_pars_fragment:AV,shadowmap_pars_vertex:SV,shadowmap_vertex:MV,shadowmask_pars_fragment:wV,skinbase_vertex:EV,skinning_pars_vertex:CV,skinning_vertex:TV,skinnormal_vertex:bV,specularmap_fragment:RV,specularmap_pars_fragment:PV,tonemapping_fragment:IV,tonemapping_pars_fragment:BV,transmission_fragment:LV,transmission_pars_fragment:DV,uv_pars_fragment:FV,uv_pars_vertex:NV,uv_vertex:UV,worldpos_vertex:OV,background_vert:`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,background_frag:`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); #ifdef DECODE_VIDEO_TEXTURE 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 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,backgroundCube_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float flipEnvMap; uniform float backgroundBlurriness; uniform float backgroundIntensity; uniform mat3 backgroundRotation; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); #elif defined( ENVMAP_TYPE_CUBE_UV ) vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); #else vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); #endif texColor.rgb *= backgroundIntensity; gl_FragColor = texColor; #include #include }`,cube_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,cube_frag:`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; void main() { vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); gl_FragColor = texColor; gl_FragColor.a *= opacity; #include #include }`,depth_vert:`#include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vHighPrecisionZW = gl_Position.zw; }`,depth_frag:`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include #include #include #include #include #include #include #include #include varying vec2 vHighPrecisionZW; void main() { vec4 diffuseColor = vec4( 1.0 ); #include #if DEPTH_PACKING == 3200 diffuseColor.a = opacity; #endif #include #include #include #include #include float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; #if DEPTH_PACKING == 3200 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #elif DEPTH_PACKING == 3202 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); #elif DEPTH_PACKING == 3203 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); #endif }`,distanceRGBA_vert:`#define DISTANCE varying vec3 vWorldPosition; #include #include #include #include #include #include #include void main() { #include #include #include #include #ifdef USE_DISPLACEMENTMAP #include #include #include #endif #include #include #include #include #include #include #include vWorldPosition = worldPosition.xyz; }`,distanceRGBA_frag:`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #include #include #include #include #include #include #include #include void main () { vec4 diffuseColor = vec4( 1.0 ); #include #include #include #include #include float dist = length( vWorldPosition - referencePosition ); dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); }`,equirect_vert:`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,equirect_frag:`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,linedashed_vert:`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vLineDistance = scale * lineDistance; #include #include #include #include #include #include #include #include #include #include }`,linedashed_frag:`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; varying float vLineDistance; #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include if ( mod( vLineDistance, totalSize ) > dashSize ) { discard; } vec3 outgoingLight = vec3( 0.0 ); #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,meshbasic_vert:`#include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include }`,meshbasic_frag:`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; #else reflectedLight.indirectDiffuse += vec3( 1.0 ); #endif #include reflectedLight.indirectDiffuse *= diffuseColor.rgb; vec3 outgoingLight = reflectedLight.indirectDiffuse; #include #include #include #include #include #include #include }`,meshlambert_vert:`#define LAMBERT varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,meshlambert_frag:`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,meshmatcap_vert:`#define MATCAP varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; }`,meshmatcap_frag:`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include #include #include #include #include #include #include #include #include vec3 viewDir = normalize( vViewPosition ); vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); vec3 y = cross( viewDir, x ); vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; #ifdef USE_MATCAP vec4 matcapColor = texture2D( matcap, uv ); #else vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); #endif vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; #include #include #include #include #include #include }`,meshnormal_vert:`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif }`,meshnormal_frag:`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,meshphong_vert:`#define PHONG varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #include }`,meshphong_frag:`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; uniform float shininess; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; #include #include #include #include #include #include #include }`,meshphysical_vert:`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; #endif #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif }`,meshphysical_frag:`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR #endif uniform vec3 diffuse; uniform vec3 emissive; uniform float roughness; uniform float metalness; uniform float opacity; #ifdef IOR uniform float ior; #endif #ifdef USE_SPECULAR uniform float specularIntensity; uniform vec3 specularColor; #ifdef USE_SPECULAR_COLORMAP uniform sampler2D specularColorMap; #endif #ifdef USE_SPECULAR_INTENSITYMAP uniform sampler2D specularIntensityMap; #endif #endif #ifdef USE_CLEARCOAT uniform float clearcoat; uniform float clearcoatRoughness; #endif #ifdef USE_DISPERSION uniform float dispersion; #endif #ifdef USE_IRIDESCENCE uniform float iridescence; uniform float iridescenceIOR; uniform float iridescenceThicknessMinimum; uniform float iridescenceThicknessMaximum; #endif #ifdef USE_SHEEN uniform vec3 sheenColor; uniform float sheenRoughness; #ifdef USE_SHEEN_COLORMAP uniform sampler2D sheenColorMap; #endif #ifdef USE_SHEEN_ROUGHNESSMAP uniform sampler2D sheenRoughnessMap; #endif #endif #ifdef USE_ANISOTROPY uniform vec2 anisotropyVector; #ifdef USE_ANISOTROPYMAP uniform sampler2D anisotropyMap; #endif #endif varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; #include vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; #ifdef USE_SHEEN float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; #endif #ifdef USE_CLEARCOAT float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; #endif #include #include #include #include #include #include }`,meshtoon_vert:`#define TOON varying vec3 vViewPosition; #include #include #include #include #include #include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include vViewPosition = - mvPosition.xyz; #include #include #include }`,meshtoon_frag:`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); vec3 totalEmissiveRadiance = emissive; #include #include #include #include #include #include #include #include #include #include #include #include #include #include vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; #include #include #include #include #include #include }`,points_vert:`uniform float size; uniform float scale; #include #include #include #include #include #include #ifdef USE_POINTS_UV varying vec2 vUv; uniform mat3 uvTransform; #endif void main() { #ifdef USE_POINTS_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif #include #include #include #include #include #include gl_PointSize = size; #ifdef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); #endif #include #include #include #include }`,points_frag:`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include #include }`,shadow_vert:`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,shadow_frag:`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include }`,sprite_vert:`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); vec2 scale; scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); #ifndef USE_SIZEATTENUATION bool isPerspective = isPerspectiveMatrix( projectionMatrix ); if ( isPerspective ) scale *= - mvPosition.z; #endif vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; vec2 rotatedPosition; rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; #include #include #include }`,sprite_frag:`uniform vec3 diffuse; uniform float opacity; #include #include #include #include #include #include #include #include #include void main() { vec4 diffuseColor = vec4( diffuse, opacity ); #include vec3 outgoingLight = vec3( 0.0 ); #include #include #include #include #include outgoingLight = diffuseColor.rgb; #include #include #include #include }`},We={common:{diffuse:{value:new ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},envMapRotation:{value:new Dt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ke(16777215)}},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 ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new ke(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ms={basic:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.fog]),vertexShader:Nt.meshbasic_vert,fragmentShader:Nt.meshbasic_frag},lambert:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new ke(0)}}]),vertexShader:Nt.meshlambert_vert,fragmentShader:Nt.meshlambert_frag},phong:{uniforms:Ki([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new ke(0)},specular:{value:new ke(1118481)},shininess:{value:30}}]),vertexShader:Nt.meshphong_vert,fragmentShader:Nt.meshphong_frag},standard:{uniforms:Ki([We.common,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.roughnessmap,We.metalnessmap,We.fog,We.lights,{emissive:{value:new ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag},toon:{uniforms:Ki([We.common,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.gradientmap,We.fog,We.lights,{emissive:{value:new ke(0)}}]),vertexShader:Nt.meshtoon_vert,fragmentShader:Nt.meshtoon_frag},matcap:{uniforms:Ki([We.common,We.bumpmap,We.normalmap,We.displacementmap,We.fog,{matcap:{value:null}}]),vertexShader:Nt.meshmatcap_vert,fragmentShader:Nt.meshmatcap_frag},points:{uniforms:Ki([We.points,We.fog]),vertexShader:Nt.points_vert,fragmentShader:Nt.points_frag},dashed:{uniforms:Ki([We.common,We.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nt.linedashed_vert,fragmentShader:Nt.linedashed_frag},depth:{uniforms:Ki([We.common,We.displacementmap]),vertexShader:Nt.depth_vert,fragmentShader:Nt.depth_frag},normal:{uniforms:Ki([We.common,We.bumpmap,We.normalmap,We.displacementmap,{opacity:{value:1}}]),vertexShader:Nt.meshnormal_vert,fragmentShader:Nt.meshnormal_frag},sprite:{uniforms:Ki([We.sprite,We.fog]),vertexShader:Nt.sprite_vert,fragmentShader:Nt.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nt.background_vert,fragmentShader:Nt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Dt}},vertexShader:Nt.backgroundCube_vert,fragmentShader:Nt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nt.cube_vert,fragmentShader:Nt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nt.equirect_vert,fragmentShader:Nt.equirect_frag},distanceRGBA:{uniforms:Ki([We.common,We.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nt.distanceRGBA_vert,fragmentShader:Nt.distanceRGBA_frag},shadow:{uniforms:Ki([We.lights,We.fog,{color:{value:new ke(0)},opacity:{value:1}}]),vertexShader:Nt.shadow_vert,fragmentShader:Nt.shadow_frag}};Ms.physical={uniforms:Ki([Ms.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new ke(0)},specularColor:{value:new ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Nt.meshphysical_vert,fragmentShader:Nt.meshphysical_frag};const Xg={r:0,b:0,g:0},Rl=new ur,kV=new mt;function zV(n,e,t,i,r,s,o){const a=new ke(0);let l=s===!0?0:1,c,d,h=null,p=0,g=null;function v(x){let S=x.isScene===!0?x.background:null;return S&&S.isTexture&&(S=(x.backgroundBlurriness>0?t:e).get(S)),S}function A(x){let S=!1;const w=v(x);w===null?m(a,l):w&&w.isColor&&(m(w,1),S=!0);const I=n.xr.getEnvironmentBlendMode();I==="additive"?i.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function _(x,S){const w=v(S);w&&(w.isCubeTexture||w.mapping===Qc)?(d===void 0&&(d=new jn(new Tl(1,1,1),new Ss({name:"BackgroundCubeMaterial",uniforms:Au(Ms.backgroundCube.uniforms),vertexShader:Ms.backgroundCube.vertexShader,fragmentShader:Ms.backgroundCube.fragmentShader,side:ji,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(I,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(d)),Rl.copy(S.backgroundRotation),Rl.x*=-1,Rl.y*=-1,Rl.z*=-1,w.isCubeTexture&&w.isRenderTargetTexture===!1&&(Rl.y*=-1,Rl.z*=-1),d.material.uniforms.envMap.value=w,d.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=S.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(kV.makeRotationFromEuler(Rl)),d.material.toneMapped=tn.getTransfer(w.colorSpace)!==vn,(h!==w||p!==w.version||g!==n.toneMapping)&&(d.material.needsUpdate=!0,h=w,p=w.version,g=n.toneMapping),d.layers.enableAll(),x.unshift(d,d.geometry,d.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new jn(new wu(2,2),new Ss({name:"BackgroundMaterial",uniforms:Au(Ms.background.uniforms),vertexShader:Ms.background.vertexShader,fragmentShader:Ms.background.fragmentShader,side:ks,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=S.backgroundIntensity,c.material.toneMapped=tn.getTransfer(w.colorSpace)!==vn,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(h!==w||p!==w.version||g!==n.toneMapping)&&(c.material.needsUpdate=!0,h=w,p=w.version,g=n.toneMapping),c.layers.enableAll(),x.unshift(c,c.geometry,c.material,0,0,null))}function m(x,S){x.getRGB(Xg,gI(n)),i.buffers.color.setClear(Xg.r,Xg.g,Xg.b,S,o)}return{getClearColor:function(){return a},setClearColor:function(x,S=1){a.set(x),l=S,m(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(x){l=x,m(a,l)},render:A,addToRenderList:_}}function HV(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=p(null);let s=r,o=!1;function a(T,F,X,J,q){let $=!1;const K=h(J,X,F);s!==K&&(s=K,c(s.object)),$=g(T,J,X,q),$&&v(T,J,X,q),q!==null&&e.update(q,n.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,w(T,F,X,J),q!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(q).buffer))}function l(){return n.createVertexArray()}function c(T){return n.bindVertexArray(T)}function d(T){return n.deleteVertexArray(T)}function h(T,F,X){const J=X.wireframe===!0;let q=i[T.id];q===void 0&&(q={},i[T.id]=q);let $=q[F.id];$===void 0&&($={},q[F.id]=$);let K=$[J];return K===void 0&&(K=p(l()),$[J]=K),K}function p(T){const F=[],X=[],J=[];for(let q=0;q=0){const ie=q[z];let fe=$[z];if(fe===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(fe=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(fe=T.instanceColor)),ie===void 0||ie.attribute!==fe||fe&&ie.data!==fe.data)return!0;K++}return s.attributesNum!==K||s.index!==J}function v(T,F,X,J){const q={},$=F.attributes;let K=0;const ge=X.getAttributes();for(const z in ge)if(ge[z].location>=0){let ie=$[z];ie===void 0&&(z==="instanceMatrix"&&T.instanceMatrix&&(ie=T.instanceMatrix),z==="instanceColor"&&T.instanceColor&&(ie=T.instanceColor));const fe={};fe.attribute=ie,ie&&ie.data&&(fe.data=ie.data),q[z]=fe,K++}s.attributes=q,s.attributesNum=K,s.index=J}function A(){const T=s.newAttributes;for(let F=0,X=T.length;F=0){let te=q[ge];if(te===void 0&&(ge==="instanceMatrix"&&T.instanceMatrix&&(te=T.instanceMatrix),ge==="instanceColor"&&T.instanceColor&&(te=T.instanceColor)),te!==void 0){const ie=te.normalized,fe=te.itemSize,Ce=e.get(te);if(Ce===void 0)continue;const ot=Ce.buffer,re=Ce.type,Me=Ce.bytesPerElement,Ie=re===n.INT||re===n.UNSIGNED_INT||te.gpuType===Wm;if(te.isInterleavedBufferAttribute){const Be=te.data,$e=Be.stride,wt=te.offset;if(Be.isInstancedInterleavedBuffer){for(let vt=0;vt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const d=l(c);d!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",d,"instead."),c=d);const h=t.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v=n.getParameter(n.MAX_TEXTURE_SIZE),A=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),_=n.getParameter(n.MAX_VERTEX_ATTRIBS),m=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),x=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),w=g>0,I=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:h,maxTextures:p,maxVertexTextures:g,maxTextureSize:v,maxCubemapSize:A,maxAttributes:_,maxVertexUniforms:m,maxVaryings:x,maxFragmentUniforms:S,vertexTextures:w,maxSamples:I}}function WV(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new xa,a=new Dt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const g=h.length!==0||p||i!==0||r;return r=p,i=h.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=d(h,p,0)},this.setState=function(h,p,g){const v=h.clippingPlanes,A=h.clipIntersection,_=h.clipShadows,m=n.get(h);if(!r||v===null||v.length===0||s&&!_)s?d(null):c();else{const x=s?0:i,S=x*4;let w=m.clippingState||null;l.value=w,w=d(v,p,S,g);for(let I=0;I!==S;++I)w[I]=t[I];m.clippingState=w,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function d(h,p,g,v){const A=h!==null?h.length:0;let _=null;if(A!==0){if(_=l.value,v!==!0||_===null){const m=g+A*4,x=p.matrixWorldInverse;a.getNormalMatrix(x),(_===null||_.length0){const c=new AI(l.height);return c.fromEquirectangularTexture(n,o),e.set(o,c),o.addEventListener("dispose",r),t(c.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Eu extends jd{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,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=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=d*this.view.offsetY,l=a-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const 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,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Cu=4,MI=[.125,.215,.35,.446,.526,.582],Pl=20,tS=new Eu,wI=new ke;let nS=null,iS=0,rS=0,sS=!1;const Il=(1+Math.sqrt(5))/2,Tu=1/Il,EI=[new G(-Il,Tu,0),new G(Il,Tu,0),new G(-Tu,0,Il),new G(Tu,0,Il),new G(0,Il,-Tu),new G(0,Il,Tu),new G(-1,1,-1),new G(1,1,-1),new G(-1,1,1),new G(1,1,1)];class oS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){nS=this._renderer.getRenderTarget(),iS=this._renderer.getActiveCubeFace(),rS=this._renderer.getActiveMipmapLevel(),sS=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=bI(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=TI(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?S:0,S,S),d.setRenderTarget(r),A&&d.render(v,a),d.render(e,a)}v.geometry.dispose(),v.material.dispose(),d.toneMapping=p,d.autoClear=h,e.background=_}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===mo||e.mapping===ua;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=bI()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=TI());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new jn(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;jg(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,tS)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let s=1;sPl&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${Pl}`);const m=[];let x=0;for(let D=0;DS-Cu?r-S+Cu:0),P=4*(this._cubeSize-w);jg(t,I,P,3*w,2*w),l.setRenderTarget(t),l.render(h,tS)}}function jV(n){const e=[],t=[],i=[];let r=n;const s=n-Cu+1+MI.length;for(let o=0;on-Cu?l=MI[o-n+Cu-1]:o===0&&(l=0),i.push(l);const c=1/(a-2),d=-c,h=1+c,p=[d,d,h,d,h,h,d,d,h,h,d,h],g=6,v=6,A=3,_=2,m=1,x=new Float32Array(A*v*g),S=new Float32Array(_*v*g),w=new Float32Array(m*v*g);for(let P=0;P2?0:-1,B=[D,N,0,D+2/3,N,0,D+2/3,N+1,0,D,N,0,D+2/3,N+1,0,D,N+1,0];x.set(B,A*v*P),S.set(p,_*v*P);const T=[P,P,P,P,P,P];w.set(T,m*v*P)}const I=new Pt;I.setAttribute("position",new $t(x,A)),I.setAttribute("uv",new $t(S,_)),I.setAttribute("faceIndex",new $t(w,m)),e.push(I),r>Cu&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function CI(n,e,t){const i=new ys(n,e,t);return i.texture.mapping=Qc,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function jg(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function JV(n,e,t){const i=new Float32Array(Pl),r=new G(0,1,0);return new Ss({name:"SphericalGaussianBlur",defines:{n:Pl,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:aS(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform int samples; uniform float weights[ n ]; uniform bool latitudinal; uniform float dTheta; uniform float mipInt; uniform vec3 poleAxis; #define ENVMAP_TYPE_CUBE_UV #include vec3 getSample( float theta, vec3 axis ) { float cosTheta = cos( theta ); // Rodrigues' axis-angle rotation vec3 sampleDirection = vOutputDirection * cosTheta + cross( axis, vOutputDirection ) * sin( theta ) + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); return bilinearCubeUV( envMap, sampleDirection, mipInt ); } void main() { vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); if ( all( equal( axis, vec3( 0.0 ) ) ) ) { axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); } axis = normalize( axis ); gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); for ( int i = 1; i < n; i++ ) { if ( i >= samples ) { break; } float theta = dTheta * float( i ); gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); } } `,blending:po,depthTest:!1,depthWrite:!1})}function TI(){return new Ss({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:aS(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; #include void main() { vec3 outputDirection = normalize( vOutputDirection ); vec2 uv = equirectUv( outputDirection ); gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } `,blending:po,depthTest:!1,depthWrite:!1})}function bI(){return new Ss({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:aS(),fragmentShader:` precision mediump float; precision mediump int; uniform float flipEnvMap; varying vec3 vOutputDirection; uniform samplerCube envMap; void main() { gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); } `,blending:po,depthTest:!1,depthWrite:!1})}function aS(){return` precision mediump float; precision mediump int; attribute float faceIndex; varying vec3 vOutputDirection; // RH coordinate system; PMREM face-indexing convention vec3 getDirection( vec2 uv, float face ) { uv = 2.0 * uv - 1.0; vec3 direction = vec3( uv, 1.0 ); if ( face == 0.0 ) { direction = direction.zyx; // ( 1, v, u ) pos x } else if ( face == 1.0 ) { direction = direction.xzy; direction.xz *= -1.0; // ( -u, 1, -v ) pos y } else if ( face == 2.0 ) { direction.x *= -1.0; // ( -u, v, 1 ) pos z } else if ( face == 3.0 ) { direction = direction.zyx; direction.xz *= -1.0; // ( -1, v, -u ) neg x } else if ( face == 4.0 ) { direction = direction.xzy; direction.xy *= -1.0; // ( -u, -1, v ) neg y } else if ( face == 5.0 ) { direction.z *= -1.0; // ( u, v, -1 ) neg z } return direction; } void main() { vOutputDirection = getDirection( uv, faceIndex ); gl_Position = vec4( position, 1.0 ); } `}function KV(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,c=l===Md||l===wd,d=l===mo||l===ua;if(c||d){let h=e.get(a);const p=h!==void 0?h.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==p)return t===null&&(t=new oS(n)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),h.texture;if(h!==void 0)return h.texture;{const g=a.image;return c&&g&&g.height>0||d&&g&&r(g)?(t===null&&(t=new oS(n)),h=c?t.fromEquirectangular(a):t.fromCubemap(a),h.texture.pmremVersion=a.pmremVersion,e.set(a,h),a.addEventListener("dispose",s),h.texture):null}}}return a}function r(a){let l=0;const c=6;for(let d=0;de.maxTextureSize&&(I=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const P=new Float32Array(w*I*4*h),D=new Cg(P,w,I,h);D.type=cr,D.needsUpdate=!0;const N=S*4;for(let T=0;T0)return n;const r=e*t;let s=DI[r];if(s===void 0&&(s=new Float32Array(r),DI[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function li(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` `)}function K5(n){const e=tn.getPrimaries(tn.workingColorSpace),t=tn.getPrimaries(n);let i;switch(e===t?i="":e===Fd&&t===Dd?i="LinearDisplayP3ToLinearSRGB":e===Dd&&t===Fd&&(i="LinearSRGBToLinearDisplayP3"),n){case yo:case Bd:return[i,"LinearTransferOETF"];case Yr:case Eg:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function HI(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` `+J5(n.getShaderSource(e),o)}else return r}function Y5(n,e){const t=K5(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function Q5(n,e){let t;switch(e){case EP:t="Linear";break;case CP:t="Reinhard";break;case TP:t="OptimizedCineon";break;case vA:t="ACESFilmic";break;case RP:t="AgX";break;case PP:t="Neutral";break;case bP:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Yg=new G;function q5(){tn.getLuminanceCoefficients(Yg);const n=Yg.x.toFixed(4),e=Yg.y.toFixed(4),t=Yg.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` `)}function Z5(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Yd).join(` `)}function $5(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function e9(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function uS(n){return n.replace(t9,i9)}const n9=new Map;function i9(n,e){let t=Nt[e];if(t===void 0){const i=n9.get(e);if(i!==void 0)t=Nt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return uS(t)}const r9=/#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 WI(n){return n.replace(r9,s9)}function s9(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(_+=` `),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(Yd).join(` `),m.length>0&&(m+=` `)):(_=[XI(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+d:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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",` `].filter(Yd).join(` `),m=[XI(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+d:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==zs?"#define TONE_MAPPING":"",t.toneMapping!==zs?Nt.tonemapping_pars_fragment:"",t.toneMapping!==zs?Q5("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Nt.colorspace_pars_fragment,Y5("linearToOutputTexel",t.outputColorSpace),q5(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(Yd).join(` `)),o=uS(o),o=GI(o,t),o=VI(o,t),a=uS(a),a=GI(a,t),a=VI(a,t),o=WI(o),a=WI(a),t.isRawShaderMaterial!==!0&&(x=`#version 300 es `,_=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+_,m=["#define varying in",t.glslVersion===BA?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===BA?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` `)+` `+m);const S=x+_+o,w=x+m+a,I=zI(r,r.VERTEX_SHADER,S),P=zI(r,r.FRAGMENT_SHADER,w);r.attachShader(A,I),r.attachShader(A,P),t.index0AttributeName!==void 0?r.bindAttribLocation(A,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(A,0,"position"),r.linkProgram(A);function D(F){if(n.debug.checkShaderErrors){const X=r.getProgramInfoLog(A).trim(),J=r.getShaderInfoLog(I).trim(),q=r.getShaderInfoLog(P).trim();let $=!0,K=!0;if(r.getProgramParameter(A,r.LINK_STATUS)===!1)if($=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,A,I,P);else{const ge=HI(r,I,"vertex"),z=HI(r,P,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(A,r.VALIDATE_STATUS)+` Material Name: `+F.name+` Material Type: `+F.type+` Program Info Log: `+X+` `+ge+` `+z)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(J===""||q==="")&&(K=!1);K&&(F.diagnostics={runnable:$,programLog:X,vertexShader:{log:J,prefix:_},fragmentShader:{log:q,prefix:m}})}r.deleteShader(I),r.deleteShader(P),N=new Kg(r,A),B=e9(r,A)}let N;this.getUniforms=function(){return N===void 0&&D(this),N};let B;this.getAttributes=function(){return B===void 0&&D(this),B};let T=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return T===!1&&(T=r.getProgramParameter(A,X5)),T},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(A),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=j5++,this.cacheKey=e,this.usedTimes=1,this.program=A,this.vertexShader=I,this.fragmentShader=P,this}let d9=0;class h9{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.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){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new p9(e),t.set(e,i)),i}}class p9{constructor(e){this.id=d9++,this.code=e,this.usedTimes=0}}function m9(n,e,t,i,r,s,o){const a=new El,l=new h9,c=new Set,d=[],h=r.logarithmicDepthBuffer,p=r.vertexTextures;let g=r.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function A(B){return c.add(B),B===0?"uv":`uv${B}`}function _(B,T,F,X,J){const q=X.fog,$=J.geometry,K=B.isMeshStandardMaterial?X.environment:null,ge=(B.isMeshStandardMaterial?t:e).get(B.envMap||K),z=ge&&ge.mapping===Qc?ge.image.height:null,te=v[B.type];B.precision!==null&&(g=r.getMaxPrecision(B.precision),g!==B.precision&&console.warn("THREE.WebGLProgram.getParameters:",B.precision,"not supported, using",g,"instead."));const ie=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,fe=ie!==void 0?ie.length:0;let Ce=0;$.morphAttributes.position!==void 0&&(Ce=1),$.morphAttributes.normal!==void 0&&(Ce=2),$.morphAttributes.color!==void 0&&(Ce=3);let ot,re,Me,Ie;if(te){const Jt=Ms[te];ot=Jt.vertexShader,re=Jt.fragmentShader}else ot=B.vertexShader,re=B.fragmentShader,l.update(B),Me=l.getVertexShaderID(B),Ie=l.getFragmentShaderID(B);const Be=n.getRenderTarget(),$e=J.isInstancedMesh===!0,wt=J.isBatchedMesh===!0,vt=!!B.map,Mt=!!B.matcap,H=!!ge,Te=!!B.aoMap,be=!!B.lightMap,He=!!B.bumpMap,ye=!!B.normalMap,dt=!!B.displacementMap,Ve=!!B.emissiveMap,qe=!!B.metalnessMap,W=!!B.roughnessMap,U=B.anisotropy>0,ae=B.clearcoat>0,ve=B.dispersion>0,we=B.iridescence>0,Ee=B.sheen>0,ct=B.transmission>0,ze=U&&!!B.anisotropyMap,Qe=ae&&!!B.clearcoatMap,Rt=ae&&!!B.clearcoatNormalMap,Pe=ae&&!!B.clearcoatRoughnessMap,Ke=we&&!!B.iridescenceMap,kt=we&&!!B.iridescenceThicknessMap,Et=Ee&&!!B.sheenColorMap,et=Ee&&!!B.sheenRoughnessMap,Tt=!!B.specularMap,Ft=!!B.specularColorMap,sn=!!B.specularIntensityMap,Y=ct&&!!B.transmissionMap,Le=ct&&!!B.thicknessMap,xe=!!B.gradientMap,Se=!!B.alphaMap,Oe=B.alphaTest>0,_t=!!B.alphaHash,Vt=!!B.extensions;let wn=zs;B.toneMapped&&(Be===null||Be.isXRRenderTarget===!0)&&(wn=n.toneMapping);const Kn={shaderID:te,shaderType:B.type,shaderName:B.name,vertexShader:ot,fragmentShader:re,defines:B.defines,customVertexShaderID:Me,customFragmentShaderID:Ie,isRawShaderMaterial:B.isRawShaderMaterial===!0,glslVersion:B.glslVersion,precision:g,batching:wt,batchingColor:wt&&J._colorsTexture!==null,instancing:$e,instancingColor:$e&&J.instanceColor!==null,instancingMorph:$e&&J.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Be===null?n.outputColorSpace:Be.isXRRenderTarget===!0?Be.texture.colorSpace:yo,alphaToCoverage:!!B.alphaToCoverage,map:vt,matcap:Mt,envMap:H,envMapMode:H&&ge.mapping,envMapCubeUVHeight:z,aoMap:Te,lightMap:be,bumpMap:He,normalMap:ye,displacementMap:p&&dt,emissiveMap:Ve,normalMapObjectSpace:ye&&B.normalMapType===OP,normalMapTangentSpace:ye&&B.normalMapType===da,metalnessMap:qe,roughnessMap:W,anisotropy:U,anisotropyMap:ze,clearcoat:ae,clearcoatMap:Qe,clearcoatNormalMap:Rt,clearcoatRoughnessMap:Pe,dispersion:ve,iridescence:we,iridescenceMap:Ke,iridescenceThicknessMap:kt,sheen:Ee,sheenColorMap:Et,sheenRoughnessMap:et,specularMap:Tt,specularColorMap:Ft,specularIntensityMap:sn,transmission:ct,transmissionMap:Y,thicknessMap:Le,gradientMap:xe,opaque:B.transparent===!1&&B.blending===hl&&B.alphaToCoverage===!1,alphaMap:Se,alphaTest:Oe,alphaHash:_t,combine:B.combine,mapUv:vt&&A(B.map.channel),aoMapUv:Te&&A(B.aoMap.channel),lightMapUv:be&&A(B.lightMap.channel),bumpMapUv:He&&A(B.bumpMap.channel),normalMapUv:ye&&A(B.normalMap.channel),displacementMapUv:dt&&A(B.displacementMap.channel),emissiveMapUv:Ve&&A(B.emissiveMap.channel),metalnessMapUv:qe&&A(B.metalnessMap.channel),roughnessMapUv:W&&A(B.roughnessMap.channel),anisotropyMapUv:ze&&A(B.anisotropyMap.channel),clearcoatMapUv:Qe&&A(B.clearcoatMap.channel),clearcoatNormalMapUv:Rt&&A(B.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Pe&&A(B.clearcoatRoughnessMap.channel),iridescenceMapUv:Ke&&A(B.iridescenceMap.channel),iridescenceThicknessMapUv:kt&&A(B.iridescenceThicknessMap.channel),sheenColorMapUv:Et&&A(B.sheenColorMap.channel),sheenRoughnessMapUv:et&&A(B.sheenRoughnessMap.channel),specularMapUv:Tt&&A(B.specularMap.channel),specularColorMapUv:Ft&&A(B.specularColorMap.channel),specularIntensityMapUv:sn&&A(B.specularIntensityMap.channel),transmissionMapUv:Y&&A(B.transmissionMap.channel),thicknessMapUv:Le&&A(B.thicknessMap.channel),alphaMapUv:Se&&A(B.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(ye||U),vertexColors:B.vertexColors,vertexAlphas:B.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!$.attributes.uv&&(vt||Se),fog:!!q,useFog:B.fog===!0,fogExp2:!!q&&q.isFogExp2,flatShading:B.flatShading===!0,sizeAttenuation:B.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:J.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:Ce,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numLightProbes:T.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:B.dithering,shadowMapEnabled:n.shadowMap.enabled&&F.length>0,shadowMapType:n.shadowMap.type,toneMapping:wn,decodeVideoTexture:vt&&B.map.isVideoTexture===!0&&tn.getTransfer(B.map.colorSpace)===vn,premultipliedAlpha:B.premultipliedAlpha,doubleSided:B.side===gs,flipSided:B.side===ji,useDepthPacking:B.depthPacking>=0,depthPacking:B.depthPacking||0,index0AttributeName:B.index0AttributeName,extensionClipCullDistance:Vt&&B.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Vt&&B.extensions.multiDraw===!0||wt)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:B.customProgramCacheKey()};return Kn.vertexUv1s=c.has(1),Kn.vertexUv2s=c.has(2),Kn.vertexUv3s=c.has(3),c.clear(),Kn}function m(B){const T=[];if(B.shaderID?T.push(B.shaderID):(T.push(B.customVertexShaderID),T.push(B.customFragmentShaderID)),B.defines!==void 0)for(const F in B.defines)T.push(F),T.push(B.defines[F]);return B.isRawShaderMaterial===!1&&(x(T,B),S(T,B),T.push(n.outputColorSpace)),T.push(B.customProgramCacheKey),T.join()}function x(B,T){B.push(T.precision),B.push(T.outputColorSpace),B.push(T.envMapMode),B.push(T.envMapCubeUVHeight),B.push(T.mapUv),B.push(T.alphaMapUv),B.push(T.lightMapUv),B.push(T.aoMapUv),B.push(T.bumpMapUv),B.push(T.normalMapUv),B.push(T.displacementMapUv),B.push(T.emissiveMapUv),B.push(T.metalnessMapUv),B.push(T.roughnessMapUv),B.push(T.anisotropyMapUv),B.push(T.clearcoatMapUv),B.push(T.clearcoatNormalMapUv),B.push(T.clearcoatRoughnessMapUv),B.push(T.iridescenceMapUv),B.push(T.iridescenceThicknessMapUv),B.push(T.sheenColorMapUv),B.push(T.sheenRoughnessMapUv),B.push(T.specularMapUv),B.push(T.specularColorMapUv),B.push(T.specularIntensityMapUv),B.push(T.transmissionMapUv),B.push(T.thicknessMapUv),B.push(T.combine),B.push(T.fogExp2),B.push(T.sizeAttenuation),B.push(T.morphTargetsCount),B.push(T.morphAttributeCount),B.push(T.numDirLights),B.push(T.numPointLights),B.push(T.numSpotLights),B.push(T.numSpotLightMaps),B.push(T.numHemiLights),B.push(T.numRectAreaLights),B.push(T.numDirLightShadows),B.push(T.numPointLightShadows),B.push(T.numSpotLightShadows),B.push(T.numSpotLightShadowsWithMaps),B.push(T.numLightProbes),B.push(T.shadowMapType),B.push(T.toneMapping),B.push(T.numClippingPlanes),B.push(T.numClipIntersection),B.push(T.depthPacking)}function S(B,T){a.disableAll(),T.supportsVertexTextures&&a.enable(0),T.instancing&&a.enable(1),T.instancingColor&&a.enable(2),T.instancingMorph&&a.enable(3),T.matcap&&a.enable(4),T.envMap&&a.enable(5),T.normalMapObjectSpace&&a.enable(6),T.normalMapTangentSpace&&a.enable(7),T.clearcoat&&a.enable(8),T.iridescence&&a.enable(9),T.alphaTest&&a.enable(10),T.vertexColors&&a.enable(11),T.vertexAlphas&&a.enable(12),T.vertexUv1s&&a.enable(13),T.vertexUv2s&&a.enable(14),T.vertexUv3s&&a.enable(15),T.vertexTangents&&a.enable(16),T.anisotropy&&a.enable(17),T.alphaHash&&a.enable(18),T.batching&&a.enable(19),T.dispersion&&a.enable(20),T.batchingColor&&a.enable(21),B.push(a.mask),a.disableAll(),T.fog&&a.enable(0),T.useFog&&a.enable(1),T.flatShading&&a.enable(2),T.logarithmicDepthBuffer&&a.enable(3),T.skinning&&a.enable(4),T.morphTargets&&a.enable(5),T.morphNormals&&a.enable(6),T.morphColors&&a.enable(7),T.premultipliedAlpha&&a.enable(8),T.shadowMapEnabled&&a.enable(9),T.doubleSided&&a.enable(10),T.flipSided&&a.enable(11),T.useDepthPacking&&a.enable(12),T.dithering&&a.enable(13),T.transmission&&a.enable(14),T.sheen&&a.enable(15),T.opaque&&a.enable(16),T.pointsUvs&&a.enable(17),T.decodeVideoTexture&&a.enable(18),T.alphaToCoverage&&a.enable(19),B.push(a.mask)}function w(B){const T=v[B.type];let F;if(T){const X=Ms[T];F=vI.clone(X.uniforms)}else F=B.uniforms;return F}function I(B,T){let F;for(let X=0,J=d.length;X0?i.push(m):g.transparent===!0?r.push(m):t.push(m)}function l(h,p,g,v,A,_){const m=o(h,p,g,v,A,_);g.transmission>0?i.unshift(m):g.transparent===!0?r.unshift(m):t.unshift(m)}function c(h,p){t.length>1&&t.sort(h||v9),i.length>1&&i.sort(p||jI),r.length>1&&r.sort(p||jI)}function d(){for(let h=e,p=n.length;h=s.length?(o=new JI,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function x9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new ke};break;case"SpotLight":t={position:new G,direction:new G,color:new ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new ke,groundColor:new ke};break;case"RectAreaLight":t={color:new ke,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function _9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let A9=0;function S9(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function M9(n){const e=new x9,t=_9(),i={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 c=0;c<9;c++)i.probe.push(new G);const r=new G,s=new mt,o=new mt;function a(c){let d=0,h=0,p=0;for(let B=0;B<9;B++)i.probe[B].set(0,0,0);let g=0,v=0,A=0,_=0,m=0,x=0,S=0,w=0,I=0,P=0,D=0;c.sort(S9);for(let B=0,T=c.length;B0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=We.LTC_FLOAT_1,i.rectAreaLTC2=We.LTC_FLOAT_2):(i.rectAreaLTC1=We.LTC_HALF_1,i.rectAreaLTC2=We.LTC_HALF_2)),i.ambient[0]=d,i.ambient[1]=h,i.ambient[2]=p;const N=i.hash;(N.directionalLength!==g||N.pointLength!==v||N.spotLength!==A||N.rectAreaLength!==_||N.hemiLength!==m||N.numDirectionalShadows!==x||N.numPointShadows!==S||N.numSpotShadows!==w||N.numSpotMaps!==I||N.numLightProbes!==D)&&(i.directional.length=g,i.spot.length=A,i.rectArea.length=_,i.point.length=v,i.hemi.length=m,i.directionalShadow.length=x,i.directionalShadowMap.length=x,i.pointShadow.length=S,i.pointShadowMap.length=S,i.spotShadow.length=w,i.spotShadowMap.length=w,i.directionalShadowMatrix.length=x,i.pointShadowMatrix.length=S,i.spotLightMatrix.length=w+I-P,i.spotLightMap.length=I,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=D,N.directionalLength=g,N.pointLength=v,N.spotLength=A,N.rectAreaLength=_,N.hemiLength=m,N.numDirectionalShadows=x,N.numPointShadows=S,N.numSpotShadows=w,N.numSpotMaps=I,N.numLightProbes=D,i.version=A9++)}function l(c,d){let h=0,p=0,g=0,v=0,A=0;const _=d.matrixWorldInverse;for(let m=0,x=c.length;m=o.length?(a=new KI(n),o.push(a)):a=o[s],a}function i(){e=new WeakMap}return{get:t,dispose:i}}class fS extends $n{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=NP,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 dS extends $n{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}}const E9=`void main() { gl_Position = vec4( position, 1.0 ); }`,C9=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include void main() { const float samples = float( VSM_SAMPLES ); float mean = 0.0; float squared_mean = 0.0; float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); float uvStart = samples <= 1.0 ? 0.0 : - 1.0; for ( float i = 0.0; i < samples; i ++ ) { float uvOffset = uvStart + i * uvStride; #ifdef HORIZONTAL_PASS vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); }`;function T9(n,e,t){let i=new Kd;const r=new Ae,s=new Ae,o=new on,a=new fS({depthPacking:UP}),l=new dS,c={},d=t.maxTextureSize,h={[ks]:ji,[ji]:ks,[gs]:gs},p=new Ss({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:E9,fragmentShader:C9}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Pt;v.setAttribute("position",new $t(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const A=new jn(v,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=km;let m=this.type;this.render=function(P,D,N){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||P.length===0)return;const B=n.getRenderTarget(),T=n.getActiveCubeFace(),F=n.getActiveMipmapLevel(),X=n.state;X.setBlending(po),X.buffers.color.setClear(1,1,1,1),X.buffers.depth.setTest(!0),X.setScissorTest(!1);const J=m!==ms&&this.type===ms,q=m===ms&&this.type!==ms;for(let $=0,K=P.length;$d||r.y>d)&&(r.x>d&&(s.x=Math.floor(d/te.x),r.x=s.x*te.x,z.mapSize.x=s.x),r.y>d&&(s.y=Math.floor(d/te.y),r.y=s.y*te.y,z.mapSize.y=s.y)),z.map===null||J===!0||q===!0){const fe=this.type!==ms?{minFilter:oi,magFilter:oi}:{};z.map!==null&&z.map.dispose(),z.map=new ys(r.x,r.y,fe),z.map.texture.name=ge.name+".shadowMap",z.camera.updateProjectionMatrix()}n.setRenderTarget(z.map),n.clear();const ie=z.getViewportCount();for(let fe=0;fe0||D.map&&D.alphaTest>0){const X=T.uuid,J=D.uuid;let q=c[X];q===void 0&&(q={},c[X]=q);let $=q[J];$===void 0&&($=T.clone(),q[J]=$,D.addEventListener("dispose",I)),T=$}if(T.visible=D.visible,T.wireframe=D.wireframe,B===ms?T.side=D.shadowSide!==null?D.shadowSide:D.side:T.side=D.shadowSide!==null?D.shadowSide:h[D.side],T.alphaMap=D.alphaMap,T.alphaTest=D.alphaTest,T.map=D.map,T.clipShadows=D.clipShadows,T.clippingPlanes=D.clippingPlanes,T.clipIntersection=D.clipIntersection,T.displacementMap=D.displacementMap,T.displacementScale=D.displacementScale,T.displacementBias=D.displacementBias,T.wireframeLinewidth=D.wireframeLinewidth,T.linewidth=D.linewidth,N.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const X=n.properties.get(T);X.light=N}return T}function w(P,D,N,B,T){if(P.visible===!1)return;if(P.layers.test(D.layers)&&(P.isMesh||P.isLine||P.isPoints)&&(P.castShadow||P.receiveShadow&&T===ms)&&(!P.frustumCulled||i.intersectsObject(P))){P.modelViewMatrix.multiplyMatrices(N.matrixWorldInverse,P.matrixWorld);const J=e.update(P),q=P.material;if(Array.isArray(q)){const $=J.groups;for(let K=0,ge=$.length;K=1):ge.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(ge)[1]),$=K>=2);let z=null,te={};const ie=n.getParameter(n.SCISSOR_BOX),fe=n.getParameter(n.VIEWPORT),Ce=new on().fromArray(ie),ot=new on().fromArray(fe);function re(Y,Le,xe,Se){const Oe=new Uint8Array(4),_t=n.createTexture();n.bindTexture(Y,_t),n.texParameteri(Y,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(Y,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Vt=0;Vte?(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2):(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0),n}function P9(n,e){const t=n.image&&n.image.width?n.image.width/n.image.height:1;return t>e?(n.repeat.x=e/t,n.repeat.y=1,n.offset.x=(1-n.repeat.x)/2,n.offset.y=0):(n.repeat.x=1,n.repeat.y=t/e,n.offset.x=0,n.offset.y=(1-n.repeat.y)/2),n}function I9(n){return n.repeat.x=1,n.repeat.y=1,n.offset.x=0,n.offset.y=0,n}function hS(n,e,t,i){const r=B9(i);switch(t){case SA:return n*e;case wA:return n*e;case EA:return n*e*2;case Jm:return n*e/r.components*r.byteLength;case Ed:return n*e/r.components*r.byteLength;case CA:return n*e*2/r.components*r.byteLength;case Km:return n*e*2/r.components*r.byteLength;case MA:return n*e*3/r.components*r.byteLength;case Ri:return n*e*4/r.components*r.byteLength;case Ym:return n*e*4/r.components*r.byteLength;case Cd:case Td:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case bd:case Rd:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case qm:case $m:return Math.max(n,16)*Math.max(e,8)/4;case Qm:case Zm:return Math.max(n,8)*Math.max(e,8)/2;case eg:case tg:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*8;case ng:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case ig:return Math.floor((n+3)/4)*Math.floor((e+3)/4)*16;case rg:return Math.floor((n+4)/5)*Math.floor((e+3)/4)*16;case sg:return Math.floor((n+4)/5)*Math.floor((e+4)/5)*16;case og:return Math.floor((n+5)/6)*Math.floor((e+4)/5)*16;case ag:return Math.floor((n+5)/6)*Math.floor((e+5)/6)*16;case lg:return Math.floor((n+7)/8)*Math.floor((e+4)/5)*16;case cg:return Math.floor((n+7)/8)*Math.floor((e+5)/6)*16;case ug:return Math.floor((n+7)/8)*Math.floor((e+7)/8)*16;case fg:return Math.floor((n+9)/10)*Math.floor((e+4)/5)*16;case dg:return Math.floor((n+9)/10)*Math.floor((e+5)/6)*16;case hg:return Math.floor((n+9)/10)*Math.floor((e+7)/8)*16;case pg:return Math.floor((n+9)/10)*Math.floor((e+9)/10)*16;case mg:return Math.floor((n+11)/12)*Math.floor((e+9)/10)*16;case gg:return Math.floor((n+11)/12)*Math.floor((e+11)/12)*16;case Pd:case vg:case yg:return Math.ceil(n/4)*Math.ceil(e/4)*16;case TA:case xg:return Math.ceil(n/4)*Math.ceil(e/4)*8;case _g:case Ag:return Math.ceil(n/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function B9(n){switch(n){case vs:case xA:return{byteLength:1,components:1};case $c:case _A:case eu:return{byteLength:2,components:1};case Xm:case jm:return{byteLength:2,components:4};case go:case Wm:case cr:return{byteLength:4,components:1};case AA:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}const L9={contain:R9,cover:P9,fill:I9,getByteLength:hS};function D9(n,e,t,i,r,s,o){const a=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator=="undefined"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Ae,d=new WeakMap;let h;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch(W){}function v(W,U){return g?new OffscreenCanvas(W,U):kd("canvas")}function A(W,U,ae){let ve=1;const we=qe(W);if((we.width>ae||we.height>ae)&&(ve=ae/Math.max(we.width,we.height)),ve<1)if(typeof HTMLImageElement!="undefined"&&W instanceof HTMLImageElement||typeof HTMLCanvasElement!="undefined"&&W instanceof HTMLCanvasElement||typeof ImageBitmap!="undefined"&&W instanceof ImageBitmap||typeof VideoFrame!="undefined"&&W instanceof VideoFrame){const Ee=Math.floor(ve*we.width),ct=Math.floor(ve*we.height);h===void 0&&(h=v(Ee,ct));const ze=U?v(Ee,ct):h;return ze.width=Ee,ze.height=ct,ze.getContext("2d").drawImage(W,0,0,Ee,ct),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+we.width+"x"+we.height+") to ("+Ee+"x"+ct+")."),ze}else return"data"in W&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+we.width+"x"+we.height+")."),W;return W}function _(W){return W.generateMipmaps&&W.minFilter!==oi&&W.minFilter!==kn}function m(W){n.generateMipmap(W)}function x(W,U,ae,ve,we=!1){if(W!==null){if(n[W]!==void 0)return n[W];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+W+"'")}let Ee=U;if(U===n.RED&&(ae===n.FLOAT&&(Ee=n.R32F),ae===n.HALF_FLOAT&&(Ee=n.R16F),ae===n.UNSIGNED_BYTE&&(Ee=n.R8)),U===n.RED_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ee=n.R8UI),ae===n.UNSIGNED_SHORT&&(Ee=n.R16UI),ae===n.UNSIGNED_INT&&(Ee=n.R32UI),ae===n.BYTE&&(Ee=n.R8I),ae===n.SHORT&&(Ee=n.R16I),ae===n.INT&&(Ee=n.R32I)),U===n.RG&&(ae===n.FLOAT&&(Ee=n.RG32F),ae===n.HALF_FLOAT&&(Ee=n.RG16F),ae===n.UNSIGNED_BYTE&&(Ee=n.RG8)),U===n.RG_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ee=n.RG8UI),ae===n.UNSIGNED_SHORT&&(Ee=n.RG16UI),ae===n.UNSIGNED_INT&&(Ee=n.RG32UI),ae===n.BYTE&&(Ee=n.RG8I),ae===n.SHORT&&(Ee=n.RG16I),ae===n.INT&&(Ee=n.RG32I)),U===n.RGB&&ae===n.UNSIGNED_INT_5_9_9_9_REV&&(Ee=n.RGB9_E5),U===n.RGBA){const ct=we?Ld:tn.getTransfer(ve);ae===n.FLOAT&&(Ee=n.RGBA32F),ae===n.HALF_FLOAT&&(Ee=n.RGBA16F),ae===n.UNSIGNED_BYTE&&(Ee=ct===vn?n.SRGB8_ALPHA8:n.RGBA8),ae===n.UNSIGNED_SHORT_4_4_4_4&&(Ee=n.RGBA4),ae===n.UNSIGNED_SHORT_5_5_5_1&&(Ee=n.RGB5_A1)}return(Ee===n.R16F||Ee===n.R32F||Ee===n.RG16F||Ee===n.RG32F||Ee===n.RGBA16F||Ee===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function S(W,U){let ae;return W?U===null||U===go||U===ml?ae=n.DEPTH24_STENCIL8:U===cr?ae=n.DEPTH32F_STENCIL8:U===$c&&(ae=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):U===null||U===go||U===ml?ae=n.DEPTH_COMPONENT24:U===cr?ae=n.DEPTH_COMPONENT32F:U===$c&&(ae=n.DEPTH_COMPONENT16),ae}function w(W,U){return _(W)===!0||W.isFramebufferTexture&&W.minFilter!==oi&&W.minFilter!==kn?Math.log2(Math.max(U.width,U.height))+1:W.mipmaps!==void 0&&W.mipmaps.length>0?W.mipmaps.length:W.isCompressedTexture&&Array.isArray(W.image)?U.mipmaps.length:1}function I(W){const U=W.target;U.removeEventListener("dispose",I),D(U),U.isVideoTexture&&d.delete(U)}function P(W){const U=W.target;U.removeEventListener("dispose",P),B(U)}function D(W){const U=i.get(W);if(U.__webglInit===void 0)return;const ae=W.source,ve=p.get(ae);if(ve){const we=ve[U.__cacheKey];we.usedTimes--,we.usedTimes===0&&N(W),Object.keys(ve).length===0&&p.delete(ae)}i.remove(W)}function N(W){const U=i.get(W);n.deleteTexture(U.__webglTexture);const ae=W.source,ve=p.get(ae);delete ve[U.__cacheKey],o.memory.textures--}function B(W){const U=i.get(W);if(W.depthTexture&&W.depthTexture.dispose(),W.isWebGLCubeRenderTarget)for(let ve=0;ve<6;ve++){if(Array.isArray(U.__webglFramebuffer[ve]))for(let we=0;we=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+W+" texture units while this GPU supports only "+r.maxTextures),T+=1,W}function J(W){const U=[];return U.push(W.wrapS),U.push(W.wrapT),U.push(W.wrapR||0),U.push(W.magFilter),U.push(W.minFilter),U.push(W.anisotropy),U.push(W.internalFormat),U.push(W.format),U.push(W.type),U.push(W.generateMipmaps),U.push(W.premultiplyAlpha),U.push(W.flipY),U.push(W.unpackAlignment),U.push(W.colorSpace),U.join()}function q(W,U){const ae=i.get(W);if(W.isVideoTexture&&dt(W),W.isRenderTargetTexture===!1&&W.version>0&&ae.__version!==W.version){const ve=W.image;if(ve===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ve.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ot(ae,W,U);return}}t.bindTexture(n.TEXTURE_2D,ae.__webglTexture,n.TEXTURE0+U)}function $(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){ot(ae,W,U);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ae.__webglTexture,n.TEXTURE0+U)}function K(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){ot(ae,W,U);return}t.bindTexture(n.TEXTURE_3D,ae.__webglTexture,n.TEXTURE0+U)}function ge(W,U){const ae=i.get(W);if(W.version>0&&ae.__version!==W.version){re(ae,W,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ae.__webglTexture,n.TEXTURE0+U)}const z={[fa]:n.REPEAT,[Tr]:n.CLAMP_TO_EDGE,[qc]:n.MIRRORED_REPEAT},te={[oi]:n.NEAREST,[Vm]:n.NEAREST_MIPMAP_NEAREST,[pl]:n.NEAREST_MIPMAP_LINEAR,[kn]:n.LINEAR,[Zc]:n.LINEAR_MIPMAP_NEAREST,[Kr]:n.LINEAR_MIPMAP_LINEAR},ie={[kP]:n.NEVER,[XP]:n.ALWAYS,[zP]:n.LESS,[IA]:n.LEQUAL,[HP]:n.EQUAL,[WP]:n.GEQUAL,[GP]:n.GREATER,[VP]:n.NOTEQUAL};function fe(W,U){if(U.type===cr&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===kn||U.magFilter===Zc||U.magFilter===pl||U.magFilter===Kr||U.minFilter===kn||U.minFilter===Zc||U.minFilter===pl||U.minFilter===Kr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(W,n.TEXTURE_WRAP_S,z[U.wrapS]),n.texParameteri(W,n.TEXTURE_WRAP_T,z[U.wrapT]),(W===n.TEXTURE_3D||W===n.TEXTURE_2D_ARRAY)&&n.texParameteri(W,n.TEXTURE_WRAP_R,z[U.wrapR]),n.texParameteri(W,n.TEXTURE_MAG_FILTER,te[U.magFilter]),n.texParameteri(W,n.TEXTURE_MIN_FILTER,te[U.minFilter]),U.compareFunction&&(n.texParameteri(W,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(W,n.TEXTURE_COMPARE_FUNC,ie[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===oi||U.minFilter!==pl&&U.minFilter!==Kr||U.type===cr&&e.has("OES_texture_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");n.texParameterf(W,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function Ce(W,U){let ae=!1;W.__webglInit===void 0&&(W.__webglInit=!0,U.addEventListener("dispose",I));const ve=U.source;let we=p.get(ve);we===void 0&&(we={},p.set(ve,we));const Ee=J(U);if(Ee!==W.__cacheKey){we[Ee]===void 0&&(we[Ee]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ae=!0),we[Ee].usedTimes++;const ct=we[W.__cacheKey];ct!==void 0&&(we[W.__cacheKey].usedTimes--,ct.usedTimes===0&&N(U)),W.__cacheKey=Ee,W.__webglTexture=we[Ee].texture}return ae}function ot(W,U,ae){let ve=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(ve=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(ve=n.TEXTURE_3D);const we=Ce(W,U),Ee=U.source;t.bindTexture(ve,W.__webglTexture,n.TEXTURE0+ae);const ct=i.get(Ee);if(Ee.version!==ct.__version||we===!0){t.activeTexture(n.TEXTURE0+ae);const ze=tn.getPrimaries(tn.workingColorSpace),Qe=U.colorSpace===vo?null:tn.getPrimaries(U.colorSpace),Rt=U.colorSpace===vo||ze===Qe?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Rt);let Pe=A(U.image,!1,r.maxTextureSize);Pe=Ve(U,Pe);const Ke=s.convert(U.format,U.colorSpace),kt=s.convert(U.type);let Et=x(U.internalFormat,Ke,kt,U.colorSpace,U.isVideoTexture);fe(ve,U);let et;const Tt=U.mipmaps,Ft=U.isVideoTexture!==!0,sn=ct.__version===void 0||we===!0,Y=Ee.dataReady,Le=w(U,Pe);if(U.isDepthTexture)Et=S(U.format===vl,U.type),sn&&(Ft?t.texStorage2D(n.TEXTURE_2D,1,Et,Pe.width,Pe.height):t.texImage2D(n.TEXTURE_2D,0,Et,Pe.width,Pe.height,0,Ke,kt,null));else if(U.isDataTexture)if(Tt.length>0){Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Et,Tt[0].width,Tt[0].height);for(let xe=0,Se=Tt.length;xe0){const Oe=hS(et.width,et.height,U.format,U.type);for(const _t of U.layerUpdates){const Vt=et.data.subarray(_t*Oe/et.data.BYTES_PER_ELEMENT,(_t+1)*Oe/et.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,_t,et.width,et.height,1,Ke,Vt,0,0)}U.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Pe.depth,Ke,et.data,0,0)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,xe,Et,et.width,et.height,Pe.depth,0,et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Ft?Y&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,xe,0,0,0,et.width,et.height,Pe.depth,Ke,kt,et.data):t.texImage3D(n.TEXTURE_2D_ARRAY,xe,Et,et.width,et.height,Pe.depth,0,Ke,kt,et.data)}else{Ft&&sn&&t.texStorage2D(n.TEXTURE_2D,Le,Et,Tt[0].width,Tt[0].height);for(let xe=0,Se=Tt.length;xe0){const xe=hS(Pe.width,Pe.height,U.format,U.type);for(const Se of U.layerUpdates){const Oe=Pe.data.subarray(Se*xe/Pe.data.BYTES_PER_ELEMENT,(Se+1)*xe/Pe.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Se,Pe.width,Pe.height,1,Ke,kt,Oe)}U.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ke,kt,Pe.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Et,Pe.width,Pe.height,Pe.depth,0,Ke,kt,Pe.data);else if(U.isData3DTexture)Ft?(sn&&t.texStorage3D(n.TEXTURE_3D,Le,Et,Pe.width,Pe.height,Pe.depth),Y&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ke,kt,Pe.data)):t.texImage3D(n.TEXTURE_3D,0,Et,Pe.width,Pe.height,Pe.depth,0,Ke,kt,Pe.data);else if(U.isFramebufferTexture){if(sn)if(Ft)t.texStorage2D(n.TEXTURE_2D,Le,Et,Pe.width,Pe.height);else{let xe=Pe.width,Se=Pe.height;for(let Oe=0;Oe>=1,Se>>=1}}else if(Tt.length>0){if(Ft&&sn){const xe=qe(Tt[0]);t.texStorage2D(n.TEXTURE_2D,Le,Et,xe.width,xe.height)}for(let xe=0,Se=Tt.length;xe0&&Le++;const Se=qe(Ke[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Le,Tt,Se.width,Se.height)}for(let Se=0;Se<6;Se++)if(Pe){Ft?Y&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,0,0,Ke[Se].width,Ke[Se].height,Et,et,Ke[Se].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Se,0,Tt,Ke[Se].width,Ke[Se].height,0,Et,et,Ke[Se].data);for(let Oe=0;Oe>Ee),Ke=Math.max(1,U.height>>Ee);we===n.TEXTURE_3D||we===n.TEXTURE_2D_ARRAY?t.texImage3D(we,Ee,Qe,Pe,Ke,U.depth,0,ct,ze,null):t.texImage2D(we,Ee,Qe,Pe,Ke,0,ct,ze,null)}t.bindFramebuffer(n.FRAMEBUFFER,W),ye(U)?a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ve,we,i.get(ae).__webglTexture,0,He(U)):(we===n.TEXTURE_2D||we>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&we<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ve,we,i.get(ae).__webglTexture,Ee),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ie(W,U,ae){if(n.bindRenderbuffer(n.RENDERBUFFER,W),U.depthBuffer){const ve=U.depthTexture,we=ve&&ve.isDepthTexture?ve.type:null,Ee=S(U.stencilBuffer,we),ct=U.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ze=He(U);ye(U)?a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,ze,Ee,U.width,U.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,ze,Ee,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,Ee,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ct,n.RENDERBUFFER,W)}else{const ve=U.textures;for(let we=0;we1;if(ct||(ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture()),ve.__version=U.version,o.memory.textures++),Ee){ae.__webglFramebuffer=[];for(let ze=0;ze<6;ze++)if(U.mipmaps&&U.mipmaps.length>0){ae.__webglFramebuffer[ze]=[];for(let Qe=0;Qe0){ae.__webglFramebuffer=[];for(let ze=0;ze0&&ye(W)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let ze=0;ze0)for(let Qe=0;Qe0)for(let Qe=0;Qe0){if(ye(W)===!1){const U=W.textures,ae=W.width,ve=W.height;let we=n.COLOR_BUFFER_BIT;const Ee=W.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ct=i.get(W),ze=U.length>1;if(ze)for(let Qe=0;Qe0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function dt(W){const U=o.render.frame;d.get(W)!==U&&(d.set(W,U),W.update())}function Ve(W,U){const ae=W.colorSpace,ve=W.format,we=W.type;return W.isCompressedTexture===!0||W.isVideoTexture===!0||ae!==yo&&ae!==vo&&(tn.getTransfer(ae)===vn?(ve!==Ri||we!==vs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ae)),U}function qe(W){return typeof HTMLImageElement!="undefined"&&W instanceof HTMLImageElement?(c.width=W.naturalWidth||W.width,c.height=W.naturalHeight||W.height):typeof VideoFrame!="undefined"&&W instanceof VideoFrame?(c.width=W.displayWidth,c.height=W.displayHeight):(c.width=W.width,c.height=W.height),c}this.allocateTextureUnit=X,this.resetTextureUnits=F,this.setTexture2D=q,this.setTexture2DArray=$,this.setTexture3D=K,this.setTextureCube=ge,this.rebindTextures=wt,this.setupRenderTarget=vt,this.updateRenderTargetMipmap=Mt,this.updateMultisampleRenderTarget=be,this.setupDepthRenderbuffer=$e,this.setupFrameBufferTexture=Me,this.useMultisampledRTT=ye}function YI(n,e){function t(i,r=vo){let s;const o=tn.getTransfer(r);if(i===vs)return n.UNSIGNED_BYTE;if(i===Xm)return n.UNSIGNED_SHORT_4_4_4_4;if(i===jm)return n.UNSIGNED_SHORT_5_5_5_1;if(i===AA)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===xA)return n.BYTE;if(i===_A)return n.SHORT;if(i===$c)return n.UNSIGNED_SHORT;if(i===Wm)return n.INT;if(i===go)return n.UNSIGNED_INT;if(i===cr)return n.FLOAT;if(i===eu)return n.HALF_FLOAT;if(i===SA)return n.ALPHA;if(i===MA)return n.RGB;if(i===Ri)return n.RGBA;if(i===wA)return n.LUMINANCE;if(i===EA)return n.LUMINANCE_ALPHA;if(i===gl)return n.DEPTH_COMPONENT;if(i===vl)return n.DEPTH_STENCIL;if(i===Jm)return n.RED;if(i===Ed)return n.RED_INTEGER;if(i===CA)return n.RG;if(i===Km)return n.RG_INTEGER;if(i===Ym)return n.RGBA_INTEGER;if(i===Cd||i===Td||i===bd||i===Rd)if(o===vn)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Cd)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Td)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Rd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Cd)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Td)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===bd)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Rd)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===Qm||i===qm||i===Zm||i===$m)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===Qm)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===qm)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Zm)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===$m)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===eg||i===tg||i===ng)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===eg||i===tg)return o===vn?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===ng)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===ig||i===rg||i===sg||i===og||i===ag||i===lg||i===cg||i===ug||i===fg||i===dg||i===hg||i===pg||i===mg||i===gg)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===ig)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===rg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===sg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===og)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ag)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===lg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===cg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===ug)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===fg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===dg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===hg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===pg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===mg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===gg)return o===vn?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===Pd||i===vg||i===yg)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===Pd)return o===vn?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===vg)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===yg)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===TA||i===xg||i===_g||i===Ag)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===Pd)return s.COMPRESSED_RED_RGTC1_EXT;if(i===xg)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===_g)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===Ag)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===ml?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}class QI extends ai{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Co extends jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const F9={type:"move"};class pS{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Co,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Co,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Co,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const A of e.hand.values()){const _=t.getJointPose(A,i),m=this._getHandJoint(c,A);_!==null&&(m.matrix.fromArray(_.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=_.radius),m.visible=_!==null}const d=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=d.position.distanceTo(h.position),g=.02,v=.005;c.inputState.pinching&&p>g+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=g-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(F9)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new Co;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const N9=` void main() { gl_Position = vec4( position, 1.0 ); }`,U9=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; void main() { vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); if ( coord.x >= 1.0 ) { gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; } else { gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; } }`;class O9{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Mn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new Ss({vertexShader:N9,fragmentShader:U9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new jn(new wu(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class k9 extends xo{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,c=null,d=null,h=null,p=null,g=null,v=null;const A=new O9,_=t.getContextAttributes();let m=null,x=null;const S=[],w=[],I=new Ae;let P=null;const D=new ai;D.layers.enable(1),D.viewport=new on;const N=new ai;N.layers.enable(2),N.viewport=new on;const B=[D,N],T=new QI;T.layers.enable(1),T.layers.enable(2);let F=null,X=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(re){let Me=S[re];return Me===void 0&&(Me=new pS,S[re]=Me),Me.getTargetRaySpace()},this.getControllerGrip=function(re){let Me=S[re];return Me===void 0&&(Me=new pS,S[re]=Me),Me.getGripSpace()},this.getHand=function(re){let Me=S[re];return Me===void 0&&(Me=new pS,S[re]=Me),Me.getHandSpace()};function J(re){const Me=w.indexOf(re.inputSource);if(Me===-1)return;const Ie=S[Me];Ie!==void 0&&(Ie.update(re.inputSource,re.frame,c||o),Ie.dispatchEvent({type:re.type,data:re.inputSource}))}function q(){r.removeEventListener("select",J),r.removeEventListener("selectstart",J),r.removeEventListener("selectend",J),r.removeEventListener("squeeze",J),r.removeEventListener("squeezestart",J),r.removeEventListener("squeezeend",J),r.removeEventListener("end",q),r.removeEventListener("inputsourceschange",$);for(let re=0;re=0&&(w[Be]=null,S[Be].disconnect(Ie))}for(let Me=0;Me=w.length){w.push(Ie),Be=wt;break}else if(w[wt]===null){w[wt]=Ie,Be=wt;break}if(Be===-1)break}const $e=S[Be];$e&&$e.connect(Ie)}}const K=new G,ge=new G;function z(re,Me,Ie){K.setFromMatrixPosition(Me.matrixWorld),ge.setFromMatrixPosition(Ie.matrixWorld);const Be=K.distanceTo(ge),$e=Me.projectionMatrix.elements,wt=Ie.projectionMatrix.elements,vt=$e[14]/($e[10]-1),Mt=$e[14]/($e[10]+1),H=($e[9]+1)/$e[5],Te=($e[9]-1)/$e[5],be=($e[8]-1)/$e[0],He=(wt[8]+1)/wt[0],ye=vt*be,dt=vt*He,Ve=Be/(-be+He),qe=Ve*-be;Me.matrixWorld.decompose(re.position,re.quaternion,re.scale),re.translateX(qe),re.translateZ(Ve),re.matrixWorld.compose(re.position,re.quaternion,re.scale),re.matrixWorldInverse.copy(re.matrixWorld).invert();const W=vt+Ve,U=Mt+Ve,ae=ye-qe,ve=dt+(Be-qe),we=H*Mt/U*W,Ee=Te*Mt/U*W;re.projectionMatrix.makePerspective(ae,ve,we,Ee,W,U),re.projectionMatrixInverse.copy(re.projectionMatrix).invert()}function te(re,Me){Me===null?re.matrixWorld.copy(re.matrix):re.matrixWorld.multiplyMatrices(Me.matrixWorld,re.matrix),re.matrixWorldInverse.copy(re.matrixWorld).invert()}this.updateCamera=function(re){if(r===null)return;A.texture!==null&&(re.near=A.depthNear,re.far=A.depthFar),T.near=N.near=D.near=re.near,T.far=N.far=D.far=re.far,(F!==T.near||X!==T.far)&&(r.updateRenderState({depthNear:T.near,depthFar:T.far}),F=T.near,X=T.far,D.near=F,D.far=X,N.near=F,N.far=X,D.updateProjectionMatrix(),N.updateProjectionMatrix(),re.updateProjectionMatrix());const Me=re.parent,Ie=T.cameras;te(T,Me);for(let Be=0;Be0&&(_.alphaTest.value=m.alphaTest);const x=e.get(m),S=x.envMap,w=x.envMapRotation;S&&(_.envMap.value=S,Bl.copy(w),Bl.x*=-1,Bl.y*=-1,Bl.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(Bl.y*=-1,Bl.z*=-1),_.envMapRotation.value.setFromMatrix4(z9.makeRotationFromEuler(Bl)),_.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=m.reflectivity,_.ior.value=m.ior,_.refractionRatio.value=m.refractionRatio),m.lightMap&&(_.lightMap.value=m.lightMap,_.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,_.lightMapTransform)),m.aoMap&&(_.aoMap.value=m.aoMap,_.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,_.aoMapTransform))}function o(_,m){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,m.map&&(_.map.value=m.map,t(m.map,_.mapTransform))}function a(_,m){_.dashSize.value=m.dashSize,_.totalSize.value=m.dashSize+m.gapSize,_.scale.value=m.scale}function l(_,m,x,S){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,_.size.value=m.size*x,_.scale.value=S*.5,m.map&&(_.map.value=m.map,t(m.map,_.uvTransform)),m.alphaMap&&(_.alphaMap.value=m.alphaMap,t(m.alphaMap,_.alphaMapTransform)),m.alphaTest>0&&(_.alphaTest.value=m.alphaTest)}function c(_,m){_.diffuse.value.copy(m.color),_.opacity.value=m.opacity,_.rotation.value=m.rotation,m.map&&(_.map.value=m.map,t(m.map,_.mapTransform)),m.alphaMap&&(_.alphaMap.value=m.alphaMap,t(m.alphaMap,_.alphaMapTransform)),m.alphaTest>0&&(_.alphaTest.value=m.alphaTest)}function d(_,m){_.specular.value.copy(m.specular),_.shininess.value=Math.max(m.shininess,1e-4)}function h(_,m){m.gradientMap&&(_.gradientMap.value=m.gradientMap)}function p(_,m){_.metalness.value=m.metalness,m.metalnessMap&&(_.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,_.metalnessMapTransform)),_.roughness.value=m.roughness,m.roughnessMap&&(_.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,_.roughnessMapTransform)),m.envMap&&(_.envMapIntensity.value=m.envMapIntensity)}function g(_,m,x){_.ior.value=m.ior,m.sheen>0&&(_.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),_.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(_.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,_.sheenColorMapTransform)),m.sheenRoughnessMap&&(_.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,_.sheenRoughnessMapTransform))),m.clearcoat>0&&(_.clearcoat.value=m.clearcoat,_.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(_.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,_.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(_.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===ji&&_.clearcoatNormalScale.value.negate())),m.dispersion>0&&(_.dispersion.value=m.dispersion),m.iridescence>0&&(_.iridescence.value=m.iridescence,_.iridescenceIOR.value=m.iridescenceIOR,_.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(_.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,_.iridescenceMapTransform)),m.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),m.transmission>0&&(_.transmission.value=m.transmission,_.transmissionSamplerMap.value=x.texture,_.transmissionSamplerSize.value.set(x.width,x.height),m.transmissionMap&&(_.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,_.transmissionMapTransform)),_.thickness.value=m.thickness,m.thicknessMap&&(_.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=m.attenuationDistance,_.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(_.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(_.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=m.specularIntensity,_.specularColor.value.copy(m.specularColor),m.specularColorMap&&(_.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,_.specularColorMapTransform)),m.specularIntensityMap&&(_.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,_.specularIntensityMapTransform))}function v(_,m){m.matcap&&(_.matcap.value=m.matcap)}function A(_,m){const x=e.get(m).light;_.referencePosition.value.setFromMatrixPosition(x.matrixWorld),_.nearDistance.value=x.shadow.camera.near,_.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function G9(n,e,t,i){let r={},s={},o=[];const a=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function l(x,S){const w=S.program;i.uniformBlockBinding(x,w)}function c(x,S){let w=r[x.id];w===void 0&&(v(x),w=d(x),r[x.id]=w,x.addEventListener("dispose",_));const I=S.program;i.updateUBOMapping(x,I);const P=e.render.frame;s[x.id]!==P&&(p(x),s[x.id]=P)}function d(x){const S=h();x.__bindingPointIndex=S;const w=n.createBuffer(),I=x.__size,P=x.usage;return n.bindBuffer(n.UNIFORM_BUFFER,w),n.bufferData(n.UNIFORM_BUFFER,I,P),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,S,w),w}function h(){for(let x=0;x0&&(w+=I-P),x.__size=w,x.__cache={},this}function A(x){const S={boundary:0,storage:0};return typeof x=="number"||typeof x=="boolean"?(S.boundary=4,S.storage=4):x.isVector2?(S.boundary=8,S.storage=8):x.isVector3||x.isColor?(S.boundary=16,S.storage=12):x.isVector4?(S.boundary=16,S.storage=16):x.isMatrix3?(S.boundary=48,S.storage=48):x.isMatrix4?(S.boundary=64,S.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),S}function _(x){const S=x.target;S.removeEventListener("dispose",_);const w=o.indexOf(S.__bindingPointIndex);o.splice(w,1),n.deleteBuffer(r[S.id]),delete r[S.id],delete s[S.id]}function m(){for(const x in r)n.deleteBuffer(r[x]);o=[],r={},s={}}return{bind:l,update:c,dispose:m}}class qI{constructor(e={}){const{canvas:t=YP(),context:i=null,depth:r=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;if(i!==null){if(typeof WebGLRenderingContext!="undefined"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=i.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),v=new Int32Array(4);let A=null,_=null;const m=[],x=[];this.domElement=t,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._outputColorSpace=Yr,this.toneMapping=zs,this.toneMappingExposure=1;const S=this;let w=!1,I=0,P=0,D=null,N=-1,B=null;const T=new on,F=new on;let X=null;const J=new ke(0);let q=0,$=t.width,K=t.height,ge=1,z=null,te=null;const ie=new on(0,0,$,K),fe=new on(0,0,$,K);let Ce=!1;const ot=new Kd;let re=!1,Me=!1;const Ie=new mt,Be=new G,$e=new on,wt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let vt=!1;function Mt(){return D===null?ge:1}let H=i;function Te(O,Z){return t.getContext(O,Z)}try{const O={alpha:!0,depth:r,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:d,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${xd}`),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",Se,!1),t.addEventListener("webglcontextcreationerror",Oe,!1),H===null){const Z="webgl2";if(H=Te(Z,O),H===null)throw Te(Z)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let be,He,ye,dt,Ve,qe,W,U,ae,ve,we,Ee,ct,ze,Qe,Rt,Pe,Ke,kt,Et,et,Tt,Ft,sn;function Y(){be=new YV(H),be.init(),Tt=new YI(H,be),He=new VV(H,be,e,Tt),ye=new b9(H),dt=new ZV(H),Ve=new g9,qe=new D9(H,be,ye,Ve,He,Tt,dt),W=new XV(S),U=new KV(S),ae=new k4(H),Ft=new HV(H,ae),ve=new QV(H,ae,dt,Ft),we=new e5(H,ve,ae,dt),kt=new $V(H,He,qe),Rt=new WV(Ve),Ee=new m9(S,W,U,be,He,Ft,Rt),ct=new H9(S,Ve),ze=new y9,Qe=new w9(be),Ke=new zV(S,W,U,ye,we,p,l),Pe=new T9(S,we,He),sn=new G9(H,dt,He,ye),Et=new GV(H,be,dt),et=new qV(H,be,dt),dt.programs=Ee.programs,S.capabilities=He,S.extensions=be,S.properties=Ve,S.renderLists=ze,S.shadowMap=Pe,S.state=ye,S.info=dt}Y();const Le=new k9(S,H);this.xr=Le,this.getContext=function(){return H},this.getContextAttributes=function(){return H.getContextAttributes()},this.forceContextLoss=function(){const O=be.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=be.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return ge},this.setPixelRatio=function(O){O!==void 0&&(ge=O,this.setSize($,K,!1))},this.getSize=function(O){return O.set($,K)},this.setSize=function(O,Z,oe=!0){if(Le.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=O,K=Z,t.width=Math.floor(O*ge),t.height=Math.floor(Z*ge),oe===!0&&(t.style.width=O+"px",t.style.height=Z+"px"),this.setViewport(0,0,O,Z)},this.getDrawingBufferSize=function(O){return O.set($*ge,K*ge).floor()},this.setDrawingBufferSize=function(O,Z,oe){$=O,K=Z,ge=oe,t.width=Math.floor(O*oe),t.height=Math.floor(Z*oe),this.setViewport(0,0,O,Z)},this.getCurrentViewport=function(O){return O.copy(T)},this.getViewport=function(O){return O.copy(ie)},this.setViewport=function(O,Z,oe,le){O.isVector4?ie.set(O.x,O.y,O.z,O.w):ie.set(O,Z,oe,le),ye.viewport(T.copy(ie).multiplyScalar(ge).round())},this.getScissor=function(O){return O.copy(fe)},this.setScissor=function(O,Z,oe,le){O.isVector4?fe.set(O.x,O.y,O.z,O.w):fe.set(O,Z,oe,le),ye.scissor(F.copy(fe).multiplyScalar(ge).round())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(O){ye.setScissorTest(Ce=O)},this.setOpaqueSort=function(O){z=O},this.setTransparentSort=function(O){te=O},this.getClearColor=function(O){return O.copy(Ke.getClearColor())},this.setClearColor=function(){Ke.setClearColor.apply(Ke,arguments)},this.getClearAlpha=function(){return Ke.getClearAlpha()},this.setClearAlpha=function(){Ke.setClearAlpha.apply(Ke,arguments)},this.clear=function(O=!0,Z=!0,oe=!0){let le=0;if(O){let ne=!1;if(D!==null){const De=D.texture.format;ne=De===Ym||De===Km||De===Ed}if(ne){const De=D.texture.type,Xe=De===vs||De===go||De===$c||De===ml||De===Xm||De===jm,nt=Ke.getClearColor(),Ze=Ke.getClearAlpha(),ht=nt.r,yt=nt.g,ft=nt.b;Xe?(g[0]=ht,g[1]=yt,g[2]=ft,g[3]=Ze,H.clearBufferuiv(H.COLOR,0,g)):(v[0]=ht,v[1]=yt,v[2]=ft,v[3]=Ze,H.clearBufferiv(H.COLOR,0,v))}else le|=H.COLOR_BUFFER_BIT}Z&&(le|=H.DEPTH_BUFFER_BIT),oe&&(le|=H.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H.clear(le)},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(){t.removeEventListener("webglcontextlost",xe,!1),t.removeEventListener("webglcontextrestored",Se,!1),t.removeEventListener("webglcontextcreationerror",Oe,!1),ze.dispose(),Qe.dispose(),Ve.dispose(),W.dispose(),U.dispose(),we.dispose(),Ft.dispose(),sn.dispose(),Ee.dispose(),Le.dispose(),Le.removeEventListener("sessionstart",Gn),Le.removeEventListener("sessionend",Xu),Dr.stop()};function xe(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function Se(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const O=dt.autoReset,Z=Pe.enabled,oe=Pe.autoUpdate,le=Pe.needsUpdate,ne=Pe.type;Y(),dt.autoReset=O,Pe.enabled=Z,Pe.autoUpdate=oe,Pe.needsUpdate=le,Pe.type=ne}function Oe(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function _t(O){const Z=O.target;Z.removeEventListener("dispose",_t),Vt(Z)}function Vt(O){wn(O),Ve.remove(O)}function wn(O){const Z=Ve.get(O).programs;Z!==void 0&&(Z.forEach(function(oe){Ee.releaseProgram(oe)}),O.isShaderMaterial&&Ee.releaseShaderCache(O))}this.renderBufferDirect=function(O,Z,oe,le,ne,De){Z===null&&(Z=wt);const Xe=ne.isMesh&&ne.matrixWorld.determinant()<0,nt=Ah(O,Z,oe,le,ne);ye.setMaterial(le,Xe);let Ze=oe.index,ht=1;if(le.wireframe===!0){if(Ze=ve.getWireframeAttribute(oe),Ze===void 0)return;ht=2}const yt=oe.drawRange,ft=oe.attributes.position;let Yt=yt.start*ht,ln=(yt.start+yt.count)*ht;De!==null&&(Yt=Math.max(Yt,De.start*ht),ln=Math.min(ln,(De.start+De.count)*ht)),Ze!==null?(Yt=Math.max(Yt,0),ln=Math.min(ln,Ze.count)):ft!=null&&(Yt=Math.max(Yt,0),ln=Math.min(ln,ft.count));const en=ln-Yt;if(en<0||en===1/0)return;Ft.setup(ne,le,nt,oe,Ze);let xn,st=Et;if(Ze!==null&&(xn=ae.get(Ze),st=et,st.setIndex(xn)),ne.isMesh)le.wireframe===!0?(ye.setLineWidth(le.wireframeLinewidth*Mt()),st.setMode(H.LINES)):st.setMode(H.TRIANGLES);else if(ne.isLine){let Ue=le.linewidth;Ue===void 0&&(Ue=1),ye.setLineWidth(Ue*Mt()),ne.isLineSegments?st.setMode(H.LINES):ne.isLineLoop?st.setMode(H.LINE_LOOP):st.setMode(H.LINE_STRIP)}else ne.isPoints?st.setMode(H.POINTS):ne.isSprite&&st.setMode(H.TRIANGLES);if(ne.isBatchedMesh)if(ne._multiDrawInstances!==null)st.renderMultiDrawInstances(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount,ne._multiDrawInstances);else if(be.get("WEBGL_multi_draw"))st.renderMultiDraw(ne._multiDrawStarts,ne._multiDrawCounts,ne._multiDrawCount);else{const Ue=ne._multiDrawStarts,fn=ne._multiDrawCounts,At=ne._multiDrawCount,cn=Ze?ae.get(Ze).bytesPerElement:1,Ui=Ve.get(le).currentProgram.getUniforms();for(let Fn=0;Fn{function De(){if(le.forEach(function(Xe){Ve.get(Xe).currentProgram.isReady()&&le.delete(Xe)}),le.size===0){ne(O);return}setTimeout(De,10)}be.get("KHR_parallel_shader_compile")!==null?De():setTimeout(De,10)})};let Jt=null;function Qi(O){Jt&&Jt(O)}function Gn(){Dr.stop()}function Xu(){Dr.start()}const Dr=new SI;Dr.setAnimationLoop(Qi),typeof self!="undefined"&&Dr.setContext(self),this.setAnimationLoop=function(O){Jt=O,Le.setAnimationLoop(O),O===null?Dr.stop():Dr.start()},Le.addEventListener("sessionstart",Gn),Le.addEventListener("sessionend",Xu),this.render=function(O,Z){if(Z!==void 0&&Z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),Z.parent===null&&Z.matrixWorldAutoUpdate===!0&&Z.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(Z),Z=Le.getCamera()),O.isScene===!0&&O.onBeforeRender(S,O,Z,D),_=Qe.get(O,x.length),_.init(Z),x.push(_),Ie.multiplyMatrices(Z.projectionMatrix,Z.matrixWorldInverse),ot.setFromProjectionMatrix(Ie),Me=this.localClippingEnabled,re=Rt.init(this.clippingPlanes,Me),A=ze.get(O,m.length),A.init(),m.push(A),Le.enabled===!0&&Le.isPresenting===!0){const De=S.xr.getDepthSensingMesh();De!==null&&Ta(De,Z,-1/0,S.sortObjects)}Ta(O,Z,0,S.sortObjects),A.finish(),S.sortObjects===!0&&A.sort(z,te),vt=Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1,vt&&Ke.addToRenderList(A,O),this.info.render.frame++,re===!0&&Rt.beginShadows();const oe=_.state.shadowsArray;Pe.render(oe,O,Z),re===!0&&Rt.endShadows(),this.info.autoReset===!0&&this.info.reset();const le=A.opaque,ne=A.transmissive;if(_.setupLights(),Z.isArrayCamera){const De=Z.cameras;if(ne.length>0)for(let Xe=0,nt=De.length;Xe0&&ba(le,ne,O,Z),vt&&Ke.render(O),Zl(A,O,Z);D!==null&&(qe.updateMultisampleRenderTarget(D),qe.updateRenderTargetMipmap(D)),O.isScene===!0&&O.onAfterRender(S,O,Z),Ft.resetDefaultState(),N=-1,B=null,x.pop(),x.length>0?(_=x[x.length-1],re===!0&&Rt.setGlobalState(S.clippingPlanes,_.state.camera)):_=null,m.pop(),m.length>0?A=m[m.length-1]:A=null};function Ta(O,Z,oe,le){if(O.visible===!1)return;if(O.layers.test(Z.layers)){if(O.isGroup)oe=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(Z);else if(O.isLight)_.pushLight(O),O.castShadow&&_.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||ot.intersectsSprite(O)){le&&$e.setFromMatrixPosition(O.matrixWorld).applyMatrix4(Ie);const Xe=we.update(O),nt=O.material;nt.visible&&A.push(O,Xe,nt,oe,$e.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||ot.intersectsObject(O))){const Xe=we.update(O),nt=O.material;if(le&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),$e.copy(O.boundingSphere.center)):(Xe.boundingSphere===null&&Xe.computeBoundingSphere(),$e.copy(Xe.boundingSphere.center)),$e.applyMatrix4(O.matrixWorld).applyMatrix4(Ie)),Array.isArray(nt)){const Ze=Xe.groups;for(let ht=0,yt=Ze.length;ht0&&Ra(ne,Z,oe),De.length>0&&Ra(De,Z,oe),Xe.length>0&&Ra(Xe,Z,oe),ye.buffers.depth.setTest(!0),ye.buffers.depth.setMask(!0),ye.buffers.color.setMask(!0),ye.setPolygonOffset(!1)}function ba(O,Z,oe,le){if((oe.isScene===!0?oe.overrideMaterial:null)!==null)return;_.state.transmissionRenderTarget[le.id]===void 0&&(_.state.transmissionRenderTarget[le.id]=new ys(1,1,{generateMipmaps:!0,type:be.has("EXT_color_buffer_half_float")||be.has("EXT_color_buffer_float")?eu:vs,minFilter:Kr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:tn.workingColorSpace}));const De=_.state.transmissionRenderTarget[le.id],Xe=le.viewport||T;De.setSize(Xe.z,Xe.w);const nt=S.getRenderTarget();S.setRenderTarget(De),S.getClearColor(J),q=S.getClearAlpha(),q<1&&S.setClearColor(16777215,.5),S.clear(),vt&&Ke.render(oe);const Ze=S.toneMapping;S.toneMapping=zs;const ht=le.viewport;if(le.viewport!==void 0&&(le.viewport=void 0),_.setupLightsView(le),re===!0&&Rt.setGlobalState(S.clippingPlanes,le),Ra(O,oe,le),qe.updateMultisampleRenderTarget(De),qe.updateRenderTargetMipmap(De),be.has("WEBGL_multisampled_render_to_texture")===!1){let yt=!1;for(let ft=0,Yt=Z.length;ft0),ft=!!oe.morphAttributes.position,Yt=!!oe.morphAttributes.normal,ln=!!oe.morphAttributes.color;let en=zs;le.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(en=S.toneMapping);const xn=oe.morphAttributes.position||oe.morphAttributes.normal||oe.morphAttributes.color,st=xn!==void 0?xn.length:0,Ue=Ve.get(le),fn=_.state.lights;if(re===!0&&(Me===!0||O!==B)){const ui=O===B&&le.id===N;Rt.setState(le,O,ui)}let At=!1;le.version===Ue.__version?(Ue.needsLights&&Ue.lightsStateVersion!==fn.state.version||Ue.outputColorSpace!==nt||ne.isBatchedMesh&&Ue.batching===!1||!ne.isBatchedMesh&&Ue.batching===!0||ne.isBatchedMesh&&Ue.batchingColor===!0&&ne.colorTexture===null||ne.isBatchedMesh&&Ue.batchingColor===!1&&ne.colorTexture!==null||ne.isInstancedMesh&&Ue.instancing===!1||!ne.isInstancedMesh&&Ue.instancing===!0||ne.isSkinnedMesh&&Ue.skinning===!1||!ne.isSkinnedMesh&&Ue.skinning===!0||ne.isInstancedMesh&&Ue.instancingColor===!0&&ne.instanceColor===null||ne.isInstancedMesh&&Ue.instancingColor===!1&&ne.instanceColor!==null||ne.isInstancedMesh&&Ue.instancingMorph===!0&&ne.morphTexture===null||ne.isInstancedMesh&&Ue.instancingMorph===!1&&ne.morphTexture!==null||Ue.envMap!==Ze||le.fog===!0&&Ue.fog!==De||Ue.numClippingPlanes!==void 0&&(Ue.numClippingPlanes!==Rt.numPlanes||Ue.numIntersection!==Rt.numIntersection)||Ue.vertexAlphas!==ht||Ue.vertexTangents!==yt||Ue.morphTargets!==ft||Ue.morphNormals!==Yt||Ue.morphColors!==ln||Ue.toneMapping!==en||Ue.morphTargetsCount!==st)&&(At=!0):(At=!0,Ue.__version=le.version);let cn=Ue.currentProgram;At===!0&&(cn=Pa(le,Z,ne));let Ui=!1,Fn=!1,Yn=!1;const hn=cn.getUniforms(),dr=Ue.uniforms;if(ye.useProgram(cn.program)&&(Ui=!0,Fn=!0,Yn=!0),le.id!==N&&(N=le.id,Fn=!0),Ui||B!==O){hn.setValue(H,"projectionMatrix",O.projectionMatrix),hn.setValue(H,"viewMatrix",O.matrixWorldInverse);const ui=hn.map.cameraPosition;ui!==void 0&&ui.setValue(H,Be.setFromMatrixPosition(O.matrixWorld)),He.logarithmicDepthBuffer&&hn.setValue(H,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(le.isMeshPhongMaterial||le.isMeshToonMaterial||le.isMeshLambertMaterial||le.isMeshBasicMaterial||le.isMeshStandardMaterial||le.isShaderMaterial)&&hn.setValue(H,"isOrthographic",O.isOrthographicCamera===!0),B!==O&&(B=O,Fn=!0,Yn=!0)}if(ne.isSkinnedMesh){hn.setOptional(H,ne,"bindMatrix"),hn.setOptional(H,ne,"bindMatrixInverse");const ui=ne.skeleton;ui&&(ui.boneTexture===null&&ui.computeBoneTexture(),hn.setValue(H,"boneTexture",ui.boneTexture,qe))}ne.isBatchedMesh&&(hn.setOptional(H,ne,"batchingTexture"),hn.setValue(H,"batchingTexture",ne._matricesTexture,qe),hn.setOptional(H,ne,"batchingIdTexture"),hn.setValue(H,"batchingIdTexture",ne._indirectTexture,qe),hn.setOptional(H,ne,"batchingColorTexture"),ne._colorsTexture!==null&&hn.setValue(H,"batchingColorTexture",ne._colorsTexture,qe));const Xs=oe.morphAttributes;if((Xs.position!==void 0||Xs.normal!==void 0||Xs.color!==void 0)&&kt.update(ne,oe,cn),(Fn||Ue.receiveShadow!==ne.receiveShadow)&&(Ue.receiveShadow=ne.receiveShadow,hn.setValue(H,"receiveShadow",ne.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(dr.envMap.value=Ze,dr.flipEnvMap.value=Ze.isCubeTexture&&Ze.isRenderTargetTexture===!1?-1:1),le.isMeshStandardMaterial&&le.envMap===null&&Z.environment!==null&&(dr.envMapIntensity.value=Z.environmentIntensity),Fn&&(hn.setValue(H,"toneMappingExposure",S.toneMappingExposure),Ue.needsLights&&Sh(dr,Yn),De&&le.fog===!0&&ct.refreshFogUniforms(dr,De),ct.refreshMaterialUniforms(dr,le,ge,K,_.state.transmissionRenderTarget[O.id]),Kg.upload(H,ju(Ue),dr,qe)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(Kg.upload(H,ju(Ue),dr,qe),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&hn.setValue(H,"center",ne.center),hn.setValue(H,"modelViewMatrix",ne.modelViewMatrix),hn.setValue(H,"normalMatrix",ne.normalMatrix),hn.setValue(H,"modelMatrix",ne.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const ui=le.uniformsGroups;for(let Ia=0,qi=ui.length;Ia0&&qe.useMultisampledRTT(O)===!1?ne=Ve.get(O).__webglMultisampledFramebuffer:Array.isArray(yt)?ne=yt[oe]:ne=yt,T.copy(O.viewport),F.copy(O.scissor),X=O.scissorTest}else T.copy(ie).multiplyScalar(ge).floor(),F.copy(fe).multiplyScalar(ge).floor(),X=Ce;if(ye.bindFramebuffer(H.FRAMEBUFFER,ne)&&le&&ye.drawBuffers(O,ne),ye.viewport(T),ye.scissor(F),ye.setScissorTest(X),De){const Ze=Ve.get(O.texture);H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_CUBE_MAP_POSITIVE_X+Z,Ze.__webglTexture,oe)}else if(Xe){const Ze=Ve.get(O.texture),ht=Z||0;H.framebufferTextureLayer(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,Ze.__webglTexture,oe||0,ht)}N=-1},this.readRenderTargetPixels=function(O,Z,oe,le,ne,De,Xe){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let nt=Ve.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Xe!==void 0&&(nt=nt[Xe]),nt){ye.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,yt=Ze.type;if(!He.textureFormatReadable(ht)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!He.textureTypeReadable(yt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Z>=0&&Z<=O.width-le&&oe>=0&&oe<=O.height-ne&&H.readPixels(Z,oe,le,ne,Tt.convert(ht),Tt.convert(yt),De)}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=function(O,Z,oe,le,ne,De,Xe){return fc(this,null,function*(){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let nt=Ve.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Xe!==void 0&&(nt=nt[Xe]),nt){ye.bindFramebuffer(H.FRAMEBUFFER,nt);try{const Ze=O.texture,ht=Ze.format,yt=Ze.type;if(!He.textureFormatReadable(ht))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!He.textureTypeReadable(yt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Z>=0&&Z<=O.width-le&&oe>=0&&oe<=O.height-ne){const ft=H.createBuffer();H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.bufferData(H.PIXEL_PACK_BUFFER,De.byteLength,H.STREAM_READ),H.readPixels(Z,oe,le,ne,Tt.convert(ht),Tt.convert(yt),0),H.flush();const Yt=H.fenceSync(H.SYNC_GPU_COMMANDS_COMPLETE,0);yield u4(H,Yt,4);try{H.bindBuffer(H.PIXEL_PACK_BUFFER,ft),H.getBufferSubData(H.PIXEL_PACK_BUFFER,0,De)}finally{H.deleteBuffer(ft),H.deleteSync(Yt)}return De}}finally{const Ze=D!==null?Ve.get(D).__webglFramebuffer:null;ye.bindFramebuffer(H.FRAMEBUFFER,Ze)}}})},this.copyFramebufferToTexture=function(O,Z=null,oe=0){O.isTexture!==!0&&(su("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Z=arguments[0]||null,O=arguments[1]);const le=Math.pow(2,-oe),ne=Math.floor(O.image.width*le),De=Math.floor(O.image.height*le),Xe=Z!==null?Z.x:0,nt=Z!==null?Z.y:0;qe.setTexture2D(O,0),H.copyTexSubImage2D(H.TEXTURE_2D,oe,0,0,Xe,nt,ne,De),ye.unbindTexture()},this.copyTextureToTexture=function(O,Z,oe=null,le=null,ne=0){O.isTexture!==!0&&(su("WebGLRenderer: copyTextureToTexture function signature has changed."),le=arguments[0]||null,O=arguments[1],Z=arguments[2],ne=arguments[3]||0,oe=null);let De,Xe,nt,Ze,ht,yt;oe!==null?(De=oe.max.x-oe.min.x,Xe=oe.max.y-oe.min.y,nt=oe.min.x,Ze=oe.min.y):(De=O.image.width,Xe=O.image.height,nt=0,Ze=0),le!==null?(ht=le.x,yt=le.y):(ht=0,yt=0);const ft=Tt.convert(Z.format),Yt=Tt.convert(Z.type);qe.setTexture2D(Z,0),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,Z.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,Z.unpackAlignment);const ln=H.getParameter(H.UNPACK_ROW_LENGTH),en=H.getParameter(H.UNPACK_IMAGE_HEIGHT),xn=H.getParameter(H.UNPACK_SKIP_PIXELS),st=H.getParameter(H.UNPACK_SKIP_ROWS),Ue=H.getParameter(H.UNPACK_SKIP_IMAGES),fn=O.isCompressedTexture?O.mipmaps[ne]:O.image;H.pixelStorei(H.UNPACK_ROW_LENGTH,fn.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,fn.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,nt),H.pixelStorei(H.UNPACK_SKIP_ROWS,Ze),O.isDataTexture?H.texSubImage2D(H.TEXTURE_2D,ne,ht,yt,De,Xe,ft,Yt,fn.data):O.isCompressedTexture?H.compressedTexSubImage2D(H.TEXTURE_2D,ne,ht,yt,fn.width,fn.height,ft,fn.data):H.texSubImage2D(H.TEXTURE_2D,ne,ht,yt,De,Xe,ft,Yt,fn),H.pixelStorei(H.UNPACK_ROW_LENGTH,ln),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,en),H.pixelStorei(H.UNPACK_SKIP_PIXELS,xn),H.pixelStorei(H.UNPACK_SKIP_ROWS,st),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Ue),ne===0&&Z.generateMipmaps&&H.generateMipmap(H.TEXTURE_2D),ye.unbindTexture()},this.copyTextureToTexture3D=function(O,Z,oe=null,le=null,ne=0){O.isTexture!==!0&&(su("WebGLRenderer: copyTextureToTexture3D function signature has changed."),oe=arguments[0]||null,le=arguments[1]||null,O=arguments[2],Z=arguments[3],ne=arguments[4]||0);let De,Xe,nt,Ze,ht,yt,ft,Yt,ln;const en=O.isCompressedTexture?O.mipmaps[ne]:O.image;oe!==null?(De=oe.max.x-oe.min.x,Xe=oe.max.y-oe.min.y,nt=oe.max.z-oe.min.z,Ze=oe.min.x,ht=oe.min.y,yt=oe.min.z):(De=en.width,Xe=en.height,nt=en.depth,Ze=0,ht=0,yt=0),le!==null?(ft=le.x,Yt=le.y,ln=le.z):(ft=0,Yt=0,ln=0);const xn=Tt.convert(Z.format),st=Tt.convert(Z.type);let Ue;if(Z.isData3DTexture)qe.setTexture3D(Z,0),Ue=H.TEXTURE_3D;else if(Z.isDataArrayTexture||Z.isCompressedArrayTexture)qe.setTexture2DArray(Z,0),Ue=H.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,Z.flipY),H.pixelStorei(H.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),H.pixelStorei(H.UNPACK_ALIGNMENT,Z.unpackAlignment);const fn=H.getParameter(H.UNPACK_ROW_LENGTH),At=H.getParameter(H.UNPACK_IMAGE_HEIGHT),cn=H.getParameter(H.UNPACK_SKIP_PIXELS),Ui=H.getParameter(H.UNPACK_SKIP_ROWS),Fn=H.getParameter(H.UNPACK_SKIP_IMAGES);H.pixelStorei(H.UNPACK_ROW_LENGTH,en.width),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,en.height),H.pixelStorei(H.UNPACK_SKIP_PIXELS,Ze),H.pixelStorei(H.UNPACK_SKIP_ROWS,ht),H.pixelStorei(H.UNPACK_SKIP_IMAGES,yt),O.isDataTexture||O.isData3DTexture?H.texSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,st,en.data):Z.isCompressedArrayTexture?H.compressedTexSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,en.data):H.texSubImage3D(Ue,ne,ft,Yt,ln,De,Xe,nt,xn,st,en),H.pixelStorei(H.UNPACK_ROW_LENGTH,fn),H.pixelStorei(H.UNPACK_IMAGE_HEIGHT,At),H.pixelStorei(H.UNPACK_SKIP_PIXELS,cn),H.pixelStorei(H.UNPACK_SKIP_ROWS,Ui),H.pixelStorei(H.UNPACK_SKIP_IMAGES,Fn),ne===0&&Z.generateMipmaps&&H.generateMipmap(Ue),ye.unbindTexture()},this.initRenderTarget=function(O){Ve.get(O).__webglFramebuffer===void 0&&qe.setupRenderTarget(O)},this.initTexture=function(O){O.isCubeTexture?qe.setTextureCube(O,0):O.isData3DTexture?qe.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?qe.setTexture2DArray(O,0):qe.setTexture2D(O,0),ye.unbindTexture()},this.resetState=function(){I=0,P=0,D=null,ye.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Hs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===Eg?"display-p3":"srgb",t.unpackColorSpace=tn.workingColorSpace===Bd?"display-p3":"srgb"}}class Qg{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new ke(e),this.density=t}clone(){return new Qg(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class qg{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new ke(e),this.near=t,this.far=i}clone(){return new qg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Zg extends jt{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 ur,this.environmentIntensity=1,this.environmentRotation=new ur,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__!="undefined"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(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),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Qd{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Nd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=br()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return su("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:qd.clone(),uv:Pr.getInterpolation(qd,$g,$d,ev,$I,gS,eB,new Ae),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function tv(n,e,t,i,r,s){Bu.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Zd.x=s*Bu.x-r*Bu.y,Zd.y=r*Bu.x+s*Bu.y):Zd.copy(Bu),n.copy(e),n.x+=Zd.x,n.y+=Zd.y,n.applyMatrix4(ZI)}const nv=new G,nB=new G;class iB extends jt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){nv.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(nv);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){nv.setFromMatrixPosition(e.matrixWorld),nB.setFromMatrixPosition(this.matrixWorld);const i=nv.distanceTo(nB)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=r.length&&r.push({start:-1,count:-1,z:-1,index:-1});const o=r[this.index];s.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t,o.index=i}reset(){this.list.length=0,this.index=0}}const Aa=new mt,AS=new mt,Y9=new mt,Q9=new ke(1,1,1),dB=new mt,SS=new Kd,ov=new Bi,Dl=new _i,ih=new G,hB=new G,q9=new G,MS=new K9,Di=new jn,av=[];function Z9(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new $t(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Bi);const e=this._geometryCount,t=this.boundingBox,i=this._drawInfo;t.makeEmpty();for(let r=0;r=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");this._drawInfo.push({visible:!0,active:!0,geometryIndex:e});const t=this._drawInfo.length-1,i=this._matricesTexture,r=i.image.data;Y9.toArray(r,t*16),i.needsUpdate=!0;const s=this._colorsTexture;return s&&(Q9.toArray(s.image.data,t*4),s.needsUpdate=!0),t}addGeometry(e,t=-1,i=-1){if(this._initializeGeometry(e),this._validateGeometry(e),this._drawInfo.length>=this._maxInstanceCount)throw new Error("BatchedMesh: Maximum item count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const c=e.getIndex(),d=c!==null;if(d&&(i===-1?r.indexCount=c.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._geometryCount;return this._geometryCount++,o.push(r),a.push({start:d?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new Bi,sphereInitialized:!1,sphere:new _i}),this.setGeometryAt(h,e),h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,c=a.vertexCount;for(const g in i.attributes){const v=t.getAttribute(g),A=i.getAttribute(g);Z9(v,A,l);const _=v.itemSize;for(let m=v.count,x=c;m=this._geometryCount)return null;const i=this._bounds[e],r=i.box,s=this.geometry;if(i.boxInitialized===!1){r.makeEmpty();const o=s.index,a=s.attributes.position,l=this._drawRanges[e];for(let c=l.start,d=l.start+l.count;c=this._geometryCount)return null;const i=this._bounds[e],r=i.sphere,s=this.geometry;if(i.sphereInitialized===!1){r.makeEmpty(),this.getBoundingBoxAt(e,ov),ov.getCenter(r.center);const o=s.index,a=s.attributes.position,l=this._drawRanges[e];let c=0;for(let d=l.start,h=l.start+l.count;d=i.length||i[e].active===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._drawInfo,r=this._matricesTexture.image.data;return e>=i.length||i[e].active===!1?null:t.fromArray(r,e*16)}setColorAt(e,t){this._colorsTexture===null&&this._initColorsTexture();const i=this._colorsTexture,r=this._colorsTexture.image.data,s=this._drawInfo;return e>=s.length||s[e].active===!1?this:(t.toArray(r,e*4),i.needsUpdate=!0,this)}getColorAt(e,t){const i=this._colorsTexture.image.data,r=this._drawInfo;return e>=r.length||r[e].active===!1?null:t.fromArray(i,e*4)}setVisibleAt(e,t){const i=this._drawInfo;return e>=i.length||i[e].active===!1||i[e].visible===t?this:(i[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._drawInfo;return e>=t.length||t[e].active===!1?!1:t[e].visible}raycast(e,t){const i=this._drawInfo,r=this._drawRanges,s=this.matrixWorld,o=this.geometry;Di.material=this.material,Di.geometry.index=o.index,Di.geometry.attributes=o.attributes,Di.geometry.boundingBox===null&&(Di.geometry.boundingBox=new Bi),Di.geometry.boundingSphere===null&&(Di.geometry.boundingSphere=new _i);for(let a=0,l=i.length;a_e({},t)),this._reservedRanges=e._reservedRanges.map(t=>_e({},t)),this._drawInfo=e._drawInfo.map(t=>_e({},t)),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null),this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._drawInfo,c=this._multiDrawStarts,d=this._multiDrawCounts,h=this._drawRanges,p=this.perObjectFrustumCulled,g=this._indirectTexture,v=g.image.data;p&&(dB.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),SS.setFromProjectionMatrix(dB,e.coordinateSystem));let A=0;if(this.sortObjects){AS.copy(this.matrixWorld).invert(),ih.setFromMatrixPosition(i.matrixWorld).applyMatrix4(AS),hB.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(AS);for(let x=0,S=l.length;x0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;si)return;wS.applyMatrix4(n.matrixWorld);const l=e.ray.origin.distanceTo(wS);if(!(le.far))return{distance:l,point:gB.clone().applyMatrix4(n.matrixWorld),index:r,face:null,faceIndex:null,object:n}}const vB=new G,yB=new G;class ws extends To{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class $9 extends Mn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:kn,this.magFilter=s!==void 0?s:kn,this.generateMipmaps=!1;const d=this;function h(){d.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class e8 extends Mn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=oi,this.minFilter=oi,this.generateMipmaps=!1,this.needsUpdate=!0}}class mv extends Mn{constructor(e,t,i,r,s,o,a,l,c,d,h,p){super(null,o,a,l,c,d,r,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class t8 extends mv{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Tr,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class n8 extends mv{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,mo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class i8 extends Mn{constructor(e,t,i,r,s,o,a,l,c){super(e,t,i,r,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Es{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const 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;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,c;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),c=i[r]-o,c<0)a=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const d=i[r],p=i[r+1]-d,g=(o-d)/p;return(r+g)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Ae:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new mt;for(let g=0;g<=e;g++){const v=g/e;r[g]=this.getTangentAt(v,new G)}s[0]=new G,o[0]=new G;let c=Number.MAX_VALUE;const d=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);d<=c&&(c=d,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),o[g]=o[g-1].clone(),a.crossVectors(r[g-1],r[g]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(zn(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(l.makeRotationAxis(a,v))}o[g].crossVectors(r[g],s[g])}if(t===!0){let g=Math.acos(zn(s[0].dot(s[e]),-1,1));g/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(g=-g);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],g*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class gv extends Es{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Ae){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,d;this.closed||a>0?c=r[(a-1)%s]:(vv.subVectors(r[0],r[1]).add(r[0]),c=vv);const h=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(MB(a,l.x,c.x,d.x,h.x),MB(a,l.y,c.y,d.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const d=c.getPoint(1);return this.currentPoint.copy(d),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class lh extends Pt{constructor(e=[new Ae(0,-.5),new Ae(.5,0),new Ae(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=zn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],d=1/t,h=new G,p=new Ae,g=new G,v=new G,A=new G;let _=0,m=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:_=e[x+1].x-e[x].x,m=e[x+1].y-e[x].y,g.x=m*1,g.y=-_,g.z=m*0,A.copy(g),g.normalize(),l.push(g.x,g.y,g.z);break;case e.length-1:l.push(A.x,A.y,A.z);break;default:_=e[x+1].x-e[x].x,m=e[x+1].y-e[x].y,g.x=m*1,g.y=-_,g.z=m*0,v.copy(g),g.x+=A.x,g.y+=A.y,g.z+=A.z,g.normalize(),l.push(g.x,g.y,g.z),A.copy(v)}for(let x=0;x<=t;x++){const S=i+x*d*r,w=Math.sin(S),I=Math.cos(S);for(let P=0;P<=e.length-1;P++){h.x=e[P].x*w,h.y=e[P].y,h.z=e[P].x*I,o.push(h.x,h.y,h.z),p.x=x/t,p.y=P/(e.length-1),a.push(p.x,p.y);const D=l[3*P+0]*w,N=l[3*P+1],B=l[3*P+0]*I;c.push(D,N,B)}}for(let x=0;x0&&S(!0),t>0&&S(!1)),this.setIndex(d),this.setAttribute("position",new rt(h,3)),this.setAttribute("normal",new rt(p,3)),this.setAttribute("uv",new rt(g,2));function x(){const w=new G,I=new G;let P=0;const D=(t-e)/i;for(let N=0;N<=s;N++){const B=[],T=N/s,F=T*(t-e)+e;for(let X=0;X<=r;X++){const J=X/r,q=J*l+a,$=Math.sin(q),K=Math.cos(q);I.x=F*$,I.y=-T*i+_,I.z=F*K,h.push(I.x,I.y,I.z),w.set($,D,K).normalize(),p.push(w.x,w.y,w.z),g.push(J,1-T),B.push(v++)}A.push(B)}for(let N=0;N.9&&D<.1&&(S<.2&&(o[x+0]+=1),w<.2&&(o[x+2]+=1),I<.2&&(o[x+4]+=1))}}function p(x){s.push(x.x,x.y,x.z)}function g(x,S){const w=x*3;S.x=e[w+0],S.y=e[w+1],S.z=e[w+2]}function v(){const x=new G,S=new G,w=new G,I=new G,P=new Ae,D=new Ae,N=new Ae;for(let B=0,T=0;B80*t){a=c=n[0],l=d=n[1];for(let v=t;vc&&(c=h),p>d&&(d=p);g=Math.max(c-a,d-l),g=g!==0?32767/g:0}return ch(s,o,t,a,l,g,0),o}};function bB(n,e,t,i,r){let s,o;if(r===T8(n,e,t,i)>0)for(s=e;s=e;s-=i)o=IB(s,n[s],n[s+1],o);return o&&Cv(o,o.next)&&(fh(o),o=o.next),o}function Nl(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Cv(t,t.next)||Dn(t.prev,t,t.next)===0)){if(fh(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function ch(n,e,t,i,r,s,o){if(!n)return;!o&&s&&A8(n,i,r,s);let a=n,l,c;for(;n.prev!==n.next;){if(l=n.prev,c=n.next,s?h8(n,i,r,s):d8(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(c.i/t|0),fh(n),n=c.next,a=c.next;continue}if(n=c,n===a){o?o===1?(n=p8(Nl(n),e,t),ch(n,e,t,i,r,s,2)):o===2&&m8(n,e,t,i,r,s):ch(Nl(n),e,t,i,r,s,1);break}}}function d8(n){const e=n.prev,t=n,i=n.next;if(Dn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,c=i.y,d=rs?r>o?r:o:s>o?s:o,g=a>l?a>c?a:c:l>c?l:c;let v=i.next;for(;v!==e;){if(v.x>=d&&v.x<=p&&v.y>=h&&v.y<=g&&Fu(r,a,s,l,o,c,v.x,v.y)&&Dn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function h8(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Dn(r,s,o)>=0)return!1;const a=r.x,l=s.x,c=o.x,d=r.y,h=s.y,p=o.y,g=al?a>c?a:c:l>c?l:c,_=d>h?d>p?d:p:h>p?h:p,m=OS(g,v,e,t,i),x=OS(A,_,e,t,i);let S=n.prevZ,w=n.nextZ;for(;S&&S.z>=m&&w&&w.z<=x;){if(S.x>=g&&S.x<=A&&S.y>=v&&S.y<=_&&S!==r&&S!==o&&Fu(a,d,l,h,c,p,S.x,S.y)&&Dn(S.prev,S,S.next)>=0||(S=S.prevZ,w.x>=g&&w.x<=A&&w.y>=v&&w.y<=_&&w!==r&&w!==o&&Fu(a,d,l,h,c,p,w.x,w.y)&&Dn(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;S&&S.z>=m;){if(S.x>=g&&S.x<=A&&S.y>=v&&S.y<=_&&S!==r&&S!==o&&Fu(a,d,l,h,c,p,S.x,S.y)&&Dn(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;w&&w.z<=x;){if(w.x>=g&&w.x<=A&&w.y>=v&&w.y<=_&&w!==r&&w!==o&&Fu(a,d,l,h,c,p,w.x,w.y)&&Dn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function p8(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Cv(r,s)&&RB(r,i,i.next,s)&&uh(r,s)&&uh(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),fh(i),fh(i.next),i=n=s),i=i.next}while(i!==n);return Nl(i)}function m8(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&w8(o,a)){let l=PB(o,a);o=Nl(o,o.next),l=Nl(l,l.next),ch(o,e,t,i,r,s,0),ch(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function g8(n,e,t,i){const r=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&Fu(or.x||t.x===r.x&&_8(r,t)))&&(r=t,d=h)),t=t.next;while(t!==a);return r}function _8(n,e){return Dn(n.prev,n,e.prev)<0&&Dn(e.next,n,n.next)<0}function A8(n,e,t,i){let r=n;do r.z===0&&(r.z=OS(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,S8(r)}function S8(n){let e,t,i,r,s,o,a,l,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function OS(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function M8(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function w8(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!E8(n,e)&&(uh(n,e)&&uh(e,n)&&C8(n,e)&&(Dn(n.prev,n,e.prev)||Dn(n,e.prev,e))||Cv(n,e)&&Dn(n.prev,n,n.next)>0&&Dn(e.prev,e,e.next)>0)}function Dn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Cv(n,e){return n.x===e.x&&n.y===e.y}function RB(n,e,t,i){const r=bv(Dn(n,e,t)),s=bv(Dn(n,e,i)),o=bv(Dn(t,i,n)),a=bv(Dn(t,i,e));return!!(r!==s&&o!==a||r===0&&Tv(n,t,e)||s===0&&Tv(n,i,e)||o===0&&Tv(t,n,i)||a===0&&Tv(t,e,i))}function Tv(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function bv(n){return n>0?1:n<0?-1:0}function E8(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&RB(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function uh(n,e){return Dn(n.prev,n,n.next)<0?Dn(n,e,n.next)>=0&&Dn(n,n.prev,e)>=0:Dn(n,e,n.prev)<0||Dn(n,n.next,e)<0}function C8(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function PB(n,e){const t=new kS(n.i,n.x,n.y),i=new kS(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function IB(n,e,t,i){const r=new kS(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function fh(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function kS(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T8(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function LB(n,e){for(let t=0;tNumber.EPSILON){const we=Math.sqrt(ae),Ee=Math.sqrt(W*W+U*U),ct=Te.x-qe/we,ze=Te.y+Ve/we,Qe=be.x-U/Ee,Rt=be.y+W/Ee,Pe=((Qe-ct)*U-(Rt-ze)*W)/(Ve*U-qe*W);He=ct+Ve*Pe-H.x,ye=ze+qe*Pe-H.y;const Ke=He*He+ye*ye;if(Ke<=2)return new Ae(He,ye);dt=Math.sqrt(Ke/2)}else{let we=!1;Ve>Number.EPSILON?W>Number.EPSILON&&(we=!0):Ve<-Number.EPSILON?W<-Number.EPSILON&&(we=!0):Math.sign(qe)===Math.sign(U)&&(we=!0),we?(He=-qe,ye=Ve,dt=Math.sqrt(ae)):(He=Ve,ye=qe,dt=Math.sqrt(ae/2))}return new Ae(He/dt,ye/dt)}const te=[];for(let H=0,Te=q.length,be=Te-1,He=H+1;H=0;H--){const Te=H/_,be=g*Math.cos(Te*Math.PI/2),He=v*Math.sin(Te*Math.PI/2)+A;for(let ye=0,dt=q.length;ye=0;){const He=be;let ye=be-1;ye<0&&(ye=H.length-1);for(let dt=0,Ve=d+_*2;dt0)&&g.push(S,w,P),(m!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class kB extends $n{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ke(16777215),this.specular=new ke(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ur,this.combine=Sd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class zB extends $n{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ke(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class HB extends $n{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class GB extends $n{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ke(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ur,this.combine=Sd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class VB extends $n{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ke(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=da,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class WB extends Fi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ul(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function XB(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function jB(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function zS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function HS(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function I8(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){h.push(c.times[g]);for(let A=0;As.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const m=v*h+d,x=m+h-d;A=a.values.slice(m,x)}else{const m=a.createInterpolant(),x=d,S=h-d;m.evaluate(s),A=m.resultBuffer.slice(x,S)}l==="quaternion"&&new Ii().fromArray(A).normalize().conjugate().toArray(A);const _=c.times.length;for(let m=0;m<_;++m){const x=m*g+p;if(l==="quaternion")Ii.multiplyQuaternionsFlat(c.values,x,A,0,c.values,x);else{const S=g-p*2;for(let w=0;w=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&XB(r))for(let a=0,l=r.length;a!==l;++a){const c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===Sg,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,c=0;c!==i;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Cs.prototype.TimeBufferType=Float32Array,Cs.prototype.ValueBufferType=Float32Array,Cs.prototype.DefaultInterpolation=nu;class Ol extends Cs{constructor(e,t,i){super(e,t,i)}}Ol.prototype.ValueTypeName="bool",Ol.prototype.ValueBufferType=Array,Ol.prototype.DefaultInterpolation=tu,Ol.prototype.InterpolantFactoryMethodLinear=void 0,Ol.prototype.InterpolantFactoryMethodSmooth=void 0;class VS extends Cs{}VS.prototype.ValueTypeName="color";class kl extends Cs{}kl.prototype.ValueTypeName="number";class YB extends Nu{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let c=e*a;for(let d=c+a;c!==d;c+=4)Ii.slerpFlat(s,0,o,c-a,o,c,l);return s}}class zl extends Cs{InterpolantFactoryMethodLinear(e){return new YB(this.times,this.values,this.getValueSize(),e)}}zl.prototype.ValueTypeName="quaternion",zl.prototype.InterpolantFactoryMethodSmooth=void 0;class Hl extends Cs{constructor(e,t,i){super(e,t,i)}}Hl.prototype.ValueTypeName="string",Hl.prototype.ValueBufferType=Array,Hl.prototype.DefaultInterpolation=tu,Hl.prototype.InterpolantFactoryMethodLinear=void 0,Hl.prototype.InterpolantFactoryMethodSmooth=void 0;class Gl extends Cs{}Gl.prototype.ValueTypeName="vector";class Uu{constructor(e="",t=-1,i=[],r=Mg){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=br(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(F8(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Cs.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const h=d[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,g,v,A){if(g.length!==0){const _=[],m=[];HS(g,_,m,v),_.length!==0&&A.push(new h(p,_,m))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Ro[e]!==void 0){Ro[e].push({onLoad:t,onProgress:i,onError:r});return}Ro[e]=[],Ro[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||c.body===void 0||c.body.getReader===void 0)return c;const d=Ro[e],h=c.body.getReader(),p=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),g=p?parseInt(p):0,v=g!==0;let A=0;const _=new ReadableStream({start(m){x();function x(){h.read().then(({done:S,value:w})=>{if(S)m.close();else{A+=w.byteLength;const I=new ProgressEvent("progress",{lengthComputable:v,loaded:A,total:g});for(let P=0,D=d.length;P{m.error(S)})}}});return new Response(_)}else throw new N8(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(d=>new DOMParser().parseFromString(d,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,g=new TextDecoder(p);return c.arrayBuffer().then(v=>g.decode(v))}}}).then(c=>{bo.add(e,c);const d=Ro[e];delete Ro[e];for(let h=0,p=d.length;h{const d=Ro[e];if(d===void 0)throw this.manager.itemError(e),c;delete Ro[e];for(let h=0,p=d.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class U8 extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Lr(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new ke().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new on().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Dt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new mt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ae().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ae().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:UB,SpriteMaterial:mS,RawShaderMaterial:OB,ShaderMaterial:Ss,PointsMaterial:dv,MeshPhysicalMaterial:qr,MeshStandardMaterial:ph,MeshPhongMaterial:kB,MeshToonMaterial:zB,MeshNormalMaterial:HB,MeshLambertMaterial:GB,MeshDepthMaterial:fS,MeshDistanceMaterial:dS,MeshBasicMaterial:Ir,MeshMatcapMaterial:VB,LineDashedMaterial:WB,LineBasicMaterial:Fi,Material:$n};return new t[e]}}class wa{static decodeText(e){if(console.warn("THREE.LoaderUtils: decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead."),typeof TextDecoder!="undefined")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new WS(t);s=new mh(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,d=e.length;c0){r=new mh(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const _=new Bi;_.min.fromArray(A.boxMin),_.max.fromArray(A.boxMax);const m=new _i;return m.radius=A.sphereRadius,m.center.fromArray(A.sphereCenter),{boxInitialized:A.boxInitialized,box:_,sphereInitialized:A.sphereInitialized,sphere:m}}),o._maxInstanceCount=e.maxInstanceCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=c(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(o._colorsTexture=c(e.colorsTexture.uuid));break;case"LOD":o=new iB;break;case"Line":o=new To(a(e.geometry),l(e.material));break;case"LineLoop":o=new ES(a(e.geometry),l(e.material));break;case"LineSegments":o=new ws(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new TS(a(e.geometry),l(e.material));break;case"Sprite":o=new tB(l(e.material));break;case"Group":o=new Co;break;case"Bone":o=new rv;break;default:o=new jt}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(o.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let g=0;g{t&&t(c),s.manager.itemEnd(e)}).catch(c=>{r&&r(c)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){return bo.add(e,c),t&&t(c),s.manager.itemEnd(e),c}).catch(function(c){r&&r(c),bo.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});bo.add(e,l),s.manager.itemStart(e)}}let Ov;class qS{static getContext(){return Ov===void 0&&(Ov=new(window.AudioContext||window.webkitAudioContext)),Ov}static setContext(e){Ov=e}}class j8 extends Ni{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Lr(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);qS.getContext().decodeAudioData(c,function(h){t(h)}).catch(a)}catch(c){a(c)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const f2=new mt,d2=new mt,Vl=new mt;class J8{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ai,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ai,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Vl.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Al*t.fov*.5)/t.zoom;let a,l;d2.elements[12]=-r,f2.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,Vl.elements[0]=2*t.near/(l-a),Vl.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Vl),a=-o*t.aspect-s,l=o*t.aspect-s,Vl.elements[0]=2*t.near/(l-a),Vl.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Vl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(d2),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(f2)}}class ZS{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=h2(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=h2();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function h2(){return(typeof performance=="undefined"?Date:performance).now()}const Wl=new G,p2=new Ii,K8=new G,Xl=new G;class Y8 extends jt{constructor(){super(),this.type="AudioListener",this.context=qS.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ZS}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Wl,p2,K8),Xl.set(0,0,-1).applyQuaternion(p2),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Wl.x,r),t.positionY.linearRampToValueAtTime(Wl.y,r),t.positionZ.linearRampToValueAtTime(Wl.z,r),t.forwardX.linearRampToValueAtTime(Xl.x,r),t.forwardY.linearRampToValueAtTime(Xl.y,r),t.forwardZ.linearRampToValueAtTime(Xl.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(Wl.x,Wl.y,Wl.z),t.setOrientation(Xl.x,Xl.y,Xl.z,i.x,i.y,i.z)}}class m2 extends jt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Ii.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Ii.multiplyQuaternionsFlat(e,o,e,t,e,i),Ii.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const $S="\\[\\]\\.:\\/",$8=new RegExp("["+$S+"]","g"),e1="[^"+$S+"]",e6="[^"+$S.replace("\\.","")+"]",t6=/((?:WC+[\/:])*)/.source.replace("WC",e1),n6=/(WCOD+)?/.source.replace("WCOD",e6),i6=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",e1),r6=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",e1),s6=new RegExp("^"+t6+n6+i6+r6+"$"),o6=["material","materials","bones","map"];class a6{constructor(e,t,i){const r=i||Kt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class Kt{constructor(e,t,i){this.path=t,this.parsedPath=i||Kt.parseTrackName(t),this.node=Kt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new Kt.Composite(e,t,i):new Kt(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace($8,"")}static parseTrackName(e){const t=s6.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);o6.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=d,e[d]=p,t[c]=h,e[h]=l;for(let g=0,v=r;g!==v;++g){const A=i[g],_=A[h],m=A[d];A[d]=_,A[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],d=c.uuid,h=t[d];if(h!==void 0)if(delete t[d],h0&&(t[g.uuid]=h),e[h]=g,e.pop();for(let v=0,A=r;v!==A;++v){const _=i[v];_[h]=_[p],_.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,d=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(h);for(let p=d,g=l.length;p!==g;++p){const v=l[p];h[p]=new Kt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class y2{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:yl,endingEnd:yl};for(let c=0;c!==o;++c){const d=s[c].createInterpolant(null);a[c]=d,d.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LP,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+i,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case bA:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),c[d].accumulateAdditive(a);break;case Mg:default:for(let d=0,h=l.length;d!==h;++d)l[d].evaluate(o),c[d].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===DP;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===BP){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=xl,r.endingEnd=xl):(e?r.endingStart=this.zeroSlopeAtStart?xl:yl:r.endingStart=Id,t?r.endingEnd=this.zeroSlopeAtEnd?xl:yl:r.endingEnd=Id)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const c6=new Float32Array(1);class u6 extends xo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,c=this._bindingsByRootAndName;let d=c[l];d===void 0&&(d={},c[l]=d);for(let h=0;h!==s;++h){const p=r[h],g=p.name;let v=d[g];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,g));continue}const A=t&&t._propertyBindings[h].binding.parsedPath;v=new v2(Kt.create(i,g,A),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,g),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,S2).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const M2=new G,kv=new G;class y6{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){M2.subVectors(e,this.start),kv.subVectors(this.end,this.start);const i=kv.dot(kv);let s=kv.dot(M2)/i;return t&&(s=zn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const w2=new G;class x6 extends jt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new Pt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{P2.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(P2,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class B6 extends ws{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Pt;r.setAttribute("position",new rt(t,3)),r.setAttribute("color",new rt(i,3));const s=new Fi({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new ke,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class L6{constructor(){this.type="ShapePath",this.color=new ke,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new ah,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const x=[];for(let S=0,w=m.length;SNumber.EPSILON){if(T<0&&(D=x[P],B=-B,N=x[I],T=-T),m.yN.y)continue;if(m.y===D.y){if(m.x===D.x)return!0}else{const F=T*(m.x-D.x)-B*(m.y-D.y);if(F===0)return!0;if(F<0)continue;w=!w}}else{if(m.y!==D.y)continue;if(N.x<=m.x&&m.x<=D.x||D.x<=m.x&&m.x<=N.x)return!0}}return w}const r=Vs.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new Fl,l.curves=a.curves,c.push(l),c;let d=!r(s[0].getPoints());d=e?!d:d;const h=[],p=[];let g=[],v=0,A;p[v]=void 0,g[v]=[];for(let m=0,x=s.length;m1){let m=!1,x=0;for(let S=0,w=p.length;S0&&m===!1&&(g=h)}let _;for(let m=0,x=p.length;mt=>(i,r)=>{i[n]===void 0&&(i[n]=new G(e)),i[n].setComponent(t,r)},N6=(n,e)=>t=>(i,r)=>{i[n]===void 0&&(i[n]=new ur(e));const s=i[n];s[t]=r},B2=n=>(e,t)=>{e[n]===void 0&&(e[n]=new ke(t)),e[n].set(t)},o1=I2("scale",1),a1=I2("position",0),l1=N6("rotation",0),L2={x:a1(0),y:a1(1),z:a1(2),scale:(n,e)=>{n.scale===void 0&&(n.scale=new G(1)),n.scale.set(e,e,e)},scaleX:o1(0),scaleY:o1(1),scaleZ:o1(2),rotateX:l1("x"),rotateY:l1("y"),rotateZ:l1("z"),color:B2("color"),specular:B2("specular")};function U6(n,e,t){e in L2?L2[e](n,t[e]):(e==="opacity"&&!n.transparent&&(n.transparent=!0),n[e]=t[e])}const c1=(n,e)=>t=>i=>{const r=i[n];return r?r[t]:e},u1=c1("position",0),Xv=c1("scale",1),f1=c1("rotation",0),D2={x:u1("x"),y:u1("y"),z:u1("z"),scale:Xv("x"),scaleX:Xv("x"),scaleY:Xv("y"),scaleZ:Xv("z"),rotateX:f1("x"),rotateY:f1("y"),rotateZ:f1("z")};function O6(n){if(n!==void 0)return n instanceof ke?n.getStyle():n}function k6(n,e){return e in D2?D2[e](n):O6(n[e])||0}const z6=["x","y","z"],F2={"position-x":"x","position-y":"y","position-z":"z","rotation-x":"rotateX","rotation-y":"rotateY","rotation-z":"rotateZ","scale-x":"scaleX","scale-y":"scaleY","scale-z":"scaleZ"},N2=(n,e)=>{const t={};let i;for(i in n){const r=n[i];if(Tn(r)||Tn(e[i])){const s=F2[i]||i;t[s]=r}else if(Array.isArray(r))for(let s=0;s({});class G6 extends DR{constructor(){super(...arguments),this.type="three",this.measureInstanceViewportBox=On}readValueFromInstance(e,t){return k6(e,t)}getBaseTargetFromProps(){}sortInstanceNodePosition(e,t){return e.id-t.id}removeValueFromRenderState(){}scrapeMotionValuesFromProps(e,t){return N2(e,t)}build(e,t){for(const i in t)e[i]=t[i]}renderInstance(e,t){for(const i in t)U6(e,i,t)}}const V6=(n,e)=>new G6(e,{}),W6=rA({scrapeMotionValuesFromProps:N2,createRenderState:H6}),X6=Object.assign({},ZT);function U2(n){return yR({Component:n,preloadedFeatures:X6,useRender:dH,useVisualState:W6,createVisualElement:V6})}const d1=new Map,O2=new Proxy(U2,{get:(n,e)=>(!d1.has(e)&&d1.set(e,U2(e)),d1.get(e))});var k2={exports:{}},Kl={};/** * @license React * react-reconciler-constants.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */Kl.ConcurrentRoot=1,Kl.ContinuousEventPriority=4,Kl.DefaultEventPriority=16,Kl.DiscreteEventPriority=1,Kl.IdleEventPriority=536870912,Kl.LegacyRoot=0,k2.exports=Kl;var Ou=k2.exports;function j6(n){let e;const t=new Set,i=(c,d)=>{const h=typeof c=="function"?c(e):c;if(h!==e){const p=e;e=d?h:Object.assign({},e,h),t.forEach(g=>g(e,p))}},r=()=>e,s=(c,d=r,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=d(e);function g(){const v=d(e);if(!h(p,v)){const A=p;c(p=v,A)}}return t.add(g),()=>t.delete(g)},l={setState:i,getState:r,subscribe:(c,d,h)=>d||h?s(c,d,h):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=n(i,r,l),l}const z2=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?pe.useEffect:pe.useLayoutEffect;function J6(n){const e=typeof n=="function"?j6(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=pe.useReducer(_=>_+1,0),o=e.getState(),a=pe.useRef(o),l=pe.useRef(i),c=pe.useRef(r),d=pe.useRef(!1),h=pe.useRef();h.current===void 0&&(h.current=i(o));let p,g=!1;(a.current!==o||l.current!==i||c.current!==r||d.current)&&(p=i(o),g=!r(h.current,p)),z2(()=>{g&&(h.current=p),a.current=o,l.current=i,c.current=r,d.current=!1});const v=pe.useRef(o);z2(()=>{const _=()=>{try{const x=e.getState(),S=l.current(x);c.current(h.current,S)||(a.current=x,h.current=S,s())}catch(x){d.current=!0,s()}},m=e.subscribe(_);return e.getState()!==v.current&&_(),m},[]);const A=g?p:h.current;return pe.useDebugValue(A),A};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,e];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},t}const K6=n=>typeof n=="object"&&typeof n.then=="function",Yl=[];function H2(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Yl.indexOf(r);s!==-1&&Yl.splice(s,1)},promise:(K6(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Yl.push(r),!t)throw r.promise}const Y6=(n,e,t)=>G2(n,e,!1,t),Q6=(n,e,t)=>void G2(n,e,!0,t),q6=n=>{if(n===void 0||n.length===0)Yl.splice(0,Yl.length);else{const e=Yl.find(t=>H2(n,t.keys,t.equal));e&&e.remove()}};var V2={exports:{}},W2={exports:{}},X2={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(n){function e(z,te){var ie=z.length;z.push(te);e:for(;0>>1,Ce=z[fe];if(0>>1;fer(Me,ie))Ier(Be,Me)?(z[fe]=Be,z[Ie]=ie,fe=Ie):(z[fe]=Me,z[re]=ie,fe=re);else if(Ier(Be,ie))z[fe]=Be,z[Ie]=ie,fe=Ie;else break e}}return te}function r(z,te){var ie=z.sortIndex-te.sortIndex;return ie!==0?ie:z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,h=null,p=3,g=!1,v=!1,A=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(z){for(var te=t(c);te!==null;){if(te.callback===null)i(c);else if(te.startTime<=z)i(c),te.sortIndex=te.expirationTime,e(l,te);else break;te=t(c)}}function w(z){if(A=!1,S(z),!v)if(t(l)!==null)v=!0,K(I);else{var te=t(c);te!==null&&ge(w,te.startTime-z)}}function I(z,te){v=!1,A&&(A=!1,m(N),N=-1),g=!0;var ie=p;try{for(S(te),h=t(l);h!==null&&(!(h.expirationTime>te)||z&&!F());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,p=h.priorityLevel;var Ce=fe(h.expirationTime<=te);te=n.unstable_now(),typeof Ce=="function"?h.callback=Ce:h===t(l)&&i(l),S(te)}else i(l);h=t(l)}if(h!==null)var ot=!0;else{var re=t(c);re!==null&&ge(w,re.startTime-te),ot=!1}return ot}finally{h=null,p=ie,g=!1}}var P=!1,D=null,N=-1,B=5,T=-1;function F(){return!(n.unstable_now()-Tz||125fe?(z.sortIndex=ie,e(c,z),t(l)===null&&z===t(c)&&(A?(m(N),N=-1):A=!0,ge(w,ie-fe))):(z.sortIndex=Ce,e(l,z),v||g||(v=!0,K(I))),z},n.unstable_shouldYield=F,n.unstable_wrapCallback=function(z){var te=p;return function(){var ie=p;p=te;try{return z.apply(this,arguments)}finally{p=ie}}}})(X2),W2.exports=X2;var h1=W2.exports;/** * @license React * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Z6=function(e){var t={},i=pe,r=h1,s=Object.assign;function o(u){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+u,y=1;yQ||E[V]!==R[Q]){var he=` `+E[V].replace(" at new "," at ");return u.displayName&&he.includes("")&&(he=he.replace("",u.displayName)),he}while(1<=V&&0<=Q);break}}}finally{yt=!1,Error.prepareStackTrace=y}return(u=u?u.displayName||u.name:"")?ht(u):""}var Yt=Object.prototype.hasOwnProperty,ln=[],en=-1;function xn(u){return{current:u}}function st(u){0>en||(u.current=ln[en],ln[en]=null,en--)}function Ue(u,f){en++,ln[en]=u.current,u.current=f}var fn={},At=xn(fn),cn=xn(!1),Ui=fn;function Fn(u,f){var y=u.type.contextTypes;if(!y)return fn;var M=u.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===f)return M.__reactInternalMemoizedMaskedChildContext;var E={},R;for(R in y)E[R]=f[R];return M&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=f,u.__reactInternalMemoizedMaskedChildContext=E),E}function Yn(u){return u=u.childContextTypes,u!=null}function hn(){st(cn),st(At)}function dr(u,f,y){if(At.current!==fn)throw Error(o(168));Ue(At,f),Ue(cn,y)}function Xs(u,f,y){var M=u.stateNode;if(f=f.childContextTypes,typeof M.getChildContext!="function")return y;M=M.getChildContext();for(var E in M)if(!(E in f))throw Error(o(108,N(u)||"Unknown",E));return s({},y,M)}function ui(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||fn,Ui=At.current,Ue(At,u),Ue(cn,cn.current),!0}function Ia(u,f,y){var M=u.stateNode;if(!M)throw Error(o(169));y?(u=Xs(u,f,Ui),M.__reactInternalMemoizedMergedChildContext=u,st(cn),st(At),Ue(At,u)):st(cn),Ue(cn,y)}var qi=Math.clz32?Math.clz32:N1,Yu=Math.log,F1=Math.LN2;function N1(u){return u>>>=0,u===0?32:31-(Yu(u)/F1|0)|0}var Qu=64,Ba=4194304;function Bo(u){switch(u&-u){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return u&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return u}}function qu(u,f){var y=u.pendingLanes;if(y===0)return 0;var M=0,E=u.suspendedLanes,R=u.pingedLanes,V=y&268435455;if(V!==0){var Q=V&~E;Q!==0?M=Bo(Q):(R&=V,R!==0&&(M=Bo(R)))}else V=y&~E,V!==0?M=Bo(V):R!==0&&(M=Bo(R));if(M===0)return 0;if(f!==0&&f!==M&&!(f&E)&&(E=M&-M,R=f&-f,E>=R||E===16&&(R&4194240)!==0))return f;if(M&4&&(M|=y&16),f=u.entangledLanes,f!==0)for(u=u.entanglements,f&=M;0y;y++)f.push(u);return f}function $l(u,f,y){u.pendingLanes|=f,f!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,f=31-qi(f),u[f]=y}function O1(u,f){var y=u.pendingLanes&~f;u.pendingLanes=f,u.suspendedLanes=0,u.pingedLanes=0,u.expiredLanes&=f,u.mutableReadLanes&=f,u.entangledLanes&=f,f=u.entanglements;var M=u.eventTimes;for(u=u.expirationTimes;0>=V,E-=V,bs=1<<32-qi(f)+E|y<nn?(mi=Bt,Bt=null):mi=Bt.sibling;var rn=xt(se,Bt,ue[nn],Ye);if(rn===null){Bt===null&&(Bt=mi);break}u&&Bt&&rn.alternate===null&&f(se,Bt),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn,Bt=mi}if(nn===ue.length)return y(se,Bt),_n&&Do(se,nn),lt;if(Bt===null){for(;nnnn?(mi=Bt,Bt=null):mi=Bt.sibling;var ja=xt(se,Bt,rn.value,Ye);if(ja===null){Bt===null&&(Bt=mi);break}u&&Bt&&ja.alternate===null&&f(se,Bt),ee=R(ja,ee,nn),Ot===null?lt=ja:Ot.sibling=ja,Ot=ja,Bt=mi}if(rn.done)return y(se,Bt),_n&&Do(se,nn),lt;if(Bt===null){for(;!rn.done;nn++,rn=ue.next())rn=It(se,rn.value,Ye),rn!==null&&(ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn);return _n&&Do(se,nn),lt}for(Bt=M(se,Bt);!rn.done;nn++,rn=ue.next())rn=pn(Bt,se,nn,rn.value,Ye),rn!==null&&(u&&rn.alternate!==null&&Bt.delete(rn.key===null?nn:rn.key),ee=R(rn,ee,nn),Ot===null?lt=rn:Ot.sibling=rn,Ot=rn);return u&&Bt.forEach(function(sj){return f(se,sj)}),_n&&Do(se,nn),lt}function ss(se,ee,ue,Ye){if(typeof ue=="object"&&ue!==null&&ue.type===d&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var lt=ue.key,Ot=ee;Ot!==null;){if(Ot.key===lt){if(lt=ue.type,lt===d){if(Ot.tag===7){y(se,Ot.sibling),ee=E(Ot,ue.props.children),ee.return=se,se=ee;break e}}else if(Ot.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===S&&b(lt)===Ot.type){y(se,Ot.sibling),ee=E(Ot,ue.props),ee.ref=nc(se,Ot,ue),ee.return=se,se=ee;break e}y(se,Ot);break}else f(se,Ot);Ot=Ot.sibling}ue.type===d?(ee=uc(ue.props.children,se.mode,Ye,ue.key),ee.return=se,se=ee):(Ye=V0(ue.type,ue.key,ue.props,null,se.mode,Ye),Ye.ref=nc(se,ee,ue),Ye.return=se,se=Ye)}return V(se);case c:e:{for(Ot=ue.key;ee!==null;){if(ee.key===Ot)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){y(se,ee.sibling),ee=E(ee,ue.children||[]),ee.return=se,se=ee;break e}else{y(se,ee);break}else f(se,ee);ee=ee.sibling}ee=EM(ue,se.mode,Ye),ee.return=se,se=ee}return V(se);case S:return Ot=ue._init,ss(se,ee,Ot(ue._payload),Ye)}if($(ue))return ut(se,ee,ue,Ye);if(P(ue))return zi(se,ee,ue,Ye);af(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,ee!==null&&ee.tag===6?(y(se,ee.sibling),ee=E(ee,ue),ee.return=se,se=ee):(y(se,ee),ee=wM(ue,se.mode,Ye),ee.return=se,se=ee),V(se)):y(se,ee)}return ss}var L=C(!0),k=C(!1),j={},ce=xn(j),de=xn(j),Fe=xn(j);function Je(u){if(u===j)throw Error(o(174));return u}function gt(u,f){Ue(Fe,f),Ue(de,u),Ue(ce,j),u=ge(f),st(ce),Ue(ce,u)}function pt(){st(ce),st(de),st(Fe)}function Nn(u){var f=Je(Fe.current),y=Je(ce.current);f=z(y,u.type,f),y!==f&&(Ue(de,u),Ue(ce,f))}function Vn(u){de.current===u&&(st(ce),st(de))}var qt=xn(0);function Ps(u){for(var f=u;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Zl(y)||ba(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ge=[];function at(){for(var u=0;uy?y:4,u(!0);var M=zt.transition;zt.transition={};try{u(!1),f()}finally{Qt=y,zt.transition=M}}function XL(){return Qs().memoizedState}function BX(u,f,y){var M=Va(u);y={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null},jL(u)?JL(f,y):(KL(u,f,y),y=tr(),u=is(u,M,y),u!==null&&YL(u,f,M))}function LX(u,f,y){var M=Va(u),E={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null};if(jL(u))JL(f,E);else{KL(u,f,E);var R=u.alternate;if(u.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var V=f.lastRenderedState,Q=R(V,y);if(E.hasEagerState=!0,E.eagerState=Q,es(Q,V))return}catch(he){}finally{}y=tr(),u=is(u,M,y),u!==null&&YL(u,f,M)}}function jL(u){var f=u.alternate;return u===Ht||f!==null&&f===Ht}function JL(u,f){ic=za=!0;var y=u.pending;y===null?f.next=f:(f.next=y.next,y.next=f),u.pending=f}function KL(u,f,y){ti!==null&&u.mode&1&&!(Gt&2)?(u=f.interleaved,u===null?(y.next=y,ts===null?ts=[f]:ts.push(f)):(y.next=u.next,u.next=y),f.interleaved=y):(u=f.pending,u===null?y.next=y:(y.next=u.next,u.next=y),f.pending=y)}function YL(u,f,y){if(y&4194240){var M=f.lanes;M&=u.pendingLanes,y|=M,f.lanes=y,Eh(u,y)}}var _0={readContext:pr,useCallback:Oi,useContext:Oi,useEffect:Oi,useImperativeHandle:Oi,useInsertionEffect:Oi,useLayoutEffect:Oi,useMemo:Oi,useReducer:Oi,useRef:Oi,useState:Oi,useDebugValue:Oi,useDeferredValue:Oi,useTransition:Oi,useMutableSource:Oi,useSyncExternalStore:Oi,useId:Oi,unstable_isNewReconciler:!1},DX={readContext:pr,useCallback:function(u,f){return Fo().memoizedState=[u,f===void 0?null:f],u},useContext:pr,useEffect:Q1,useImperativeHandle:function(u,f,y){return y=y!=null?y.concat([u]):null,y0(4194308,4,HL.bind(null,f,u),y)},useLayoutEffect:function(u,f){return y0(4194308,4,u,f)},useInsertionEffect:function(u,f){return y0(4,2,u,f)},useMemo:function(u,f){var y=Fo();return f=f===void 0?null:f,u=u(),y.memoizedState=[u,f],u},useReducer:function(u,f,y){var M=Fo();return f=y!==void 0?y(f):f,M.memoizedState=M.baseState=f,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:f},M.queue=u,u=u.dispatch=BX.bind(null,Ht,u),[M.memoizedState,u]},useRef:function(u){var f=Fo();return u={current:u},f.memoizedState=u},useState:Y1,useDebugValue:q1,useDeferredValue:function(u){var f=Y1(u),y=f[0],M=f[1];return Q1(function(){var E=zt.transition;zt.transition={};try{M(u)}finally{zt.transition=E}},[u]),y},useTransition:function(){var u=Y1(!1),f=u[0];return u=IX.bind(null,u[1]),Fo().memoizedState=u,[f,u]},useMutableSource:function(){},useSyncExternalStore:function(u,f,y){var M=Ht,E=Fo();if(_n){if(y===void 0)throw Error(o(407));y=y()}else{if(y=f(),ti===null)throw Error(o(349));dn&30||DL(M,f,y)}E.memoizedState=y;var R={value:y,getSnapshot:f};return E.queue=R,Q1(NL.bind(null,M,R,u),[u]),M.flags|=2048,Gh(9,FL.bind(null,M,R,y,f),void 0,null),y},useId:function(){var u=Fo(),f=ti.identifierPrefix;if(_n){var y=Rs,M=bs;y=(M&~(1<<32-qi(M)-1)).toString(32)+y,f=":"+f+"R"+y,y=Hh++,0gM&&(f.flags|=128,M=!0,jh(E,!1),f.lanes=4194304)}else{if(!M)if(u=Ps(R),u!==null){if(f.flags|=128,M=!0,u=u.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),jh(E,!0),E.tail===null&&E.tailMode==="hidden"&&!R.alternate&&!_n)return ki(f),null}else 2*Qn()-E.renderingStartTime>gM&&y!==1073741824&&(f.flags|=128,M=!0,jh(E,!1),f.lanes=4194304);E.isBackwards?(R.sibling=f.child,f.child=R):(u=E.last,u!==null?u.sibling=R:f.child=R,E.last=R)}return E.tail!==null?(f=E.tail,E.rendering=f,E.tail=f.sibling,E.renderingStartTime=Qn(),f.sibling=null,u=qt.current,Ue(qt,M?u&1|2:u&1),f):(ki(f),null);case 22:case 23:return AM(),M=f.memoizedState!==null,u!==null&&u.memoizedState!==null!==M&&(f.flags|=8192),M&&f.mode&1?Or&1073741824&&(ki(f),Mt&&f.subtreeFlags&6&&(f.flags|=8192)):ki(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var kX=a.ReactCurrentOwner,Ur=!1;function er(u,f,y,M){f.child=u===null?k(f,null,y,M):L(f,u.child,y,M)}function iD(u,f,y,M,E){y=y.render;var R=f.ref;return Fa(f,E),M=J1(u,f,y,M,R,E),y=K1(),u!==null&&!Ur?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~E,No(u,f,E)):(_n&&y&&Fh(f),f.flags|=1,er(u,f,M,E),f.child)}function rD(u,f,y,M,E){if(u===null){var R=y.type;return typeof R=="function"&&!MM(R)&&R.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(f.tag=15,f.type=R,sD(u,f,R,M,E)):(u=V0(y.type,null,M,f,f.mode,E),u.ref=f.ref,u.return=f,f.child=u)}if(R=u.child,!(u.lanes&E)){var V=R.memoizedProps;if(y=y.compare,y=y!==null?y:ef,y(V,M)&&u.ref===f.ref)return No(u,f,E)}return f.flags|=1,u=Xa(R,M),u.ref=f.ref,u.return=f,f.child=u}function sD(u,f,y,M,E){if(u!==null&&ef(u.memoizedProps,M)&&u.ref===f.ref)if(Ur=!1,(u.lanes&E)!==0)u.flags&131072&&(Ur=!0);else return f.lanes=u.lanes,No(u,f,E);return eM(u,f,y,M,E)}function oD(u,f,y){var M=f.pendingProps,E=M.children,R=u!==null?u.memoizedState:null;if(M.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},Ue(lf,Or),Or|=y;else if(y&1073741824)f.memoizedState={baseLanes:0,cachePool:null},M=R!==null?R.baseLanes:y,Ue(lf,Or),Or|=M;else return u=R!==null?R.baseLanes|y:y,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:u,cachePool:null},f.updateQueue=null,Ue(lf,Or),Or|=u,null;else R!==null?(M=R.baseLanes|y,f.memoizedState=null):M=y,Ue(lf,Or),Or|=M;return er(u,f,E,y),f.child}function aD(u,f){var y=f.ref;(u===null&&y!==null||u!==null&&u.ref!==y)&&(f.flags|=512,f.flags|=2097152)}function eM(u,f,y,M,E){var R=Yn(y)?Ui:At.current;return R=Fn(f,R),Fa(f,E),y=J1(u,f,y,M,R,E),M=K1(),u!==null&&!Ur?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~E,No(u,f,E)):(_n&&M&&Fh(f),f.flags|=1,er(u,f,y,E),f.child)}function lD(u,f,y,M,E){if(Yn(y)){var R=!0;ui(f)}else R=!1;if(Fa(f,E),f.stateNode===null)u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),f0(f,y,M),Dh(f,y,M,E),M=!0;else if(u===null){var V=f.stateNode,Q=f.memoizedProps;V.props=Q;var he=V.context,Ne=y.contextType;typeof Ne=="object"&&Ne!==null?Ne=pr(Ne):(Ne=Yn(y)?Ui:At.current,Ne=Fn(f,Ne));var it=y.getDerivedStateFromProps,It=typeof it=="function"||typeof V.getSnapshotBeforeUpdate=="function";It||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==M||he!==Ne)&&d0(f,V,M,Ne),Js=!1;var xt=f.memoizedState;V.state=xt,rf(f,M,V,E),he=f.memoizedState,Q!==M||xt!==he||cn.current||Js?(typeof it=="function"&&(sf(f,y,it,M),he=f.memoizedState),(Q=Js||u0(f,y,Q,M,xt,he,Ne))?(It||typeof V.UNSAFE_componentWillMount!="function"&&typeof V.componentWillMount!="function"||(typeof V.componentWillMount=="function"&&V.componentWillMount(),typeof V.UNSAFE_componentWillMount=="function"&&V.UNSAFE_componentWillMount()),typeof V.componentDidMount=="function"&&(f.flags|=4194308)):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=he),V.props=M,V.state=he,V.context=Ne,M=Q):(typeof V.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{V=f.stateNode,o0(u,f),Q=f.memoizedProps,Ne=f.type===f.elementType?Q:Nr(f.type,Q),V.props=Ne,It=f.pendingProps,xt=V.context,he=y.contextType,typeof he=="object"&&he!==null?he=pr(he):(he=Yn(y)?Ui:At.current,he=Fn(f,he));var pn=y.getDerivedStateFromProps;(it=typeof pn=="function"||typeof V.getSnapshotBeforeUpdate=="function")||typeof V.UNSAFE_componentWillReceiveProps!="function"&&typeof V.componentWillReceiveProps!="function"||(Q!==It||xt!==he)&&d0(f,V,M,he),Js=!1,xt=f.memoizedState,V.state=xt,rf(f,M,V,E);var ut=f.memoizedState;Q!==It||xt!==ut||cn.current||Js?(typeof pn=="function"&&(sf(f,y,pn,M),ut=f.memoizedState),(Ne=Js||u0(f,y,Ne,M,xt,ut,he)||!1)?(it||typeof V.UNSAFE_componentWillUpdate!="function"&&typeof V.componentWillUpdate!="function"||(typeof V.componentWillUpdate=="function"&&V.componentWillUpdate(M,ut,he),typeof V.UNSAFE_componentWillUpdate=="function"&&V.UNSAFE_componentWillUpdate(M,ut,he)),typeof V.componentDidUpdate=="function"&&(f.flags|=4),typeof V.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof V.componentDidUpdate!="function"||Q===u.memoizedProps&&xt===u.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&xt===u.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=ut),V.props=M,V.state=ut,V.context=he,M=Ne):(typeof V.componentDidUpdate!="function"||Q===u.memoizedProps&&xt===u.memoizedState||(f.flags|=4),typeof V.getSnapshotBeforeUpdate!="function"||Q===u.memoizedProps&&xt===u.memoizedState||(f.flags|=1024),M=!1)}return tM(u,f,y,M,R,E)}function tM(u,f,y,M,E,R){aD(u,f);var V=(f.flags&128)!==0;if(!M&&!V)return E&&Ia(f,y,!1),No(u,f,R);M=f.stateNode,kX.current=f;var Q=V&&typeof y.getDerivedStateFromError!="function"?null:M.render();return f.flags|=1,u!==null&&V?(f.child=L(f,u.child,null,R),f.child=L(f,null,Q,R)):er(u,f,Q,R),f.memoizedState=M.state,E&&Ia(f,y,!0),f.child}function cD(u){var f=u.stateNode;f.pendingContext?dr(u,f.pendingContext,f.pendingContext!==f.context):f.context&&dr(u,f.context,!1),gt(u,f.containerInfo)}function uD(u,f,y,M,E){return ka(),zh(E),f.flags|=256,er(u,f,y,M),f.child}var M0={dehydrated:null,treeContext:null,retryLane:0};function w0(u){return{baseLanes:u,cachePool:null}}function fD(u,f,y){var M=f.pendingProps,E=qt.current,R=!1,V=(f.flags&128)!==0,Q;if((Q=V)||(Q=u!==null&&u.memoizedState===null?!1:(E&2)!==0),Q?(R=!0,f.flags&=-129):(u===null||u.memoizedState!==null)&&(E|=1),Ue(qt,E&1),u===null)return Oh(f),u=f.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?(f.mode&1?ba(u)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(E=M.children,u=M.fallback,R?(M=f.mode,R=f.child,E={mode:"hidden",children:E},!(M&1)&&R!==null?(R.childLanes=0,R.pendingProps=E):R=W0(E,M,0,null),u=uc(u,M,y,null),R.return=f,u.return=f,R.sibling=u,f.child=R,f.child.memoizedState=w0(y),f.memoizedState=M0,u):nM(f,E));if(E=u.memoizedState,E!==null){if(Q=E.dehydrated,Q!==null){if(V)return f.flags&256?(f.flags&=-257,E0(u,f,y,Error(o(422)))):f.memoizedState!==null?(f.child=u.child,f.flags|=128,null):(R=M.fallback,E=f.mode,M=W0({mode:"visible",children:M.children},E,0,null),R=uc(R,E,y,null),R.flags|=2,M.return=f,R.return=f,M.sibling=R,f.child=M,f.mode&1&&L(f,u.child,null,y),f.child.memoizedState=w0(y),f.memoizedState=M0,R);if(!(f.mode&1))f=E0(u,f,y,null);else if(ba(Q))f=E0(u,f,y,Error(o(419)));else if(M=(y&u.childLanes)!==0,Ur||M){if(M=ti,M!==null){switch(y&-y){case 4:R=2;break;case 16:R=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:R=32;break;case 536870912:R=268435456;break;default:R=0}M=R&(M.suspendedLanes|y)?0:R,M!==0&&M!==E.retryLane&&(E.retryLane=M,is(u,M,-1))}SM(),f=E0(u,f,y,Error(o(421)))}else Zl(Q)?(f.flags|=128,f.child=u.child,f=ZX.bind(null,u),Ra(Q,f),f=null):(y=E.treeContext,Te&&($i=Ju(Q),Zi=f,_n=!0,Si=null,tc=!1,y!==null&&(mr[gr++]=bs,mr[gr++]=Rs,mr[gr++]=Lo,bs=y.id,Rs=y.overflow,Lo=f)),f=nM(f,f.pendingProps.children),f.flags|=4096);return f}return R?(M=hD(u,f,M.children,M.fallback,y),R=f.child,E=u.child.memoizedState,R.memoizedState=E===null?w0(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=u.childLanes&~y,f.memoizedState=M0,M):(y=dD(u,f,M.children,y),f.memoizedState=null,y)}return R?(M=hD(u,f,M.children,M.fallback,y),R=f.child,E=u.child.memoizedState,R.memoizedState=E===null?w0(y):{baseLanes:E.baseLanes|y,cachePool:null},R.childLanes=u.childLanes&~y,f.memoizedState=M0,M):(y=dD(u,f,M.children,y),f.memoizedState=null,y)}function nM(u,f){return f=W0({mode:"visible",children:f},u.mode,0,null),f.return=u,u.child=f}function dD(u,f,y,M){var E=u.child;return u=E.sibling,y=Xa(E,{mode:"visible",children:y}),!(f.mode&1)&&(y.lanes=M),y.return=f,y.sibling=null,u!==null&&(M=f.deletions,M===null?(f.deletions=[u],f.flags|=16):M.push(u)),f.child=y}function hD(u,f,y,M,E){var R=f.mode;u=u.child;var V=u.sibling,Q={mode:"hidden",children:y};return!(R&1)&&f.child!==u?(y=f.child,y.childLanes=0,y.pendingProps=Q,f.deletions=null):(y=Xa(u,Q),y.subtreeFlags=u.subtreeFlags&14680064),V!==null?M=Xa(V,M):(M=uc(M,R,E,null),M.flags|=2),M.return=f,y.return=f,y.sibling=M,f.child=y,M}function E0(u,f,y,M){return M!==null&&zh(M),L(f,u.child,null,y),u=nM(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function pD(u,f,y){u.lanes|=f;var M=u.alternate;M!==null&&(M.lanes|=f),Bh(u.return,f,y)}function iM(u,f,y,M,E){var R=u.memoizedState;R===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:E}:(R.isBackwards=f,R.rendering=null,R.renderingStartTime=0,R.last=M,R.tail=y,R.tailMode=E)}function mD(u,f,y){var M=f.pendingProps,E=M.revealOrder,R=M.tail;if(er(u,f,M.children,y),M=qt.current,M&2)M=M&1|2,f.flags|=128;else{if(u!==null&&u.flags&128)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&pD(u,y,f);else if(u.tag===19)pD(u,y,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}M&=1}if(Ue(qt,M),!(f.mode&1))f.memoizedState=null;else switch(E){case"forwards":for(y=f.child,E=null;y!==null;)u=y.alternate,u!==null&&Ps(u)===null&&(E=y),y=y.sibling;y=E,y===null?(E=f.child,f.child=null):(E=y.sibling,y.sibling=null),iM(f,!1,E,y,R);break;case"backwards":for(y=null,E=f.child,f.child=null;E!==null;){if(u=E.alternate,u!==null&&Ps(u)===null){f.child=E;break}u=E.sibling,E.sibling=y,y=E,E=u}iM(f,!0,y,null,R);break;case"together":iM(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function No(u,f,y){if(u!==null&&(f.dependencies=u.dependencies),cf|=f.lanes,!(y&f.childLanes))return null;if(u!==null&&f.child!==u.child)throw Error(o(153));if(f.child!==null){for(u=f.child,y=Xa(u,u.pendingProps),f.child=y,y.return=f;u.sibling!==null;)u=u.sibling,y=y.sibling=Xa(u,u.pendingProps),y.return=f;y.sibling=null}return f.child}function zX(u,f,y){switch(f.tag){case 3:cD(f),ka();break;case 5:Nn(f);break;case 1:Yn(f.type)&&ui(f);break;case 4:gt(f,f.stateNode.containerInfo);break;case 10:s0(f,f.type._context,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(Ue(qt,qt.current&1),f.flags|=128,null):y&f.child.childLanes?fD(u,f,y):(Ue(qt,qt.current&1),u=No(u,f,y),u!==null?u.sibling:null);Ue(qt,qt.current&1);break;case 19:if(M=(y&f.childLanes)!==0,u.flags&128){if(M)return mD(u,f,y);f.flags|=128}var E=f.memoizedState;if(E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Ue(qt,qt.current),M)break;return null;case 22:case 23:return f.lanes=0,oD(u,f,y)}return No(u,f,y)}function HX(u,f){switch(Nh(f),f.tag){case 1:return Yn(f.type)&&hn(),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return pt(),st(cn),st(At),at(),u=f.flags,u&65536&&!(u&128)?(f.flags=u&-65537|128,f):null;case 5:return Vn(f),null;case 13:if(st(qt),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(o(340));ka()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return st(qt),null;case 4:return pt(),null;case 10:return Ih(f.type._context),null;case 22:case 23:return AM(),null;case 24:return null;default:return null}}var C0=!1,sc=!1,GX=typeof WeakSet=="function"?WeakSet:Set,je=null;function T0(u,f){var y=u.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(M){xr(u,f,M)}else y.current=null}function rM(u,f,y){try{y()}catch(M){xr(u,f,M)}}var gD=!1;function VX(u,f){for(te(u.containerInfo),je=f;je!==null;)if(u=je,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,je=f;else for(;je!==null;){u=je;try{var y=u.alternate;if(u.flags&1024)switch(u.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var M=y.memoizedProps,E=y.memoizedState,R=u.stateNode,V=R.getSnapshotBeforeUpdate(u.elementType===u.type?M:Nr(u.type,M),E);R.__reactInternalSnapshotBeforeUpdate=V}break;case 3:Mt&&Oe(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Q){xr(u,u.return,Q)}if(f=u.sibling,f!==null){f.return=u.return,je=f;break}je=u.return}return y=gD,gD=!1,y}function oc(u,f,y){var M=f.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var E=M=M.next;do{if((E.tag&u)===u){var R=E.destroy;E.destroy=void 0,R!==void 0&&rM(f,y,R)}E=E.next}while(E!==M)}}function Jh(u,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&u)===u){var M=y.create;y.destroy=M()}y=y.next}while(y!==f)}}function sM(u){var f=u.ref;if(f!==null){var y=u.stateNode;switch(u.tag){case 5:u=K(y);break;default:u=y}typeof f=="function"?f(u):f.current=u}}function vD(u,f,y){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount($u,f)}catch(V){}switch(f.tag){case 0:case 11:case 14:case 15:if(u=f.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var M=u=u.next;do{var E=M,R=E.destroy;E=E.tag,R!==void 0&&(E&2||E&4)&&rM(f,y,R),M=M.next}while(M!==u)}break;case 1:if(T0(f,y),u=f.stateNode,typeof u.componentWillUnmount=="function")try{u.props=f.memoizedProps,u.state=f.memoizedState,u.componentWillUnmount()}catch(V){xr(f,y,V)}break;case 5:T0(f,y);break;case 4:Mt?MD(u,f,y):H&&H&&(f=f.stateNode.containerInfo,y=Vt(f),Jt(f,y))}}function yD(u,f,y){for(var M=f;;)if(vD(u,M,y),M.child===null||Mt&&M.tag===4){if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function xD(u){var f=u.alternate;f!==null&&(u.alternate=null,xD(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&dt(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}function _D(u){return u.tag===5||u.tag===3||u.tag===4}function AD(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||_D(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function SD(u){if(Mt){e:{for(var f=u.return;f!==null;){if(_D(f))break e;f=f.return}throw Error(o(160))}var y=f;switch(y.tag){case 5:f=y.stateNode,y.flags&32&&(sn(f),y.flags&=-33),y=AD(u),aM(u,y,f);break;case 3:case 4:f=y.stateNode.containerInfo,y=AD(u),oM(u,y,f);break;default:throw Error(o(161))}}}function oM(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?et(y,u,f):Rt(y,u);else if(M!==4&&(u=u.child,u!==null))for(oM(u,f,y),u=u.sibling;u!==null;)oM(u,f,y),u=u.sibling}function aM(u,f,y){var M=u.tag;if(M===5||M===6)u=u.stateNode,f?Et(y,u,f):Qe(y,u);else if(M!==4&&(u=u.child,u!==null))for(aM(u,f,y),u=u.sibling;u!==null;)aM(u,f,y),u=u.sibling}function MD(u,f,y){for(var M=f,E=!1,R,V;;){if(!E){E=M.return;e:for(;;){if(E===null)throw Error(o(160));switch(R=E.stateNode,E.tag){case 5:V=!1;break e;case 3:R=R.containerInfo,V=!0;break e;case 4:R=R.containerInfo,V=!0;break e}E=E.return}E=!0}if(M.tag===5||M.tag===6)yD(u,M,y),V?Ft(R,M.stateNode):Tt(R,M.stateNode);else if(M.tag===18)V?ne(R,M.stateNode):le(R,M.stateNode);else if(M.tag===4){if(M.child!==null){R=M.stateNode.containerInfo,V=!0,M.child.return=M,M=M.child;continue}}else if(vD(u,M,y),M.child!==null){M.child.return=M,M=M.child;continue}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return,M.tag===4&&(E=!1)}M.sibling.return=M.return,M=M.sibling}}function lM(u,f){if(Mt){switch(f.tag){case 0:case 11:case 14:case 15:oc(3,f,f.return),Jh(3,f),oc(5,f,f.return);return;case 1:return;case 5:var y=f.stateNode;if(y!=null){var M=f.memoizedProps;u=u!==null?u.memoizedProps:M;var E=f.type,R=f.updateQueue;f.updateQueue=null,R!==null&&kt(y,R,E,u,M,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));y=f.memoizedProps,Pe(f.stateNode,u!==null?u.memoizedProps:y,y);return;case 3:Te&&u!==null&&u.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);return;case 12:return;case 13:b0(f);return;case 19:b0(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:oc(3,f,f.return),Jh(3,f),oc(5,f,f.return);return;case 12:return;case 13:b0(f);return;case 19:b0(f);return;case 3:Te&&u!==null&&u.memoizedState.isDehydrated&&Z(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(H){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Jt(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function b0(u){var f=u.updateQueue;if(f!==null){u.updateQueue=null;var y=u.stateNode;y===null&&(y=u.stateNode=new GX),f.forEach(function(M){var E=$X.bind(null,u,M);y.has(M)||(y.add(M),M.then(E,E))})}}function WX(u,f){for(je=f;je!==null;){f=je;var y=f.deletions;if(y!==null)for(var M=0;M";case P0:return":has("+(fM(u)||"")+")";case I0:return'[role="'+u.value+'"]';case L0:return'"'+u.value+'"';case B0:return'[data-testname="'+u.value+'"]';default:throw Error(o(365))}}function bD(u,f){var y=[];u=[u,0];for(var M=0;ME&&(E=V),M&=~R}if(M=E,M=Qn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*jX(M/1960))-M,10u?16:u,Ga===null)var M=!1;else{if(u=Ga,Ga=null,O0=0,Gt&6)throw Error(o(331));var E=Gt;for(Gt|=4,je=u.current;je!==null;){var R=je,V=R.child;if(je.flags&16){var Q=R.deletions;if(Q!==null){for(var he=0;heQn()-mM?ac(u,0):pM|=y),yr(u,f)}function UD(u,f){f===0&&(u.mode&1?(f=Ba,Ba<<=1,!(Ba&130023424)&&(Ba=4194304)):f=1);var y=tr();u=H0(u,f),u!==null&&($l(u,f,y),yr(u,y))}function ZX(u){var f=u.memoizedState,y=0;f!==null&&(y=f.retryLane),UD(u,y)}function $X(u,f){var y=0;switch(u.tag){case 13:var M=u.stateNode,E=u.memoizedState;E!==null&&(y=E.retryLane);break;case 19:M=u.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(f),UD(u,y)}var OD;OD=function(u,f,y){if(u!==null)if(u.memoizedProps!==f.pendingProps||cn.current)Ur=!0;else{if(!(u.lanes&y)&&!(f.flags&128))return Ur=!1,zX(u,f,y);Ur=!!(u.flags&131072)}else Ur=!1,_n&&f.flags&1048576&&h0(f,Ts,f.index);switch(f.lanes=0,f.tag){case 2:var M=f.type;u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),u=f.pendingProps;var E=Fn(f,At.current);Fa(f,y),E=J1(null,f,M,u,E,y);var R=K1();return f.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Yn(M)?(R=!0,ui(f)):R=!1,f.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Lh(f),E.updater=of,f.stateNode=E,E._reactInternals=f,Dh(f,M,u,y),f=tM(null,f,M,!0,R,y)):(f.tag=0,_n&&R&&Fh(f),er(null,f,E,y),f=f.child),f;case 16:M=f.elementType;e:{switch(u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),u=f.pendingProps,E=M._init,M=E(M._payload),f.type=M,E=f.tag=tj(M),u=Nr(M,u),E){case 0:f=eM(null,f,M,u,y);break e;case 1:f=lD(null,f,M,u,y);break e;case 11:f=iD(null,f,M,u,y);break e;case 14:f=rD(null,f,M,Nr(M.type,u),y);break e}throw Error(o(306,M,""))}return f;case 0:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),eM(u,f,M,E,y);case 1:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),lD(u,f,M,E,y);case 3:e:{if(cD(f),u===null)throw Error(o(387));M=f.pendingProps,R=f.memoizedState,E=R.element,o0(u,f),rf(f,M,null,y);var V=f.memoizedState;if(M=V.element,Te&&R.isDehydrated)if(R={element:M,isDehydrated:!1,cache:V.cache,transitions:V.transitions},f.updateQueue.baseState=R,f.memoizedState=R,f.flags&256){E=Error(o(423)),f=uD(u,f,M,y,E);break e}else if(M!==E){E=Error(o(424)),f=uD(u,f,M,y,E);break e}else for(Te&&($i=ju(f.stateNode.containerInfo),Zi=f,_n=!0,Si=null,tc=!1),y=k(f,null,M,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ka(),M===E){f=No(u,f,y);break e}er(u,f,M,y)}f=f.child}return f;case 5:return Nn(f),u===null&&Oh(f),M=f.type,E=f.pendingProps,R=u!==null?u.memoizedProps:null,V=E.children,Me(M,E)?V=null:R!==null&&Me(M,R)&&(f.flags|=32),aD(u,f),er(u,f,V,y),f.child;case 6:return u===null&&Oh(f),null;case 13:return fD(u,f,y);case 4:return gt(f,f.stateNode.containerInfo),M=f.pendingProps,u===null?f.child=L(f,null,M,y):er(u,f,M,y),f.child;case 11:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),iD(u,f,M,E,y);case 7:return er(u,f,f.pendingProps,y),f.child;case 8:return er(u,f,f.pendingProps.children,y),f.child;case 12:return er(u,f,f.pendingProps.children,y),f.child;case 10:e:{if(M=f.type._context,E=f.pendingProps,R=f.memoizedProps,V=E.value,s0(f,M,V),R!==null)if(es(R.value,V)){if(R.children===E.children&&!cn.current){f=No(u,f,y);break e}}else for(R=f.child,R!==null&&(R.return=f);R!==null;){var Q=R.dependencies;if(Q!==null){V=R.child;for(var he=Q.firstContext;he!==null;){if(he.context===M){if(R.tag===1){he=ns(-1,y&-y),he.tag=2;var Ne=R.updateQueue;if(Ne!==null){Ne=Ne.shared;var it=Ne.pending;it===null?he.next=he:(he.next=it.next,it.next=he),Ne.pending=he}}R.lanes|=y,he=R.alternate,he!==null&&(he.lanes|=y),Bh(R.return,y,f),Q.lanes|=y;break}he=he.next}}else if(R.tag===10)V=R.type===f.type?null:R.child;else if(R.tag===18){if(V=R.return,V===null)throw Error(o(341));V.lanes|=y,Q=V.alternate,Q!==null&&(Q.lanes|=y),Bh(V,y,f),V=R.sibling}else V=R.child;if(V!==null)V.return=R;else for(V=R;V!==null;){if(V===f){V=null;break}if(R=V.sibling,R!==null){R.return=V.return,V=R;break}V=V.return}R=V}er(u,f,E.children,y),f=f.child}return f;case 9:return E=f.type,M=f.pendingProps.children,Fa(f,y),E=pr(E),M=M(E),f.flags|=1,er(u,f,M,y),f.child;case 14:return M=f.type,E=Nr(M,f.pendingProps),E=Nr(M.type,E),rD(u,f,M,E,y);case 15:return sD(u,f,f.type,f.pendingProps,y);case 17:return M=f.type,E=f.pendingProps,E=f.elementType===M?E:Nr(M,E),u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,Yn(M)?(u=!0,ui(f)):u=!1,Fa(f,y),f0(f,M,E),Dh(f,M,E,y),tM(null,f,M,!0,u,y);case 19:return mD(u,f,y);case 22:return oD(u,f,y)}throw Error(o(156,f.tag))};function kD(u,f){return La(u,f)}function ej(u,f,y,M){this.tag=u,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rs(u,f,y,M){return new ej(u,f,y,M)}function MM(u){return u=u.prototype,!(!u||!u.isReactComponent)}function tj(u){if(typeof u=="function")return MM(u)?1:0;if(u!=null){if(u=u.$$typeof,u===A)return 11;if(u===x)return 14}return 2}function Xa(u,f){var y=u.alternate;return y===null?(y=rs(u.tag,f,u.key,u.mode),y.elementType=u.elementType,y.type=u.type,y.stateNode=u.stateNode,y.alternate=u,u.alternate=y):(y.pendingProps=f,y.type=u.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=u.flags&14680064,y.childLanes=u.childLanes,y.lanes=u.lanes,y.child=u.child,y.memoizedProps=u.memoizedProps,y.memoizedState=u.memoizedState,y.updateQueue=u.updateQueue,f=u.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=u.sibling,y.index=u.index,y.ref=u.ref,y}function V0(u,f,y,M,E,R){var V=2;if(M=u,typeof u=="function")MM(u)&&(V=1);else if(typeof u=="string")V=5;else e:switch(u){case d:return uc(y.children,E,R,f);case h:V=8,E|=8;break;case p:return u=rs(12,y,f,E|2),u.elementType=p,u.lanes=R,u;case _:return u=rs(13,y,f,E),u.elementType=_,u.lanes=R,u;case m:return u=rs(19,y,f,E),u.elementType=m,u.lanes=R,u;case w:return W0(y,E,R,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case g:V=10;break e;case v:V=9;break e;case A:V=11;break e;case x:V=14;break e;case S:V=16,M=null;break e}throw Error(o(130,u==null?u:typeof u,""))}return f=rs(V,y,f,E),f.elementType=u,f.type=M,f.lanes=R,f}function uc(u,f,y,M){return u=rs(7,u,M,f),u.lanes=y,u}function W0(u,f,y,M){return u=rs(22,u,M,f),u.elementType=w,u.lanes=y,u.stateNode={},u}function wM(u,f,y){return u=rs(6,u,null,f),u.lanes=y,u}function EM(u,f,y){return f=rs(4,u.children!==null?u.children:[],u.key,f),f.lanes=y,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function nj(u,f,y,M,E){this.tag=f,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=wt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wh(0),this.expirationTimes=wh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wh(0),this.identifierPrefix=M,this.onRecoverableError=E,Te&&(this.mutableSourceEagerHydrationData=null)}function zD(u,f,y,M,E,R,V,Q,he){return u=new nj(u,f,y,Q,he),f===1?(f=1,R===!0&&(f|=8)):f=0,R=rs(3,null,null,f),u.current=R,R.stateNode=u,R.memoizedState={element:M,isDehydrated:y,cache:null,transitions:null},Lh(R),u}function HD(u){if(!u)return fn;u=u._reactInternals;e:{if(B(u)!==u||u.tag!==1)throw Error(o(170));var f=u;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Yn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(u.tag===1){var y=u.type;if(Yn(y))return Xs(u,y,f)}return f}function GD(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(o(188)):(u=Object.keys(u).join(","),Error(o(268,u)));return u=X(f),u===null?null:u.stateNode}function VD(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var y=u.retryLane;u.retryLane=y!==0&&y=Ne&&R>=It&&E<=it&&V<=xt){u.splice(f,1);break}else if(M!==Ne||y.width!==he.width||xtV){if(!(R!==It||y.height!==he.height||itE)){Ne>M&&(he.width+=Ne-M,he.x=M),itR&&(he.height+=It-R,he.y=R),xty&&(y=V)),V ")+` No matching component was found for: `)+u.join(" > ")}return null},t.getPublicRootInstance=function(u){if(u=u.current,!u.child)return null;switch(u.child.tag){case 5:return K(u.child.stateNode);default:return u.child.stateNode}},t.injectIntoDevTools=function(u){if(u={bundleType:u.bundleType,version:u.version,rendererPackageName:u.rendererPackageName,rendererConfig:u.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:ij,findFiberByHostInstance:u.findFiberByHostInstance||rj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{$u=f.inject(u),$r=f}catch(y){}u=!!f.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,f,y,M){if(!W)throw Error(o(363));u=dM(u,f);var E=ze(u,y,M).disconnect;return{disconnect:function(){E()}}},t.registerMutableSourceForHydration=function(u,f){var y=f._getVersion;y=y(f._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[f,y]:u.mutableSourceEagerHydrationData.push(f,y)},t.runWithPriority=function(u,f){var y=Qt;try{return Qt=u,f()}finally{Qt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,f,y,M){var E=f.current,R=tr(),V=Va(E);return y=HD(y),f.context===null?f.context=y:f.pendingContext=y,f=ns(R,V),f.payload={element:u},M=M===void 0?null:M,M!==null&&(f.callback=M),Ks(E,f),u=is(E,V,R),u!==null&&nf(u,E,V),V},t};V2.exports=Z6;var $6=V2.exports;const eW=un($6),p1={},tW=n=>void Object.assign(p1,n);function nW(n,e){function t(d,A,v){var _=A,{args:h=[],attach:p}=_,g=Wn(_,["args","attach"]);let m=`${d[0].toUpperCase()}${d.slice(1)}`,x;if(d==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const S=g.object;x=ku(S,{type:d,root:v,attach:p,primitive:!0})}else{const S=p1[m];if(!S)throw new Error(`R3F: ${m} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");x=ku(new S(...h),{type:d,root:v,attach:p,memoizedProps:{args:h}})}return x.__r3f.attach===void 0&&(x instanceof Pt?x.__r3f.attach="geometry":x instanceof $n&&(x.__r3f.attach="material")),m!=="inject"&&y1(x,g),x}function i(d,h){let p=!1;if(h){var g,v;(g=h.__r3f)!=null&&g.attach?v1(d,h,h.__r3f.attach):h.isObject3D&&d.isObject3D&&(d.add(h),p=!0),p||(v=d.__r3f)==null||v.objects.push(h),h.__r3f||ku(h,{}),h.__r3f.parent=d,x1(h),zu(h)}}function r(d,h,p){let g=!1;if(h){var v,A;if((v=h.__r3f)!=null&&v.attach)v1(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){h.parent=d,h.dispatchEvent({type:"added"}),d.dispatchEvent({type:"childadded",child:h});const _=d.children.filter(x=>x!==h),m=_.indexOf(p);d.children=[..._.slice(0,m),h,..._.slice(m)],g=!0}g||(A=d.__r3f)==null||A.objects.push(h),h.__r3f||ku(h,{}),h.__r3f.parent=d,x1(h),zu(h)}}function s(d,h,p=!1){d&&[...d].forEach(g=>o(h,g,p))}function o(d,h,p){if(h){var g,v,A;if(h.__r3f&&(h.__r3f.parent=null),(g=d.__r3f)!=null&&g.objects&&(d.__r3f.objects=d.__r3f.objects.filter(w=>w!==h)),(v=h.__r3f)!=null&&v.attach)tL(d,h,h.__r3f.attach);else if(h.isObject3D&&d.isObject3D){var _;d.remove(h),(_=h.__r3f)!=null&&_.root&&dW(Jv(h),h)}const x=(A=h.__r3f)==null?void 0:A.primitive,S=!x&&(p===void 0?h.dispose!==null:p);if(!x){var m;s((m=h.__r3f)==null?void 0:m.objects,h,S),s(h.children,h,S)}if(delete h.__r3f,S&&h.dispose&&h.type!=="Scene"){const w=()=>{try{h.dispose()}catch(I){}};typeof IS_REACT_ACT_ENVIRONMENT=="undefined"?h1.unstable_scheduleCallback(h1.unstable_IdlePriority,w):w()}zu(d)}}function a(d,h,p,g){var v;const A=(v=d.__r3f)==null?void 0:v.parent;if(!A)return;const _=t(h,p,d.__r3f.root);if(d.children){for(const m of d.children)m.__r3f&&i(_,m);d.children=d.children.filter(m=>!m.__r3f)}d.__r3f.objects.forEach(m=>i(_,m)),d.__r3f.objects=[],d.__r3f.autoRemovedBeforeAppend||o(A,d),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(A,_),_.raycast&&_.__r3f.eventCount&&Jv(_).getState().internal.interaction.push(_),[g,g.alternate].forEach(m=>{m!==null&&(m.stateNode=_,m.ref&&(typeof m.ref=="function"?m.ref(_):m.ref.current=_))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:eW({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(d,h)=>{if(!h)return;const p=d.getState().scene;p.__r3f&&(p.__r3f.root=d,i(p,h))},removeChildFromContainer:(d,h)=>{h&&o(d.getState().scene,h)},insertInContainerBefore:(d,h,p)=>{if(!h||!p)return;const g=d.getState().scene;g.__r3f&&r(g,h,p)},getRootHostContext:()=>null,getChildHostContext:d=>d,finalizeInitialChildren(d){var h;return!!((h=d==null?void 0:d.__r3f)!=null?h:{}).handlers},prepareUpdate(d,h,p,g){var v;if(((v=d==null?void 0:d.__r3f)!=null?v:{}).primitive&&g.object&&g.object!==d)return[!0];{const _=g,{args:x=[],children:S}=_,w=Wn(_,["args","children"]),m=p,{args:I=[],children:P}=m,D=Wn(m,["args","children"]);if(!Array.isArray(x))throw new Error("R3F: the args prop must be an array!");if(x.some((B,T)=>B!==I[T]))return[!0];const N=nL(d,w,D,!0);return N.changes.length?[!1,N]:null}},commitUpdate(d,[h,p],g,v,A,_){h?a(d,g,A,_):y1(d,p)},commitMount(d,h,p,g){var v;const A=(v=d.__r3f)!=null?v:{};d.raycast&&A.handlers&&A.eventCount&&Jv(d).getState().internal.interaction.push(d)},getPublicInstance:d=>d,prepareForCommit:()=>null,preparePortalMount:d=>ku(d.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(d){var h;const{attach:p,parent:g}=(h=d.__r3f)!=null?h:{};p&&g&&tL(g,d,p),d.isObject3D&&(d.visible=!1),zu(d)},unhideInstance(d,h){var p;const{attach:g,parent:v}=(p=d.__r3f)!=null?p:{};g&&v&&v1(v,d,g),(d.isObject3D&&h.visible==null||h.visible)&&(d.visible=!0),zu(d)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Ou.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance!="undefined"&&yn.fun(performance.now)?performance.now:yn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:yn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:yn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:y1}}var j2,J2;const m1=n=>"colorSpace"in n||"outputColorSpace"in n,K2=()=>{var n;return(n=p1.ColorManagement)!=null?n:null},Y2=n=>n&&n.isOrthographicCamera,iW=n=>n&&n.hasOwnProperty("current"),jv=typeof window!="undefined"&&((j2=window.document)!=null&&j2.createElement||((J2=window.navigator)==null?void 0:J2.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;function rW(n){const e=pe.useRef(n);return jv(()=>void(e.current=n),[n]),e}function sW({set:n}){return jv(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class Q2 extends pe.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Q2.getDerivedStateFromError=()=>({error:!0});const q2="__default",Z2=new Map,oW=n=>n&&!!n.memoized&&!!n.changes;function $2(n){var e;const t=typeof window!="undefined"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const vh=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Jv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const yn={obj:n=>n===Object(n)&&!yn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(yn.str(n)||yn.num(n)||yn.boo(n))return n===e;const s=yn.obj(n);if(s&&i==="reference")return n===e;const o=yn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!yn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(yn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function aW(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function lW(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function ku(n,e){const t=n;return t.__r3f=_e({type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null},e),n}function g1(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const eL=/-\d+$/;function v1(n,e,t){if(yn.str(t)){if(eL.test(t)){const s=t.replace(eL,""),{target:o,key:a}=g1(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=g1(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function tL(n,e,t){var i,r;if(yn.str(t)){const{target:s,key:o}=g1(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function nL(n,d,p={},c=!1){var h=d,{children:e,key:t,ref:i}=h,r=Wn(h,["children","key","ref"]);var g=p,{children:s,key:o,ref:a}=g,l=Wn(g,["children","key","ref"]);const v=n.__r3f,A=Object.entries(r),_=[];if(c){const x=Object.keys(l);for(let S=0;S{var w;if((w=n.__r3f)!=null&&w.primitive&&x==="object"||yn.equ(S,l[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return _.push([x,S,!0,[]]);let I=[];x.includes("-")&&(I=x.split("-")),_.push([x,S,!1,I]);for(const P in r){const D=r[P];P.startsWith(`${x}-`)&&_.push([P,D,!1,P.split("-")])}});const m=_e({},r);return v!=null&&v.memoizedProps&&v!=null&&v.memoizedProps.args&&(m.args=v.memoizedProps.args),v!=null&&v.memoizedProps&&v!=null&&v.memoizedProps.attach&&(m.attach=v.memoizedProps.attach),{memoized:m,changes:_}}const cW=typeof process!="undefined"&&!1;function y1(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=oW(e)?e:nL(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let d=0;dm[x],n),!(_&&_.set))){const[m,...x]=v.reverse();A=x.reverse().reduce((S,w)=>S[w],n),h=m}if(p===q2+"remove")if(A.constructor){let m=Z2.get(A.constructor);m||(m=new A.constructor,Z2.set(A.constructor,m)),p=m[h]}else p=0;if(g&&i)p?i.handlers[h]=p:delete i.handlers[h],i.eventCount=Object.keys(i.handlers).length;else if(_&&_.set&&(_.copy||_ instanceof El)){if(Array.isArray(p))_.fromArray?_.fromArray(p):_.set(...p);else if(_.copy&&p&&p.constructor&&(cW?_.constructor.name===p.constructor.name:_.constructor===p.constructor))_.copy(p);else if(p!==void 0){const m=_ instanceof ke;!m&&_.setScalar?_.setScalar(p):_ instanceof El&&p instanceof El?_.mask=p.mask:_.set(p),!K2()&&s&&!s.linear&&m&&_.convertSRGBToLinear()}}else if(A[h]=p,A[h]instanceof Mn&&A[h].format===Ri&&A[h].type===vs&&s){const m=A[h];m1(m)&&m1(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}zu(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const d=Jv(n).getState().internal,h=d.interaction.indexOf(n);h>-1&&d.interaction.splice(h,1),i.eventCount&&d.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&x1(n),n}function zu(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function x1(n){n.onUpdate==null||n.onUpdate(n)}function uW(n,e){n.manual||(Y2(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Kv(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function fW(){var n;const e=typeof self!="undefined"&&self||typeof window!="undefined"&&window;if(!e)return Ou.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Ou.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Ou.ContinuousEventPriority;default:return Ou.DefaultEventPriority}}function iL(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function dW(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{iL(t.capturedMap,e,i,r)})}function hW(n){function e(l){const{internal:c}=n.getState(),d=l.offsetX-c.initialClick[0],h=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(d*d+h*h))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(d=>{var h;return(h=c.__r3f)==null?void 0:h.handlers["onPointer"+d]}))}function i(l,c){const d=n.getState(),h=new Set,p=[],g=c?c(d.internal.interaction):d.internal.interaction;for(let m=0;m{const S=vh(m.object),w=vh(x.object);return!S||!w?m.distance-x.distance:w.events.priority-S.events.priority||m.distance-x.distance}).filter(m=>{const x=Kv(m);return h.has(x)?!1:(h.add(x),!0)});d.events.filter&&(A=d.events.filter(A,d));for(const m of A){let x=m.object;for(;x;){var _;(_=x.__r3f)!=null&&_.eventCount&&p.push(Ct(_e({},m),{eventObject:x})),x=x.parent}}if("pointerId"in l&&d.internal.capturedMap.has(l.pointerId))for(let m of d.internal.capturedMap.get(l.pointerId).values())h.has(Kv(m.intersection))||p.push(m.intersection);return p}function r(l,c,d,h){const p=n.getState();if(l.length){const g={stopped:!1};for(const v of l){const A=vh(v.object)||p,{raycaster:_,pointer:m,camera:x,internal:S}=A,w=new G(m.x,m.y,0).unproject(x),I=T=>{var F,X;return(F=(X=S.capturedMap.get(T))==null?void 0:X.has(v.eventObject))!=null?F:!1},P=T=>{const F={intersection:v,target:c.target};S.capturedMap.has(T)?S.capturedMap.get(T).set(v.eventObject,F):S.capturedMap.set(T,new Map([[v.eventObject,F]])),c.target.setPointerCapture(T)},D=T=>{const F=S.capturedMap.get(T);F&&iL(S.capturedMap,v.eventObject,F,T)};let N={};for(let T in c){let F=c[T];typeof F!="function"&&(N[T]=F)}let B=Ct(_e(_e({},v),N),{pointer:m,intersections:l,stopped:g.stopped,delta:d,unprojectedPoint:w,ray:_.ray,camera:x,stopPropagation(){const T="pointerId"in c&&S.capturedMap.get(c.pointerId);if((!T||T.has(v.eventObject))&&(B.stopped=g.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(F=>F.eventObject===v.eventObject))){const F=l.slice(0,l.indexOf(v));s([...F,v])}},target:{hasPointerCapture:I,setPointerCapture:P,releasePointerCapture:D},currentTarget:{hasPointerCapture:I,setPointerCapture:P,releasePointerCapture:D},nativeEvent:c});if(h(B),g.stopped===!0)break}}return l}function s(l){const{internal:c}=n.getState();for(const d of c.hovered.values())if(!l.length||!l.find(h=>h.object===d.object&&h.index===d.index&&h.instanceId===d.instanceId)){const p=d.eventObject.__r3f,g=p==null?void 0:p.handlers;if(c.hovered.delete(Kv(d)),p!=null&&p.eventCount){const v=Ct(_e({},d),{intersections:l});g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(l,c){for(let d=0;ds([]);case"onLostPointerCapture":return c=>{const{internal:d}=n.getState();"pointerId"in c&&d.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{d.capturedMap.has(c.pointerId)&&(d.capturedMap.delete(c.pointerId),s([]))})}}return function(d){const{onPointerMissed:h,internal:p}=n.getState();p.lastEvent.current=d;const g=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=i(d,g?t:void 0),m=v?e(d):0;l==="onPointerDown"&&(p.initialClick=[d.offsetX,d.offsetY],p.initialHits=_.map(S=>S.eventObject)),v&&!_.length&&m<=2&&(o(d,p.interaction),h&&h(d)),g&&s(_);function x(S){const w=S.eventObject,I=w.__r3f,P=I==null?void 0:I.handlers;if(I!=null&&I.eventCount)if(g){if(P.onPointerOver||P.onPointerEnter||P.onPointerOut||P.onPointerLeave){const D=Kv(S),N=p.hovered.get(D);N?N.stopped&&S.stopPropagation():(p.hovered.set(D,S),P.onPointerOver==null||P.onPointerOver(S),P.onPointerEnter==null||P.onPointerEnter(S))}P.onPointerMove==null||P.onPointerMove(S)}else{const D=P[l];D?(!v||p.initialHits.includes(w))&&(o(d,p.interaction.filter(N=>!p.initialHits.includes(N))),D(S)):v&&p.initialHits.includes(w)&&o(d,p.interaction.filter(N=>!p.initialHits.includes(N)))}}r(_,d,m,x)}}return{handlePointer:a}}const rL=n=>!!(n!=null&&n.render),pW=pe.createContext(null),mW=(n,e)=>{const t=J6((a,l)=>{const c=new G,d=new G,h=new G;function p(m=l().camera,x=d,S=l().size){const{width:w,height:I,top:P,left:D}=S,N=w/I;x instanceof G?h.copy(x):h.set(...x);const B=m.getWorldPosition(c).distanceTo(h);if(Y2(m))return{width:w/m.zoom,height:I/m.zoom,top:P,left:D,factor:1,distance:B,aspect:N};{const T=m.fov*Math.PI/180,F=2*Math.tan(T/2)*B,X=F*(w/I);return{width:X,height:F,top:P,left:D,factor:w/X,distance:B,aspect:N}}}let g;const v=m=>a(x=>({performance:Ct(_e({},x.performance),{current:m})})),A=new Ae;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,x)=>e(m,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new ZS,pointer:A,mouse:A,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();g&&clearTimeout(g),m.performance.current!==m.performance.min&&v(m.performance.min),g=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:m=>a(x=>Ct(_e({},x),{events:_e(_e({},x.events),m)})),setSize:(m,x,S,w,I)=>{const P=l().camera,D={width:m,height:x,top:w||0,left:I||0,updateStyle:S};a(N=>({size:D,viewport:_e(_e({},N.viewport),p(P,d,D))}))},setDpr:m=>a(x=>{const S=$2(m);return{viewport:Ct(_e({},x.viewport),{dpr:S,initialDpr:x.viewport.initialDpr||S})}}),setFrameloop:(m="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,m!=="never"&&(x.start(),x.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:pe.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,x,S)=>{const w=l().internal;return w.priority=w.priority+(x>0?1:0),w.subscribers.push({ref:m,priority:x,store:S}),w.subscribers=w.subscribers.sort((I,P)=>I.priority-P.priority),()=>{const I=l().internal;I!=null&&I.subscribers&&(I.priority=I.priority-(x>0?1:0),I.subscribers=I.subscribers.filter(P=>P.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:d,set:h}=t.getState();if(l.width!==r.width||l.height!==r.height||c.dpr!==s){var p;r=l,s=c.dpr,uW(a,l),d.setPixelRatio(c.dpr);const g=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement!="undefined"&&d.domElement instanceof HTMLCanvasElement;d.setSize(l.width,l.height,g)}a!==o&&(o=a,h(g=>({viewport:_e(_e({},g.viewport),g.viewport.getCurrentViewport(a))})))}),t.subscribe(a=>n(a)),t};let Yv,gW=new Set,vW=new Set,yW=new Set;function _1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function yh(n,e){switch(n){case"before":return _1(gW,e);case"after":return _1(vW,e);case"tail":return _1(yW,e)}}let A1,S1;function M1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),A1=e.internal.subscribers,Yv=0;Yv0)&&!((d=s.gl.xr)!=null&&d.isPresenting)&&(i+=M1(c,s))}if(t=!1,yh("after",c),i===0)return yh("tail",c),e=!1,cancelAnimationFrame(r)}function a(c,d=1){var h;if(!c)return n.forEach(p=>a(p.store.getState(),d));(h=c.gl.xr)!=null&&h.isPresenting||!c.internal.active||c.frameloop==="never"||(d>1?c.internal.frames=Math.min(60,c.internal.frames+d):t?c.internal.frames=2:c.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(c,d=!0,h,p){if(d&&yh("before",c),h)M1(c,h,p);else for(const g of n.values())M1(c,g.store.getState());d&&yh("after",c)}return{loop:o,invalidate:a,advance:l}}const sL=new WeakMap;function oL(n,e){return function(t,...i){let r=sL.get(t);return r||(r=new t,sL.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,aW(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`))))))}}function xh(n,e,t,i){const r=Array.isArray(e)?e:[e],s=Y6(oL(t,i),[n,...r],{equal:yn.equ});return Array.isArray(e)?s:s[0]}xh.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return Q6(oL(t),[n,...i])},xh.clear=function(n,e){const t=Array.isArray(e)?e:[e];return q6([n,...t])};const Hu=new Map,{invalidate:aL,advance:lL}=xW(Hu),{reconciler:Qv,applyProps:Gu}=nW(Hu,fW),Vu={objects:"shallow",strict:!1},_W=(n,e)=>{const t=typeof n=="function"?n(e):n;return rL(t)?t:new qI(_e({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0},n))};function AW(n,e){const t=typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function SW(n){const e=Hu.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||mW(aL,lL),o=t||Qv.createContainer(s,Ou.ConcurrentRoot,null,!1,null,"",r,null);e||Hu.set(n,{fiber:o,store:s});let a,l=!1,c;return{configure(d={}){let{gl:h,size:p,scene:g,events:v,onCreated:A,shadows:_=!1,linear:m=!1,flat:x=!1,legacy:S=!1,orthographic:w=!1,frameloop:I="always",dpr:P=[1,2],performance:D,raycaster:N,camera:B,onPointerMissed:T}=d,F=s.getState(),X=F.gl;F.gl||F.set({gl:X=_W(h,n)});let J=F.raycaster;J||F.set({raycaster:J=new _2});const ie=N||{},{params:q}=ie,$=Wn(ie,["params"]);if(yn.equ($,J,Vu)||Gu(J,_e({},$)),yn.equ(q,J.params,Vu)||Gu(J,{params:_e(_e({},J.params),q)}),!F.camera||F.camera===c&&!yn.equ(c,B,Vu)){c=B;const fe=B instanceof jd,Ce=fe?B:w?new Eu(0,0,0,0,.1,1e3):new ai(75,0,.1,1e3);fe||(Ce.position.z=5,B&&(Gu(Ce,B),("aspect"in B||"left"in B||"right"in B||"bottom"in B||"top"in B)&&(Ce.manual=!0,Ce.updateProjectionMatrix())),!F.camera&&!(B!=null&&B.rotation)&&Ce.lookAt(0,0,0)),F.set({camera:Ce}),J.camera=Ce}if(!F.scene){let fe;g instanceof Zg?fe=g:(fe=new Zg,g&&Gu(fe,g)),F.set({scene:ku(fe)})}if(!F.xr){var K;const fe=(re,Me)=>{const Ie=s.getState();Ie.frameloop!=="never"&&lL(re,!0,Ie,Me)},Ce=()=>{const re=s.getState();re.gl.xr.enabled=re.gl.xr.isPresenting,re.gl.xr.setAnimationLoop(re.gl.xr.isPresenting?fe:null),re.gl.xr.isPresenting||aL(re)},ot={connect(){const re=s.getState().gl;re.xr.addEventListener("sessionstart",Ce),re.xr.addEventListener("sessionend",Ce)},disconnect(){const re=s.getState().gl;re.xr.removeEventListener("sessionstart",Ce),re.xr.removeEventListener("sessionend",Ce)}};typeof((K=X.xr)==null?void 0:K.addEventListener)=="function"&&ot.connect(),F.set({xr:ot})}if(X.shadowMap){const fe=X.shadowMap.enabled,Ce=X.shadowMap.type;if(X.shadowMap.enabled=!!_,yn.boo(_))X.shadowMap.type=_d;else if(yn.str(_)){var ge;const ot={basic:qR,percentage:km,soft:_d,variance:ms};X.shadowMap.type=(ge=ot[_])!=null?ge:_d}else yn.obj(_)&&Object.assign(X.shadowMap,_);(fe!==X.shadowMap.enabled||Ce!==X.shadowMap.type)&&(X.shadowMap.needsUpdate=!0)}const z=K2();z&&("enabled"in z?z.enabled=!S:"legacyMode"in z&&(z.legacyMode=S)),l||Gu(X,{outputEncoding:m?3e3:3001,toneMapping:x?zs:vA}),F.legacy!==S&&F.set(()=>({legacy:S})),F.linear!==m&&F.set(()=>({linear:m})),F.flat!==x&&F.set(()=>({flat:x})),h&&!yn.fun(h)&&!rL(h)&&!yn.equ(h,X,Vu)&&Gu(X,h),v&&!F.events.handlers&&F.set({events:v(s)});const te=AW(n,p);return yn.equ(te,F.size,Vu)||F.setSize(te.width,te.height,te.updateStyle,te.top,te.left),P&&F.viewport.dpr!==$2(P)&&F.setDpr(P),F.frameloop!==I&&F.setFrameloop(I),F.onPointerMissed||F.set({onPointerMissed:T}),D&&!yn.equ(D,F.performance,Vu)&&F.set(fe=>({performance:_e(_e({},fe.performance),D)})),a=A,l=!0,this},render(d){return l||this.configure(),Qv.updateContainer(me.jsx(MW,{store:s,children:d,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){cL(n)}}}function MW({store:n,children:e,onCreated:t,rootElement:i}){return jv(()=>{const r=n.getState();r.set(s=>({internal:Ct(_e({},s.internal),{active:!0})})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),me.jsx(pW.Provider,{value:n,children:e})}function cL(n,e){const t=Hu.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),Qv.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),lW(r),Hu.delete(n)}catch(c){}},500)})}}Qv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:pe.version});const w1={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function wW(n){const{handlePointer:e}=hW(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(w1).reduce((t,i)=>Ct(_e({},t),{[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:Ct(_e({},o.events),{connected:t})})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,c]=w1[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=w1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:Ct(_e({},s.events),{connected:void 0})}))}}}}function E1(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var d=Date.now()-o;d=0?i=setTimeout(l,e-d):(i=null,t||(a=n.apply(s,r),s=r=null))}var c=function(){s=this,r=arguments,o=Date.now();var d=t&&!i;return i||(i=setTimeout(l,e)),d&&(a=n.apply(s,r),s=r=null),a};return c.clear=function(){i&&(clearTimeout(i),i=null)},c.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},c}E1.debounce=E1;var EW=E1;const uL=un(EW);var CW=Object.defineProperty,TW=Object.defineProperties,bW=Object.getOwnPropertyDescriptors,fL=Object.getOwnPropertySymbols,RW=Object.prototype.hasOwnProperty,PW=Object.prototype.propertyIsEnumerable,dL=(n,e,t)=>e in n?CW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,hL=(n,e)=>{for(var t in e||(e={}))RW.call(e,t)&&dL(n,t,e[t]);if(fL)for(var t of fL(e))PW.call(e,t)&&dL(n,t,e[t]);return n},IW=(n,e)=>TW(n,bW(e)),pL,mL;typeof window!="undefined"&&((pL=window.document)!=null&&pL.createElement||((mL=window.navigator)==null?void 0:mL.product)==="ReactNative")?pe.useLayoutEffect:pe.useEffect;function gL(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=gL(i,e,t);if(r)return r;i=i.sibling}}function vL(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(e){return n}}const yL=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=yL;return}return yL.apply(this,arguments)};const C1=vL(pe.createContext(null));class xL extends pe.Component{render(){return pe.createElement(C1.Provider,{value:this._reactInternals},this.props.children)}}function BW(){const n=pe.useContext(C1);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=pe.useId();return pe.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=gL(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function LW(){const n=BW(),[e]=pe.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==C1&&!e.has(r)&&e.set(r,pe.useContext(vL(r)))}t=t.return}return e}function DW(){const n=LW();return pe.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>pe.createElement(e,null,pe.createElement(t.Provider,IW(hL({},i),{value:n.get(t)}))),e=>pe.createElement(xL,hL({},e))),[n])}function FW({debounce:n,scroll:e,polyfill:t,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const r=t||typeof window!="undefined"&&window.ResizeObserver,[s,o]=pe.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0});if(!r)return s.width=1280,s.height=800,[()=>{},s,()=>{}];const a=pe.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),l=n?typeof n=="number"?n:n.scroll:null,c=n?typeof n=="number"?n:n.resize:null,d=pe.useRef(!1);pe.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[h,p,g]=pe.useMemo(()=>{const m=()=>{if(!a.current.element)return;const{left:x,top:S,width:w,height:I,bottom:P,right:D,x:N,y:B}=a.current.element.getBoundingClientRect(),T={left:x,top:S,width:w,height:I,bottom:P,right:D,x:N,y:B};a.current.element instanceof HTMLElement&&i&&(T.height=a.current.element.offsetHeight,T.width=a.current.element.offsetWidth),Object.freeze(T),d.current&&!kW(a.current.lastBounds,T)&&o(a.current.lastBounds=T)};return[m,c?uL(m,c):m,l?uL(m,l):m]},[o,i,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(m=>m.removeEventListener("scroll",g,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null)}function A(){a.current.element&&(a.current.resizeObserver=new r(g),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(m=>m.addEventListener("scroll",g,{capture:!0,passive:!0})))}const _=m=>{!m||m===a.current.element||(v(),a.current.element=m,a.current.scrollContainers=_L(m),A())};return UW(g,!!e),NW(p),pe.useEffect(()=>{v(),A()},[e,g,p]),pe.useEffect(()=>v,[]),[_,s,h]}function NW(n){pe.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function UW(n,e){pe.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function _L(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,..._L(n.parentElement)]}const OW=["x","y","top","bottom","left","right","width","height"],kW=(n,e)=>OW.every(t=>n[t]===e[t]),zW=pe.forwardRef(function(N,D){var B=N,{children:e,fallback:t,resize:i,style:r,gl:s,events:o=wW,eventSource:a,eventPrefix:l,shadows:c,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:A,performance:_,raycaster:m,camera:x,scene:S,onPointerMissed:w,onCreated:I}=B,P=Wn(B,["children","fallback","resize","style","gl","events","eventSource","eventPrefix","shadows","linear","flat","legacy","orthographic","frameloop","dpr","performance","raycaster","camera","scene","onPointerMissed","onCreated"]);pe.useMemo(()=>tW(F6),[]);const T=DW(),[F,X]=FW(_e({scroll:!0,debounce:{scroll:50,resize:0}},i)),J=pe.useRef(null),q=pe.useRef(null);pe.useImperativeHandle(D,()=>J.current);const $=rW(w),[K,ge]=pe.useState(!1),[z,te]=pe.useState(!1);if(K)throw K;if(z)throw z;const ie=pe.useRef(null);jv(()=>{const Ce=J.current;X.width>0&&X.height>0&&Ce&&(ie.current||(ie.current=SW(Ce)),ie.current.configure({gl:s,events:o,shadows:c,linear:d,flat:h,legacy:p,orthographic:g,frameloop:v,dpr:A,performance:_,raycaster:m,camera:x,scene:S,size:X,onPointerMissed:(...ot)=>$.current==null?void 0:$.current(...ot),onCreated:ot=>{ot.events.connect==null||ot.events.connect(a?iW(a)?a.current:a:q.current),l&&ot.setEvents({compute:(re,Me)=>{const Ie=re[l+"X"],Be=re[l+"Y"];Me.pointer.set(Ie/Me.size.width*2-1,-(Be/Me.size.height)*2+1),Me.raycaster.setFromCamera(Me.pointer,Me.camera)}}),I==null||I(ot)}}),ie.current.render(me.jsx(T,{children:me.jsx(Q2,{set:te,children:me.jsx(pe.Suspense,{fallback:me.jsx(sW,{set:ge}),children:e})})})))}),pe.useEffect(()=>{const Ce=J.current;if(Ce)return()=>cL(Ce)},[]);const fe=a?"none":"auto";return me.jsx("div",Ct(_e({ref:q,style:_e({position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:fe},r)},P),{children:me.jsx("div",{ref:F,style:{width:"100%",height:"100%"},children:me.jsx("canvas",{ref:J,style:{display:"block"},children:t})})}))}),HW=pe.forwardRef(function(e,t){return me.jsx(xL,{children:me.jsx(zW,Ct(_e({},e),{ref:t}))})}),GW=parseInt(xd.replace(/\D+/g,""));function AL(n,e){if(e===FP)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===wg||e===RA){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l=2.0 are supported."));return}const l=new SX(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&a[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function WW(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const Wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class XW{constructor(e){this.parser=e,this.name=Wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class sX{constructor(e){this.parser=e,this.name=Wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class oX{constructor(e){this.parser=e,this.name=Wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const c=i.options.manager.getHandler(a.uri);c!==null&&(l=c)}return this.detectSupport().then(function(c){if(c)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class aX{constructor(e){this.name=Wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,c=r.byteLength||0,d=r.count,h=r.byteStride,p=new Uint8Array(a,l,c);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,h,p,r.mode,r.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*h);return o.decodeGltfBuffer(new Uint8Array(g),d,h,p,r.mode,r.filter),g})})}else return null}}class lX{constructor(e){this.name=Wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const c of r.primitives)if(c.mode!==Zr.TRIANGLES&&c.mode!==Zr.TRIANGLE_STRIP&&c.mode!==Zr.TRIANGLE_FAN&&c.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const c in o)a.push(this.parser.getDependency("accessor",o[c]).then(d=>(l[c]=d,l[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(c=>{const d=c.pop(),h=d.isGroup?d.children:[d],p=c[0].count,g=[];for(const v of h){const A=new mt,_=new G,m=new Ii,x=new G(1,1,1),S=new _S(v.geometry,v.material,p);for(let w=0;w=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"}),{COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"}),Ca={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},mX={CUBICSPLINE:void 0,LINEAR:nu,STEP:tu},P1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function gX(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new ph({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ks})),n.DefaultMaterial}function ql(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Io(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function vX(n,e,t){let i=!1,r=!1,s=!1;for(let c=0,d=e.length;c0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const AX=new mt;class SX{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new WW,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap=="undefined"||i||r&&s<98?this.textureLoader=new qB(this.options.manager):this.textureLoader=new u2(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Lr(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return ql(s,a,r),Io(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){for(const l of a.scenes)l.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[c,d]of o.children.entries())s(d,a.children[c])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&_.setY(B,P[D*l+1]),l>=3&&_.setZ(B,P[D*l+2]),l>=4&&_.setW(B,P[D*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const c=this.loadImageSource(t,i).then(function(d){d.flipY=!1,d.name=o.name||a.name||"",d.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(d.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return d.magFilter=CL[p.magFilter]||kn,d.minFilter=CL[p.minFilter]||Kr,d.wrapS=TL[p.wrapS]||fa,d.wrapT=TL[p.wrapT]||fa,r.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[l]=c,c}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",c=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){c=!0;const p=new Blob([h],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(l).then(function(h){return new Promise(function(p,g){let v=p;t.isImageBitmapLoader===!0&&(v=function(A){const _=new Mn(A);_.needsUpdate=!0,p(_)}),t.load(wa.resolveURL(h,s.path),v,void 0,g)})}).then(function(h){return c===!0&&a.revokeObjectURL(l),Io(h,o),h.userData.mimeType=o.mimeType||_X(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=d,d}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[Wt.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[Wt.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[Wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&(typeof r=="number"&&(r=r===SL?Ql:Po),"colorSpace"in o?o.colorSpace=r:o.encoding=r===Ql?SL:VW),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new dv,$n.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new Fi,$n.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return ph}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},c=[];if(l[Wt.KHR_MATERIALS_UNLIT]){const h=r[Wt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(a,s,t))}else{const h=s.pbrMetallicRoughness||{};if(a.color=new ke(1,1,1),a.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;a.color.setRGB(p[0],p[1],p[2],Po),a.opacity=p[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(a,"map",h.baseColorTexture,Ql)),a.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,a.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(a,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(a,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=gs);const d=s.alphaMode||P1.OPAQUE;if(d===P1.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,d===P1.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ir&&(c.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Ae(1,1),s.normalTexture.scale!==void 0)){const h=s.normalTexture.scale;a.normalScale.set(h,h)}if(s.occlusionTexture!==void 0&&o!==Ir&&(c.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ir){const h=s.emissiveFactor;a.emissive=new ke().setRGB(h[0],h[1],h[2],Po)}return s.emissiveTexture!==void 0&&o!==Ir&&c.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Ql)),Promise.all(c).then(function(){const h=new o(a);return s.name&&(h.name=s.name),Io(h,s),t.associations.set(h,{materials:e}),s.extensions&&ql(r,h,s),h})}createUniqueName(e){const t=Kt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[Wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return bL(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&yX(m,s),m.name=t.createUniqueName(s.name||"mesh_"+e),Io(m,s),_.extensions&&ql(r,m,_),t.assignFinalMaterial(m),h.push(m)}for(let g=0,v=h.length;g1?d=new Co:c.length===1?d=c[0]:d=new jt,d!==c[0])for(let h=0,p=c.length;h{const h=new Map;for(const[p,g]of r.associations)(p instanceof $n||p instanceof Mn)&&h.set(p,g);return d.traverse(p=>{const g=r.associations.get(p);g!=null&&h.set(p,g)}),h};return r.associations=c(s),s})}_createAnimationTracks(e,t,i,r,s){const o=[],a=e.name?e.name:e.uuid,l=[];Ca[s.path]===Ca.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(a);let c;switch(Ca[s.path]){case Ca.weights:c=kl;break;case Ca.rotation:c=zl;break;case Ca.position:case Ca.scale:c=Gl;break;default:switch(i.itemSize){case 1:c=kl;break;case 2:case 3:default:c=Gl;break}break}const d=r.interpolation!==void 0?mX[r.interpolation]:nu,h=this._getArrayFromAccessor(i);for(let p=0,g=l.length;p{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const c=t.attributeTypes[l];c.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=c.name)}const i=JSON.stringify(t);if(L1.has(e)){const l=L1.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((c,d)=>{r._callbacks[s]={resolve:c,reject:d},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),L1.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new Pt;e.index&&t.setIndex(new $t(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=EX.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` `);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const h=d.draco,p=new h.Decoder,g=new h.DecoderBuffer;g.Init(new Int8Array(l),l.byteLength);try{const v=t(h,p,g,c),A=v.attributes.map(_=>_.array.buffer);v.index&&A.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},A)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{h.destroy(g),h.destroy(p)}});break}};function t(o,a,l,c){const d=c.attributeIDs,h=c.attributeTypes;let p,g;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)p=new o.Mesh,g=a.DecodeBufferToMesh(l,p);else if(v===o.POINT_CLOUD)p=new o.PointCloud,g=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!g.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+g.error_msg());const A={index:null,attributes:[]};for(const _ in d){const m=self[h[_]];let x,S;if(c.useUniqueIDs)S=d[_],x=a.GetAttributeByUniqueId(p,S);else{if(S=a.GetAttributeId(p,o[d[_]]),S===-1)continue;x=a.GetAttribute(p,S)}A.attributes.push(r(o,a,p,_,m,x))}return v===o.TRIANGULAR_MESH&&(A.index=i(o,a,p)),o.destroy(p),A}function i(o,a,l){const d=l.num_faces()*3,h=d*4,p=o._malloc(h);a.GetTrianglesUInt32Array(l,h,p);const g=new Uint32Array(o.HEAPF32.buffer,p,d).slice();return o._free(p),{array:g,itemSize:1}}function r(o,a,l,c,d,h){const p=h.num_components(),v=l.num_points()*p,A=v*d.BYTES_PER_ELEMENT,_=s(o,d),m=o._malloc(A);a.GetAttributeDataArrayForAllPoints(l,h,_,A,m);const x=new d(o.HEAPF32.buffer,m,v).slice();return o._free(m),{name:c,array:x,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let Zv;const D1=()=>{if(Zv)return Zv;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(h=>{s=h.instance,s.exports.__wasm_call_ctors()});function a(h){const p=new Uint8Array(h.length);for(let v=0;v96?A-71:A>64?A-65:A>47?A+4:A>46?63:62}let g=0;for(let v=0;v{t&&t(i),n&&($v||($v=new wX),$v.setDecoderPath(typeof n=="string"?n:RL),i.setDRACOLoader($v)),e&&i.setMeshoptDecoder(typeof D1=="function"?D1():D1)}}function e0(n,e=!0,t=!0,i){return xh(T1,n,PL(e,t,i))}e0.preload=(n,e=!0,t=!0,i)=>xh.preload(T1,n,PL(e,t,i)),e0.clear=n=>xh.clear(T1,n),e0.setDecoderPath=n=>{RL=n};const IL={name:"dc-overview-ws",private:!0,version:"0.1.6",type:"module",scripts:{dev:"vite",build:"vite build",lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",preview:"vite preview",commit:"git-cz"},dependencies:{"@react-three/drei":"^9.111.1","@react-three/fiber":"^8.17.5","@vidyard/embed-code":"^4.3.15","framer-motion":"^11.3.19","framer-motion-3d":"^11.3.28",react:"^18.2.0","react-aria-components":"^1.2.1","react-dom":"^18.2.0",three:"^0.167.1"},devDependencies:{"@sfdc-www/chassis-core":"^1.70.0","@sfdc-www/chassis-core-types":"^1.30.0","@sfdc-www/www-schemas":"1.172.0","@types/react":"^18.2.66","@types/react-dom":"^18.2.22","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-prefix-selector":"^1.16.1",tailwindcss:"^3.4.3",typescript:"^5.2.2",vite:"^5.2.0"},config:{commitizen:{path:"./node_modules/cz-conventional-changelog"}}},CX=IL.version,TX=`https://a.sfdcstatic.com/digital/@sfdc-www/open-blade-libs/${IL.name}/v${CX}/data-dust.glb`,bX=Object.freeze(Object.defineProperty({__proto__:null,default:({progress:n,direction:e,size:t})=>{const{nodes:i}=e0(TX),r=lr(n,[0,1],[e==="left"?0:10,e==="left"?10:0]),s=[[2,2,5,.4],[8,0,4,.3]];return me.jsx(O2.div,{initial:{opacity:0},animate:{opacity:1},children:me.jsxs(HW,{resize:{offsetSize:!0},dpr:[1,2],camera:{position:[0,0,5.5],fov:t==="sm"?25:t==="md"?15:10},children:[me.jsx("ambientLight",{intensity:.3,color:"#63B1F8"}),s.map(([o,a,l,c],d)=>me.jsx("pointLight",{intensity:c,position:[o/8,a/8,l/8],color:"#63B1F8"},d)),me.jsx("group",{dispose:null,children:me.jsx(O2.mesh,{geometry:i.Star.geometry,rotation:[Math.PI/2,0,r],scale:8,animate:{rotateZ:0,transition:{rotateZ:{duration:15,ease:"linear",repeat:1/0}}},children:me.jsx("meshPhongMaterial",{color:"#63B1F8",emissive:"#416FB6",specular:"#89DCFA",shininess:30})})})]})})}},Symbol.toStringTag,{value:"Module"})),RX=Object.freeze(Object.defineProperty({__proto__:null,default:()=>me.jsx("div",{className:"flex justify-center items-center h-screen",children:me.jsxs("svg",{className:"animate-spin mt-20 h-20 w-20 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[me.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),me.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})},Symbol.toStringTag,{value:"Module"}))});