var F2=Object.defineProperty;var z2=(n,e,t)=>e in n?F2(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Dt=(n,e,t)=>z2(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();function gA(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var V_={exports:{}},Hp={},H_={exports:{}},mn={};/** * @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 cE;function B2(){if(cE)return mn;cE=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.iterator;function g(G){return G===null||typeof G!="object"?null:(G=v&&G[v]||G["@@iterator"],typeof G=="function"?G:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function w(G,te,Oe){this.props=G,this.context=te,this.refs=C,this.updater=Oe||y}w.prototype.isReactComponent={},w.prototype.setState=function(G,te){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,te,"setState")},w.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=w.prototype;function P(G,te,Oe){this.props=G,this.context=te,this.refs=C,this.updater=Oe||y}var I=P.prototype=new M;I.constructor=P,E(I,w.prototype),I.isPureReactComponent=!0;var D=Array.isArray,L=Object.prototype.hasOwnProperty,O={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function b(G,te,Oe){var We,qe={},fe=null,Ae=null;if(te!=null)for(We in te.ref!==void 0&&(Ae=te.ref),te.key!==void 0&&(fe=""+te.key),te)L.call(te,We)&&!U.hasOwnProperty(We)&&(qe[We]=te[We]);var Te=arguments.length-2;if(Te===1)qe.children=Oe;else if(1>>1,te=X[G];if(0>>1;Gr(qe,B))fer(Ae,qe)?(X[G]=Ae,X[fe]=B,G=fe):(X[G]=qe,X[We]=B,G=We);else if(fer(Ae,B))X[G]=Ae,X[fe]=B,G=fe;else break e}}return Q}function r(X,Q){var B=X.sortIndex-Q.sortIndex;return B!==0?B:X.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();n.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,v=null,g=3,y=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(X){for(var Q=t(p);Q!==null;){if(Q.callback===null)i(p);else if(Q.startTime<=X)i(p),Q.sortIndex=Q.expirationTime,e(d,Q);else break;Q=t(p)}}function D(X){if(C=!1,I(X),!E)if(t(d)!==null)E=!0,ce(L);else{var Q=t(p);Q!==null&&$(D,Q.startTime-X)}}function L(X,Q){E=!1,C&&(C=!1,M(b),b=-1),y=!0;var B=g;try{for(I(Q),v=t(d);v!==null&&(!(v.expirationTime>Q)||X&&!W());){var G=v.callback;if(typeof G=="function"){v.callback=null,g=v.priorityLevel;var te=G(v.expirationTime<=Q);Q=n.unstable_now(),typeof te=="function"?v.callback=te:v===t(d)&&i(d),I(Q)}else i(d);v=t(d)}if(v!==null)var Oe=!0;else{var We=t(p);We!==null&&$(D,We.startTime-Q),Oe=!1}return Oe}finally{v=null,g=B,y=!1}}var O=!1,U=null,b=-1,F=5,H=-1;function W(){return!(n.unstable_now()-HX||125G?(X.sortIndex=B,e(p,X),t(d)===null&&X===t(p)&&(C?(M(b),b=-1):C=!0,$(D,B-G))):(X.sortIndex=te,e(d,X),E||y||(E=!0,ce(L))),X},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(X){var Q=g;return function(){var B=g;g=Q;try{return X.apply(this,arguments)}finally{g=B}}}})(X_)),X_}var mE;function W2(){return mE||(mE=1,W_.exports=G2()),W_.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 gE;function X2(){if(gE)return Is;gE=1;var n=Zv(),e=W2();function t(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,h=1;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},v={};function g(s){return d.call(v,s)?!0:d.call(m,s)?!1:p.test(s)?v[s]=!0:(m[s]=!0,!1)}function y(s,a,h,x){if(h!==null&&h.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return x?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function E(s,a,h,x){if(a===null||typeof a>"u"||y(s,a,h,x))return!0;if(x)return!1;if(h!==null)switch(h.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function C(s,a,h,x,T,R,z){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=x,this.attributeNamespace=T,this.mustUseProperty=h,this.propertyName=s,this.type=a,this.sanitizeURL=R,this.removeEmptyString=z}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){w[s]=new C(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];w[a]=new C(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){w[s]=new C(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){w[s]=new C(s,2,!1,s,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(s){w[s]=new C(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){w[s]=new C(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){w[s]=new C(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){w[s]=new C(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){w[s]=new C(s,5,!1,s.toLowerCase(),null,!1,!1)});var M=/[\-:]([a-z])/g;function P(s){return s[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(s){var a=s.replace(M,P);w[a]=new C(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(M,P);w[a]=new C(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(M,P);w[a]=new C(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){w[s]=new C(s,1,!1,s.toLowerCase(),null,!1,!1)}),w.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){w[s]=new C(s,1,!1,s.toLowerCase(),null,!0,!0)});function I(s,a,h,x){var T=w.hasOwnProperty(a)?w[a]:null;(T!==null?T.type!==0:x||!(2K||T[z]!==R[K]){var ne=` `+T[z].replace(" at new "," at ");return s.displayName&&ne.includes("")&&(ne=ne.replace("",s.displayName)),ne}while(1<=z&&0<=K);break}}}finally{Oe=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?te(s):""}function qe(s){switch(s.tag){case 5:return te(s.type);case 16:return te("Lazy");case 13:return te("Suspense");case 19:return te("SuspenseList");case 0:case 2:case 15:return s=We(s.type,!1),s;case 11:return s=We(s.type.render,!1),s;case 1:return s=We(s.type,!0),s;default:return""}}function fe(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case U:return"Fragment";case O:return"Portal";case F:return"Profiler";case b:return"StrictMode";case le:return"Suspense";case pe:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case W:return(s.displayName||"Context")+".Consumer";case H:return(s._context.displayName||"Context")+".Provider";case Y:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case ee:return a=s.displayName||null,a!==null?a:fe(s.type)||"Memo";case ce:a=s._payload,s=s._init;try{return fe(s(a))}catch{}}return null}function Ae(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(a);case 8:return a===b?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function Te(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Ze(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function pt(s){var a=Ze(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),x=""+s[a];if(!s.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var T=h.get,R=h.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return T.call(this)},set:function(z){x=""+z,R.call(this,z)}}),Object.defineProperty(s,a,{enumerable:h.enumerable}),{getValue:function(){return x},setValue:function(z){x=""+z},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function ot(s){s._valueTracker||(s._valueTracker=pt(s))}function $t(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var h=a.getValue(),x="";return s&&(x=Ze(s)?s.checked?"true":"false":s.value),s=x,s!==h?(a.setValue(s),!0):!1}function et(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Lt(s,a){var h=a.checked;return B({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function Ht(s,a){var h=a.defaultValue==null?"":a.defaultValue,x=a.checked!=null?a.checked:a.defaultChecked;h=Te(a.value!=null?a.value:h),s._wrapperState={initialChecked:x,initialValue:h,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function Ft(s,a){a=a.checked,a!=null&&I(s,"checked",a,!1)}function ve(s,a){Ft(s,a);var h=Te(a.value),x=a.type;if(h!=null)x==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(x==="submit"||x==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?Cn(s,a.type,h):a.hasOwnProperty("defaultValue")&&Cn(s,a.type,Te(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function hn(s,a,h){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var x=a.type;if(!(x!=="submit"&&x!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,h||a===s.value||(s.value=a),s.defaultValue=a}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function Cn(s,a,h){(a!=="number"||et(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var pn=Array.isArray;function kt(s,a,h,x){if(s=s.options,a){a={};for(var T=0;T"+a.valueOf().toString()+"",a=ae.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function Me(s,a){if(a){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=a;return}}s.textContent=a}var He={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},ze=["Webkit","ms","Moz","O"];Object.keys(He).forEach(function(s){ze.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),He[a]=He[s]})});function Ce(s,a,h){return a==null||typeof a=="boolean"||a===""?"":h||typeof a!="number"||a===0||He.hasOwnProperty(s)&&He[s]?(""+a).trim():a+"px"}function Re(s,a){s=s.style;for(var h in a)if(a.hasOwnProperty(h)){var x=h.indexOf("--")===0,T=Ce(h,a[h],x);h==="float"&&(h="cssFloat"),x?s.setProperty(h,T):s[h]=T}}var nt=B({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 mt(s,a){if(a){if(nt[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(t(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(t(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(t(61))}if(a.style!=null&&typeof a.style!="object")throw Error(t(62))}}function Ke(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){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 $e=null;function Ge(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Mt=null,wt=null,J=null;function Xe(s){if(s=Qo(s)){if(typeof Mt!="function")throw Error(t(280));var a=s.stateNode;a&&(a=fd(a),Mt(s.stateNode,s.type,a))}}function Pe(s){wt?J?J.push(s):J=[s]:wt=s}function Je(){if(wt){var s=wt,a=J;if(J=wt=null,Xe(s),a)for(s=0;s>>=0,s===0?32:31-(lt(s)/dt|0)|0}var Gt=64,ut=4194304;function fn(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function jn(s,a){var h=s.pendingLanes;if(h===0)return 0;var x=0,T=s.suspendedLanes,R=s.pingedLanes,z=h&268435455;if(z!==0){var K=z&~T;K!==0?x=fn(K):(R&=z,R!==0&&(x=fn(R)))}else z=h&~T,z!==0?x=fn(z):R!==0&&(x=fn(R));if(x===0)return 0;if(a!==0&&a!==x&&(a&T)===0&&(T=x&-x,R=a&-a,T>=R||T===16&&(R&4194240)!==0))return a;if((x&4)!==0&&(x|=h&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=x;0h;h++)a.push(s);return a}function ln(s,a,h){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Ye(a),s[a]=h}function Ur(s,a){var h=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var x=s.eventTimes;for(s=s.expirationTimes;0=ir),Rs=" ",ip=!1;function rp(s,a){switch(s){case"keyup":return np.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qf(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Pa=!1;function xg(s,a){switch(s){case"compositionend":return qf(a);case"keypress":return a.which!==32?null:(ip=!0,Rs);case"textInput":return s=a.data,s===Rs&&ip?null:s;default:return null}}function vc(s,a){if(Pa)return s==="compositionend"||!Ar&&rp(s,a)?(s=mc(),zr=Kh=js=null,Pa=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:h,offset:a-s};s=x}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=_c(h)}}function pl(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?pl(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function di(){for(var s=window,a=et();a instanceof s.HTMLIFrameElement;){try{var h=typeof a.contentWindow.location.href=="string"}catch{h=!1}if(h)s=a.contentWindow;else break;a=et(s.document)}return a}function Xi(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function ji(s){var a=di(),h=s.focusedElem,x=s.selectionRange;if(a!==h&&h&&h.ownerDocument&&pl(h.ownerDocument.documentElement,h)){if(x!==null&&Xi(h)){if(a=x.start,s=x.end,s===void 0&&(s=a),"selectionStart"in h)h.selectionStart=a,h.selectionEnd=Math.min(s,h.value.length);else if(s=(a=h.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var T=h.textContent.length,R=Math.min(x.start,T);x=x.end===void 0?R:Math.min(x.end,T),!s.extend&&R>x&&(T=x,x=R,R=T),T=os(h,R);var z=os(h,x);T&&z&&(s.rangeCount!==1||s.anchorNode!==T.node||s.anchorOffset!==T.offset||s.focusNode!==z.node||s.focusOffset!==z.offset)&&(a=a.createRange(),a.setStart(T.node,T.offset),s.removeAllRanges(),R>x?(s.addRange(a),s.extend(z.node,z.offset)):(a.setEnd(z.node,z.offset),s.addRange(a)))}}for(a=[],s=h;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h=document.documentMode,Mo=null,ml=null,xc=null,Yi=!1;function Jf(s,a,h){var x=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Yi||Mo==null||Mo!==et(x)||(x=Mo,"selectionStart"in x&&Xi(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),xc&&hl(xc,x)||(xc=x,x=od(ml,"onSelect"),0qi||(s.current=gp[qi],gp[qi]=null,qi--)}function Yn(s,a){qi++,gp[qi]=s.current,s.current=a}var Jo={},rr=mi(Jo),Rr=mi(!1),ea=Jo;function xl(s,a){var h=s.type.contextTypes;if(!h)return Jo;var x=s.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===a)return x.__reactInternalMemoizedMaskedChildContext;var T={},R;for(R in h)T[R]=a[R];return x&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=T),T}function pr(s){return s=s.childContextTypes,s!=null}function Ac(){$n(Rr),$n(rr)}function vp(s,a,h){if(rr.current!==Jo)throw Error(t(168));Yn(rr,a),Yn(Rr,h)}function Rc(s,a,h){var x=s.stateNode;if(a=a.childContextTypes,typeof x.getChildContext!="function")return h;x=x.getChildContext();for(var T in x)if(!(T in a))throw Error(t(108,Ae(s)||"Unknown",T));return B({},h,x)}function yl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Jo,ea=rr.current,Yn(rr,s),Yn(Rr,Rr.current),!0}function _p(s,a,h){var x=s.stateNode;if(!x)throw Error(t(169));h?(s=Rc(s,a,ea),x.__reactInternalMemoizedMergedChildContext=s,$n(Rr),$n(rr),Yn(rr,s)):$n(Rr),Yn(Rr,h)}var Ks=null,Pc=!1,dd=!1;function bc(s){Ks===null?Ks=[s]:Ks.push(s)}function Ag(s){Pc=!0,bc(s)}function wo(){if(!dd&&Ks!==null){dd=!0;var s=0,a=sn;try{var h=Ks;for(sn=1;s>=z,T-=z,st=1<<32-Ye(a)+T|h<Yt?(_r=Vt,Vt=null):_r=Vt.sibling;var kn=Be(ge,Vt,ye[Yt],tt);if(kn===null){Vt===null&&(Vt=_r);break}s&&Vt&&kn.alternate===null&&a(ge,Vt),re=R(kn,re,Yt),Bt===null?bt=kn:Bt.sibling=kn,Bt=kn,Vt=_r}if(Yt===ye.length)return h(ge,Vt),ii&&ta(ge,Yt),bt;if(Vt===null){for(;YtYt?(_r=Vt,Vt=null):_r=Vt.sibling;var Nu=Be(ge,Vt,kn.value,tt);if(Nu===null){Vt===null&&(Vt=_r);break}s&&Vt&&Nu.alternate===null&&a(ge,Vt),re=R(Nu,re,Yt),Bt===null?bt=Nu:Bt.sibling=Nu,Bt=Nu,Vt=_r}if(kn.done)return h(ge,Vt),ii&&ta(ge,Yt),bt;if(Vt===null){for(;!kn.done;Yt++,kn=ye.next())kn=je(ge,kn.value,tt),kn!==null&&(re=R(kn,re,Yt),Bt===null?bt=kn:Bt.sibling=kn,Bt=kn);return ii&&ta(ge,Yt),bt}for(Vt=x(ge,Vt);!kn.done;Yt++,kn=ye.next())kn=gt(Vt,ge,Yt,kn.value,tt),kn!==null&&(s&&kn.alternate!==null&&Vt.delete(kn.key===null?Yt:kn.key),re=R(kn,re,Yt),Bt===null?bt=kn:Bt.sibling=kn,Bt=kn);return s&&Vt.forEach(function(U2){return a(ge,U2)}),ii&&ta(ge,Yt),bt}function Fi(ge,re,ye,tt){if(typeof ye=="object"&&ye!==null&&ye.type===U&&ye.key===null&&(ye=ye.props.children),typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case L:e:{for(var bt=ye.key,Bt=re;Bt!==null;){if(Bt.key===bt){if(bt=ye.type,bt===U){if(Bt.tag===7){h(ge,Bt.sibling),re=T(Bt,ye.props.children),re.return=ge,ge=re;break e}}else if(Bt.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===ce&&wp(bt)===Bt.type){h(ge,Bt.sibling),re=T(Bt,ye.props),re.ref=Dc(ge,Bt,ye),re.return=ge,ge=re;break e}h(ge,Bt);break}else a(ge,Bt);Bt=Bt.sibling}ye.type===U?(re=Zc(ye.props.children,ge.mode,tt,ye.key),re.return=ge,ge=re):(tt=Kg(ye.type,ye.key,ye.props,null,ge.mode,tt),tt.ref=Dc(ge,re,ye),tt.return=ge,ge=tt)}return z(ge);case O:e:{for(Bt=ye.key;re!==null;){if(re.key===Bt)if(re.tag===4&&re.stateNode.containerInfo===ye.containerInfo&&re.stateNode.implementation===ye.implementation){h(ge,re.sibling),re=T(re,ye.children||[]),re.return=ge,ge=re;break e}else{h(ge,re);break}else a(ge,re);re=re.sibling}re=O_(ye,ge.mode,tt),re.return=ge,ge=re}return z(ge);case ce:return Bt=ye._init,Fi(ge,re,Bt(ye._payload),tt)}if(pn(ye))return Et(ge,re,ye,tt);if(Q(ye))return At(ge,re,ye,tt);Nc(ge,ye)}return typeof ye=="string"&&ye!==""||typeof ye=="number"?(ye=""+ye,re!==null&&re.tag===6?(h(ge,re.sibling),re=T(re,ye),re.return=ge,ge=re):(h(ge,re),re=k_(ye,ge.mode,tt),re.return=ge,ge=re),z(ge)):h(ge,re)}return Fi}var El=Tp(!0),Lc=Tp(!1),wl=mi(null),Tl=null,ia=null,Su=null;function Cl(){Su=ia=Tl=null}function Ic(s){var a=wl.current;$n(wl),s._currentValue=a}function kc(s,a,h){for(;s!==null;){var x=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,x!==null&&(x.childLanes|=a)):x!==null&&(x.childLanes&a)!==a&&(x.childLanes|=a),s===h)break;s=s.return}}function ka(s,a){Tl=s,Su=ia=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&a)!==0&&(an=!0),s.firstContext=null)}function ls(s){var a=s._currentValue;if(Su!==s)if(s={context:s,memoizedValue:a,next:null},ia===null){if(Tl===null)throw Error(t(308));ia=s,Tl.dependencies={lanes:0,firstContext:s}}else ia=ia.next=s;return a}var ra=null;function Cp(s){ra===null?ra=[s]:ra.push(s)}function Oc(s,a,h,x){var T=a.interleaved;return T===null?(h.next=h,Cp(a)):(h.next=T.next,T.next=h),a.interleaved=h,$s(s,x)}function $s(s,a){s.lanes|=a;var h=s.alternate;for(h!==null&&(h.lanes|=a),h=s,s=s.return;s!==null;)s.childLanes|=a,h=s.alternate,h!==null&&(h.childLanes|=a),h=s,s=s.return;return h.tag===3?h.stateNode:null}var Vn=!1;function on(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ei(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Hn(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function ui(s,a,h){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Ln&2)!==0){var T=x.pending;return T===null?a.next=a:(a.next=T.next,T.next=a),x.pending=a,$s(s,h)}return T=x.interleaved,T===null?(a.next=a,Cp(x)):(a.next=T.next,T.next=a),x.interleaved=a,$s(s,h)}function mr(s,a,h){if(a=a.updateQueue,a!==null&&(a=a.shared,(h&4194240)!==0)){var x=a.lanes;x&=s.pendingLanes,h|=x,a.lanes=h,nr(s,h)}}function Al(s,a){var h=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,h===x)){var T=null,R=null;if(h=h.firstBaseUpdate,h!==null){do{var z={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};R===null?T=R=z:R=R.next=z,h=h.next}while(h!==null);R===null?T=R=a:R=R.next=a}else T=R=a;h={baseState:x.baseState,firstBaseUpdate:T,lastBaseUpdate:R,shared:x.shared,effects:x.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=a:s.next=a,h.lastBaseUpdate=a}function gi(s,a,h,x){var T=s.updateQueue;Vn=!1;var R=T.firstBaseUpdate,z=T.lastBaseUpdate,K=T.shared.pending;if(K!==null){T.shared.pending=null;var ne=K,Ee=ne.next;ne.next=null,z===null?R=Ee:z.next=Ee,z=ne;var Ve=s.alternate;Ve!==null&&(Ve=Ve.updateQueue,K=Ve.lastBaseUpdate,K!==z&&(K===null?Ve.firstBaseUpdate=Ee:K.next=Ee,Ve.lastBaseUpdate=ne))}if(R!==null){var je=T.baseState;z=0,Ve=Ee=ne=null,K=R;do{var Be=K.lane,gt=K.eventTime;if((x&Be)===Be){Ve!==null&&(Ve=Ve.next={eventTime:gt,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var Et=s,At=K;switch(Be=a,gt=h,At.tag){case 1:if(Et=At.payload,typeof Et=="function"){je=Et.call(gt,je,Be);break e}je=Et;break e;case 3:Et.flags=Et.flags&-65537|128;case 0:if(Et=At.payload,Be=typeof Et=="function"?Et.call(gt,je,Be):Et,Be==null)break e;je=B({},je,Be);break e;case 2:Vn=!0}}K.callback!==null&&K.lane!==0&&(s.flags|=64,Be=T.effects,Be===null?T.effects=[K]:Be.push(K))}else gt={eventTime:gt,lane:Be,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Ve===null?(Ee=Ve=gt,ne=je):Ve=Ve.next=gt,z|=Be;if(K=K.next,K===null){if(K=T.shared.pending,K===null)break;Be=K,K=Be.next,Be.next=null,T.lastBaseUpdate=Be,T.shared.pending=null}}while(!0);if(Ve===null&&(ne=je),T.baseState=ne,T.firstBaseUpdate=Ee,T.lastBaseUpdate=Ve,a=T.shared.interleaved,a!==null){T=a;do z|=T.lane,T=T.next;while(T!==a)}else R===null&&(T.shared.lanes=0);Xc|=z,s.lanes=z,s.memoizedState=je}}function Mu(s,a,h){if(s=a.effects,a.effects=null,s!==null)for(a=0;ah?h:4,s(!0);var x=Dl.transition;Dl.transition={};try{s(!1),a()}finally{sn=h,Dl.transition=x}}function la(){return cs().memoizedState}function Sd(s,a,h){var x=Pu(s);if(h={lane:x,action:h,hasEagerState:!1,eagerState:null,next:null},Gc(s))Md(a,h);else if(h=Oc(s,a,h,x),h!==null){var T=hs();da(h,s,x,T),Ed(h,a,x)}}function Nl(s,a,h){var x=Pu(s),T={lane:x,action:h,hasEagerState:!1,eagerState:null,next:null};if(Gc(s))Md(a,T);else{var R=s.alternate;if(s.lanes===0&&(R===null||R.lanes===0)&&(R=a.lastRenderedReducer,R!==null))try{var z=a.lastRenderedState,K=R(z,h);if(T.hasEagerState=!0,T.eagerState=K,ss(K,z)){var ne=a.interleaved;ne===null?(T.next=T,Cp(a)):(T.next=ne.next,ne.next=T),a.interleaved=T;return}}catch{}finally{}h=Oc(s,a,T,x),h!==null&&(T=hs(),da(h,s,x,T),Ed(h,a,x))}}function Gc(s){var a=s.alternate;return s===Qn||a!==null&&a===Qn}function Md(s,a){gr=Js=!0;var h=s.pending;h===null?a.next=a:(a.next=h.next,h.next=a),s.pending=a}function Ed(s,a,h){if((h&4194240)!==0){var x=a.lanes;x&=s.pendingLanes,h|=x,a.lanes=h,nr(s,h)}}var wd={readContext:ls,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},Ig={readContext:ls,useCallback:function(s,a){return ar().memoizedState=[s,a===void 0?null:a],s},useContext:ls,useEffect:Dr,useImperativeHandle:function(s,a,h){return h=h!=null?h.concat([s]):null,Ao(4194308,4,Ng.bind(null,a,s),h)},useLayoutEffect:function(s,a){return Ao(4194308,4,s,a)},useInsertionEffect:function(s,a){return Ao(4,2,s,a)},useMemo:function(s,a){var h=ar();return a=a===void 0?null:a,s=s(),h.memoizedState=[s,a],s},useReducer:function(s,a,h){var x=ar();return a=h!==void 0?h(a):a,x.memoizedState=x.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},x.queue=s,s=s.dispatch=Sd.bind(null,Qn,s),[x.memoizedState,s]},useRef:function(s){var a=ar();return s={current:s},a.memoizedState=s},useState:Dp,useDebugValue:xd,useDeferredValue:function(s){return ar().memoizedState=s},useTransition:function(){var s=Dp(!1),a=s[0];return s=v_.bind(null,s[1]),ar().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,h){var x=Qn,T=ar();if(ii){if(h===void 0)throw Error(t(407));h=h()}else{if(h=a(),vr===null)throw Error(t(349));(oa&30)!==0||_d(x,a,h)}T.memoizedState=h;var R={value:h,getSnapshot:a};return T.queue=R,Dr(Rg.bind(null,x,R,s),[s]),x.flags|=2048,eo(9,Vc.bind(null,x,R,h,a),void 0,null),h},useId:function(){var s=ar(),a=vr.identifierPrefix;if(ii){var h=Ps,x=st;h=(x&~(1<<32-Ye(x)-1)).toString(32)+h,a=":"+a+"R"+h,h=Ua++,0<\/script>",s=s.removeChild(s.firstChild)):typeof x.is=="string"?s=z.createElement(h,{is:x.is}):(s=z.createElement(h),h==="select"&&(z=s,x.multiple?z.multiple=!0:x.size&&(z.size=x.size))):s=z.createElementNS(s,h),s[Ui]=a,s[_u]=x,kM(s,a,!1,!1),a.stateNode=s;e:{switch(z=Ke(h,x),h){case"dialog":Kn("cancel",s),Kn("close",s),T=x;break;case"iframe":case"object":case"embed":Kn("load",s),T=x;break;case"video":case"audio":for(T=0;TRd&&(a.flags|=128,x=!0,Op(R,!1),a.lanes=4194304)}else{if(!x)if(s=Qs(z),s!==null){if(a.flags|=128,x=!0,h=s.updateQueue,h!==null&&(a.updateQueue=h,a.flags|=4),Op(R,!0),R.tail===null&&R.tailMode==="hidden"&&!z.alternate&&!ii)return Wr(a),null}else 2*Jt()-R.renderingStartTime>Rd&&h!==1073741824&&(a.flags|=128,x=!0,Op(R,!1),a.lanes=4194304);R.isBackwards?(z.sibling=a.child,a.child=z):(h=R.last,h!==null?h.sibling=z:a.child=z,R.last=z)}return R.tail!==null?(a=R.tail,R.rendering=a,R.tail=a.sibling,R.renderingStartTime=Jt(),a.sibling=null,h=ri.current,Yn(ri,x?h&1|2:h&1),a):(Wr(a),null);case 22:case 23:return N_(),x=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==x&&(a.flags|=8192),x&&(a.mode&1)!==0?(to&1073741824)!==0&&(Wr(a),a.subtreeFlags&6&&(a.flags|=8192)):Wr(a),null;case 24:return null;case 25:return null}throw Error(t(156,a.tag))}function v2(s,a){switch(na(a),a.tag){case 1:return pr(a.type)&&Ac(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return Oa(),$n(Rr),$n(rr),Co(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 5:return Eu(a),null;case 13:if($n(ri),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(t(340));Ia()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return $n(ri),null;case 4:return Oa(),null;case 10:return Ic(a.type._context),null;case 22:case 23:return N_(),null;case 24:return null;default:return null}}var Bg=!1,Xr=!1,_2=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Cd(s,a){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(x){Di(s,a,x)}else h.current=null}function y_(s,a,h){try{h()}catch(x){Di(s,a,x)}}var FM=!1;function x2(s,a){if(vu=Es,s=di(),Xi(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var x=h.getSelection&&h.getSelection();if(x&&x.rangeCount!==0){h=x.anchorNode;var T=x.anchorOffset,R=x.focusNode;x=x.focusOffset;try{h.nodeType,R.nodeType}catch{h=null;break e}var z=0,K=-1,ne=-1,Ee=0,Ve=0,je=s,Be=null;t:for(;;){for(var gt;je!==h||T!==0&&je.nodeType!==3||(K=z+T),je!==R||x!==0&&je.nodeType!==3||(ne=z+x),je.nodeType===3&&(z+=je.nodeValue.length),(gt=je.firstChild)!==null;)Be=je,je=gt;for(;;){if(je===s)break t;if(Be===h&&++Ee===T&&(K=z),Be===R&&++Ve===x&&(ne=z),(gt=je.nextSibling)!==null)break;je=Be,Be=je.parentNode}je=gt}h=K===-1||ne===-1?null:{start:K,end:ne}}else h=null}h=h||{start:0,end:0}}else h=null;for(fp={focusedElem:s,selectionRange:h},Es=!1,yt=a;yt!==null;)if(a=yt,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,yt=s;else for(;yt!==null;){a=yt;try{var Et=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(Et!==null){var At=Et.memoizedProps,Fi=Et.memoizedState,ge=a.stateNode,re=ge.getSnapshotBeforeUpdate(a.elementType===a.type?At:Ds(a.type,At),Fi);ge.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var ye=a.stateNode.containerInfo;ye.nodeType===1?ye.textContent="":ye.nodeType===9&&ye.documentElement&&ye.removeChild(ye.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(tt){Di(a,a.return,tt)}if(s=a.sibling,s!==null){s.return=a.return,yt=s;break}yt=a.return}return Et=FM,FM=!1,Et}function Up(s,a,h){var x=a.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var T=x=x.next;do{if((T.tag&s)===s){var R=T.destroy;T.destroy=void 0,R!==void 0&&y_(a,h,R)}T=T.next}while(T!==x)}}function Vg(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var h=a=a.next;do{if((h.tag&s)===s){var x=h.create;h.destroy=x()}h=h.next}while(h!==a)}}function S_(s){var a=s.ref;if(a!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof a=="function"?a(s):a.current=s}}function zM(s){var a=s.alternate;a!==null&&(s.alternate=null,zM(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[Ui],delete a[_u],delete a[_l],delete a[ud],delete a[cd])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function BM(s){return s.tag===5||s.tag===3||s.tag===4}function VM(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||BM(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function M_(s,a,h){var x=s.tag;if(x===5||x===6)s=s.stateNode,a?h.nodeType===8?h.parentNode.insertBefore(s,a):h.insertBefore(s,a):(h.nodeType===8?(a=h.parentNode,a.insertBefore(s,h)):(a=h,a.appendChild(s)),h=h._reactRootContainer,h!=null||a.onclick!==null||(a.onclick=Cc));else if(x!==4&&(s=s.child,s!==null))for(M_(s,a,h),s=s.sibling;s!==null;)M_(s,a,h),s=s.sibling}function E_(s,a,h){var x=s.tag;if(x===5||x===6)s=s.stateNode,a?h.insertBefore(s,a):h.appendChild(s);else if(x!==4&&(s=s.child,s!==null))for(E_(s,a,h),s=s.sibling;s!==null;)E_(s,a,h),s=s.sibling}var Nr=null,ca=!1;function Cu(s,a,h){for(h=h.child;h!==null;)HM(s,a,h),h=h.sibling}function HM(s,a,h){if(Ie&&typeof Ie.onCommitFiberUnmount=="function")try{Ie.onCommitFiberUnmount(he,h)}catch{}switch(h.tag){case 5:Xr||Cd(h,a);case 6:var x=Nr,T=ca;Nr=null,Cu(s,a,h),Nr=x,ca=T,Nr!==null&&(ca?(s=Nr,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):Nr.removeChild(h.stateNode));break;case 18:Nr!==null&&(ca?(s=Nr,h=h.stateNode,s.nodeType===8?ld(s.parentNode,h):s.nodeType===1&&ld(s,h),pc(s)):ld(Nr,h.stateNode));break;case 4:x=Nr,T=ca,Nr=h.stateNode.containerInfo,ca=!0,Cu(s,a,h),Nr=x,ca=T;break;case 0:case 11:case 14:case 15:if(!Xr&&(x=h.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){T=x=x.next;do{var R=T,z=R.destroy;R=R.tag,z!==void 0&&((R&2)!==0||(R&4)!==0)&&y_(h,a,z),T=T.next}while(T!==x)}Cu(s,a,h);break;case 1:if(!Xr&&(Cd(h,a),x=h.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=h.memoizedProps,x.state=h.memoizedState,x.componentWillUnmount()}catch(K){Di(h,a,K)}Cu(s,a,h);break;case 21:Cu(s,a,h);break;case 22:h.mode&1?(Xr=(x=Xr)||h.memoizedState!==null,Cu(s,a,h),Xr=x):Cu(s,a,h);break;default:Cu(s,a,h)}}function GM(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new _2),a.forEach(function(x){var T=R2.bind(null,s,x);h.has(x)||(h.add(x),x.then(T,T))})}}function fa(s,a){var h=a.deletions;if(h!==null)for(var x=0;xT&&(T=z),x&=~R}if(x=T,x=Jt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*S2(x/1960))-x,10s?16:s,Ru===null)var x=!1;else{if(s=Ru,Ru=null,jg=0,(Ln&6)!==0)throw Error(t(331));var T=Ln;for(Ln|=4,yt=s.current;yt!==null;){var R=yt,z=R.child;if((yt.flags&16)!==0){var K=R.deletions;if(K!==null){for(var ne=0;neJt()-C_?Yc(s,0):T_|=h),Ls(s,a)}function nE(s,a){a===0&&((s.mode&1)===0?a=1:(a=ut,ut<<=1,(ut&130023424)===0&&(ut=4194304)));var h=hs();s=$s(s,a),s!==null&&(ln(s,a,h),Ls(s,h))}function A2(s){var a=s.memoizedState,h=0;a!==null&&(h=a.retryLane),nE(s,h)}function R2(s,a){var h=0;switch(s.tag){case 13:var x=s.stateNode,T=s.memoizedState;T!==null&&(h=T.retryLane);break;case 19:x=s.stateNode;break;default:throw Error(t(314))}x!==null&&x.delete(a),nE(s,h)}var iE;iE=function(s,a,h){if(s!==null)if(s.memoizedProps!==a.pendingProps||Rr.current)an=!0;else{if((s.lanes&h)===0&&(a.flags&128)===0)return an=!1,m2(s,a,h);an=(s.flags&131072)!==0}else an=!1,ii&&(a.flags&1048576)!==0&&xp(a,pd,a.index);switch(a.lanes=0,a.tag){case 2:var x=a.type;zg(s,a),s=a.pendingProps;var T=xl(a,rr.current);ka(a,h),T=zc(null,a,x,s,T,h);var R=Ap();return a.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,pr(x)?(R=!0,yl(a)):R=!1,a.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,on(a),T.updater=Td,a.stateNode=T,T._reactInternals=a,_(a,x,s,h),a=en(null,a,x,!0,R,h)):(a.tag=0,ii&&R&&yp(a),ht(null,a,T,h),a=a.child),a;case 16:x=a.elementType;e:{switch(zg(s,a),s=a.pendingProps,T=x._init,x=T(x._payload),a.type=x,T=a.tag=b2(x),s=Ds(x,s),T){case 0:a=ct(null,a,x,s,h);break e;case 1:a=Pt(null,a,x,s,h);break e;case 11:a=lr(null,a,x,s,h);break e;case 14:a=ds(null,a,x,Ds(x.type,s),h);break e}throw Error(t(306,x,""))}return a;case 0:return x=a.type,T=a.pendingProps,T=a.elementType===x?T:Ds(x,T),ct(s,a,x,T,h);case 1:return x=a.type,T=a.pendingProps,T=a.elementType===x?T:Ds(x,T),Pt(s,a,x,T,h);case 3:e:{if(Zt(a),s===null)throw Error(t(387));x=a.pendingProps,R=a.memoizedState,T=R.element,Ei(s,a),gi(a,x,null,h);var z=a.memoizedState;if(x=z.element,R.isDehydrated)if(R={element:x,isDehydrated:!1,cache:z.cache,pendingSuspenseBoundaries:z.pendingSuspenseBoundaries,transitions:z.transitions},a.updateQueue.baseState=R,a.memoizedState=R,a.flags&256){T=S(Error(t(423)),a),a=Mn(s,a,x,h,T);break e}else if(x!==T){T=S(Error(t(424)),a),a=Mn(s,a,x,h,T);break e}else for(br=$o(a.stateNode.containerInfo.firstChild),sr=a,ii=!0,bs=null,h=Lc(a,null,x,h),a.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Ia(),x===T){a=Ll(s,a,h);break e}ht(s,a,x,h)}a=a.child}return a;case 5:return Pl(a),s===null&&gd(a),x=a.type,T=a.pendingProps,R=s!==null?s.memoizedProps:null,z=T.children,dp(x,T)?z=null:R!==null&&dp(x,R)&&(a.flags|=32),we(s,a),ht(s,a,z,h),a.child;case 6:return s===null&&gd(a),null;case 13:return ua(s,a,h);case 4:return Uc(a,a.stateNode.containerInfo),x=a.pendingProps,s===null?a.child=El(a,null,x,h):ht(s,a,x,h),a.child;case 11:return x=a.type,T=a.pendingProps,T=a.elementType===x?T:Ds(x,T),lr(s,a,x,T,h);case 7:return ht(s,a,a.pendingProps,h),a.child;case 8:return ht(s,a,a.pendingProps.children,h),a.child;case 12:return ht(s,a,a.pendingProps.children,h),a.child;case 10:e:{if(x=a.type._context,T=a.pendingProps,R=a.memoizedProps,z=T.value,Yn(wl,x._currentValue),x._currentValue=z,R!==null)if(ss(R.value,z)){if(R.children===T.children&&!Rr.current){a=Ll(s,a,h);break e}}else for(R=a.child,R!==null&&(R.return=a);R!==null;){var K=R.dependencies;if(K!==null){z=R.child;for(var ne=K.firstContext;ne!==null;){if(ne.context===x){if(R.tag===1){ne=Hn(-1,h&-h),ne.tag=2;var Ee=R.updateQueue;if(Ee!==null){Ee=Ee.shared;var Ve=Ee.pending;Ve===null?ne.next=ne:(ne.next=Ve.next,Ve.next=ne),Ee.pending=ne}}R.lanes|=h,ne=R.alternate,ne!==null&&(ne.lanes|=h),kc(R.return,h,a),K.lanes|=h;break}ne=ne.next}}else if(R.tag===10)z=R.type===a.type?null:R.child;else if(R.tag===18){if(z=R.return,z===null)throw Error(t(341));z.lanes|=h,K=z.alternate,K!==null&&(K.lanes|=h),kc(z,h,a),z=R.sibling}else z=R.child;if(z!==null)z.return=R;else for(z=R;z!==null;){if(z===a){z=null;break}if(R=z.sibling,R!==null){R.return=z.return,z=R;break}z=z.return}R=z}ht(s,a,T.children,h),a=a.child}return a;case 9:return T=a.type,x=a.pendingProps.children,ka(a,h),T=ls(T),x=x(T),a.flags|=1,ht(s,a,x,h),a.child;case 14:return x=a.type,T=Ds(x,a.pendingProps),T=Ds(x.type,T),ds(s,a,x,T,h);case 15:return Se(s,a,a.type,a.pendingProps,h);case 17:return x=a.type,T=a.pendingProps,T=a.elementType===x?T:Ds(x,T),zg(s,a),a.tag=1,pr(x)?(s=!0,yl(a)):s=!1,ka(a,h),u(a,x,T),_(a,x,T,h),en(null,a,x,!0,s,h);case 19:return IM(s,a,h);case 22:return ue(s,a,h)}throw Error(t(156,a.tag))};function rE(s,a){return ei(s,a)}function P2(s,a,h,x){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Po(s,a,h,x){return new P2(s,a,h,x)}function I_(s){return s=s.prototype,!(!s||!s.isReactComponent)}function b2(s){if(typeof s=="function")return I_(s)?1:0;if(s!=null){if(s=s.$$typeof,s===Y)return 11;if(s===ee)return 14}return 2}function Du(s,a){var h=s.alternate;return h===null?(h=Po(s.tag,a,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=a,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,a=s.dependencies,h.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Kg(s,a,h,x,T,R){var z=2;if(x=s,typeof s=="function")I_(s)&&(z=1);else if(typeof s=="string")z=5;else e:switch(s){case U:return Zc(h.children,T,R,a);case b:z=8,T|=8;break;case F:return s=Po(12,h,a,T|2),s.elementType=F,s.lanes=R,s;case le:return s=Po(13,h,a,T),s.elementType=le,s.lanes=R,s;case pe:return s=Po(19,h,a,T),s.elementType=pe,s.lanes=R,s;case $:return $g(h,T,R,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case H:z=10;break e;case W:z=9;break e;case Y:z=11;break e;case ee:z=14;break e;case ce:z=16,x=null;break e}throw Error(t(130,s==null?s:typeof s,""))}return a=Po(z,h,a,T),a.elementType=s,a.type=x,a.lanes=R,a}function Zc(s,a,h,x){return s=Po(7,s,x,a),s.lanes=h,s}function $g(s,a,h,x){return s=Po(22,s,x,a),s.elementType=$,s.lanes=h,s.stateNode={isHidden:!1},s}function k_(s,a,h){return s=Po(6,s,null,a),s.lanes=h,s}function O_(s,a,h){return a=Po(4,s.children!==null?s.children:[],s.key,a),a.lanes=h,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function D2(s,a,h,x,T){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tr(0),this.expirationTimes=tr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tr(0),this.identifierPrefix=x,this.onRecoverableError=T,this.mutableSourceEagerHydrationData=null}function U_(s,a,h,x,T,R,z,K,ne){return s=new D2(s,a,h,K,ne),a===1?(a=1,R===!0&&(a|=8)):a=0,R=Po(3,null,null,a),s.current=R,R.stateNode=s,R.memoizedState={element:x,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},on(R),s}function N2(s,a,h){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),G_.exports=X2(),G_.exports}var _E;function Y2(){if(_E)return r0;_E=1;var n=j2();return r0.createRoot=n.createRoot,r0.hydrateRoot=n.hydrateRoot,r0}var q2=Y2(),De=Zv();const s0=gA(De);var xE="1.3.26";function vA(n,e,t){return Math.max(n,Math.min(e,t))}function Z2(n,e,t){return(1-t)*n+t*e}function K2(n,e,t,i){return Z2(n,e,1-Math.exp(-t*i))}function $2(n,e){return(n%e+e)%e}var Q2=class{constructor(){Dt(this,"isRunning",!1);Dt(this,"value",0);Dt(this,"from",0);Dt(this,"to",0);Dt(this,"currentTime",0);Dt(this,"lerp");Dt(this,"duration");Dt(this,"easing");Dt(this,"onUpdate")}advance(n){var t;if(!this.isRunning)return;let e=!1;if(this.duration&&this.easing){this.currentTime+=n;const i=vA(0,this.currentTime/this.duration,1);e=i>=1;const r=e?1:this.easing(i);this.value=this.from+(this.to-this.from)*r}else this.lerp?(this.value=K2(this.value,this.to,this.lerp*60,n),Math.round(this.value)===Math.round(this.to)&&(this.value=this.to,e=!0)):(this.value=this.to,e=!0);e&&this.stop(),(t=this.onUpdate)==null||t.call(this,this.value,e)}stop(){this.isRunning=!1}fromTo(n,e,{lerp:t,duration:i,easing:r,onStart:o,onUpdate:l}){this.from=this.value=n,this.to=e,this.lerp=t,this.duration=i,this.easing=r,this.currentTime=0,this.isRunning=!0,o==null||o(),this.onUpdate=l}};function J2(n,e){let t;return function(...i){clearTimeout(t),t=setTimeout(()=>{t=void 0,n.apply(this,i)},e)}}var e3=class{constructor(n,e,{autoResize:t=!0,debounce:i=250}={}){Dt(this,"width",0);Dt(this,"height",0);Dt(this,"scrollHeight",0);Dt(this,"scrollWidth",0);Dt(this,"debouncedResize");Dt(this,"wrapperResizeObserver");Dt(this,"contentResizeObserver");Dt(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});Dt(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});Dt(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=n,this.content=e,t&&(this.debouncedResize=J2(this.resize,i),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var n,e;(n=this.wrapperResizeObserver)==null||n.disconnect(),(e=this.contentResizeObserver)==null||e.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},_A=class{constructor(){Dt(this,"events",{})}emit(n,...e){var i;const t=this.events[n]||[];for(let r=0,o=t.length;r{var t;this.events[n]=(t=this.events[n])==null?void 0:t.filter(i=>e!==i)}}off(n,e){var t;this.events[n]=(t=this.events[n])==null?void 0:t.filter(i=>e!==i)}destroy(){this.events={}}};const t3=100/6,Lu={passive:!1};function yE(n,e){return n===1?t3:n===2?e:1}var n3=class{constructor(n,e={wheelMultiplier:1,touchMultiplier:1}){Dt(this,"touchStart",{x:0,y:0});Dt(this,"lastDelta",{x:0,y:0});Dt(this,"window",{width:0,height:0});Dt(this,"emitter",new _A);Dt(this,"onTouchStart",n=>{const{clientX:e,clientY:t}=n.targetTouches?n.targetTouches[0]:n;this.touchStart.x=e,this.touchStart.y=t,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:n})});Dt(this,"onTouchMove",n=>{const{clientX:e,clientY:t}=n.targetTouches?n.targetTouches[0]:n,i=-(e-this.touchStart.x)*this.options.touchMultiplier,r=-(t-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=e,this.touchStart.y=t,this.lastDelta={x:i,y:r},this.emitter.emit("scroll",{deltaX:i,deltaY:r,event:n})});Dt(this,"onTouchEnd",n=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:n})});Dt(this,"onWheel",n=>{let{deltaX:e,deltaY:t,deltaMode:i}=n;const r=yE(i,this.window.width),o=yE(i,this.window.height);e*=r,t*=o,e*=this.options.wheelMultiplier,t*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:e,deltaY:t,event:n})});Dt(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=n,this.options=e,window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,Lu),this.element.addEventListener("touchstart",this.onTouchStart,Lu),this.element.addEventListener("touchmove",this.onTouchMove,Lu),this.element.addEventListener("touchend",this.onTouchEnd,Lu)}on(n,e){return this.emitter.on(n,e)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize),this.element.removeEventListener("wheel",this.onWheel,Lu),this.element.removeEventListener("touchstart",this.onTouchStart,Lu),this.element.removeEventListener("touchmove",this.onTouchMove,Lu),this.element.removeEventListener("touchend",this.onTouchEnd,Lu)}};const SE=n=>Math.min(1,1.001-2**(-10*n));var i3=class{constructor({wrapper:n=window,content:e=document.documentElement,eventsTarget:t=n,smoothWheel:i=!0,syncTouch:r=!1,syncTouchLerp:o=.075,touchInertiaExponent:l=1.7,duration:c,easing:d,lerp:p=.1,infinite:m=!1,orientation:v="vertical",gestureOrientation:g=v==="horizontal"?"both":"vertical",touchMultiplier:y=1,wheelMultiplier:E=1,autoResize:C=!0,prevent:w,virtualScroll:M,overscroll:P=!0,autoRaf:I=!1,anchors:D=!1,autoToggle:L=!1,allowNestedScroll:O=!1,__experimental__naiveDimensions:U=!1,naiveDimensions:b=U,stopInertiaOnNavigate:F=!1,respectReducedMotion:H=!0}={}){Dt(this,"_isScrolling",!1);Dt(this,"_isStopped",!1);Dt(this,"_isLocked",!1);Dt(this,"_preventNextNativeScrollEvent",!1);Dt(this,"_resetVelocityTimeout",null);Dt(this,"_rafId",null);Dt(this,"_isDraggingSelection",!1);Dt(this,"reducedMotionMediaQuery",window.matchMedia("(prefers-reduced-motion: reduce)"));Dt(this,"isTouching");Dt(this,"isIos");Dt(this,"time",0);Dt(this,"userData",{});Dt(this,"lastVelocity",0);Dt(this,"velocity",0);Dt(this,"direction",0);Dt(this,"options");Dt(this,"targetScroll");Dt(this,"animatedScroll");Dt(this,"animate",new Q2);Dt(this,"emitter",new _A);Dt(this,"dimensions");Dt(this,"virtualScroll");Dt(this,"onScrollEnd",n=>{n instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&n.stopPropagation()});Dt(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});Dt(this,"onTransitionEnd",n=>{var e;(e=n.propertyName)!=null&&e.includes("overflow")&&n.target===this.rootElement&&this.checkOverflow()});Dt(this,"onClick",n=>{const e=n.composedPath().filter(i=>i instanceof HTMLAnchorElement&&i.href).map(i=>new URL(i.href)),t=new URL(window.location.href);if(this.options.anchors){const i=e.find(r=>t.host===r.host&&t.pathname===r.pathname&&r.hash);if(i){const r=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,o=decodeURIComponent(i.hash);this.scrollTo(o,r);return}}if(this.options.stopInertiaOnNavigate&&e.some(i=>t.host===i.host&&t.pathname!==i.pathname)){this.reset();return}});Dt(this,"onPointerDown",n=>{n.button===1&&this.reset()});Dt(this,"onVirtualScroll",n=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(n)===!1)return;const{deltaX:e,deltaY:t,event:i}=n;if(this.emitter.emit("virtual-scroll",{deltaX:e,deltaY:t,event:i}),i.ctrlKey||i.lenisStopPropagation)return;const r=i.type.includes("touch"),o=i.type.includes("wheel");if(r&&this.isIos&&(i.type==="touchstart"&&(this._isDraggingSelection=this.isTouchOnSelectionHandle(i)),this._isDraggingSelection)){i.type==="touchend"&&(this._isDraggingSelection=!1);return}this.isTouching=i.type==="touchstart"||i.type==="touchmove";const l=e===0&&t===0;if(this.options.syncTouch&&r&&i.type==="touchstart"&&l&&!this.isStopped&&!this.isLocked){this.reset();return}const c=this.options.gestureOrientation==="vertical"&&t===0||this.options.gestureOrientation==="horizontal"&&e===0;if(l||c)return;let d=i.composedPath();d=d.slice(0,d.indexOf(this.rootElement));const p=this.options.prevent,m=Math.abs(e)>=Math.abs(t)?"horizontal":"vertical";if(d.find(E=>{var C,w,M,P,I;return E instanceof HTMLElement&&(typeof p=="function"&&(p==null?void 0:p(E))||((C=E.hasAttribute)==null?void 0:C.call(E,"data-lenis-prevent"))||m==="vertical"&&((w=E.hasAttribute)==null?void 0:w.call(E,"data-lenis-prevent-vertical"))||m==="horizontal"&&((M=E.hasAttribute)==null?void 0:M.call(E,"data-lenis-prevent-horizontal"))||r&&((P=E.hasAttribute)==null?void 0:P.call(E,"data-lenis-prevent-touch"))||o&&((I=E.hasAttribute)==null?void 0:I.call(E,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.hasNestedScroll(E,{deltaX:e,deltaY:t}))}))return;if(this.isStopped||this.isLocked){i.cancelable&&i.preventDefault();return}if(!(this.options.syncTouch&&r||this.options.smoothWheel&&o)){this.isScrolling="native",this.animate.stop(),i.lenisStopPropagation=!0;return}let v=t;this.options.gestureOrientation==="both"?v=Math.abs(t)>Math.abs(e)?t:e:this.options.gestureOrientation==="horizontal"&&(v=e),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll0||this.animatedScroll===this.limit&&t<0))&&(i.lenisStopPropagation=!0),i.cancelable&&i.preventDefault();const g=r&&this.options.syncTouch,y=r&&i.type==="touchend";y&&(v=Math.sign(v)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+v,{programmatic:!1,...g?{lerp:y?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});Dt(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const n=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-n,this.direction=Math.sign(this.animatedScroll-n),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});Dt(this,"raf",n=>{const e=n-(this.time||n);this.time=n,this.animate.advance(e*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=xE,window.lenis||(window.lenis={}),window.lenis.version=xE,v==="horizontal"&&(window.lenis.horizontal=!0),r===!0&&(window.lenis.touch=!0),this.isIos=/(iPad|iPhone|iPod)/g.test(navigator.userAgent),(!n||n===document.documentElement)&&(n=window),typeof c=="number"&&typeof d!="function"?d=SE:typeof d=="function"&&typeof c!="number"&&(c=1),this.options={wrapper:n,content:e,eventsTarget:t,smoothWheel:i,syncTouch:r,syncTouchLerp:o,touchInertiaExponent:l,duration:c,easing:d,lerp:p,infinite:m,gestureOrientation:g,orientation:v,touchMultiplier:y,wheelMultiplier:E,autoResize:C,prevent:w,virtualScroll:M,overscroll:P,autoRaf:I,anchors:D,autoToggle:L,allowNestedScroll:O,naiveDimensions:b,stopInertiaOnNavigate:F,respectReducedMotion:H},this.dimensions=new e3(n,e,{autoResize:C}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown),this.virtualScroll=new n3(t,{touchMultiplier:y,wheelMultiplier:E}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(n,e){return this.emitter.on(n,e)}off(n,e){return this.emitter.off(n,e)}get overflow(){const n=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[n]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(n){this.isHorizontal?this.options.wrapper.scrollTo({left:n,behavior:"instant"}):this.options.wrapper.scrollTo({top:n,behavior:"instant"})}isTouchOnSelectionHandle(n){const e=window.getSelection();if(!e||e.isCollapsed||e.rangeCount===0)return!1;const t=n.targetTouches[0]??n.changedTouches[0];if(!t)return!1;const i=e.getRangeAt(0).getClientRects();if(i.length===0)return!1;const r=i[0],o=i[i.length-1],l=40,c=Math.hypot(t.clientX-r.left,t.clientY-r.top)<=l,d=Math.hypot(t.clientX-o.right,t.clientY-o.bottom)<=l;return c||d}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(n,{offset:e=0,immediate:t=!1,lock:i=!1,programmatic:r=!0,lerp:o=r?this.options.lerp:void 0,duration:l=r?this.options.duration:void 0,easing:c=r?this.options.easing:void 0,onStart:d,onComplete:p,force:m=!1,userData:v}={}){if(this.prefersReducedMotion&&(r?t=!0:(o=1,l=void 0,c=void 0)),(this.isStopped||this.isLocked)&&!m)return;let g=n,y=e;if(typeof g=="string"&&["top","left","start","#"].includes(g))g=0;else if(typeof g=="string"&&["bottom","right","end"].includes(g))g=this.limit;else{let E=null;if(typeof g=="string"?(E=g.startsWith("#")?document.getElementById(g.slice(1)):document.querySelector(g),E||(g==="#top"?g=0:console.warn("Lenis: Target not found",g))):g instanceof HTMLElement&&(g!=null&&g.nodeType)&&(E=g),E){if(this.options.wrapper!==window){const D=this.rootElement.getBoundingClientRect();y-=this.isHorizontal?D.left:D.top}const C=E.getBoundingClientRect(),w=getComputedStyle(E),M=this.isHorizontal?Number.parseFloat(w.scrollMarginLeft):Number.parseFloat(w.scrollMarginTop),P=getComputedStyle(this.rootElement),I=this.isHorizontal?Number.parseFloat(P.scrollPaddingLeft):Number.parseFloat(P.scrollPaddingTop);g=(this.isHorizontal?C.left:C.top)+this.animatedScroll-(Number.isNaN(M)?0:M)-(Number.isNaN(I)?0:I)}}if(typeof g=="number"){if(g+=y,this.options.infinite){if(r){this.targetScroll=this.animatedScroll=this.scroll;const E=g-this.animatedScroll;E>this.limit/2?g-=this.limit:E<-this.limit/2&&(g+=this.limit)}}else g=vA(0,g,this.limit);if(g===this.targetScroll){d==null||d(this),p==null||p(this);return}if(this.userData=v??{},t){this.animatedScroll=this.targetScroll=g,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),p==null||p(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}r||(this.targetScroll=g),typeof l=="number"&&typeof c!="function"?c=SE:typeof c=="function"&&typeof l!="number"&&(l=1),this.animate.fromTo(this.animatedScroll,g,{duration:l,easing:c,lerp:o,onStart:()=>{i&&(this.isLocked=!0),this.isScrolling="smooth",d==null||d(this)},onUpdate:(E,C)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=E-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=E,this.setScroll(this.scroll),r&&(this.targetScroll=E),C||this.emit(),C&&(this.reset(),this.emit(),p==null||p(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(n,{deltaX:e,deltaY:t}){const i=Date.now();n._lenis||(n._lenis={});const r=n._lenis;let o,l,c,d,p,m,v,g,y,E;if(i-(r.time??0)>2e3){r.time=Date.now();const O=window.getComputedStyle(n);if(r.computedStyle=O,o=["auto","overlay","scroll"].includes(O.overflowX),l=["auto","overlay","scroll"].includes(O.overflowY),p=["auto"].includes(O.overscrollBehaviorX),m=["auto"].includes(O.overscrollBehaviorY),r.hasOverflowX=o,r.hasOverflowY=l,!(o||l))return!1;v=n.scrollWidth,g=n.scrollHeight,y=n.clientWidth,E=n.clientHeight,c=v>y,d=g>E,r.isScrollableX=c,r.isScrollableY=d,r.scrollWidth=v,r.scrollHeight=g,r.clientWidth=y,r.clientHeight=E,r.hasOverscrollBehaviorX=p,r.hasOverscrollBehaviorY=m}else c=r.isScrollableX,d=r.isScrollableY,o=r.hasOverflowX,l=r.hasOverflowY,v=r.scrollWidth,g=r.scrollHeight,y=r.clientWidth,E=r.clientHeight,p=r.hasOverscrollBehaviorX,m=r.hasOverscrollBehaviorY;if(!(o&&c||l&&d))return!1;const C=Math.abs(e)>=Math.abs(t)?"horizontal":"vertical";let w,M,P,I,D,L;if(C==="horizontal")w=Math.round(n.scrollLeft),M=v-y,P=e,I=o,D=c,L=p;else if(C==="vertical")w=Math.round(n.scrollTop),M=g-E,P=t,I=l,D=d,L=m;else return!1;return!L&&(w>=M||w<=0)?!0:(P>0?w0)&&I&&D}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const n=this.options.wrapper;return this.isHorizontal?n.scrollX??n.scrollLeft:n.scrollY??n.scrollTop}get scroll(){return this.options.infinite?$2(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(n){this._isScrolling!==n&&(this._isScrolling=n,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(n){this._isStopped!==n&&(this._isStopped=n,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(n){this._isLocked!==n&&(this._isLocked=n,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get prefersReducedMotion(){return this.options.respectReducedMotion&&this.reducedMotionMediaQuery.matches}get className(){let n="lenis";return this.options.autoToggle&&(n+=" lenis-autoToggle"),this.isStopped&&(n+=" lenis-stopped"),this.isLocked&&(n+=" lenis-locked"),this.isScrolling&&(n+=" lenis-scrolling"),this.isScrolling==="smooth"&&(n+=" lenis-smooth"),n}updateClassName(){this.cleanUpClassName(),this.className.split(" ").forEach(n=>{this.rootElement.classList.add(n)})}cleanUpClassName(){for(const n of Array.from(this.rootElement.classList))(n==="lenis"||n.startsWith("lenis-"))&&this.rootElement.classList.remove(n)}};function Bl(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function xA(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! * GSAP 3.15.0 * https://gsap.com * * @license Copyright 2008-2026, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var po={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Om={duration:.5,overwrite:!1,delay:0},s1,Or,xi,Fo=1e8,oi=1/Fo,_y=Math.PI*2,r3=_y/4,s3=0,yA=Math.sqrt,o3=Math.cos,a3=Math.sin,wr=function(e){return typeof e=="string"},Ii=function(e){return typeof e=="function"},Kl=function(e){return typeof e=="number"},o1=function(e){return typeof e>"u"},el=function(e){return typeof e=="object"},Fs=function(e){return e!==!1},a1=function(){return typeof window<"u"},o0=function(e){return Ii(e)||wr(e)},SA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},es=Array.isArray,l3=/random\([^)]+\)/g,u3=/,\s*/g,ME=/(?:-?\.?\d|\.)+/gi,MA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ih=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,j_=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,EA=/[+-]=-?[.\d]+/,c3=/[^,'"\[\]\s]+/gi,f3=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ti,Va,xy,l1,go={},vv={},wA,TA=function(e){return(vv=wh(e,go))&&Ws},u1=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Um=function(e,t){return!t&&console.warn(e)},CA=function(e,t){return e&&(go[e]=t)&&vv&&(vv[e]=t)||go},Fm=function(){return 0},d3={suppressEvents:!0,isStart:!0,kill:!1},K0={suppressEvents:!0,kill:!1},h3={suppressEvents:!0},c1={},Qu=[],yy={},AA,oo={},Y_={},EE=30,$0=[],f1="",d1=function(e){var t=e[0],i,r;if(el(t)||Ii(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(r=$0.length;r--&&!$0[r].targetTest(t););i=$0[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new ZA(e[r],i)))||e.splice(r,1);return e},vf=function(e){return e._gsap||d1(zo(e))[0]._gsap},RA=function(e,t,i){return(i=e[t])&&Ii(i)?e[t]():o1(i)&&e.getAttribute&&e.getAttribute(t)||i},zs=function(e,t){return(e=e.split(",")).forEach(t)||e},Bi=function(e){return Math.round(e*1e5)/1e5||0},wi=function(e){return Math.round(e*1e7)/1e7||0},hh=function(e,t){var i=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+r:i==="-"?e-r:i==="*"?e*r:e/r},p3=function(e,t){for(var i=t.length,r=0;e.indexOf(t[r])<0&&++rc;)l=l._prev;return l?(t._next=l._next,l._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[r]=t,t._prev=l,t.parent=t._dp=e,t},Kv=function(e,t,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var o=t._prev,l=t._next;o?o._next=l:e[i]===t&&(e[i]=l),l?l._prev=o:e[r]===t&&(e[r]=o),t._next=t._prev=t.parent=null},nc=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},_f=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},v3=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Sy=function(e,t,i,r){return e._startAt&&(Or?e._startAt.revert(K0):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},_3=function n(e){return!e||e._ts&&n(e.parent)},TE=function(e){return e._repeat?Th(e._tTime,e=e.duration()+e._rDelay)*e:0},Th=function(e,t){var i=Math.floor(e=wi(e/t));return e&&i===e?i-1:i},yv=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},$v=function(e){return e._end=wi(e._start+(e._tDur/Math.abs(e._ts||e._rts||oi)||0))},Qv=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=wi(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),$v(e),i._dirty||_f(i,e)),e},LA=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._startoi)&&t.render(i,!0)),_f(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-oi}},Wa=function(e,t,i,r){return t.parent&&nc(t),t._start=wi((Kl(i)?i:i||e!==Ti?No(e,i,t):e._time)+t._delay),t._end=wi(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),NA(e,t,"_first","_last",e._sort?"_start":0),My(t)||(e._recent=t),r||LA(e,t),e._ts<0&&Qv(e,e._tTime),e},IA=function(e,t){return(go.ScrollTrigger||u1("scrollTrigger",t))&&go.ScrollTrigger.create(t,e)},kA=function(e,t,i,r,o){if(m1(e,t,o),!e._initted)return 1;if(!i&&e._pt&&!Or&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&AA!==lo.frame)return Qu.push(e),e._lazy=[o,r],1},x3=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},My=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},y3=function(e,t,i,r){var o=e.ratio,l=t<0||!t&&(!e._start&&x3(e)&&!(!e._initted&&My(e))||(e._ts<0||e._dp._ts<0)&&!My(e))?0:1,c=e._rDelay,d=0,p,m,v;if(c&&e._repeat&&(d=ng(0,e._tDur,t),m=Th(d,c),e._yoyo&&m&1&&(l=1-l),m!==Th(e._tTime,c)&&(o=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==o||Or||r||e._zTime===oi||!t&&e._zTime){if(!e._initted&&kA(e,t,r,i,d))return;for(v=e._zTime,e._zTime=t||(i?oi:0),i||(i=t&&!v),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=d,p=e._pt;p;)p.r(l,p.d),p=p._next;t<0&&Sy(e,t,i,!0),e._onUpdate&&!i&&fo(e,"onUpdate"),d&&e._repeat&&!i&&e.parent&&fo(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&nc(e,1),!i&&!Or&&(fo(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},S3=function(e,t,i){var r;if(i>t)for(r=e._first;r&&r._start<=i;){if(r.data==="isPause"&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=i;){if(r.data==="isPause"&&r._start0&&!r&&Qv(e,e._tTime=e._tDur*c),e.parent&&$v(e),i||_f(e.parent,e),e},CE=function(e){return e instanceof Us?_f(e):Ch(e,e._dur)},M3={_start:0,endTime:Fm,totalDuration:Fm},No=function n(e,t,i){var r=e.labels,o=e._recent||M3,l=e.duration()>=Fo?o.endTime(!1):e._dur,c,d,p;return wr(t)&&(isNaN(t)||t in r)?(d=t.charAt(0),p=t.substr(-1)==="%",c=t.indexOf("="),d==="<"||d===">"?(c>=0&&(t=t.replace(/=/,"")),(d==="<"?o._start:o.endTime(o._repeat>=0))+(parseFloat(t.substr(1))||0)*(p?(c<0?o:i).totalDuration()/100:1)):c<0?(t in r||(r[t]=l),r[t]):(d=parseFloat(t.charAt(c-1)+t.substr(c+1)),p&&i&&(d=d/100*(es(i)?i[0]:i).totalDuration()),c>1?n(e,t.substr(0,c-1),i)+d:l+d)):t==null?l:+t},xm=function(e,t,i){var r=Kl(t[1]),o=(r?2:1)+(e<2?0:1),l=t[o],c,d;if(r&&(l.duration=t[1]),l.parent=i,e){for(c=l,d=i;d&&!("immediateRender"in c);)c=d.vars.defaults||{},d=Fs(d.vars.inherit)&&d.parent;l.immediateRender=Fs(c.immediateRender),e<2?l.runBackwards=1:l.startAt=t[o-1]}return new er(t[0],l,t[o+1])},cc=function(e,t){return e||e===0?t(e):t},ng=function(e,t,i){return it?t:i},$r=function(e,t){return!wr(e)||!(t=f3.exec(e))?"":t[1]},E3=function(e,t,i){return cc(i,function(r){return ng(e,t,r)})},Ey=[].slice,OA=function(e,t){return e&&el(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&el(e[0]))&&!e.nodeType&&e!==Va},w3=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(r){var o;return wr(r)&&!t||OA(r,1)?(o=i).push.apply(o,zo(r)):i.push(r)})||i},zo=function(e,t,i){return xi&&!t&&xi.selector?xi.selector(e):wr(e)&&!i&&(xy||!Ah())?Ey.call((t||l1).querySelectorAll(e),0):es(e)?w3(e,i):OA(e)?Ey.call(e,0):e?[e]:[]},wy=function(e){return e=zo(e)[0]||Um("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return zo(t,i.querySelectorAll?i:i===e?Um("Invalid scope")||l1.createElement("div"):e)}},UA=function(e){return e.sort(function(){return .5-Math.random()})},FA=function(e){if(Ii(e))return e;var t=el(e)?e:{each:e},i=xf(t.ease),r=t.from||0,o=parseFloat(t.base)||0,l={},c=r>0&&r<1,d=isNaN(r)||c,p=t.axis,m=r,v=r;return wr(r)?m=v={center:.5,edges:.5,end:1}[r]||0:!c&&d&&(m=r[0],v=r[1]),function(g,y,E){var C=(E||t).length,w=l[C],M,P,I,D,L,O,U,b,F;if(!w){if(F=t.grid==="auto"?0:(t.grid||[1,Fo])[1],!F){for(U=-Fo;U<(U=E[F++].getBoundingClientRect().left)&&FU&&(U=L),LC?C-1:p?p==="y"?C/F:F:Math.max(F,C/F))||0)*(r==="edges"?-1:1),w.b=C<0?o-C:o,w.u=$r(t.amount||t.each)||0,i=i&&C<0?U3(i):i}return C=(w[g]-w.min)/w.max||0,wi(w.b+(i?i(C):C)*w.v)+w.u}},Ty=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var r=wi(Math.round(parseFloat(i)/e)*e*t);return(r-r%1)/t+(Kl(i)?0:$r(i))}},zA=function(e,t){var i=es(e),r,o;return!i&&el(e)&&(r=i=e.radius||Fo,e.values?(e=zo(e.values),(o=!Kl(e[0]))&&(r*=r)):e=Ty(e.increment)),cc(t,i?Ii(e)?function(l){return o=e(l),Math.abs(o-l)<=r?o:l}:function(l){for(var c=parseFloat(o?l.x:l),d=parseFloat(o?l.y:0),p=Fo,m=0,v=e.length,g,y;v--;)o?(g=e[v].x-c,y=e[v].y-d,g=g*g+y*y):g=Math.abs(e[v]-c),gr?o-l:l)})},zm=function(e){return e.replace(l3,function(t){var i=t.indexOf("[")+1,r=t.substring(i||7,i?t.indexOf("]"):t.length-1).split(u3);return BA(i?r:+r[0],i?0:+r[1],+r[2]||1e-5)})},HA=function(e,t,i,r,o){var l=t-e,c=r-i;return cc(o,function(d){return i+((d-e)/l*c||0)})},b3=function n(e,t,i,r){var o=isNaN(e+t)?0:function(y){return(1-y)*e+y*t};if(!o){var l=wr(e),c={},d,p,m,v,g;if(i===!0&&(r=1)&&(i=null),l)e={p:e},t={p:t};else if(es(e)&&!es(t)){for(m=[],v=e.length,g=v-2,p=1;p(c=Math.abs(c))&&(d=l,o=c);return d},fo=function(e,t,i){var r=e.vars,o=r[t],l=xi,c=e._ctx,d,p,m;if(o)return d=r[t+"Params"],p=r.callbackScope||e,i&&Qu.length&&_v(),c&&(xi=c),m=d?o.apply(p,d):o.call(p),xi=l,m},sm=function(e){return nc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Or),e.progress()<1&&fo(e,"onInterrupt"),e},rh,GA=[],WA=function(e){if(e)if(e=!e.name&&e.default||e,a1()||e.headless){var t=e.name,i=Ii(e),r=t&&!i&&e.init?function(){this._props=[]}:e,o={init:Fm,render:_1,add:p1,kill:Y3,modifier:j3,rawVars:0},l={targetTest:0,get:0,getSetter:v1,aliases:{},register:0};if(Ah(),e!==r){if(oo[t])return;vo(r,vo(xv(e,o),l)),wh(r.prototype,wh(o,xv(e,l))),oo[r.prop=t]=r,e.targetTest&&($0.push(r),c1[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}CA(t,r),e.register&&e.register(Ws,r,Bs)}else GA.push(e)},si=255,om={aqua:[0,si,si],lime:[0,si,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,si],navy:[0,0,128],white:[si,si,si],olive:[128,128,0],yellow:[si,si,0],orange:[si,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[si,0,0],pink:[si,192,203],cyan:[0,si,si],transparent:[si,si,si,0]},q_=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*si+.5|0},XA=function(e,t,i){var r=e?Kl(e)?[e>>16,e>>8&si,e&si]:0:om.black,o,l,c,d,p,m,v,g,y,E;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),om[e])r=om[e];else if(e.charAt(0)==="#"){if(e.length<6&&(o=e.charAt(1),l=e.charAt(2),c=e.charAt(3),e="#"+o+o+l+l+c+c+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&si,r&si,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&si,e&si]}else if(e.substr(0,3)==="hsl"){if(r=E=e.match(ME),!t)d=+r[0]%360/360,p=+r[1]/100,m=+r[2]/100,l=m<=.5?m*(p+1):m+p-m*p,o=m*2-l,r.length>3&&(r[3]*=1),r[0]=q_(d+1/3,o,l),r[1]=q_(d,o,l),r[2]=q_(d-1/3,o,l);else if(~e.indexOf("="))return r=e.match(MA),i&&r.length<4&&(r[3]=1),r}else r=e.match(ME)||om.transparent;r=r.map(Number)}return t&&!E&&(o=r[0]/si,l=r[1]/si,c=r[2]/si,v=Math.max(o,l,c),g=Math.min(o,l,c),m=(v+g)/2,v===g?d=p=0:(y=v-g,p=m>.5?y/(2-v-g):y/(v+g),d=v===o?(l-c)/y+(le||M<0)&&(i+=M-t),r+=M,L=r-i,I=L-l,(I>0||P)&&(O=++v.frame,g=L-v.time*1e3,v.time=L=L/1e3,l+=I+(I>=o?4:o-I),D=1),P||(d=p(C)),D)for(y=0;y=M&&y--},_listeners:c},v})(),Ah=function(){return!Bm&&lo.wake()},Tn={},N3=/^[\d.\-M][\d.\-,\s]/,L3=/["']/g,I3=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),r=i[0],o=1,l=i.length,c,d,p;o1&&i.config?i.config.apply(null,~e.indexOf("{")?[I3(t[1])]:k3(e).split(",").map(bA)):Tn._CE&&N3.test(e)?Tn._CE("",e):i},U3=function(e){return function(t){return 1-e(1-t)}},xf=function(e,t){return e&&(Ii(e)?e:Tn[e]||O3(e))||t},Nf=function(e,t,i,r){i===void 0&&(i=function(d){return 1-t(1-d)}),r===void 0&&(r=function(d){return d<.5?t(d*2)/2:1-t((1-d)*2)/2});var o={easeIn:t,easeOut:i,easeInOut:r},l;return zs(e,function(c){Tn[c]=go[c]=o,Tn[l=c.toLowerCase()]=i;for(var d in o)Tn[l+(d==="easeIn"?".in":d==="easeOut"?".out":".inOut")]=Tn[c+"."+d]=o[d]}),o},qA=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},Z_=function n(e,t,i){var r=t>=1?t:1,o=(i||(e?.3:.45))/(t<1?t:1),l=o/_y*(Math.asin(1/r)||0),c=function(m){return m===1?1:r*Math.pow(2,-10*m)*a3((m-l)*o)+1},d=e==="out"?c:e==="in"?function(p){return 1-c(1-p)}:qA(c);return o=_y/o,d.config=function(p,m){return n(e,p,m)},d},K_=function n(e,t){t===void 0&&(t=1.70158);var i=function(l){return l?--l*l*((t+1)*l+t)+1:0},r=e==="out"?i:e==="in"?function(o){return 1-i(1-o)}:qA(i);return r.config=function(o){return n(e,o)},r};zs("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;Nf(n+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})});Tn.Linear.easeNone=Tn.none=Tn.Linear.easeIn;Nf("Elastic",Z_("in"),Z_("out"),Z_());(function(n,e){var t=1/e,i=2*t,r=2.5*t,o=function(c){return c0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,Ch(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,r){if(Ah(),!arguments.length)return this._tTime;var o=this._dp;if(o&&o.smoothChildTiming&&this._ts){for(Qv(this,i),!o._dp||o.parent||LA(o,this);o&&o.parent;)o.parent._time!==o._start+(o._ts>=0?o._tTime/o._ts:(o.totalDuration()-o._tTime)/-o._ts)&&o.totalTime(o._tTime,!0),o=o.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i0||!this._tDur&&!i)&&Wa(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===oi||!this._initted&&this._dur&&i||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),PA(this,i,r)),this},e.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+TE(this))%(this._dur+this._rDelay)||(i?this._dur:0),r):this._time},e.totalProgress=function(i,r){return arguments.length?this.totalTime(this.totalDuration()*i,r):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+TE(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,r){var o=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*o,r):this._repeat?Th(this._tTime,o)+1:1},e.timeScale=function(i,r){if(!arguments.length)return this._rts===-oi?0:this._rts;if(this._rts===i)return this;var o=this.parent&&this._ts?yv(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-oi?0:this._rts,this.totalTime(ng(-Math.abs(this._delay),this.totalDuration(),o),r!==!1),$v(this),v3(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ah(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==oi&&(this._tTime-=oi)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=wi(i);var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&Wa(r,this,this._start-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Fs(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var r=this.parent||this._dp;return r?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?yv(r.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=h3);var r=Or;return Or=i,h1(this)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Or=r,this},e.globalTime=function(i){for(var r=this,o=arguments.length?i:r.rawTime();r;)o=r._start+o/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):o},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,CE(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,CE(this),r?this.time(r):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,r){return this.totalTime(No(this,i),Fs(r))},e.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,Fs(r)),this._dur||(this._zTime=-oi),this},e.play=function(i,r){return i!=null&&this.seek(i,r),this.reversed(!1).paused(!1)},e.reverse=function(i,r){return i!=null&&this.seek(i||this.totalDuration(),r),this.reversed(!0).paused(!1)},e.pause=function(i,r){return i!=null&&this.seek(i,r),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-oi:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-oi,this},e.isActive=function(){var i=this.parent||this._dp,r=this._start,o;return!!(!i||this._ts&&this._initted&&i.isActive()&&(o=i.rawTime(!0))>=r&&o1?(r?(l[i]=r,o&&(l[i+"Params"]=o),i==="onUpdate"&&(this._onUpdate=r)):delete l[i],this):l[i]},e.then=function(i){var r=this,o=r._prom;return new Promise(function(l){var c=Ii(i)?i:DA,d=function(){var m=r.then;r.then=null,o&&o(),Ii(c)&&(c=c(r))&&(c.then||c===r)&&(r.then=m),l(c),r.then=m};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?d():r._prom=d})},e.kill=function(){sm(this)},n})();vo(Vm.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-oi,_prom:0,_ps:!1,_rts:1});var Us=(function(n){xA(e,n);function e(i,r){var o;return i===void 0&&(i={}),o=n.call(this,i)||this,o.labels={},o.smoothChildTiming=!!i.smoothChildTiming,o.autoRemoveChildren=!!i.autoRemoveChildren,o._sort=Fs(i.sortChildren),Ti&&Wa(i.parent||Ti,Bl(o),r),i.reversed&&o.reverse(),i.paused&&o.paused(!0),i.scrollTrigger&&IA(Bl(o),i.scrollTrigger),o}var t=e.prototype;return t.to=function(r,o,l){return xm(0,arguments,this),this},t.from=function(r,o,l){return xm(1,arguments,this),this},t.fromTo=function(r,o,l,c){return xm(2,arguments,this),this},t.set=function(r,o,l){return o.duration=0,o.parent=this,_m(o).repeatDelay||(o.repeat=0),o.immediateRender=!!o.immediateRender,new er(r,o,No(this,l),1),this},t.call=function(r,o,l){return Wa(this,er.delayedCall(0,r,o),l)},t.staggerTo=function(r,o,l,c,d,p,m){return l.duration=o,l.stagger=l.stagger||c,l.onComplete=p,l.onCompleteParams=m,l.parent=this,new er(r,l,No(this,d)),this},t.staggerFrom=function(r,o,l,c,d,p,m){return l.runBackwards=1,_m(l).immediateRender=Fs(l.immediateRender),this.staggerTo(r,o,l,c,d,p,m)},t.staggerFromTo=function(r,o,l,c,d,p,m,v){return c.startAt=l,_m(c).immediateRender=Fs(c.immediateRender),this.staggerTo(r,o,c,d,p,m,v)},t.render=function(r,o,l){var c=this._time,d=this._dirty?this.totalDuration():this._tDur,p=this._dur,m=r<=0?0:wi(r),v=this._zTime<0!=r<0&&(this._initted||!p),g,y,E,C,w,M,P,I,D,L,O,U;if(this!==Ti&&m>d&&r>=0&&(m=d),m!==this._tTime||l||v){if(c!==this._time&&p&&(m+=this._time-c,r+=this._time-c),g=m,D=this._start,I=this._ts,M=!I,v&&(p||(c=this._zTime),(r||!o)&&(this._zTime=r)),this._repeat){if(O=this._yoyo,w=p+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(w*100+r,o,l);if(g=wi(m%w),m===d?(C=this._repeat,g=p):(L=wi(m/w),C=~~L,C&&C===L&&(g=p,C--),g>p&&(g=p)),L=Th(this._tTime,w),!c&&this._tTime&&L!==C&&this._tTime-L*w-this._dur<=0&&(L=C),O&&C&1&&(g=p-g,U=1),C!==L&&!this._lock){var b=O&&L&1,F=b===(O&&C&1);if(C=c&&r>=0)for(y=this._first;y;){if(E=y._next,(y._act||g>=y._start)&&y._ts&&P!==y){if(y.parent!==this)return this.render(r,o,l);if(y.render(y._ts>0?(g-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(g-y._start)*y._ts,o,l),g!==this._time||!this._ts&&!M){P=0,E&&(m+=this._zTime=-oi);break}}y=E}else{y=this._last;for(var H=r<0?r:g;y;){if(E=y._prev,(y._act||H<=y._end)&&y._ts&&P!==y){if(y.parent!==this)return this.render(r,o,l);if(y.render(y._ts>0?(H-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(H-y._start)*y._ts,o,l||Or&&h1(y)),g!==this._time||!this._ts&&!M){P=0,E&&(m+=this._zTime=H?-oi:oi);break}}y=E}}if(P&&!o&&(this.pause(),P.render(g>=c?0:-oi)._zTime=g>=c?1:-1,this._ts))return this._start=D,$v(this),this.render(r,o,l);this._onUpdate&&!o&&fo(this,"onUpdate",!0),(m===d&&this._tTime>=this.totalDuration()||!m&&c)&&(D===this._start||Math.abs(I)!==Math.abs(this._ts))&&(this._lock||((r||!p)&&(m===d&&this._ts>0||!m&&this._ts<0)&&nc(this,1),!o&&!(r<0&&!c)&&(m||c||!d)&&(fo(this,m===d&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(m0)&&this._prom())))}return this},t.add=function(r,o){var l=this;if(Kl(o)||(o=No(this,o,r)),!(r instanceof Vm)){if(es(r))return r.forEach(function(c){return l.add(c,o)}),this;if(wr(r))return this.addLabel(r,o);if(Ii(r))r=er.delayedCall(0,r);else return this}return this!==r?Wa(this,r,o):this},t.getChildren=function(r,o,l,c){r===void 0&&(r=!0),o===void 0&&(o=!0),l===void 0&&(l=!0),c===void 0&&(c=-Fo);for(var d=[],p=this._first;p;)p._start>=c&&(p instanceof er?o&&d.push(p):(l&&d.push(p),r&&d.push.apply(d,p.getChildren(!0,o,l)))),p=p._next;return d},t.getById=function(r){for(var o=this.getChildren(1,1,1),l=o.length;l--;)if(o[l].vars.id===r)return o[l]},t.remove=function(r){return wr(r)?this.removeLabel(r):Ii(r)?this.killTweensOf(r):(r.parent===this&&Kv(this,r),r===this._recent&&(this._recent=this._last),_f(this))},t.totalTime=function(r,o){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=wi(lo.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,o),this._forcing=0,this):this._tTime},t.addLabel=function(r,o){return this.labels[r]=No(this,o),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,o,l){var c=er.delayedCall(0,o||Fm,l);return c.data="isPause",this._hasPause=1,Wa(this,c,No(this,r))},t.removePause=function(r){var o=this._first;for(r=No(this,r);o;)o._start===r&&o.data==="isPause"&&nc(o),o=o._next},t.killTweensOf=function(r,o,l){for(var c=this.getTweensOf(r,l),d=c.length;d--;)Xu!==c[d]&&c[d].kill(r,o);return this},t.getTweensOf=function(r,o){for(var l=[],c=zo(r),d=this._first,p=Kl(o),m;d;)d instanceof er?p3(d._targets,c)&&(p?(!Xu||d._initted&&d._ts)&&d.globalTime(0)<=o&&d.globalTime(d.totalDuration())>o:!o||d.isActive())&&l.push(d):(m=d.getTweensOf(c,o)).length&&l.push.apply(l,m),d=d._next;return l},t.tweenTo=function(r,o){o=o||{};var l=this,c=No(l,r),d=o,p=d.startAt,m=d.onStart,v=d.onStartParams,g=d.immediateRender,y,E=er.to(l,vo({ease:o.ease||"none",lazy:!1,immediateRender:!1,time:c,overwrite:"auto",duration:o.duration||Math.abs((c-(p&&"time"in p?p.time:l._time))/l.timeScale())||oi,onStart:function(){if(l.pause(),!y){var w=o.duration||Math.abs((c-(p&&"time"in p?p.time:l._time))/l.timeScale());E._dur!==w&&Ch(E,w,0,1).render(E._time,!0,!0),y=1}m&&m.apply(E,v||[])}},o));return g?E.render(0):E},t.tweenFromTo=function(r,o,l){return this.tweenTo(o,vo({startAt:{time:No(this,r)}},l))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),AE(this,No(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),AE(this,No(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+oi)},t.shiftChildren=function(r,o,l){l===void 0&&(l=0);var c=this._first,d=this.labels,p;for(r=wi(r);c;)c._start>=l&&(c._start+=r,c._end+=r),c=c._next;if(o)for(p in d)d[p]>=l&&(d[p]+=r);return _f(this)},t.invalidate=function(r){var o=this._first;for(this._lock=0;o;)o.invalidate(r),o=o._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var o=this._first,l;o;)l=o._next,this.remove(o),o=l;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),_f(this)},t.totalDuration=function(r){var o=0,l=this,c=l._last,d=Fo,p,m,v;if(arguments.length)return l.timeScale((l._repeat<0?l.duration():l.totalDuration())/(l.reversed()?-r:r));if(l._dirty){for(v=l.parent;c;)p=c._prev,c._dirty&&c.totalDuration(),m=c._start,m>d&&l._sort&&c._ts&&!l._lock?(l._lock=1,Wa(l,c,m-c._delay,1)._lock=0):d=m,m<0&&c._ts&&(o-=m,(!v&&!l._dp||v&&v.smoothChildTiming)&&(l._start+=wi(m/l._ts),l._time-=m,l._tTime-=m),l.shiftChildren(-m,!1,-1/0),d=0),c._end>o&&c._ts&&(o=c._end),c=p;Ch(l,l===Ti&&l._time>o?l._time:o,1,1),l._dirty=0}return l._tDur},e.updateRoot=function(r){if(Ti._ts&&(PA(Ti,yv(r,Ti)),AA=lo.frame),lo.frame>=EE){EE+=po.autoSleep||120;var o=Ti._first;if((!o||!o._ts)&&po.autoSleep&&lo._listeners.length<2){for(;o&&!o._ts;)o=o._next;o||lo.sleep()}}},e})(Vm);vo(Us.prototype,{_lock:0,_hasPause:0,_forcing:0});var F3=function(e,t,i,r,o,l,c){var d=new Bs(this._pt,e,t,0,1,tR,null,o),p=0,m=0,v,g,y,E,C,w,M,P;for(d.b=i,d.e=r,i+="",r+="",(M=~r.indexOf("random("))&&(r=zm(r)),l&&(P=[i,r],l(P,e,t),i=P[0],r=P[1]),g=i.match(j_)||[];v=j_.exec(r);)E=v[0],C=r.substring(p,v.index),y?y=(y+1)%5:C.substr(-5)==="rgba("&&(y=1),E!==g[m++]&&(w=parseFloat(g[m-1])||0,d._pt={_next:d._pt,p:C||m===1?C:",",s:w,c:E.charAt(1)==="="?hh(w,E)-w:parseFloat(E)-w,m:y&&y<4?Math.round:0},p=j_.lastIndex);return d.c=p")}),I.duration();else{L={};for(U in E)U==="ease"||U==="easeEach"||H3(U,E[U],L,E.easeEach);for(U in L)for(le=L[U].sort(function(ce,$){return ce.t-$.t}),Y=0,D=0;Dd-oi&&!m?d:rp&&(g=p)),M=this._yoyo&&E&1,M&&(g=p-g),w=Th(this._tTime,C),g===c&&!l&&this._initted&&E===w)return this._tTime=v,this;E!==w&&this.vars.repeatRefresh&&!M&&!this._lock&&g!==C&&this._initted&&(this._lock=l=1,this.render(wi(C*E),!0).invalidate()._lock=0)}if(!this._initted){if(kA(this,m?r:g,l,o,v))return this._tTime=0,this;if(c!==this._time&&!(l&&this.vars.repeatRefresh&&E!==w))return this;if(p!==this._dur)return this.render(r,o,l)}if(this._rEase){var D=g0||!v&&this._ts<0)&&nc(this,1),!o&&!(m&&!c)&&(v||c||M)&&(fo(this,v===d?"onComplete":"onReverseComplete",!0),this._prom&&!(v0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(r){return(!r||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(r),n.prototype.invalidate.call(this,r)},t.resetTo=function(r,o,l,c,d){Bm||lo.wake(),this._ts||this.play();var p=Math.min(this._dur,(this._dp._time-this._start)*this._ts),m;return this._initted||m1(this,p),m=this._ease(p/this._dur),B3(this,r,o,l,c,m,p,d)?this.resetTo(r,o,l,c,1):(Qv(this,0),this.parent||NA(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,o){if(o===void 0&&(o="all"),!r&&(!o||o==="all"))return this._lazy=this._pt=0,this.parent?sm(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Or),this;if(this.timeline){var l=this.timeline.totalDuration();return this.timeline.killTweensOf(r,o,Xu&&Xu.vars.overwrite!==!0)._first||sm(this),this.parent&&l!==this.timeline.totalDuration()&&Ch(this,this._dur*this.timeline._tDur/l,0,1),this}var c=this._targets,d=r?zo(r):c,p=this._ptLookup,m=this._pt,v,g,y,E,C,w,M;if((!o||o==="all")&&g3(c,d))return o==="all"&&(this._pt=0),sm(this);for(v=this._op=this._op||[],o!=="all"&&(wr(o)&&(C={},zs(o,function(P){return C[P]=1}),o=C),o=V3(c,o)),M=c.length;M--;)if(~d.indexOf(c[M])){g=p[M],o==="all"?(v[M]=o,E=g,y={}):(y=v[M]=v[M]||{},E=o);for(C in E)w=g&&g[C],w&&((!("kill"in w.d)||w.d.kill(C)===!0)&&Kv(this,w,"_pt"),delete g[C]),y!=="all"&&(y[C]=1)}return this._initted&&!this._pt&&m&&sm(this),this},e.to=function(r,o){return new e(r,o,arguments[2])},e.from=function(r,o){return xm(1,arguments)},e.delayedCall=function(r,o,l,c){return new e(o,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:o,onReverseComplete:o,onCompleteParams:l,onReverseCompleteParams:l,callbackScope:c})},e.fromTo=function(r,o,l){return xm(2,arguments)},e.set=function(r,o){return o.duration=0,o.repeatDelay||(o.repeat=0),new e(r,o)},e.killTweensOf=function(r,o,l){return Ti.killTweensOf(r,o,l)},e})(Vm);vo(er.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});zs("staggerTo,staggerFrom,staggerFromTo",function(n){er[n]=function(){var e=new Us,t=Ey.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var g1=function(e,t,i){return e[t]=i},JA=function(e,t,i){return e[t](i)},G3=function(e,t,i,r){return e[t](r.fp,i)},W3=function(e,t,i){return e.setAttribute(t,i)},v1=function(e,t){return Ii(e[t])?JA:o1(e[t])&&e.setAttribute?W3:g1},eR=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},X3=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},tR=function(e,t){var i=t._pt,r="";if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;i;)r=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+r,i=i._next;r+=t.c}t.set(t.t,t.p,r,t)},_1=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},j3=function(e,t,i,r){for(var o=this._pt,l;o;)l=o._next,o.p===r&&o.modifier(e,t,i),o=l},Y3=function(e){for(var t=this._pt,i,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?Kv(this,t,"_pt"):t.dep||(i=1),t=r;return!i},q3=function(e,t,i,r){r.mSet(e,t,r.m.call(r.tween,i,r.mt),r)},nR=function(e){for(var t=e._pt,i,r,o,l;t;){for(i=t._next,r=o;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:l)?t._prev._next=t:o=t,(t._next=r)?r._prev=t:l=t,t=i}e._pt=o},Bs=(function(){function n(t,i,r,o,l,c,d,p,m){this.t=i,this.s=o,this.c=l,this.p=r,this.r=c||eR,this.d=d||this,this.set=p||g1,this.pr=m||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(i,r,o){this.mSet=this.mSet||this.set,this.set=q3,this.m=i,this.mt=o,this.tween=r},n})();zs(f1+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(n){return c1[n]=1});go.TweenMax=go.TweenLite=er;go.TimelineLite=go.TimelineMax=Us;Ti=new Us({sortChildren:!1,defaults:Om,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});po.stringFilter=YA;var yf=[],Q0={},Z3=[],PE=0,K3=0,$_=function(e){return(Q0[e]||Z3).map(function(t){return t()})},Ay=function(){var e=Date.now(),t=[];e-PE>2&&($_("matchMediaInit"),yf.forEach(function(i){var r=i.queries,o=i.conditions,l,c,d,p;for(c in r)l=Va.matchMedia(r[c]).matches,l&&(d=1),l!==o[c]&&(o[c]=l,p=1);p&&(i.revert(),d&&t.push(i))}),$_("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),PE=e,$_("matchMedia"))},iR=(function(){function n(t,i){this.selector=i&&wy(i),this.data=[],this._r=[],this.isReverted=!1,this.id=K3++,t&&this.add(t)}var e=n.prototype;return e.add=function(i,r,o){Ii(i)&&(o=r,r=i,i=Ii);var l=this,c=function(){var p=xi,m=l.selector,v;return p&&p!==l&&p.data.push(l),o&&(l.selector=wy(o)),xi=l,v=r.apply(l,arguments),Ii(v)&&l._r.push(v),xi=p,l.selector=m,l.isReverted=!1,v};return l.last=c,i===Ii?c(l,function(d){return l.add(null,d)}):i?l[i]=c:c},e.ignore=function(i){var r=xi;xi=null,i(this),xi=r},e.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof n?i.push.apply(i,r.getTweens()):r instanceof er&&!(r.parent&&r.parent.data==="nested")&&i.push(r)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,r){var o=this;if(i?(function(){for(var c=o.getTweens(),d=o.data.length,p;d--;)p=o.data[d],p.data==="isFlip"&&(p.revert(),p.getChildren(!0,!0,!1).forEach(function(m){return c.splice(c.indexOf(m),1)}));for(c.map(function(m){return{g:m._dur||m._delay||m._sat&&!m._sat.vars.immediateRender?m.globalTime(0):-1/0,t:m}}).sort(function(m,v){return v.g-m.g||-1/0}).forEach(function(m){return m.t.revert(i)}),d=o.data.length;d--;)p=o.data[d],p instanceof Us?p.data!=="nested"&&(p.scrollTrigger&&p.scrollTrigger.revert(),p.kill()):!(p instanceof er)&&p.revert&&p.revert(i);o._r.forEach(function(m){return m(i,o)}),o.isReverted=!0})():this.data.forEach(function(c){return c.kill&&c.kill()}),this.clear(),r)for(var l=yf.length;l--;)yf[l].id===this.id&&yf.splice(l,1)},e.revert=function(i){this.kill(i||{})},n})(),$3=(function(){function n(t){this.contexts=[],this.scope=t,xi&&xi.data.push(this)}var e=n.prototype;return e.add=function(i,r,o){el(i)||(i={matches:i});var l=new iR(0,o||this.scope),c=l.conditions={},d,p,m;xi&&!l.selector&&(l.selector=xi.selector),this.contexts.push(l),r=l.add("onMatch",r),l.queries=i;for(p in i)p==="all"?m=1:(d=Va.matchMedia(i[p]),d&&(yf.indexOf(l)<0&&yf.push(l),(c[p]=d.matches)&&(m=1),d.addListener?d.addListener(Ay):d.addEventListener("change",Ay)));return m&&r(l,function(v){return l.add(null,v)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},n})(),Sv={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i1){var r=e.map(function(m){return Ws.quickSetter(m,t,i)}),o=r.length;return function(m){for(var v=o;v--;)r[v](m)}}e=e[0]||{};var l=oo[t],c=vf(e),d=c.harness&&(c.harness.aliases||{})[t]||t,p=l?function(m){var v=new l;rh._pt=0,v.init(e,i?m+i:m,rh,0,[e]),v.render(1,v),rh._pt&&_1(1,rh)}:c.set(e,d);return l?p:function(m){return p(e,d,i?m+i:m,c,1)}},quickTo:function(e,t,i){var r,o=Ws.to(e,vo((r={},r[t]="+=0.1",r.paused=!0,r.stagger=0,r),i||{})),l=function(d,p,m){return o.resetTo(t,d,p,m)};return l.tween=o,l},isTweening:function(e){return Ti.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=xf(e.ease,Om.ease)),wE(Om,e||{})},config:function(e){return wE(po,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,r=e.plugins,o=e.defaults,l=e.extendTimeline;(r||"").split(",").forEach(function(c){return c&&!oo[c]&&!go[c]&&Um(t+" effect requires "+c+" plugin.")}),Y_[t]=function(c,d,p){return i(zo(c),vo(d||{},o),p)},l&&(Us.prototype[t]=function(c,d,p){return this.add(Y_[t](c,el(d)?d:(p=d)&&{},this),p)})},registerEase:function(e,t){Tn[e]=xf(t)},parseEase:function(e,t){return arguments.length?xf(e,t):Tn},getById:function(e){return Ti.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Us(e),r,o;for(i.smoothChildTiming=Fs(e.smoothChildTiming),Ti.remove(i),i._dp=0,i._time=i._tTime=Ti._time,r=Ti._first;r;)o=r._next,(t||!(!r._dur&&r instanceof er&&r.vars.onComplete===r._targets[0]))&&Wa(i,r,r._start-r._delay),r=o;return Wa(Ti,i,0),i},context:function(e,t){return e?new iR(e,t):xi},matchMedia:function(e){return new $3(e)},matchMediaRefresh:function(){return yf.forEach(function(e){var t=e.conditions,i,r;for(r in t)t[r]&&(t[r]=!1,i=1);i&&e.revert()})||Ay()},addEventListener:function(e,t){var i=Q0[e]||(Q0[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=Q0[e],r=i&&i.indexOf(t);r>=0&&i.splice(r,1)},utils:{wrap:R3,wrapYoyo:P3,distribute:FA,random:BA,snap:zA,normalize:A3,getUnit:$r,clamp:E3,splitColor:XA,toArray:zo,selector:wy,mapRange:HA,pipe:T3,unitize:C3,interpolate:b3,shuffle:UA},install:TA,effects:Y_,ticker:lo,updateRoot:Us.updateRoot,plugins:oo,globalTimeline:Ti,core:{PropTween:Bs,globals:CA,Tween:er,Timeline:Us,Animation:Vm,getCache:vf,_removeLinkedListItem:Kv,reverting:function(){return Or},context:function(e){return e&&xi&&(xi.data.push(e),e._ctx=xi),xi},suppressOverwrites:function(e){return s1=e}}};zs("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return Sv[n]=er[n]});lo.add(Us.updateRoot);rh=Sv.to({},{duration:0});var Q3=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},J3=function(e,t){var i=e._targets,r,o,l;for(r in t)for(o=i.length;o--;)l=e._ptLookup[o][r],l&&(l=l.d)&&(l._pt&&(l=Q3(l,r)),l&&l.modifier&&l.modifier(t[r],e,i[o],r))},Q_=function(e,t){return{name:e,headless:1,rawVars:1,init:function(r,o,l){l._onInit=function(c){var d,p;if(wr(o)&&(d={},zs(o,function(m){return d[m]=1}),o=d),t){d={};for(p in o)d[p]=t(o[p]);o=d}J3(c,o)}}}},Ws=Sv.registerPlugin({name:"attr",init:function(e,t,i,r,o){var l,c,d;this.tween=i;for(l in t)d=e.getAttribute(l)||"",c=this.add(e,"setAttribute",(d||0)+"",t[l],r,o,0,0,l),c.op=l,c.b=d,this._props.push(l)},render:function(e,t){for(var i=t._pt;i;)Or?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",headless:1,init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},Q_("roundProps",Ty),Q_("modifiers"),Q_("snap",zA))||Sv;er.version=Us.version=Ws.version="3.15.0";wA=1;a1()&&Ah();Tn.Power0;Tn.Power1;Tn.Power2;Tn.Power3;Tn.Power4;Tn.Linear;Tn.Quad;Tn.Cubic;Tn.Quart;Tn.Quint;Tn.Strong;Tn.Elastic;Tn.Back;Tn.SteppedEase;Tn.Bounce;Tn.Sine;Tn.Expo;Tn.Circ;/*! * CSSPlugin 3.15.0 * https://gsap.com * * Copyright 2008-2026, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var bE,ju,ph,x1,df,DE,y1,eD=function(){return typeof window<"u"},$l={},rf=180/Math.PI,mh=Math.PI/180,bd=Math.atan2,NE=1e8,S1=/([A-Z])/g,tD=/(left|right|width|margin|padding|x)/i,nD=/[\s,\(]\S/,ja={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ry=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},iD=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rD=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},sD=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},oD=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},rR=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},sR=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},aD=function(e,t,i){return e.style[t]=i},lD=function(e,t,i){return e.style.setProperty(t,i)},uD=function(e,t,i){return e._gsap[t]=i},cD=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},fD=function(e,t,i,r,o){var l=e._gsap;l.scaleX=l.scaleY=i,l.renderTransform(o,l)},dD=function(e,t,i,r,o){var l=e._gsap;l[t]=i,l.renderTransform(o,l)},Ci="transform",Vs=Ci+"Origin",hD=function n(e,t){var i=this,r=this.target,o=r.style,l=r._gsap;if(e in $l&&o){if(this.tfm=this.tfm||{},e!=="transform")e=ja[e]||e,~e.indexOf(",")?e.split(",").forEach(function(c){return i.tfm[c]=Vl(r,c)}):this.tfm[e]=l.x?l[e]:Vl(r,e),e===Vs&&(this.tfm.zOrigin=l.zOrigin);else return ja.transform.split(",").forEach(function(c){return n.call(i,c,t)});if(this.props.indexOf(Ci)>=0)return;l.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Vs,t,"")),e=Ci}(o||t)&&this.props.push(e,t,o[e])},oR=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},pD=function(){var e=this.props,t=this.target,i=t.style,r=t._gsap,o,l;for(o=0;o=0?LE[l]:"")+e},by=function(){eD()&&window.document&&(bE=window,ju=bE.document,ph=ju.documentElement,df=Py("div")||{style:{}},Py("div"),Ci=Rh(Ci),Vs=Ci+"Origin",df.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",lR=!!Rh("perspective"),y1=Ws.core.reverting,x1=1)},IE=function(e){var t=e.ownerSVGElement,i=Py("svg",t&&t.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=e.cloneNode(!0),o;r.style.display="block",i.appendChild(r),ph.appendChild(i);try{o=r.getBBox()}catch{}return i.removeChild(r),ph.removeChild(i),o},kE=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},uR=function(e){var t,i;try{t=e.getBBox()}catch{t=IE(e),i=1}return t&&(t.width||t.height)||i||(t=IE(e)),t&&!t.width&&!t.x&&!t.y?{x:+kE(e,["x","cx","x1"])||0,y:+kE(e,["y","cy","y1"])||0,width:0,height:0}:t},cR=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&uR(e))},ic=function(e,t){if(t){var i=e.style,r;t in $l&&t!==Vs&&(t=Ci),i.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(r==="--"?t:t.replace(S1,"-$1").toLowerCase())):i.removeAttribute(t)}},Yu=function(e,t,i,r,o,l){var c=new Bs(e._pt,t,i,0,1,l?sR:rR);return e._pt=c,c.b=r,c.e=o,e._props.push(i),c},OE={deg:1,rad:1,turn:1},mD={grid:1,flex:1},rc=function n(e,t,i,r){var o=parseFloat(i)||0,l=(i+"").trim().substr((o+"").length)||"px",c=df.style,d=tD.test(t),p=e.tagName.toLowerCase()==="svg",m=(p?"client":"offset")+(d?"Width":"Height"),v=100,g=r==="px",y=r==="%",E,C,w,M;if(r===l||!o||OE[r]||OE[l])return o;if(l!=="px"&&!g&&(o=n(e,t,i,"px")),M=e.getCTM&&cR(e),(y||l==="%")&&($l[t]||~t.indexOf("adius")))return E=M?e.getBBox()[d?"width":"height"]:e[m],Bi(y?o/E*v:o/100*E);if(c[d?"width":"height"]=v+(g?l:r),C=r!=="rem"&&~t.indexOf("adius")||r==="em"&&e.appendChild&&!p?e:e.parentNode,M&&(C=(e.ownerSVGElement||{}).parentNode),(!C||C===ju||!C.appendChild)&&(C=ju.body),w=C._gsap,w&&y&&w.width&&d&&w.time===lo.time&&!w.uncache)return Bi(o/w.width*v);if(y&&(t==="height"||t==="width")){var P=e.style[t];e.style[t]=v+r,E=e[m],P?e.style[t]=P:ic(e,t)}else(y||l==="%")&&!mD[ho(C,"display")]&&(c.position=ho(e,"position")),C===e&&(c.position="static"),C.appendChild(df),E=df[m],C.removeChild(df),c.position="absolute";return d&&y&&(w=vf(C),w.time=lo.time,w.width=C[m]),Bi(g?E*o/v:E&&o?v/E*o:0)},Vl=function(e,t,i,r){var o;return x1||by(),t in ja&&t!=="transform"&&(t=ja[t],~t.indexOf(",")&&(t=t.split(",")[0])),$l[t]&&t!=="transform"?(o=Gm(e,r),o=t!=="transformOrigin"?o[t]:o.svg?o.origin:Ev(ho(e,Vs))+" "+o.zOrigin+"px"):(o=e.style[t],(!o||o==="auto"||r||~(o+"").indexOf("calc("))&&(o=Mv[t]&&Mv[t](e,t,i)||ho(e,t)||RA(e,t)||(t==="opacity"?1:0))),i&&!~(o+"").trim().indexOf(" ")?rc(e,t,o,i)+i:o},gD=function(e,t,i,r){if(!i||i==="none"){var o=Rh(t,e,1),l=o&&ho(e,o,1);l&&l!==i?(t=o,i=l):t==="borderColor"&&(i=ho(e,"borderTopColor"))}var c=new Bs(this._pt,e.style,t,0,1,tR),d=0,p=0,m,v,g,y,E,C,w,M,P,I,D,L;if(c.b=i,c.e=r,i+="",r+="",r.substring(0,6)==="var(--"&&(r=ho(e,r.substring(4,r.indexOf(")")))),r==="auto"&&(C=e.style[t],e.style[t]=r,r=ho(e,t)||r,C?e.style[t]=C:ic(e,t)),m=[i,r],YA(m),i=m[0],r=m[1],g=i.match(ih)||[],L=r.match(ih)||[],L.length){for(;v=ih.exec(r);)w=v[0],P=r.substring(d,v.index),E?E=(E+1)%5:(P.substr(-5)==="rgba("||P.substr(-5)==="hsla(")&&(E=1),w!==(C=g[p++]||"")&&(y=parseFloat(C)||0,D=C.substr((y+"").length),w.charAt(1)==="="&&(w=hh(y,w)+D),M=parseFloat(w),I=w.substr((M+"").length),d=ih.lastIndex-I.length,I||(I=I||po.units[t]||D,d===r.length&&(r+=I,c.e+=I)),D!==I&&(y=rc(e,t,C,I)||0),c._pt={_next:c._pt,p:P||p===1?P:",",s:y,c:M-y,m:E&&E<4||t==="zIndex"?Math.round:0});c.c=d-1;)c=o[p],$l[c]&&(d=1,c=c==="transformOrigin"?Vs:Ci),ic(i,c);d&&(ic(i,Ci),l&&(l.svg&&i.removeAttribute("transform"),r.scale=r.rotate=r.translate="none",Gm(i,1),l.uncache=1,oR(r)))}},Mv={clearProps:function(e,t,i,r,o){if(o.data!=="isFromStart"){var l=e._pt=new Bs(e._pt,t,i,0,0,_D);return l.u=r,l.pr=-10,l.tween=o,e._props.push(i),1}}},Hm=[1,0,0,1,0,0],fR={},dR=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},FE=function(e){var t=ho(e,Ci);return dR(t)?Hm:t.substr(7).match(MA).map(Bi)},M1=function(e,t){var i=e._gsap||vf(e),r=e.style,o=FE(e),l,c,d,p;return i.svg&&e.getAttribute("transform")?(d=e.transform.baseVal.consolidate().matrix,o=[d.a,d.b,d.c,d.d,d.e,d.f],o.join(",")==="1,0,0,1,0,0"?Hm:o):(o===Hm&&!e.offsetParent&&e!==ph&&!i.svg&&(d=r.display,r.display="block",l=e.parentNode,(!l||!e.offsetParent&&!e.getBoundingClientRect().width)&&(p=1,c=e.nextElementSibling,ph.appendChild(e)),o=FE(e),d?r.display=d:ic(e,"display"),p&&(c?l.insertBefore(e,c):l?l.appendChild(e):ph.removeChild(e))),t&&o.length>6?[o[0],o[1],o[4],o[5],o[12],o[13]]:o)},Dy=function(e,t,i,r,o,l){var c=e._gsap,d=o||M1(e,!0),p=c.xOrigin||0,m=c.yOrigin||0,v=c.xOffset||0,g=c.yOffset||0,y=d[0],E=d[1],C=d[2],w=d[3],M=d[4],P=d[5],I=t.split(" "),D=parseFloat(I[0])||0,L=parseFloat(I[1])||0,O,U,b,F;i?d!==Hm&&(U=y*w-E*C)&&(b=D*(w/U)+L*(-C/U)+(C*P-w*M)/U,F=D*(-E/U)+L*(y/U)-(y*P-E*M)/U,D=b,L=F):(O=uR(e),D=O.x+(~I[0].indexOf("%")?D/100*O.width:D),L=O.y+(~(I[1]||I[0]).indexOf("%")?L/100*O.height:L)),r||r!==!1&&c.smooth?(M=D-p,P=L-m,c.xOffset=v+(M*y+P*C)-M,c.yOffset=g+(M*E+P*w)-P):c.xOffset=c.yOffset=0,c.xOrigin=D,c.yOrigin=L,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!i,e.style[Vs]="0px 0px",l&&(Yu(l,c,"xOrigin",p,D),Yu(l,c,"yOrigin",m,L),Yu(l,c,"xOffset",v,c.xOffset),Yu(l,c,"yOffset",g,c.yOffset)),e.setAttribute("data-svg-origin",D+" "+L)},Gm=function(e,t){var i=e._gsap||new ZA(e);if("x"in i&&!t&&!i.uncache)return i;var r=e.style,o=i.scaleX<0,l="px",c="deg",d=getComputedStyle(e),p=ho(e,Vs)||"0",m,v,g,y,E,C,w,M,P,I,D,L,O,U,b,F,H,W,Y,le,pe,ee,ce,$,X,Q,B,G,te,Oe,We,qe;return m=v=g=C=w=M=P=I=D=0,y=E=1,i.svg=!!(e.getCTM&&cR(e)),d.translate&&((d.translate!=="none"||d.scale!=="none"||d.rotate!=="none")&&(r[Ci]=(d.translate!=="none"?"translate3d("+(d.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(d.rotate!=="none"?"rotate("+d.rotate+") ":"")+(d.scale!=="none"?"scale("+d.scale.split(" ").join(",")+") ":"")+(d[Ci]!=="none"?d[Ci]:"")),r.scale=r.rotate=r.translate="none"),U=M1(e,i.svg),i.svg&&(i.uncache?(X=e.getBBox(),p=i.xOrigin-X.x+"px "+(i.yOrigin-X.y)+"px",$=""):$=!t&&e.getAttribute("data-svg-origin"),Dy(e,$||p,!!$||i.originIsAbsolute,i.smooth!==!1,U)),L=i.xOrigin||0,O=i.yOrigin||0,U!==Hm&&(W=U[0],Y=U[1],le=U[2],pe=U[3],m=ee=U[4],v=ce=U[5],U.length===6?(y=Math.sqrt(W*W+Y*Y),E=Math.sqrt(pe*pe+le*le),C=W||Y?bd(Y,W)*rf:0,P=le||pe?bd(le,pe)*rf+C:0,P&&(E*=Math.abs(Math.cos(P*mh))),i.svg&&(m-=L-(L*W+O*le),v-=O-(L*Y+O*pe))):(qe=U[6],Oe=U[7],B=U[8],G=U[9],te=U[10],We=U[11],m=U[12],v=U[13],g=U[14],b=bd(qe,te),w=b*rf,b&&(F=Math.cos(-b),H=Math.sin(-b),$=ee*F+B*H,X=ce*F+G*H,Q=qe*F+te*H,B=ee*-H+B*F,G=ce*-H+G*F,te=qe*-H+te*F,We=Oe*-H+We*F,ee=$,ce=X,qe=Q),b=bd(-le,te),M=b*rf,b&&(F=Math.cos(-b),H=Math.sin(-b),$=W*F-B*H,X=Y*F-G*H,Q=le*F-te*H,We=pe*H+We*F,W=$,Y=X,le=Q),b=bd(Y,W),C=b*rf,b&&(F=Math.cos(b),H=Math.sin(b),$=W*F+Y*H,X=ee*F+ce*H,Y=Y*F-W*H,ce=ce*F-ee*H,W=$,ee=X),w&&Math.abs(w)+Math.abs(C)>359.9&&(w=C=0,M=180-M),y=Bi(Math.sqrt(W*W+Y*Y+le*le)),E=Bi(Math.sqrt(ce*ce+qe*qe)),b=bd(ee,ce),P=Math.abs(b)>2e-4?b*rf:0,D=We?1/(We<0?-We:We):0),i.svg&&($=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!dR(ho(e,Ci)),$&&e.setAttribute("transform",$))),Math.abs(P)>90&&Math.abs(P)<270&&(o?(y*=-1,P+=C<=0?180:-180,C+=C<=0?180:-180):(E*=-1,P+=P<=0?180:-180)),t=t||i.uncache,i.x=m-((i.xPercent=m&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-m)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+l,i.y=v-((i.yPercent=v&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-v)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+l,i.z=g+l,i.scaleX=Bi(y),i.scaleY=Bi(E),i.rotation=Bi(C)+c,i.rotationX=Bi(w)+c,i.rotationY=Bi(M)+c,i.skewX=P+c,i.skewY=I+c,i.transformPerspective=D+l,(i.zOrigin=parseFloat(p.split(" ")[2])||!t&&i.zOrigin||0)&&(r[Vs]=Ev(p)),i.xOffset=i.yOffset=0,i.force3D=po.force3D,i.renderTransform=i.svg?yD:lR?hR:xD,i.uncache=0,i},Ev=function(e){return(e=e.split(" "))[0]+" "+e[1]},J_=function(e,t,i){var r=$r(t);return Bi(parseFloat(t)+parseFloat(rc(e,"x",i+"px",r)))+r},xD=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,hR(e,t)},Kc="0deg",Gp="0px",$c=") ",hR=function(e,t){var i=t||this,r=i.xPercent,o=i.yPercent,l=i.x,c=i.y,d=i.z,p=i.rotation,m=i.rotationY,v=i.rotationX,g=i.skewX,y=i.skewY,E=i.scaleX,C=i.scaleY,w=i.transformPerspective,M=i.force3D,P=i.target,I=i.zOrigin,D="",L=M==="auto"&&e&&e!==1||M===!0;if(I&&(v!==Kc||m!==Kc)){var O=parseFloat(m)*mh,U=Math.sin(O),b=Math.cos(O),F;O=parseFloat(v)*mh,F=Math.cos(O),l=J_(P,l,U*F*-I),c=J_(P,c,-Math.sin(O)*-I),d=J_(P,d,b*F*-I+I)}w!==Gp&&(D+="perspective("+w+$c),(r||o)&&(D+="translate("+r+"%, "+o+"%) "),(L||l!==Gp||c!==Gp||d!==Gp)&&(D+=d!==Gp||L?"translate3d("+l+", "+c+", "+d+") ":"translate("+l+", "+c+$c),p!==Kc&&(D+="rotate("+p+$c),m!==Kc&&(D+="rotateY("+m+$c),v!==Kc&&(D+="rotateX("+v+$c),(g!==Kc||y!==Kc)&&(D+="skew("+g+", "+y+$c),(E!==1||C!==1)&&(D+="scale("+E+", "+C+$c),P.style[Ci]=D||"translate(0, 0)"},yD=function(e,t){var i=t||this,r=i.xPercent,o=i.yPercent,l=i.x,c=i.y,d=i.rotation,p=i.skewX,m=i.skewY,v=i.scaleX,g=i.scaleY,y=i.target,E=i.xOrigin,C=i.yOrigin,w=i.xOffset,M=i.yOffset,P=i.forceCSS,I=parseFloat(l),D=parseFloat(c),L,O,U,b,F;d=parseFloat(d),p=parseFloat(p),m=parseFloat(m),m&&(m=parseFloat(m),p+=m,d+=m),d||p?(d*=mh,p*=mh,L=Math.cos(d)*v,O=Math.sin(d)*v,U=Math.sin(d-p)*-g,b=Math.cos(d-p)*g,p&&(m*=mh,F=Math.tan(p-m),F=Math.sqrt(1+F*F),U*=F,b*=F,m&&(F=Math.tan(m),F=Math.sqrt(1+F*F),L*=F,O*=F)),L=Bi(L),O=Bi(O),U=Bi(U),b=Bi(b)):(L=v,b=g,O=U=0),(I&&!~(l+"").indexOf("px")||D&&!~(c+"").indexOf("px"))&&(I=rc(y,"x",l,"px"),D=rc(y,"y",c,"px")),(E||C||w||M)&&(I=Bi(I+E-(E*L+C*U)+w),D=Bi(D+C-(E*O+C*b)+M)),(r||o)&&(F=y.getBBox(),I=Bi(I+r/100*F.width),D=Bi(D+o/100*F.height)),F="matrix("+L+","+O+","+U+","+b+","+I+","+D+")",y.setAttribute("transform",F),P&&(y.style[Ci]=F)},SD=function(e,t,i,r,o){var l=360,c=wr(o),d=parseFloat(o)*(c&&~o.indexOf("rad")?rf:1),p=d-r,m=r+p+"deg",v,g;return c&&(v=o.split("_")[1],v==="short"&&(p%=l,p!==p%(l/2)&&(p+=p<0?l:-l)),v==="cw"&&p<0?p=(p+l*NE)%l-~~(p/l)*l:v==="ccw"&&p>0&&(p=(p-l*NE)%l-~~(p/l)*l)),e._pt=g=new Bs(e._pt,t,i,r,p,iD),g.e=m,g.u="deg",e._props.push(i),g},zE=function(e,t){for(var i in t)e[i]=t[i];return e},MD=function(e,t,i){var r=zE({},i._gsap),o="perspective,force3D,transformOrigin,svgOrigin",l=i.style,c,d,p,m,v,g,y,E;r.svg?(p=i.getAttribute("transform"),i.setAttribute("transform",""),l[Ci]=t,c=Gm(i,1),ic(i,Ci),i.setAttribute("transform",p)):(p=getComputedStyle(i)[Ci],l[Ci]=t,c=Gm(i,1),l[Ci]=p);for(d in $l)p=r[d],m=c[d],p!==m&&o.indexOf(d)<0&&(y=$r(p),E=$r(m),v=y!==E?rc(i,d,p,E):parseFloat(p),g=parseFloat(m),e._pt=new Bs(e._pt,c,d,v,g-v,Ry),e._pt.u=E||0,e._props.push(d));zE(c,r)};zs("padding,margin,Width,Radius",function(n,e){var t="Top",i="Right",r="Bottom",o="Left",l=(e<3?[t,i,r,o]:[t+o,t+i,r+i,r+o]).map(function(c){return e<2?n+c:"border"+c+n});Mv[e>1?"border"+n:n]=function(c,d,p,m,v){var g,y;if(arguments.length<4)return g=l.map(function(E){return Vl(c,E,p)}),y=g.join(" "),y.split(g[0]).length===5?g[0]:y;g=(m+"").split(" "),y={},l.forEach(function(E,C){return y[E]=g[C]=g[C]||g[(C-1)/2|0]}),c.init(d,y,v)}});var pR={name:"css",register:by,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,r,o){var l=this._props,c=e.style,d=i.vars.startAt,p,m,v,g,y,E,C,w,M,P,I,D,L,O,U,b,F;x1||by(),this.styles=this.styles||aR(e),b=this.styles.props,this.tween=i;for(C in t)if(C!=="autoRound"&&(m=t[C],!(oo[C]&&KA(C,t,i,r,e,o)))){if(y=typeof m,E=Mv[C],y==="function"&&(m=m.call(i,r,e,o),y=typeof m),y==="string"&&~m.indexOf("random(")&&(m=zm(m)),E)E(this,e,C,m,i)&&(U=1);else if(C.substr(0,2)==="--")p=(getComputedStyle(e).getPropertyValue(C)+"").trim(),m+="",Ju.lastIndex=0,Ju.test(p)||(w=$r(p),M=$r(m),M?w!==M&&(p=rc(e,C,p,M)+M):w&&(m+=w)),this.add(c,"setProperty",p,m,r,o,0,0,C),l.push(C),b.push(C,0,c[C]);else if(y!=="undefined"){if(d&&C in d?(p=typeof d[C]=="function"?d[C].call(i,r,e,o):d[C],wr(p)&&~p.indexOf("random(")&&(p=zm(p)),$r(p+"")||p==="auto"||(p+=po.units[C]||$r(Vl(e,C))||""),(p+"").charAt(1)==="="&&(p=Vl(e,C))):p=Vl(e,C),g=parseFloat(p),P=y==="string"&&m.charAt(1)==="="&&m.substr(0,2),P&&(m=m.substr(2)),v=parseFloat(m),C in ja&&(C==="autoAlpha"&&(g===1&&Vl(e,"visibility")==="hidden"&&v&&(g=0),b.push("visibility",0,c.visibility),Yu(this,c,"visibility",g?"inherit":"hidden",v?"inherit":"hidden",!v)),C!=="scale"&&C!=="transform"&&(C=ja[C],~C.indexOf(",")&&(C=C.split(",")[0]))),I=C in $l,I){if(this.styles.save(C),F=m,y==="string"&&m.substring(0,6)==="var(--"){if(m=ho(e,m.substring(4,m.indexOf(")"))),m.substring(0,5)==="calc("){var H=e.style.perspective;e.style.perspective=m,m=ho(e,"perspective"),H?e.style.perspective=H:ic(e,"perspective")}v=parseFloat(m)}if(D||(L=e._gsap,L.renderTransform&&!t.parseTransform||Gm(e,t.parseTransform),O=t.smoothOrigin!==!1&&L.smooth,D=this._pt=new Bs(this._pt,c,Ci,0,1,L.renderTransform,L,0,-1),D.dep=1),C==="scale")this._pt=new Bs(this._pt,L,"scaleY",L.scaleY,(P?hh(L.scaleY,P+v):v)-L.scaleY||0,Ry),this._pt.u=0,l.push("scaleY",C),C+="X";else if(C==="transformOrigin"){b.push(Vs,0,c[Vs]),m=vD(m),L.svg?Dy(e,m,0,O,0,this):(M=parseFloat(m.split(" ")[2])||0,M!==L.zOrigin&&Yu(this,L,"zOrigin",L.zOrigin,M),Yu(this,c,C,Ev(p),Ev(m)));continue}else if(C==="svgOrigin"){Dy(e,m,1,O,0,this);continue}else if(C in fR){SD(this,L,C,g,P?hh(g,P+m):m);continue}else if(C==="smoothOrigin"){Yu(this,L,"smooth",L.smooth,m);continue}else if(C==="force3D"){L[C]=m;continue}else if(C==="transform"){MD(this,m,e);continue}}else C in c||(C=Rh(C)||C);if(I||(v||v===0)&&(g||g===0)&&!nD.test(m)&&C in c)w=(p+"").substr((g+"").length),v||(v=0),M=$r(m)||(C in po.units?po.units[C]:w),w!==M&&(g=rc(e,C,p,M)),this._pt=new Bs(this._pt,I?L:c,C,g,(P?hh(g,P+v):v)-g,!I&&(M==="px"||C==="zIndex")&&t.autoRound!==!1?oD:Ry),this._pt.u=M||0,I&&F!==m?(this._pt.b=p,this._pt.e=F,this._pt.r=sD):w!==M&&M!=="%"&&(this._pt.b=p,this._pt.r=rD);else if(C in c)gD.call(this,e,C,p,P?P+m:m);else if(C in e)this.add(e,C,p||e[C],P?P+m:m,r,o);else if(C!=="parseTransform"){u1(C,m);continue}I||(C in c?b.push(C,0,c[C]):typeof e[C]=="function"?b.push(C,2,e[C]()):b.push(C,1,p||e[C])),l.push(C)}}U&&nR(this)},render:function(e,t){if(t.tween._time||!y1())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Vl,aliases:ja,getSetter:function(e,t,i){var r=ja[t];return r&&r.indexOf(",")<0&&(t=r),t in $l&&t!==Vs&&(e._gsap.x||Vl(e,"x"))?i&&DE===i?t==="scale"?cD:uD:(DE=i||{})&&(t==="scale"?fD:dD):e.style&&!o1(e.style[t])?aD:~t.indexOf("-")?lD:v1(e,t)},core:{_removeProperty:ic,_getMatrix:M1}};Ws.utils.checkPrefix=Rh;Ws.core.getStyleSaver=aR;(function(n,e,t,i){var r=zs(n+","+e+","+t,function(o){$l[o]=1});zs(e,function(o){po.units[o]="deg",fR[o]=1}),ja[r[13]]=n+","+e,zs(i,function(o){var l=o.split(":");ja[l[1]]=r[l[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");zs("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){po.units[n]="px"});Ws.registerPlugin(pR);var _i=Ws.registerPlugin(pR)||Ws;_i.core.Tween;function ED(n,e){for(var t=0;td?(o=r,r=E,c=l,l=w):i?r+=E:r=o+(E-o)/(w-c)*(l-c)},v=function(){o=r=i?0:r,c=l=0},g=function(E){var C=c,w=o,M=Sm();return(E||E===0)&&E!==r&&m(E),l===c||M-c>p?0:(r+(i?w:-w))/((i?M:l)-C)*1e3};return{update:m,reset:v,getVelocity:g}},Wp=function(e,t){return t&&!e._gsapAllow&&e.cancelable!==!1&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},BE=function(e){var t=Math.max.apply(Math,e),i=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(i)?t:i},yR=function(){vh=Ir.core.globals().ScrollTrigger,vh&&vh.core&&TD()},SR=function(e){return Ir=e||_R(),!J0&&Ir&&typeof document<"u"&&document.body&&(uo=window,qu=document,Zu=qu.documentElement,gh=qu.body,gR=[uo,qu,Zu,gh],Ir.utils.clamp,vR=Ir.core.context||function(){},sf="onpointerenter"in gh?"pointer":"mouse",mR=Vi.isTouch=uo.matchMedia&&uo.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in uo||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,ga=Vi.eventTypes=("ontouchstart"in Zu?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in Zu?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return xR=0},500),J0=1),vh||yR(),J0};ys.op=fr;vn.cache=0;var Vi=(function(){function n(t){this.init(t)}var e=n.prototype;return e.init=function(i){J0||SR(Ir)||console.warn("Please gsap.registerPlugin(Observer)"),vh||yR();var r=i.tolerance,o=i.dragMinimum,l=i.type,c=i.target,d=i.lineHeight,p=i.debounce,m=i.preventDefault,v=i.onStop,g=i.onStopDelay,y=i.ignore,E=i.wheelSpeed,C=i.event,w=i.onDragStart,M=i.onDragEnd,P=i.onDrag,I=i.onPress,D=i.onRelease,L=i.onRight,O=i.onLeft,U=i.onUp,b=i.onDown,F=i.onChangeX,H=i.onChangeY,W=i.onChange,Y=i.onToggleX,le=i.onToggleY,pe=i.onHover,ee=i.onHoverEnd,ce=i.onMove,$=i.ignoreCheck,X=i.isNormalizer,Q=i.onGestureStart,B=i.onGestureEnd,G=i.onWheel,te=i.onEnable,Oe=i.onDisable,We=i.onClick,qe=i.scrollSpeed,fe=i.capture,Ae=i.allowClicks,Te=i.lockAxis,Ze=i.onLockAxis;this.target=c=Os(c)||Zu,this.vars=i,y&&(y=Ir.utils.toArray(y)),r=r||1e-9,o=o||0,E=E||1,qe=qe||1,l=l||"wheel,touch,pointer",p=p!==!1,d||(d=parseFloat(uo.getComputedStyle(gh).lineHeight)||22);var pt,ot,$t,et,Lt,Ht,Ft,ve=this,hn=0,Cn=0,pn=i.passive||!m&&i.passive!==!1,kt=sc(c,ys),xn=sc(c,fr),ie=kt(),Un=xn(),Ut=~l.indexOf("touch")&&!~l.indexOf("pointer")&&ga[0]==="pointerdown",j=Mm(c),k=c.ownerDocument||qu,ae=[0,0,0],me=[0,0,0],Me=0,He=function(){return Me=Sm()},ze=function(Le,Tt){return(ve.event=Le)&&y&&CD(Le.target,y)||Tt&&Ut&&Le.pointerType!=="touch"||$&&$(Le,Tt)},Ce=function(){ve._vx.reset(),ve._vy.reset(),ot.pause(),v&&v(ve)},Re=function(){var Le=ve.deltaX=BE(ae),Tt=ve.deltaY=BE(me),Ue=Math.abs(Le)>=r,Ct=Math.abs(Tt)>=r;W&&(Ue||Ct)&&W(ve,Le,Tt,ae,me),Ue&&(L&&ve.deltaX>0&&L(ve),O&&ve.deltaX<0&&O(ve),F&&F(ve),Y&&ve.deltaX<0!=hn<0&&Y(ve),hn=ve.deltaX,ae[0]=ae[1]=ae[2]=0),Ct&&(b&&ve.deltaY>0&&b(ve),U&&ve.deltaY<0&&U(ve),H&&H(ve),le&&ve.deltaY<0!=Cn<0&&le(ve),Cn=ve.deltaY,me[0]=me[1]=me[2]=0),(et||$t)&&(ce&&ce(ve),$t&&(w&&$t===1&&w(ve),P&&P(ve),$t=0),et=!1),Ht&&!(Ht=!1)&&Ze&&Ze(ve),Lt&&(G(ve),Lt=!1),pt=0},nt=function(Le,Tt,Ue){ae[Ue]+=Le,me[Ue]+=Tt,ve._vx.update(Le),ve._vy.update(Tt),p?pt||(pt=requestAnimationFrame(Re)):Re()},mt=function(Le,Tt){Te&&!Ft&&(ve.axis=Ft=Math.abs(Le)>Math.abs(Tt)?"x":"y",Ht=!0),Ft!=="y"&&(ae[2]+=Le,ve._vx.update(Le,!0)),Ft!=="x"&&(me[2]+=Tt,ve._vy.update(Tt,!0)),p?pt||(pt=requestAnimationFrame(Re)):Re()},Ke=function(Le){if(!ze(Le,1)){Le=Wp(Le,m);var Tt=Le.clientX,Ue=Le.clientY,Ct=Tt-ve.x,_t=Ue-ve.y,It=ve.isDragging;ve.x=Tt,ve.y=Ue,(It||(Ct||_t)&&(Math.abs(ve.startX-Tt)>=o||Math.abs(ve.startY-Ue)>=o))&&($t||($t=It?2:1),It||(ve.isDragging=!0),mt(Ct,_t))}},$e=ve.onPress=function(ke){ze(ke,1)||ke&&ke.button||(ve.axis=Ft=null,ot.pause(),ve.isPressed=!0,ke=Wp(ke),hn=Cn=0,ve.startX=ve.x=ke.clientX,ve.startY=ve.y=ke.clientY,ve._vx.reset(),ve._vy.reset(),ms(X?c:k,ga[1],Ke,pn,!0),ve.deltaX=ve.deltaY=0,I&&I(ve))},Ge=ve.onRelease=function(ke){if(!ze(ke,1)){ps(X?c:k,ga[1],Ke,!0);var Le=!isNaN(ve.y-ve.startY),Tt=ve.isDragging,Ue=Tt&&(Math.abs(ve.x-ve.startX)>3||Math.abs(ve.y-ve.startY)>3),Ct=Wp(ke);!Ue&&Le&&(ve._vx.reset(),ve._vy.reset(),m&&Ae&&Ir.delayedCall(.08,function(){if(Sm()-Me>300&&!ke.defaultPrevented){if(ke.target.click)ke.target.click();else if(k.createEvent){var _t=k.createEvent("MouseEvents");_t.initMouseEvent("click",!0,!0,uo,1,Ct.screenX,Ct.screenY,Ct.clientX,Ct.clientY,!1,!1,!1,!1,0,null),ke.target.dispatchEvent(_t)}}})),ve.isDragging=ve.isGesturing=ve.isPressed=!1,v&&Tt&&!X&&ot.restart(!0),$t&&Re(),M&&Tt&&M(ve),D&&D(ve,Ue)}},Mt=function(Le){return Le.touches&&Le.touches.length>1&&(ve.isGesturing=!0)&&Q(Le,ve.isDragging)},wt=function(){return(ve.isGesturing=!1)||B(ve)},J=function(Le){if(!ze(Le)){var Tt=kt(),Ue=xn();nt((Tt-ie)*qe,(Ue-Un)*qe,1),ie=Tt,Un=Ue,v&&ot.restart(!0)}},Xe=function(Le){if(!ze(Le)){Le=Wp(Le,m),G&&(Lt=!0);var Tt=(Le.deltaMode===1?d:Le.deltaMode===2?uo.innerHeight:1)*E;nt(Le.deltaX*Tt,Le.deltaY*Tt,0),v&&!X&&ot.restart(!0)}},Pe=function(Le){if(!ze(Le)){var Tt=Le.clientX,Ue=Le.clientY,Ct=Tt-ve.x,_t=Ue-ve.y;ve.x=Tt,ve.y=Ue,et=!0,v&&ot.restart(!0),(Ct||_t)&&mt(Ct,_t)}},Je=function(Le){ve.event=Le,pe(ve)},rt=function(Le){ve.event=Le,ee(ve)},Ne=function(Le){return ze(Le)||Wp(Le,m)&&We(ve)};ot=ve._dc=Ir.delayedCall(g||.25,Ce).pause(),ve.deltaX=ve.deltaY=0,ve._vx=Iy(0,50,!0),ve._vy=Iy(0,50,!0),ve.scrollX=kt,ve.scrollY=xn,ve.isDragging=ve.isGesturing=ve.isPressed=!1,vR(this),ve.enable=function(ke){return ve.isEnabled||(ms(j?k:c,"scroll",Ly),l.indexOf("scroll")>=0&&ms(j?k:c,"scroll",J,pn,fe),l.indexOf("wheel")>=0&&ms(c,"wheel",Xe,pn,fe),(l.indexOf("touch")>=0&&mR||l.indexOf("pointer")>=0)&&(ms(c,ga[0],$e,pn,fe),ms(k,ga[2],Ge),ms(k,ga[3],Ge),Ae&&ms(c,"click",He,!0,!0),We&&ms(c,"click",Ne),Q&&ms(k,"gesturestart",Mt),B&&ms(k,"gestureend",wt),pe&&ms(c,sf+"enter",Je),ee&&ms(c,sf+"leave",rt),ce&&ms(c,sf+"move",Pe)),ve.isEnabled=!0,ve.isDragging=ve.isGesturing=ve.isPressed=et=$t=!1,ve._vx.reset(),ve._vy.reset(),ie=kt(),Un=xn(),ke&&ke.type&&$e(ke),te&&te(ve)),ve},ve.disable=function(){ve.isEnabled&&(sh.filter(function(ke){return ke!==ve&&Mm(ke.target)}).length||ps(j?k:c,"scroll",Ly),ve.isPressed&&(ve._vx.reset(),ve._vy.reset(),ps(X?c:k,ga[1],Ke,!0)),ps(j?k:c,"scroll",J,fe),ps(c,"wheel",Xe,fe),ps(c,ga[0],$e,fe),ps(k,ga[2],Ge),ps(k,ga[3],Ge),ps(c,"click",He,!0),ps(c,"click",Ne),ps(k,"gesturestart",Mt),ps(k,"gestureend",wt),ps(c,sf+"enter",Je),ps(c,sf+"leave",rt),ps(c,sf+"move",Pe),ve.isEnabled=ve.isPressed=ve.isDragging=!1,Oe&&Oe(ve))},ve.kill=ve.revert=function(){ve.disable();var ke=sh.indexOf(ve);ke>=0&&sh.splice(ke,1),Gl===ve&&(Gl=0)},sh.push(ve),X&&Mm(c)&&(Gl=ve),ve.enable(C)},wD(n,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),n})();Vi.version="3.15.0";Vi.create=function(n){return new Vi(n)};Vi.register=SR;Vi.getAll=function(){return sh.slice()};Vi.getById=function(n){return sh.filter(function(e){return e.vars.id===n})[0]};_R()&&Ir.registerPlugin(Vi);/*! * ScrollTrigger 3.15.0 * https://gsap.com * * @license Copyright 2008-2026, GreenSock. All rights reserved. * Subject to the terms at https://gsap.com/standard-license * @author: Jack Doyle, jack@greensock.com */var St,$d,gn,qn,ao,Gn,E1,Tv,Wm,Em,am,u0,qr,Jv,ky,_s,VE,HE,Qd,MR,ex,ER,vs,Oy,wR,TR,Vu,Uy,w1,_h,T1,wm,Fy,tx,c0=1,Kr=Date.now,nx=Kr(),Vo=0,lm=0,GE=function(e,t,i){var r=so(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return i["_"+t+"Clamp"]=r,r?e.substr(6,e.length-7):e},WE=function(e,t){return t&&(!so(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},AD=function n(){return lm&&requestAnimationFrame(n)},XE=function(){return Jv=1},jE=function(){return Jv=0},Ha=function(e){return e},um=function(e){return Math.round(e*1e5)/1e5||0},CR=function(){return typeof window<"u"},AR=function(){return St||CR()&&(St=window.gsap)&&St.registerPlugin&&St},Tf=function(e){return!!~E1.indexOf(e)},RR=function(e){return(e==="Height"?T1:gn["inner"+e])||ao["client"+e]||Gn["client"+e]},PR=function(e){return ec(e,"getBoundingClientRect")||(Tf(e)?function(){return rv.width=gn.innerWidth,rv.height=T1,rv}:function(){return Hl(e)})},RD=function(e,t,i){var r=i.d,o=i.d2,l=i.a;return(l=ec(e,"getBoundingClientRect"))?function(){return l()[r]}:function(){return(t?RR(o):e["client"+o])||0}},PD=function(e,t){return!t||~Za.indexOf(e)?PR(e):function(){return rv}},Ya=function(e,t){var i=t.s,r=t.d2,o=t.d,l=t.a;return Math.max(0,(i="scroll"+r)&&(l=ec(e,i))?l()-PR(e)()[o]:Tf(e)?(ao[i]||Gn[i])-RR(r):e[i]-e["offset"+r])},f0=function(e,t){for(var i=0;i0){for(r-=l,c=0;c=r)return i[c];return i[c-1]}else for(c=i.length,r+=l;c--;)if(i[c]<=r)return i[c];return i[0]}:function(r,o,l){l===void 0&&(l=.001);var c=t(r);return!o||Math.abs(c-r)i&&(r*=t/100),e=e.substr(0,i-1)),e=r+(e in Av?Av[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},m0=function(e,t,i,r,o,l,c,d){var p=o.startColor,m=o.endColor,v=o.fontSize,g=o.indent,y=o.fontWeight,E=qn.createElement("div"),C=Tf(i)||ec(i,"pinType")==="fixed",w=e.indexOf("scroller")!==-1,M=C?Gn:i.tagName==="IFRAME"?i.contentDocument.body:i,P=e.indexOf("start")!==-1,I=P?p:m,D="border-color:"+I+";font-size:"+v+";color:"+I+";font-weight:"+y+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return D+="position:"+((w||d)&&C?"fixed;":"absolute;"),(w||d||!C)&&(D+=(r===fr?C1:A1)+":"+(l+parseFloat(g))+"px;"),c&&(D+="box-sizing:border-box;text-align:left;width:"+c.offsetWidth+"px;"),E._isStart=P,E.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),E.style.cssText=D,E.innerText=t||t===0?e+"-"+t:e,M.children[0]?M.insertBefore(E,M.children[0]):M.appendChild(E),E._offset=E["offset"+r.op.d2],tv(E,0,r,P),E},tv=function(e,t,i,r){var o={display:"block"},l=i[r?"os2":"p2"],c=i[r?"p2":"os2"];e._isFlipped=r,o[i.a+"Percent"]=r?-100:0,o[i.a]=r?"1px":0,o["border"+l+Ph]=1,o["border"+c+Ph]=0,o[i.p]=t+"px",St.set(e,o)},dn=[],zy={},Xm,ZE=function(){return Kr()-Vo>34&&(Xm||(Xm=requestAnimationFrame(Xl)))},Ld=function(){(!vs||!vs.isPressed||vs.startX>Gn.clientWidth)&&(vn.cache++,vs?Xm||(Xm=requestAnimationFrame(Xl)):Xl(),Vo||Af("scrollStart"),Vo=Kr())},ix=function(){TR=gn.innerWidth,wR=gn.innerHeight},fm=function(e){vn.cache++,(e===!0||!qr&&!ER&&!qn.fullscreenElement&&!qn.webkitFullscreenElement&&(!Oy||TR!==gn.innerWidth||Math.abs(gn.innerHeight-wR)>gn.innerHeight*.25))&&Tv.restart(!0)},Cf={},LD=[],LR=function n(){return yr(Kt,"scrollEnd",n)||hf(!0)},Af=function(e){return Cf[e]&&Cf[e].map(function(t){return t()})||LD},ro=[],IR=function(e){for(var t=0;to,c=r._startClamp&&r.start>=o;(l||c)&&r.setPositions(c?o-1:r.start,l?Math.max(c?o:r.start+1,o):r.end,!0)}),$E(!1),Fy=0,i.forEach(function(r){return r&&r.render&&r.render(-1)}),vn.forEach(function(r){Qr(r)&&(r.smooth&&requestAnimationFrame(function(){return r.target.style.scrollBehavior="smooth"}),r.rec&&r(r.rec))}),OR(w1,1),Tv.pause(),Ef++,xs=2,Xl(2),dn.forEach(function(r){return Qr(r.vars.onRefresh)&&r.vars.onRefresh(r)}),xs=Kt.isRefreshing=!1,Af("refresh")},By=0,nv=1,Pm,Xl=function(e){if(e===2||!xs&&!wm){Kt.isUpdating=!0,Pm&&Pm.update(0);var t=dn.length,i=Kr(),r=i-nx>=50,o=t&&dn[0].scroll();if(nv=By>o?-1:1,xs||(By=o),r&&(Vo&&!Jv&&i-Vo>200&&(Vo=0,Af("scrollEnd")),am=nx,nx=i),nv<0){for(_s=t;_s-- >0;)dn[_s]&&dn[_s].update(0,r);nv=1}else for(_s=0;_s20),i-=i-O}if(E&&(d[E]=e||-.001,e<0&&(e=0)),l){var b=e+i,F=l._isStart;w="scroll"+r.d2,tv(l,b,r,F&&b>20||!F&&(v?Math.max(Gn[w],ao[w]):l.parentNode[w])<=b+1),v&&(p=Hl(c),v&&(l.style[r.op.p]=p[r.op.p]-r.op.m-l._offset+cr))}return y&&P&&(w=Hl(P),y.seek(g),M=Hl(P),y._caScrollDist=w[r.p]-M[r.p],e=e/y._caScrollDist*g),y&&y.seek(C),y?e:Math.round(e)},FD=/(webkit|moz|length|cssText|inset)/i,JE=function(e,t,i,r){if(e.parentNode!==t){var o=e.style,l,c;if(t===Gn){e._stOrig=o.cssText,c=Oo(e);for(l in c)!+l&&!FD.test(l)&&c[l]&&typeof o[l]=="string"&&l!=="0"&&(o[l]=c[l]);o.top=i,o.left=r}else o.cssText=e._stOrig;St.core.getCache(e).uncache=1,t.appendChild(e)}},FR=function(e,t,i){var r=t,o=r;return function(l){var c=Math.round(e());return c!==r&&c!==o&&Math.abs(c-r)>3&&Math.abs(c-o)>3&&(l=c,i&&i()),o=r,r=Math.round(l),r}},v0=function(e,t,i){var r={};r[t.p]="+="+i,St.set(e,r)},ew=function(e,t){var i=sc(e,t),r="_scroll"+t.p2,o=function l(c,d,p,m,v){var g=l.tween,y=d.onComplete,E={};p=p||i();var C=FR(i,p,function(){g.kill(),l.tween=0});return v=m&&v||0,m=m||c-p,g&&g.kill(),d[r]=c,d.inherit=!1,d.modifiers=E,E[r]=function(){return C(p+m*g.ratio+v*g.ratio*g.ratio)},d.onUpdate=function(){vn.cache++,l.tween&&Xl()},d.onComplete=function(){l.tween=0,y&&y.call(g)},g=l.tween=St.to(e,d),g};return e[r]=i,i.wheelHandler=function(){return o.tween&&o.tween.kill()&&(o.tween=0)},Sr(e,"wheel",i.wheelHandler),Kt.isTouch&&Sr(e,"touchmove",i.wheelHandler),o},Kt=(function(){function n(t,i){$d||n.register(St)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),Uy(this),this.init(t,i)}var e=n.prototype;return e.init=function(i,r){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!lm){this.update=this.refresh=this.kill=Ha;return}i=YE(so(i)||cm(i)||i.nodeType?{trigger:i}:i,p0);var o=i,l=o.onUpdate,c=o.toggleClass,d=o.id,p=o.onToggle,m=o.onRefresh,v=o.scrub,g=o.trigger,y=o.pin,E=o.pinSpacing,C=o.invalidateOnRefresh,w=o.anticipatePin,M=o.onScrubComplete,P=o.onSnapComplete,I=o.once,D=o.snap,L=o.pinReparent,O=o.pinSpacer,U=o.containerAnimation,b=o.fastScrollEnd,F=o.preventOverlaps,H=i.horizontal||i.containerAnimation&&i.horizontal!==!1?ys:fr,W=!v&&v!==0,Y=Os(i.scroller||gn),le=St.core.getCache(Y),pe=Tf(Y),ee=("pinType"in i?i.pinType:ec(Y,"pinType")||pe&&"fixed")==="fixed",ce=[i.onEnter,i.onLeave,i.onEnterBack,i.onLeaveBack],$=W&&i.toggleActions.split(" "),X="markers"in i?i.markers:p0.markers,Q=pe?0:parseFloat(Oo(Y)["border"+H.p2+Ph])||0,B=this,G=i.onRefreshInit&&function(){return i.onRefreshInit(B)},te=RD(Y,pe,H),Oe=PD(Y,pe),We=0,qe=0,fe=0,Ae=sc(Y,H),Te,Ze,pt,ot,$t,et,Lt,Ht,Ft,ve,hn,Cn,pn,kt,xn,ie,Un,Ut,j,k,ae,me,Me,He,ze,Ce,Re,nt,mt,Ke,$e,Ge,Mt,wt,J,Xe,Pe,Je,rt;if(B._startClamp=B._endClamp=!1,B._dir=H,w*=45,B.scroller=Y,B.scroll=U?U.time.bind(U):Ae,ot=Ae(),B.vars=i,r=r||i.animation,"refreshPriority"in i&&(MR=1,i.refreshPriority===-9999&&(Pm=B)),le.tweenScroll=le.tweenScroll||{top:ew(Y,fr),left:ew(Y,ys)},B.tweenTo=Te=le.tweenScroll[H.p],B.scrubDuration=function(Ue){Mt=cm(Ue)&&Ue,Mt?Ge?Ge.duration(Ue):Ge=St.to(r,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:Mt,paused:!0,onComplete:function(){return M&&M(B)}}):(Ge&&Ge.progress(1).kill(),Ge=0)},r&&(r.vars.lazy=!1,r._initted&&!B.isReverted||r.vars.immediateRender!==!1&&i.immediateRender!==!1&&r.duration()&&r.render(0,!0,!0),B.animation=r.pause(),r.scrollTrigger=B,B.scrubDuration(v),Ke=0,d||(d=r.vars.id)),D&&((!of(D)||D.push)&&(D={snapTo:D}),"scrollBehavior"in Gn.style&&St.set(pe?[Gn,ao]:Y,{scrollBehavior:"auto"}),vn.forEach(function(Ue){return Qr(Ue)&&Ue.target===(pe?qn.scrollingElement||ao:Y)&&(Ue.smooth=!1)}),pt=Qr(D.snapTo)?D.snapTo:D.snapTo==="labels"?DD(r):D.snapTo==="labelsDirectional"?ND(r):D.directional!==!1?function(Ue,Ct){return P1(D.snapTo)(Ue,Kr()-qe<500?0:Ct.direction)}:St.utils.snap(D.snapTo),wt=D.duration||{min:.1,max:2},wt=of(wt)?Em(wt.min,wt.max):Em(wt,wt),J=St.delayedCall(D.delay||Mt/2||.1,function(){var Ue=Ae(),Ct=Kr()-qe<500,_t=Te.tween;if((Ct||Math.abs(B.getVelocity())<10)&&!_t&&!Jv&&We!==Ue){var It=(Ue-et)/kt,Jn=r&&!W?r.totalProgress():It,Xt=Ct?0:(Jn-$e)/(Kr()-am)*1e3||0,Fn=St.utils.clamp(-It,1-It,Nd(Xt/2)*Xt/.185),Ri=It+(D.inertia===!1?0:Fn),Wn,zn,Qt=D,Hi=Qt.onStart,Bn=Qt.onInterrupt,ki=Qt.onComplete;if(Wn=pt(Ri,B),cm(Wn)||(Wn=Ri),zn=Math.max(0,Math.round(et+Wn*kt)),Ue<=Lt&&Ue>=et&&zn!==Ue){if(_t&&!_t._initted&&_t.data<=Nd(zn-Ue))return;D.inertia===!1&&(Fn=Wn-It),Te(zn,{duration:wt(Nd(Math.max(Nd(Ri-Jn),Nd(Wn-Jn))*.185/Xt/.05||0)),ease:D.ease||"power3",data:Nd(zn-Ue),onInterrupt:function(){return J.restart(!0)&&Bn&&Dd(B,Bn)},onComplete:function(){B.update(),We=Ae(),r&&!W&&(Ge?Ge.resetTo("totalProgress",Wn,r._tTime/r._tDur):r.progress(Wn)),Ke=$e=r&&!W?r.totalProgress():B.progress,P&&P(B),ki&&Dd(B,ki)}},Ue,Fn*kt,zn-Ue-Fn*kt),Hi&&Dd(B,Hi,Te.tween)}}else B.isActive&&We!==Ue&&J.restart(!0)}).pause()),d&&(zy[d]=B),g=B.trigger=Os(g||y!==!0&&y),rt=g&&g._gsap&&g._gsap.stRevert,rt&&(rt=rt(B)),y=y===!0?g:Os(y),so(c)&&(c={targets:g,className:c}),y&&(E===!1||E===ko||(E=!E&&y.parentNode&&y.parentNode.style&&Oo(y.parentNode).display==="flex"?!1:Qi),B.pin=y,Ze=St.core.getCache(y),Ze.spacer?xn=Ze.pinState:(O&&(O=Os(O),O&&!O.nodeType&&(O=O.current||O.nativeElement),Ze.spacerIsNative=!!O,O&&(Ze.spacerState=g0(O))),Ze.spacer=Ut=O||qn.createElement("div"),Ut.classList.add("pin-spacer"),d&&Ut.classList.add("pin-spacer-"+d),Ze.pinState=xn=g0(y)),i.force3D!==!1&&St.set(y,{force3D:!0}),B.spacer=Ut=Ze.spacer,mt=Oo(y),He=mt[E+H.os2],k=St.getProperty(y),ae=St.quickSetter(y,H.a,cr),rx(y,Ut,mt),Un=g0(y)),X){Cn=of(X)?YE(X,qE):qE,ve=m0("scroller-start",d,Y,H,Cn,0),hn=m0("scroller-end",d,Y,H,Cn,0,ve),j=ve["offset"+H.op.d2];var Ne=Os(ec(Y,"content")||Y);Ht=this.markerStart=m0("start",d,Ne,H,Cn,j,0,U),Ft=this.markerEnd=m0("end",d,Ne,H,Cn,j,0,U),U&&(Je=St.quickSetter([Ht,Ft],H.a,cr)),!ee&&!(Za.length&&ec(Y,"fixedMarkers")===!0)&&(bD(pe?Gn:Y),St.set([ve,hn],{force3D:!0}),Ce=St.quickSetter(ve,H.a,cr),nt=St.quickSetter(hn,H.a,cr))}if(U){var ke=U.vars.onUpdate,Le=U.vars.onUpdateParams;U.eventCallback("onUpdate",function(){B.update(0,0,1),ke&&ke.apply(U,Le||[])})}if(B.previous=function(){return dn[dn.indexOf(B)-1]},B.next=function(){return dn[dn.indexOf(B)+1]},B.revert=function(Ue,Ct){if(!Ct)return B.kill(!0);var _t=Ue!==!1||!B.enabled,It=qr;_t!==B.isReverted&&(_t&&(Xe=Math.max(Ae(),B.scroll.rec||0),fe=B.progress,Pe=r&&r.progress()),Ht&&[Ht,Ft,ve,hn].forEach(function(Jn){return Jn.style.display=_t?"none":"block"}),_t&&(qr=B,B.update(_t)),y&&(!L||!B.isActive)&&(_t?kD(y,Ut,xn):rx(y,Ut,Oo(y),ze)),_t||B.update(_t),qr=It,B.isReverted=_t)},B.refresh=function(Ue,Ct,_t,It){if(!((qr||!B.enabled)&&!Ct)){if(y&&Ue&&Vo){Sr(n,"scrollEnd",LR);return}!xs&&G&&G(B),qr=B,Te.tween&&!_t&&(Te.tween.kill(),Te.tween=0),Ge&&Ge.pause(),C&&r&&(r.revert({kill:!1}).invalidate(),r.getChildren?r.getChildren(!0,!0,!1).forEach(function(Fe){return Fe.vars.immediateRender&&Fe.render(0,!0,!0)}):r.vars.immediateRender&&r.render(0,!0,!0)),B.isReverted||B.revert(!0,!0),B._subPinOffset=!1;var Jn=te(),Xt=Oe(),Fn=U?U.duration():Ya(Y,H),Ri=kt<=.01||!kt,Wn=0,zn=It||0,Qt=of(_t)?_t.end:i.end,Hi=i.endTrigger||g,Bn=of(_t)?_t.start:i.start||(i.start===0||!g?0:y?"0 0":"0 100%"),ki=B.pinnedContainer=i.pinnedContainer&&Os(i.pinnedContainer,B),Gi=g&&Math.max(0,dn.indexOf(B))||0,ci=Gi,ei,pi,Ms,Ta,Jt,Xn,Wi,V,se,_e,de,he,Ie;for(X&&of(_t)&&(he=St.getProperty(ve,H.p),Ie=St.getProperty(hn,H.p));ci-- >0;)Xn=dn[ci],Xn.end||Xn.refresh(0,1)||(qr=B),Wi=Xn.pin,Wi&&(Wi===g||Wi===y||Wi===ki)&&!Xn.isReverted&&(_e||(_e=[]),_e.unshift(Xn),Xn.revert(!0,!0)),Xn!==dn[ci]&&(Gi--,ci--);for(Qr(Bn)&&(Bn=Bn(B)),Bn=GE(Bn,"start",B),et=QE(Bn,g,Jn,H,Ae(),Ht,ve,B,Xt,Q,ee,Fn,U,B._startClamp&&"_startClamp")||(y?-.001:0),Qr(Qt)&&(Qt=Qt(B)),so(Qt)&&!Qt.indexOf("+=")&&(~Qt.indexOf(" ")?Qt=(so(Bn)?Bn.split(" ")[0]:"")+Qt:(Wn=ev(Qt.substr(2),Jn),Qt=so(Bn)?Bn:(U?St.utils.mapRange(0,U.duration(),U.scrollTrigger.start,U.scrollTrigger.end,et):et)+Wn,Hi=g)),Qt=GE(Qt,"end",B),Lt=Math.max(et,QE(Qt||(Hi?"100% 0":Fn),Hi,Jn,H,Ae()+Wn,Ft,hn,B,Xt,Q,ee,Fn,U,B._endClamp&&"_endClamp"))||-.001,Wn=0,ci=Gi;ci--;)Xn=dn[ci]||{},Wi=Xn.pin,Wi&&Xn.start-Xn._pinPush<=et&&!U&&Xn.end>0&&(ei=Xn.end-(B._startClamp?Math.max(0,Xn.start):Xn.start),(Wi===g&&Xn.start-Xn._pinPush=Ya(Y,H)))ei=Oo(y),Ta=H===fr,Ms=Ae(),me=parseFloat(k(H.a))+zn,!Fn&&Lt>1&&(de=(pe?qn.scrollingElement||ao:Y).style,de={style:de,value:de["overflow"+H.a.toUpperCase()]},pe&&Oo(Gn)["overflow"+H.a.toUpperCase()]!=="scroll"&&(de.style["overflow"+H.a.toUpperCase()]="scroll")),rx(y,Ut,ei),Un=g0(y),pi=Hl(y,!0),V=ee&&sc(Y,Ta?ys:fr)(),E?(ze=[E+H.os2,kt+zn+cr],ze.t=Ut,ci=E===Qi?Cv(y,H)+kt+zn:0,ci&&(ze.push(H.d,ci+cr),Ut.style.flexBasis!=="auto"&&(Ut.style.flexBasis=ci+cr)),xh(ze),ki&&dn.forEach(function(Fe){Fe.pin===ki&&Fe.vars.pinSpacing!==!1&&(Fe._subPinOffset=!0)}),ee&&Ae(Xe)):(ci=Cv(y,H),ci&&Ut.style.flexBasis!=="auto"&&(Ut.style.flexBasis=ci+cr)),ee&&(Jt={top:pi.top+(Ta?Ms-et:V)+cr,left:pi.left+(Ta?V:Ms-et)+cr,boxSizing:"border-box",position:"fixed"},Jt[Sf]=Jt["max"+Ph]=Math.ceil(pi.width)+cr,Jt[Mf]=Jt["max"+R1]=Math.ceil(pi.height)+cr,Jt[ko]=Jt[ko+Am]=Jt[ko+Tm]=Jt[ko+Rm]=Jt[ko+Cm]="0",Jt[Qi]=ei[Qi],Jt[Qi+Am]=ei[Qi+Am],Jt[Qi+Tm]=ei[Qi+Tm],Jt[Qi+Rm]=ei[Qi+Rm],Jt[Qi+Cm]=ei[Qi+Cm],ie=UD(xn,Jt,L),xs&&Ae(0)),r?(se=r._initted,ex(1),r.render(r.duration(),!0,!0),Me=k(H.a)-me+kt+zn,Re=Math.abs(kt-Me)>1,ee&&Re&&ie.splice(ie.length-2,2),r.render(0,!0,!0),se||r.invalidate(!0),r.parent||r.totalTime(r.totalTime()),ex(0)):Me=kt,de&&(de.value?de.style["overflow"+H.a.toUpperCase()]=de.value:de.style.removeProperty("overflow-"+H.a));else if(g&&Ae()&&!U)for(pi=g.parentNode;pi&&pi!==Gn;)pi._pinOffset&&(et-=pi._pinOffset,Lt-=pi._pinOffset),pi=pi.parentNode;_e&&_e.forEach(function(Fe){return Fe.revert(!1,!0)}),B.start=et,B.end=Lt,ot=$t=xs?Xe:Ae(),!U&&!xs&&(ot0?dn.slice(0,Ct).reverse():dn.slice(Ct+1);return(so(Ue)?_t.filter(function(It){return It.vars.preventOverlaps===Ue}):_t).filter(function(It){return B.direction>0?It.end<=et:It.start>=Lt})},B.update=function(Ue,Ct,_t){if(!(U&&!_t&&!Ue)){var It=xs===!0?Xe:B.scroll(),Jn=Ue?0:(It-et)/kt,Xt=Jn<0?0:Jn>1?1:Jn||0,Fn=B.progress,Ri,Wn,zn,Qt,Hi,Bn,ki,Gi;if(Ct&&($t=ot,ot=U?Ae():It,D&&($e=Ke,Ke=r&&!W?r.totalProgress():Xt)),w&&y&&!qr&&!c0&&Vo&&(!Xt&&etIt+(It-$t)/(Kr()-am)*w&&(Xt=.9999)),Xt!==Fn&&B.enabled){if(Ri=B.isActive=!!Xt&&Xt<1,Wn=!!Fn&&Fn<1,Bn=Ri!==Wn,Hi=Bn||!!Xt!=!!Fn,B.direction=Xt>Fn?1:-1,B.progress=Xt,Hi&&!qr&&(zn=Xt&&!Fn?0:Xt===1?1:Fn===1?2:3,W&&(Qt=!Bn&&$[zn+1]!=="none"&&$[zn+1]||$[zn],Gi=r&&(Qt==="complete"||Qt==="reset"||Qt in r))),F&&(Bn||Gi)&&(Gi||v||!r)&&(Qr(F)?F(B):B.getTrailing(F).forEach(function(Ms){return Ms.endAnimation()})),W||(Ge&&!qr&&!c0?(Ge._dp._time-Ge._start!==Ge._time&&Ge.render(Ge._dp._time-Ge._start),Ge.resetTo?Ge.resetTo("totalProgress",Xt,r._tTime/r._tDur):(Ge.vars.totalProgress=Xt,Ge.invalidate().restart())):r&&r.totalProgress(Xt,!!(qr&&(qe||Ue)))),y){if(Ue&&E&&(Ut.style[E+H.os2]=He),!ee)ae(um(me+Me*Xt));else if(Hi){if(ki=!Ue&&Xt>Fn&&Lt+1>It&&It+1>=Ya(Y,H),L)if(!Ue&&(Ri||ki)){var ci=Hl(y,!0),ei=It-et;JE(y,Gn,ci.top+(H===fr?ei:0)+cr,ci.left+(H===fr?0:ei)+cr)}else JE(y,Ut);xh(Ri||ki?ie:Un),Re&&Xt<1&&Ri||ae(me+(Xt===1&&!ki?Me:0))}}D&&!Te.tween&&!qr&&!c0&&J.restart(!0),c&&(Bn||I&&Xt&&(Xt<1||!tx))&&Wm(c.targets).forEach(function(Ms){return Ms.classList[Ri||I?"add":"remove"](c.className)}),l&&!W&&!Ue&&l(B),Hi&&!qr?(W&&(Gi&&(Qt==="complete"?r.pause().totalProgress(1):Qt==="reset"?r.restart(!0).pause():Qt==="restart"?r.restart(!0):r[Qt]()),l&&l(B)),(Bn||!tx)&&(p&&Bn&&Dd(B,p),ce[zn]&&Dd(B,ce[zn]),I&&(Xt===1?B.kill(!1,1):ce[zn]=0),Bn||(zn=Xt===1?1:3,ce[zn]&&Dd(B,ce[zn]))),b&&!Ri&&Math.abs(B.getVelocity())>(cm(b)?b:2500)&&(Xp(B.callbackAnimation),Ge?Ge.progress(1):Xp(r,Qt==="reverse"?1:!Xt,1))):W&&l&&!qr&&l(B)}if(nt){var pi=U?It/U.duration()*(U._caScrollDist||0):It;Ce(pi+(ve._isFlipped?1:0)),nt(pi)}Je&&Je(-It/U.duration()*(U._caScrollDist||0))}},B.enable=function(Ue,Ct){B.enabled||(B.enabled=!0,Sr(Y,"resize",fm),pe||Sr(Y,"scroll",Ld),G&&Sr(n,"refreshInit",G),Ue!==!1&&(B.progress=fe=0,ot=$t=We=Ae()),Ct!==!1&&B.refresh())},B.getTween=function(Ue){return Ue&&Te?Te.tween:Ge},B.setPositions=function(Ue,Ct,_t,It){if(U){var Jn=U.scrollTrigger,Xt=U.duration(),Fn=Jn.end-Jn.start;Ue=Jn.start+Fn*Ue/Xt,Ct=Jn.start+Fn*Ct/Xt}B.refresh(!1,!1,{start:WE(Ue,_t&&!!B._startClamp),end:WE(Ct,_t&&!!B._endClamp)},It),B.update()},B.adjustPinSpacing=function(Ue){if(ze&&Ue){var Ct=ze.indexOf(H.d)+1;ze[Ct]=parseFloat(ze[Ct])+Ue+cr,ze[1]=parseFloat(ze[1])+Ue+cr,xh(ze)}},B.disable=function(Ue,Ct){if(Ue!==!1&&B.revert(!0,!0),B.enabled&&(B.enabled=B.isActive=!1,Ct||Ge&&Ge.pause(),Xe=0,Ze&&(Ze.uncache=1),G&&yr(n,"refreshInit",G),J&&(J.pause(),Te.tween&&Te.tween.kill()&&(Te.tween=0)),!pe)){for(var _t=dn.length;_t--;)if(dn[_t].scroller===Y&&dn[_t]!==B)return;yr(Y,"resize",fm),pe||yr(Y,"scroll",Ld)}},B.kill=function(Ue,Ct){B.disable(Ue,Ct),Ge&&!Ct&&Ge.kill(),d&&delete zy[d];var _t=dn.indexOf(B);_t>=0&&dn.splice(_t,1),_t===_s&&nv>0&&_s--,_t=0,dn.forEach(function(It){return It.scroller===B.scroller&&(_t=1)}),_t||xs||(B.scroll.rec=0),r&&(r.scrollTrigger=null,Ue&&r.revert({kill:!1}),Ct||r.kill()),Ht&&[Ht,Ft,ve,hn].forEach(function(It){return It.parentNode&&It.parentNode.removeChild(It)}),Pm===B&&(Pm=0),y&&(Ze&&(Ze.uncache=1),_t=0,dn.forEach(function(It){return It.pin===y&&_t++}),_t||(Ze.spacer=0)),i.onKill&&i.onKill(B)},dn.push(B),B.enable(!1,!1),rt&&rt(B),r&&r.add&&!kt){var Tt=B.update;B.update=function(){B.update=Tt,vn.cache++,et||Lt||B.refresh()},St.delayedCall(.01,B.update),kt=.01,et=Lt=0}else B.refresh();y&&ID()},n.register=function(i){return $d||(St=i||AR(),CR()&&window.document&&n.enable(),$d=lm),$d},n.defaults=function(i){if(i)for(var r in i)p0[r]=i[r];return p0},n.disable=function(i,r){lm=0,dn.forEach(function(l){return l[r?"kill":"disable"](i)}),yr(gn,"wheel",Ld),yr(qn,"scroll",Ld),clearInterval(u0),yr(qn,"touchcancel",Ha),yr(Gn,"touchstart",Ha),d0(yr,qn,"pointerdown,touchstart,mousedown",XE),d0(yr,qn,"pointerup,touchend,mouseup",jE),Tv.kill(),f0(yr);for(var o=0;o0&&l.left+c0&&l.top+c=0&&ro.splice(t,5),ro.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),St.core.getCache(e),Uy())}}):ro};Kt.revert=function(n,e){return b1(!n,e)};Kt.create=function(n,e){return new Kt(n,e)};Kt.refresh=function(n){return n?fm(!0):($d||Kt.register())&&hf(!0)};Kt.update=function(n){return++vn.cache&&Xl(n===!0?2:0)};Kt.clearScrollMemory=OR;Kt.maxScroll=function(n,e){return Ya(n,e?ys:fr)};Kt.getScrollFunc=function(n,e){return sc(Os(n),e?ys:fr)};Kt.getById=function(n){return zy[n]};Kt.getAll=function(){return dn.filter(function(n){return n.vars.id!=="ScrollSmoother"})};Kt.isScrolling=function(){return!!Vo};Kt.snapDirectional=P1;Kt.addEventListener=function(n,e){var t=Cf[n]||(Cf[n]=[]);~t.indexOf(e)||t.push(e)};Kt.removeEventListener=function(n,e){var t=Cf[n],i=t&&t.indexOf(e);i>=0&&t.splice(i,1)};Kt.batch=function(n,e){var t=[],i={},r=e.interval||.016,o=e.batchMax||1e9,l=function(p,m){var v=[],g=[],y=St.delayedCall(r,function(){m(v,g),v=[],g=[]}).pause();return function(E){v.length||y.restart(!0),v.push(E.trigger),g.push(E),o<=v.length&&y.progress(1)}},c;for(c in e)i[c]=c.substr(0,2)==="on"&&Qr(e[c])&&c!=="onRefreshInit"?l(c,e[c]):e[c];return Qr(o)&&(o=o(),Sr(Kt,"refresh",function(){return o=e.batchMax()})),Wm(n).forEach(function(d){var p={};for(c in i)p[c]=i[c];p.trigger=d,t.push(Kt.create(p))}),t};var tw=function(e,t,i,r){return t>r?e(r):t<0&&e(0),i>r?(r-t)/(i-t):i<0?t/(t-i):1},sx=function n(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(Vi.isTouch?" pinch-zoom":""):"none",e===ao&&n(Gn,t)},_0={auto:1,scroll:1},zD=function(e){var t=e.event,i=e.target,r=e.axis,o=(t.changedTouches?t.changedTouches[0]:t).target,l=o._gsap||St.core.getCache(o),c=Kr(),d;if(!l._isScrollT||c-l._isScrollT>2e3){for(;o&&o!==Gn&&(o.scrollHeight<=o.clientHeight&&o.scrollWidth<=o.clientWidth||!(_0[(d=Oo(o)).overflowY]||_0[d.overflowX]));)o=o.parentNode;l._isScroll=o&&o!==i&&!Tf(o)&&(_0[(d=Oo(o)).overflowY]||_0[d.overflowX]),l._isScrollT=c}(l._isScroll||r==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},zR=function(e,t,i,r){return Vi.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:r=r&&zD,onPress:r,onDrag:r,onScroll:r,onEnable:function(){return i&&Sr(qn,Vi.eventTypes[0],iw,!1,!0)},onDisable:function(){return yr(qn,Vi.eventTypes[0],iw,!0)}})},BD=/(input|label|select|textarea)/i,nw,iw=function(e){var t=BD.test(e.target.tagName);(t||nw)&&(e._gsapAllow=!0,nw=t)},VD=function(e){of(e)||(e={}),e.preventDefault=e.isNormalizer=e.allowClicks=!0,e.type||(e.type="wheel,touch"),e.debounce=!!e.debounce,e.id=e.id||"normalizer";var t=e,i=t.normalizeScrollX,r=t.momentum,o=t.allowNestedScroll,l=t.onRelease,c,d,p=Os(e.target)||ao,m=St.core.globals().ScrollSmoother,v=m&&m.get(),g=Vu&&(e.content&&Os(e.content)||v&&e.content!==!1&&!v.smooth()&&v.content()),y=sc(p,fr),E=sc(p,ys),C=1,w=(Vi.isTouch&&gn.visualViewport?gn.visualViewport.scale*gn.visualViewport.width:gn.outerWidth)/gn.innerWidth,M=0,P=Qr(r)?function(){return r(c)}:function(){return r||2.8},I,D,L=zR(p,e.type,!0,o),O=function(){return D=!1},U=Ha,b=Ha,F=function(){d=Ya(p,fr),b=Em(Vu?1:0,d),i&&(U=Em(0,Ya(p,ys))),I=Ef},H=function(){g._gsap.y=um(parseFloat(g._gsap.y)+y.offset)+"px",g.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(g._gsap.y)+", 0, 1)",y.offset=y.cacheID=0},W=function(){if(D){requestAnimationFrame(O);var X=um(c.deltaY/2),Q=b(y.v-X);if(g&&Q!==y.v+y.offset){y.offset=Q-y.v;var B=um((parseFloat(g&&g._gsap.y)||0)-y.offset);g.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+B+", 0, 1)",g._gsap.y=B+"px",y.cacheID=vn.cache,Xl()}return!0}y.offset&&H(),D=!0},Y,le,pe,ee,ce=function(){F(),Y.isActive()&&Y.vars.scrollY>d&&(y()>d?Y.progress(1)&&y(d):Y.resetTo("scrollY",d))};return g&&St.set(g,{y:"+=0"}),e.ignoreCheck=function($){return Vu&&$.type==="touchmove"&&W()||C>1.05&&$.type!=="touchstart"||c.isGesturing||$.touches&&$.touches.length>1},e.onPress=function(){D=!1;var $=C;C=um((gn.visualViewport&&gn.visualViewport.scale||1)/w),Y.pause(),$!==C&&sx(p,C>1.01?!0:i?!1:"x"),le=E(),pe=y(),F(),I=Ef},e.onRelease=e.onGestureStart=function($,X){if(y.offset&&H(),!X)ee.restart(!0);else{vn.cache++;var Q=P(),B,G;i&&(B=E(),G=B+Q*.05*-$.velocityX/.227,Q*=tw(E,B,G,Ya(p,ys)),Y.vars.scrollX=U(G)),B=y(),G=B+Q*.05*-$.velocityY/.227,Q*=tw(y,B,G,Ya(p,fr)),Y.vars.scrollY=b(G),Y.invalidate().duration(Q).play(.01),(Vu&&Y.vars.scrollY>=d||B>=d-1)&&St.to({},{onUpdate:ce,duration:Q})}l&&l($)},e.onWheel=function(){Y._ts&&Y.pause(),Kr()-M>1e3&&(I=0,M=Kr())},e.onChange=function($,X,Q,B,G){if(Ef!==I&&F(),X&&i&&E(U(B[2]===X?le+($.startX-$.x):E()+X-B[1])),Q){y.offset&&H();var te=G[2]===Q,Oe=te?pe+$.startY-$.y:y()+Q-G[1],We=b(Oe);te&&Oe!==We&&(pe+=We-Oe),y(We)}(Q||X)&&Xl()},e.onEnable=function(){sx(p,i?!1:"x"),Kt.addEventListener("refresh",ce),Sr(gn,"resize",ce),y.smooth&&(y.target.style.scrollBehavior="auto",y.smooth=E.smooth=!1),L.enable()},e.onDisable=function(){sx(p,!0),yr(gn,"resize",ce),Kt.removeEventListener("refresh",ce),L.kill()},e.lockAxis=e.lockAxis!==!1,c=new Vi(e),c.iOS=Vu,Vu&&!y()&&y(1),Vu&&St.ticker.add(Ha),ee=c._dc,Y=St.to(c,{ease:"power4",paused:!0,inherit:!1,scrollX:i?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:FR(y,y(),function(){return Y.pause()})},onUpdate:Xl,onComplete:ee.vars.onComplete}),c};Kt.sort=function(n){if(Qr(n))return dn.sort(n);var e=gn.pageYOffset||0;return Kt.getAll().forEach(function(t){return t._sortY=t.trigger?e+t.trigger.getBoundingClientRect().top:t.start+gn.innerHeight}),dn.sort(n||function(t,i){return(t.vars.refreshPriority||0)*-1e6+(t.vars.containerAnimation?1e6:t._sortY)-((i.vars.containerAnimation?1e6:i._sortY)+(i.vars.refreshPriority||0)*-1e6)})};Kt.observe=function(n){return new Vi(n)};Kt.normalizeScroll=function(n){if(typeof n>"u")return vs;if(n===!0&&vs)return vs.enable();if(n===!1){vs&&vs.kill(),vs=n;return}var e=n instanceof Vi?n:VD(n);return vs&&vs.target===e.target&&vs.kill(),Tf(e.target)&&(vs=e),e};Kt.core={_getVelocityProp:Iy,_inputObserver:zR,_scrollers:vn,_proxies:Za,bridge:{ss:function(){Vo||Af("scrollStart"),Vo=Kr()},ref:function(){return qr}}};AR()&&St.registerPlugin(Kt);const rw="(prefers-reduced-motion: reduce)";function Ea(){const[n,e]=De.useState(()=>typeof window>"u"?!1:window.matchMedia(rw).matches);return De.useEffect(()=>{const t=window.matchMedia(rw),i=r=>e(r.matches);return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[]),n}_i.registerPlugin(Kt);function HD(){const n=getComputedStyle(document.body);return(n.overflowY==="auto"||n.overflowY==="scroll")&&document.body.scrollHeight>document.body.clientHeight}function GD(){const n=Ea();De.useEffect(()=>{if(n)return;const e=()=>Kt.refresh();window.addEventListener("load",e);let t;const i=new ResizeObserver(()=>{window.clearTimeout(t),t=window.setTimeout(e,400)});i.observe(document.body);const r=window.setTimeout(()=>i.disconnect(),5e3);if(HD())return Kt.defaults({scroller:document.body}),Kt.refresh(),()=>{window.removeEventListener("load",e),window.clearTimeout(t),window.clearTimeout(r),i.disconnect(),Kt.defaults({scroller:window})};const o=new i3({duration:1.2,easing:c=>Math.min(1,1.001-Math.pow(2,-10*c)),prevent:c=>c.querySelector(".lenis-prevent")!==null}),l=c=>{o.raf(c*1e3)};return o.on("scroll",Kt.update),_i.ticker.add(l),_i.ticker.lagSmoothing(0),()=>{window.removeEventListener("load",e),window.clearTimeout(t),window.clearTimeout(r),i.disconnect(),o.destroy(),_i.ticker.remove(l)}},[n])}function WD(){return GD(),null}_i.registerPlugin(Kt);const sv=[{title:"Ventas que se escapan en chats desordenados",body:"¿Cuántas cotizaciones se quedan en el olvido porque un mensaje de WhatsApp se contestó tres horas tarde? Cuando su captación depende del registro manual en un chat personal, la paciencia del cliente se agota.",badge:"Leads sin responder",tone:"amber",y:16},{title:"Ecosistema disperso y ceguera de resultados",body:"Tener contactos en cuadernos, cotizaciones en Excel y campañas por su lado es una receta para la esclavitud operativa. Sin un pipeline claro, usted no puede ver en qué fase se enfrían sus prospectos.",badge:"Cero visibilidad",tone:"red",y:50},{title:"El miedo a la tecnología compleja y al abandono",body:"La mayoría de las PYMEs han gastado en plataformas complejas que su equipo termina abandonando. Lo que su empresa necesita no es otra herramienta genérica, sino un proceso estratégico a medida y capacitación a su personal.",badge:"Riesgo de abandono",tone:"amber",y:84}],sw=sv.length,x0=12,ow=66,XD={amber:"border-amber-400/60 bg-amber-400/10 text-amber-300",red:"border-red-400/60 bg-red-400/10 text-red-300"},jD={amber:"#FBBF24",red:"#F87171"};function YD(){const n=De.useRef(null),e=De.useRef(null),t=De.useRef([]),i=De.useRef([]),r=De.useRef([]),o=Ea();return De.useEffect(()=>{const l=n.current,c=e.current,d=t.current.filter(y=>!!y),p=i.current.filter(y=>!!y),m=r.current.filter(y=>!!y);if(!l||!c||d.length===0)return;const v=p.map(y=>y.getTotalLength());if(o){_i.set(d,{opacity:1,y:0}),_i.set(m,{opacity:1,scale:1}),p.forEach(y=>_i.set(y,{strokeDashoffset:0}));return}_i.set(d,{opacity:0,y:32}),_i.set(m,{opacity:0,scale:.6}),p.forEach((y,E)=>{_i.set(y,{strokeDasharray:v[E],strokeDashoffset:v[E]})});const g=Kt.create({trigger:l,start:"top top",end:"+=200%",pin:c,scrub:1,onUpdate:y=>{d.forEach((E,C)=>{const w=C/sw,M=(C+.85)/sw,P=_i.utils.clamp(0,1,(y.progress-w)/(M-w));_i.set(E,{opacity:P,y:32*(1-P)});const I=p[C],D=v[C];I&&D!==void 0&&_i.set(I,{strokeDashoffset:D*(1-P)});const L=m[C];L&&_i.set(L,{opacity:P,scale:.6+P*.4})})}});return()=>g.kill()},[o]),Z.jsx("div",{ref:n,id:"friccion",className:"relative",children:Z.jsx("div",{ref:e,className:"hl-grid-line-dark hl-noise relative flex min-h-screen items-center overflow-hidden bg-hl-primary-dark",children:Z.jsxs("div",{className:"relative z-10 mx-auto grid w-full max-w-6xl gap-10 px-6 py-24 md:grid-cols-2 md:px-10",children:[Z.jsxs("div",{className:"flex flex-col gap-10",children:[Z.jsx("h2",{className:"hl-display text-3xl uppercase text-hl-white sm:text-4xl md:text-5xl",children:"El desorden operativo y la ceguera de ventas son los verdaderos enemigos de su crecimiento."}),Z.jsxs("div",{className:"relative hidden aspect-[4/5] w-full max-w-sm md:block","aria-hidden":"true",children:[Z.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"absolute inset-0 h-full w-full",children:[Z.jsx("path",{className:"hl-flow-trunk",d:`M ${x0} 4 L ${x0} 96`,fill:"none",stroke:"#FBC774",strokeWidth:"0.6",strokeOpacity:"0.35",strokeDasharray:"2 3",vectorEffect:"non-scaling-stroke"}),sv.map((l,c)=>Z.jsxs("g",{children:[Z.jsx("circle",{cx:x0,cy:l.y,r:"1.6",fill:"#FBC774"}),Z.jsx("path",{ref:d=>{i.current[c]=d},d:`M ${x0} ${l.y} L ${ow} ${l.y}`,fill:"none",stroke:jD[l.tone],strokeWidth:"0.6",strokeDasharray:"1.5 2",vectorEffect:"non-scaling-stroke"})]},l.title))]}),sv.map((l,c)=>Z.jsx("div",{ref:d=>{r.current[c]=d},className:`absolute -translate-y-1/2 rounded-full border px-3 py-1 text-[11px] font-semibold uppercase tracking-wide ${XD[l.tone]}`,style:{left:`${ow+2}%`,top:`${l.y}%`},children:l.badge},l.title))]})]}),Z.jsx("div",{className:"flex flex-col gap-5",children:sv.map((l,c)=>Z.jsxs("div",{ref:d=>{t.current[c]=d},className:"rounded-2xl border-2 border-hl-accent-gold/40 bg-white/5 p-6 shadow-[6px_6px_0_0_#FBC774]",children:[Z.jsx("h3",{className:"hl-display mb-2 text-lg uppercase text-hl-accent-gold",children:l.title}),Z.jsx("p",{className:"text-sm leading-relaxed text-white/80",children:l.body})]},l.title))})]})})})}const ov={logos:{navbarFullColor:"https://assets.cdn.filesafe.space/iV3yXhM4FBzojQmnrJuU/media/6a87dc9410d5025e475ffea7.png",footerWhite:"https://assets.cdn.filesafe.space/iV3yXhM4FBzojQmnrJuU/media/6a88186d67ecc8731db2b30f.png"},attribution:{fontCreditText:"Intro Black font licensed under CC 4.0 BY by Web Free Fonts",fontCreditLink:"http://www.webfontfree.com"}};function qD(){return Z.jsx("header",{className:"sticky top-0 z-50 border-b border-hl-text-primary/5 bg-white/80 backdrop-blur-md",children:Z.jsxs("nav",{className:"mx-auto flex max-w-6xl items-center justify-between px-8 py-4",children:[Z.jsx("a",{href:"#top",className:"shrink-0",children:Z.jsx("img",{src:ov.logos.navbarFullColor,alt:"Heilead",className:"h-9 w-auto object-contain"})}),Z.jsx("a",{href:"#diagnostico",className:"hidden rounded-full bg-hl-primary-dark px-5 py-2.5 text-xs font-bold uppercase tracking-wide text-white transition-colors duration-200 hover:bg-hl-primary sm:inline-flex",children:"Iniciar diagnóstico"})]})})}const BR=[{x:0,y:92},{x:60,y:78},{x:120,y:82},{x:180,y:56},{x:240,y:40},{x:300,y:14}],VR=BR.map((n,e)=>`${e===0?"M":"L"} ${n.x} ${n.y}`).join(" "),ZD=`${VR} L 300 120 L 0 120 Z`,KD=["Mar","Abr","May","Jun","Jul","Hoy"],$D=[{label:"Agendamientos",value:"+35%",tone:"gold"},{label:"Leads activos",value:"128",tone:"white"},{label:"Resp. automática",value:"<5 min",tone:"white"}];function QD(){return Z.jsxs("div",{className:"hl-drift relative mx-auto w-full max-w-md lg:mx-0",children:[Z.jsx("div",{"aria-hidden":"true",className:"absolute -inset-6 -z-10 rounded-[2rem] bg-gradient-to-br from-hl-primary/25 via-transparent to-hl-accent-gold/15 blur-2xl"}),Z.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-white/10 bg-white/[0.06] p-5 shadow-2xl backdrop-blur-xl sm:p-6",children:[Z.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[Z.jsxs("div",{className:"flex items-center gap-1.5","aria-hidden":"true",children:[Z.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"}),Z.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"}),Z.jsx("span",{className:"h-2.5 w-2.5 rounded-full bg-white/15"})]}),Z.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-emerald-400/30 bg-emerald-400/10 px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[Z.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[Z.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"}),Z.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]})]}),Z.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-white/45",children:"Panel de adquisición"}),Z.jsx("p",{className:"hl-display mb-4 text-2xl text-white",children:"Pipeline en tiempo real"}),Z.jsxs("div",{className:"relative mb-2 rounded-2xl border border-white/5 bg-black/20 p-3",children:[Z.jsxs("svg",{viewBox:"0 0 300 120",preserveAspectRatio:"none",className:"h-28 w-full sm:h-32",children:[Z.jsxs("defs",{children:[Z.jsxs("linearGradient",{id:"hl-chart-stroke",x1:"0",y1:"0",x2:"1",y2:"0",children:[Z.jsx("stop",{offset:"0%",stopColor:"#415FA8"}),Z.jsx("stop",{offset:"100%",stopColor:"#FBC774"})]}),Z.jsxs("linearGradient",{id:"hl-chart-fill",x1:"0",y1:"0",x2:"0",y2:"1",children:[Z.jsx("stop",{offset:"0%",stopColor:"#FBC774",stopOpacity:"0.3"}),Z.jsx("stop",{offset:"100%",stopColor:"#FBC774",stopOpacity:"0"})]})]}),Z.jsx("path",{d:ZD,fill:"url(#hl-chart-fill)"}),Z.jsx("path",{d:VR,fill:"none",stroke:"url(#hl-chart-stroke)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"hl-draw-in",style:{"--hl-draw-length":420}}),BR.map(n=>Z.jsx("circle",{cx:n.x,cy:n.y,r:"3.5",fill:"#FBC774",fillOpacity:"0.9"},`${n.x}-${n.y}`))]}),Z.jsx("div",{className:"mt-1 flex justify-between px-0.5",children:KD.map(n=>Z.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-white/30",children:n},n))})]}),Z.jsx("div",{className:"grid grid-cols-3 gap-2 pt-3",children:$D.map(n=>Z.jsxs("div",{className:"rounded-xl border border-white/5 bg-white/[0.04] px-2.5 py-2.5",children:[Z.jsx("p",{className:"text-[10px] font-medium uppercase leading-tight tracking-wide text-white/40",children:n.label}),Z.jsx("p",{className:`hl-display mt-1 text-base ${n.tone==="gold"?"text-hl-accent-gold":"text-white"}`,style:{fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})]})]})}const JD="modulepreload",eN=function(n){return"/"+n},aw={},tN=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(t.map(p=>{if(p=eN(p),p in aw)return;aw[p]=!0;const m=p.endsWith(".css"),v=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${v}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":JD,m||(g.as="script"),g.crossOrigin="",g.href=p,d&&g.setAttribute("nonce",d),document.head.appendChild(g),m)return new Promise((y,E)=>{g.addEventListener("load",y),g.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return e().catch(o)})},nN=De.lazy(()=>tN(()=>Promise.resolve().then(()=>HH),void 0));function iN(){try{const t=document.createElement("canvas");if(!(t.getContext("webgl2")??t.getContext("webgl")))return"unsupported"}catch{return"unsupported"}const n=navigator.hardwareConcurrency??4,e=window.innerWidth<768;return n<4||e?"lite":"full"}function rN(){const n=Ea(),[e,t]=De.useState("checking"),[i,r]=De.useState(!1),o=De.useRef(!1);De.useEffect(()=>{t(iN())},[]);const l=()=>{o.current||(o.current=!0,r(!0))},c=e==="lite"?60:160,d=e==="lite"?1.5:typeof window<"u"?Math.min(window.devicePixelRatio||1,2):1;return Z.jsx("div",{className:"h-full w-full","aria-hidden":"true",children:(e==="full"||e==="lite")&&Z.jsx("div",{className:`h-full w-full transition-opacity duration-500 ease-out ${i?"opacity-100":"opacity-0"}`,children:Z.jsx(De.Suspense,{fallback:null,children:Z.jsx(nN,{particleCount:c,animate:!n,dpr:d,onReady:l})})})})}function sN(){return Z.jsxs("section",{id:"top",className:"hl-grid-line-dark hl-noise relative isolate overflow-hidden bg-hl-deep",children:[Z.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 -z-10",style:{background:"radial-gradient(60% 50% at 22% 0%, rgba(65, 95, 168, 0.38) 0%, transparent 70%),radial-gradient(45% 35% at 88% 8%, rgba(251, 199, 116, 0.16) 0%, transparent 70%)"}}),Z.jsxs("div",{className:"relative z-10 mx-auto grid max-w-6xl gap-14 px-6 py-24 md:px-10 md:py-32 lg:grid-cols-[1.05fr_0.95fr] lg:items-center lg:gap-10",children:[Z.jsxs("div",{className:"flex flex-col items-start gap-8 text-left",children:[Z.jsx("h1",{className:"hl-display max-w-2xl text-3xl uppercase leading-tight tracking-tight text-white md:text-5xl lg:text-[3.4rem]",children:"Tome el control total de sus ventas y automatice su negocio sin complicaciones tecnológicas."}),Z.jsx("p",{className:"max-w-xl text-base leading-relaxed text-white/70 md:text-lg",children:"Deje atrás el caos de los chats de WhatsApp desordenados, los leads que se enfrían por falta de respuesta y la esclavitud de las tareas manuales. En Heilead diseñamos e implementamos el ecosistema digital completo de su empresa: desde la captación inteligente hasta el seguimiento de clientes, posventa y recompra. Todo centralizado en un CRM de última tecnología, con la asesoría y el acompañamiento humano que su equipo necesita para vender más."}),Z.jsxs("div",{className:"flex flex-col items-stretch gap-3 sm:flex-row sm:items-center",children:[Z.jsx("a",{href:"#diagnostico",className:"inline-flex items-center justify-center rounded-full bg-hl-accent-gold px-8 py-4 text-sm font-bold uppercase tracking-wide text-hl-text-primary transition-transform duration-200 hover:scale-[1.03] active:scale-[0.98]",children:"Iniciar diagnóstico gratuito"}),Z.jsx("a",{href:"#friccion",className:"inline-flex items-center justify-center rounded-full border border-white/20 px-8 py-4 text-sm font-semibold text-white/80 transition-colors duration-200 hover:border-white/50 hover:text-white",children:"Ver qué estamos solucionando"})]}),Z.jsx("span",{className:"text-xs text-white/45",children:"Toma menos de 3 minutos. Identifique los cuellos de botella de su negocio y reciba recomendaciones inmediatas."}),Z.jsxs("div",{className:"flex flex-col gap-3 border-t border-white/10 pt-6",children:[Z.jsxs("div",{className:"flex flex-wrap gap-2",children:[Z.jsx("span",{className:"rounded-full border border-white/15 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-white/60",children:"Socio Tecnológico CRM Certificado"}),Z.jsx("span",{className:"rounded-full border border-white/15 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-white/60",children:"Metodología de Acompañamiento Co-Creado"})]}),Z.jsx("p",{className:"text-xs text-white/45",children:"Estructurando y automatizando el pipeline de ventas de más de 150 PYMEs y negocios consultivos."})]})]}),Z.jsxs("div",{className:"mx-auto w-full max-w-md lg:mx-0",children:[Z.jsx("div",{className:"relative mb-6 h-64 sm:h-72",children:Z.jsx(rN,{})}),Z.jsx(QD,{})]})]})]})}const oN={blue:"from-hl-primary/20",gold:"from-hl-accent-gold/25",neutral:"from-slate-200/60"};function y0({title:n,tint:e="neutral",className:t="",children:i}){return Z.jsxs("div",{className:`group relative flex flex-col overflow-hidden rounded-3xl border border-slate-200 bg-white p-6 shadow-[0_1px_2px_rgba(15,23,42,0.04)] transition-all duration-300 hover:-translate-y-1 hover:border-hl-primary/30 hover:shadow-xl sm:p-7 ${t}`,children:[Z.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute -right-16 -top-16 h-48 w-48 rounded-full bg-gradient-to-br ${oN[e]} to-transparent opacity-70 blur-2xl transition-opacity duration-300 group-hover:opacity-100`}),Z.jsx("p",{className:"relative z-10 mb-5 text-xs font-bold uppercase tracking-wide text-hl-text-primary/50",children:n}),Z.jsx("div",{className:"relative z-10 flex flex-1 flex-col",children:i})]})}const D1=De.createContext({});function ig(n){const e=De.useRef(null);return e.current===null&&(e.current=n()),e.current}const e_=De.createContext(null),rg=De.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class aN extends De.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const i=this.props.sizeRef.current;i.height=t.offsetHeight||0,i.width=t.offsetWidth||0,i.top=t.offsetTop,i.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function lN({children:n,isPresent:e}){const t=De.useId(),i=De.useRef(null),r=De.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=De.useContext(rg);return De.useInsertionEffect(()=>{const{width:l,height:c,top:d,left:p}=r.current;if(e||!i.current||!l||!c)return;i.current.dataset.motionPopId=t;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(` [data-motion-pop-id="${t}"] { position: absolute !important; width: ${l}px !important; height: ${c}px !important; top: ${d}px !important; left: ${p}px !important; } `),()=>{document.head.removeChild(m)}},[e]),Z.jsx(aN,{isPresent:e,childRef:i,sizeRef:r,children:De.cloneElement(n,{ref:i})})}const uN=({children:n,initial:e,isPresent:t,onExitComplete:i,custom:r,presenceAffectsLayout:o,mode:l})=>{const c=ig(cN),d=De.useId(),p=De.useCallback(v=>{c.set(v,!0);for(const g of c.values())if(!g)return;i&&i()},[c,i]),m=De.useMemo(()=>({id:d,initial:e,isPresent:t,custom:r,onExitComplete:p,register:v=>(c.set(v,!1),()=>c.delete(v))}),o?[Math.random(),p]:[t,p]);return De.useMemo(()=>{c.forEach((v,g)=>c.set(g,!1))},[t]),De.useEffect(()=>{!t&&!c.size&&i&&i()},[t]),l==="popLayout"&&(n=Z.jsx(lN,{isPresent:t,children:n})),Z.jsx(e_.Provider,{value:m,children:n})};function cN(){return new Map}function HR(n=!0){const e=De.useContext(e_);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:i,register:r}=e,o=De.useId();De.useEffect(()=>{n&&r(o)},[n]);const l=De.useCallback(()=>n&&i&&i(o),[o,i,n]);return!t&&i?[!1,l]:[!0]}const S0=n=>n.key||"";function lw(n){const e=[];return De.Children.forEach(n,t=>{De.isValidElement(t)&&e.push(t)}),e}const N1=typeof window<"u",t_=N1?De.useLayoutEffect:De.useEffect,Hy=({children:n,custom:e,initial:t=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:o="sync",propagate:l=!1})=>{const[c,d]=HR(l),p=De.useMemo(()=>lw(n),[n]),m=l&&!c?[]:p.map(S0),v=De.useRef(!0),g=De.useRef(p),y=ig(()=>new Map),[E,C]=De.useState(p),[w,M]=De.useState(p);t_(()=>{v.current=!1,g.current=p;for(let D=0;D{const L=S0(D),O=l&&!c?!1:p===w||m.includes(L),U=()=>{if(y.has(L))y.set(L,!0);else return;let b=!0;y.forEach(F=>{F||(b=!1)}),b&&(I==null||I(),M(g.current),l&&(d==null||d()),i&&i())};return Z.jsx(uN,{isPresent:O,initial:!v.current||t?void 0:!1,custom:O?void 0:e,presenceAffectsLayout:r,mode:o,onExitComplete:O?void 0:U,children:D},L)})})},mo=n=>n;let GR=mo;function L1(n){let e;return()=>(e===void 0&&(e=n()),e)}const bh=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},jl=n=>n*1e3,Yl=n=>n/1e3,fN={useManualTiming:!1};function dN(n){let e=new Set,t=new Set,i=!1,r=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(p){o.has(p)&&(d.schedule(p),n()),p(l)}const d={schedule:(p,m=!1,v=!1)=>{const y=v&&i?e:t;return m&&o.add(p),y.has(p)||y.add(p),p},cancel:p=>{t.delete(p),o.delete(p)},process:p=>{if(l=p,i){r=!0;return}i=!0,[e,t]=[t,e],e.forEach(c),e.clear(),i=!1,r&&(r=!1,d.process(p))}};return d}const M0=["read","resolveKeyframes","update","preRender","render","postRender"],hN=40;function WR(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>t=!0,l=M0.reduce((M,P)=>(M[P]=dN(o),M),{}),{read:c,resolveKeyframes:d,update:p,preRender:m,render:v,postRender:g}=l,y=()=>{const M=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(M-r.timestamp,hN),1),r.timestamp=M,r.isProcessing=!0,c.process(r),d.process(r),p.process(r),m.process(r),v.process(r),g.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(y))},E=()=>{t=!0,i=!0,r.isProcessing||n(y)};return{schedule:M0.reduce((M,P)=>{const I=l[P];return M[P]=(D,L=!1,O=!1)=>(t||E(),I.schedule(D,L,O)),M},{}),cancel:M=>{for(let P=0;Puw[n].some(t=>!!e[t])};function pN(n){for(const e in n)Dh[e]={...Dh[e],...n[e]}}const mN=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 Rv(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||mN.has(n)}let jR=n=>!Rv(n);function gN(n){n&&(jR=e=>e.startsWith("on")?!Rv(e):n(e))}try{gN(require("@emotion/is-prop-valid").default)}catch{}function vN(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(jR(r)||t===!0&&Rv(r)||!e&&!Rv(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function _N(n){if(typeof Proxy>"u")return n;const e=new Map,t=(...i)=>n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}const n_=De.createContext({});function jm(n){return typeof n=="string"||Array.isArray(n)}function i_(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}const I1=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],k1=["initial",...I1];function r_(n){return i_(n.animate)||k1.some(e=>jm(n[e]))}function YR(n){return!!(r_(n)||n.variants)}function xN(n,e){if(r_(n)){const{initial:t,animate:i}=n;return{initial:t===!1||jm(t)?t:void 0,animate:jm(i)?i:void 0}}return n.inherit!==!1?e:{}}function yN(n){const{initial:e,animate:t}=xN(n,De.useContext(n_));return De.useMemo(()=>({initial:e,animate:t}),[cw(e),cw(t)])}function cw(n){return Array.isArray(n)?n.join(" "):n}const SN=Symbol.for("motionComponentSymbol");function oh(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function MN(n,e,t){return De.useCallback(i=>{i&&n.onMount&&n.onMount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):oh(t)&&(t.current=i))},[e])}const O1=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),EN="framerAppearId",qR="data-"+O1(EN),{schedule:U1}=WR(queueMicrotask,!1),ZR=De.createContext({});function wN(n,e,t,i,r){var o,l;const{visualElement:c}=De.useContext(n_),d=De.useContext(XR),p=De.useContext(e_),m=De.useContext(rg).reducedMotion,v=De.useRef(null);i=i||d.renderer,!v.current&&i&&(v.current=i(n,{visualState:e,parent:c,props:t,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:m}));const g=v.current,y=De.useContext(ZR);g&&!g.projection&&r&&(g.type==="html"||g.type==="svg")&&TN(v.current,t,r,y);const E=De.useRef(!1);De.useInsertionEffect(()=>{g&&E.current&&g.update(t,p)});const C=t[qR],w=De.useRef(!!C&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,C))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,C)));return t_(()=>{g&&(E.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),U1.render(g.render),w.current&&g.animationState&&g.animationState.animateChanges())}),De.useEffect(()=>{g&&(!w.current&&g.animationState&&g.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var M;(M=window.MotionHandoffMarkAsComplete)===null||M===void 0||M.call(window,C)}),w.current=!1))}),g}function TN(n,e,t,i){const{layoutId:r,layout:o,drag:l,dragConstraints:c,layoutScroll:d,layoutRoot:p}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:KR(n.parent)),n.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!l||c&&oh(c),visualElement:n,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,layoutScroll:d,layoutRoot:p})}function KR(n){if(n)return n.options.allowProjection!==!1?n.projection:KR(n.parent)}function CN({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){var o,l;n&&pN(n);function c(p,m){let v;const g={...De.useContext(rg),...p,layoutId:AN(p)},{isStatic:y}=g,E=yN(p),C=i(p,y);if(!y&&N1){RN();const w=PN(g);v=w.MeasureLayout,E.visualElement=wN(r,C,g,e,w.ProjectionNode)}return Z.jsxs(n_.Provider,{value:E,children:[v&&E.visualElement?Z.jsx(v,{visualElement:E.visualElement,...g}):null,t(r,p,MN(C,E.visualElement,m),C,y,E.visualElement)]})}c.displayName=`motion.${typeof r=="string"?r:`create(${(l=(o=r.displayName)!==null&&o!==void 0?o:r.name)!==null&&l!==void 0?l:""})`}`;const d=De.forwardRef(c);return d[SN]=r,d}function AN({layoutId:n}){const e=De.useContext(D1).id;return e&&n!==void 0?e+"-"+n:n}function RN(n,e){De.useContext(XR).strict}function PN(n){const{drag:e,layout:t}=Dh;if(!e&&!t)return{};const i={...e,...t};return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const bN=["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 F1(n){return typeof n!="string"||n.includes("-")?!1:!!(bN.indexOf(n)>-1||/[A-Z]/u.test(n))}function fw(n){const e=[{},{}];return n==null||n.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function z1(n,e,t,i){if(typeof e=="function"){const[r,o]=fw(i);e=e(t!==void 0?t:n.custom,r,o)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,o]=fw(i);e=e(t!==void 0?t:n.custom,r,o)}return e}const Gy=n=>Array.isArray(n),DN=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),NN=n=>Gy(n)?n[n.length-1]||0:n,Er=n=>!!(n&&n.getVelocity);function av(n){const e=Er(n)?n.get():n;return DN(e)?e.toValue():e}function LN({scrapeMotionValuesFromProps:n,createRenderState:e,onUpdate:t},i,r,o){const l={latestValues:IN(i,r,o,n),renderState:e()};return t&&(l.onMount=c=>t({props:i,current:c,...l}),l.onUpdate=c=>t(c)),l}const $R=n=>(e,t)=>{const i=De.useContext(n_),r=De.useContext(e_),o=()=>LN(n,e,i,r);return t?o():ig(o)};function IN(n,e,t,i){const r={},o=i(n,{});for(const g in o)r[g]=av(o[g]);let{initial:l,animate:c}=n;const d=r_(n),p=YR(n);e&&p&&!d&&n.inherit!==!1&&(l===void 0&&(l=e.initial),c===void 0&&(c=e.animate));let m=t?t.initial===!1:!1;m=m||l===!1;const v=m?c:l;if(v&&typeof v!="boolean"&&!i_(v)){const g=Array.isArray(v)?v:[v];for(let y=0;ye=>typeof e=="string"&&e.startsWith(n),JR=QR("--"),kN=QR("var(--"),B1=n=>kN(n)?ON.test(n.split("/*")[0].trim()):!1,ON=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,eP=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Jl=(n,e,t)=>t>e?e:ttypeof n=="number",parse:parseFloat,transform:n=>n},Ym={...jh,transform:n=>Jl(0,1,n)},E0={...jh,default:1},sg=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),Hu=sg("deg"),Ka=sg("%"),Wt=sg("px"),UN=sg("vh"),FN=sg("vw"),dw={...Ka,parse:n=>Ka.parse(n)/100,transform:n=>Ka.transform(n*100)},zN={borderWidth:Wt,borderTopWidth:Wt,borderRightWidth:Wt,borderBottomWidth:Wt,borderLeftWidth:Wt,borderRadius:Wt,radius:Wt,borderTopLeftRadius:Wt,borderTopRightRadius:Wt,borderBottomRightRadius:Wt,borderBottomLeftRadius:Wt,width:Wt,maxWidth:Wt,height:Wt,maxHeight:Wt,top:Wt,right:Wt,bottom:Wt,left:Wt,padding:Wt,paddingTop:Wt,paddingRight:Wt,paddingBottom:Wt,paddingLeft:Wt,margin:Wt,marginTop:Wt,marginRight:Wt,marginBottom:Wt,marginLeft:Wt,backgroundPositionX:Wt,backgroundPositionY:Wt},BN={rotate:Hu,rotateX:Hu,rotateY:Hu,rotateZ:Hu,scale:E0,scaleX:E0,scaleY:E0,scaleZ:E0,skew:Hu,skewX:Hu,skewY:Hu,distance:Wt,translateX:Wt,translateY:Wt,translateZ:Wt,x:Wt,y:Wt,z:Wt,perspective:Wt,transformPerspective:Wt,opacity:Ym,originX:dw,originY:dw,originZ:Wt},hw={...jh,transform:Math.round},V1={...zN,...BN,zIndex:hw,size:Wt,fillOpacity:Ym,strokeOpacity:Ym,numOctaves:hw},VN={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},HN=Xh.length;function GN(n,e,t){let i="",r=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}}),tP=()=>({...W1(),attrs:{}}),X1=n=>typeof n=="string"&&n.toLowerCase()==="svg";function nP(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const o in t)n.style.setProperty(o,t[o])}const iP=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 rP(n,e,t,i){nP(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(iP.has(r)?r:O1(r),e.attrs[r])}const Pv={};function qN(n){Object.assign(Pv,n)}function sP(n,{layout:e,layoutId:t}){return Lf.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Pv[n]||n==="opacity")}function j1(n,e,t){var i;const{style:r}=n,o={};for(const l in r)(Er(r[l])||e.style&&Er(e.style[l])||sP(l,n)||((i=t==null?void 0:t.getValue(l))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(o[l]=r[l]);return o}function oP(n,e,t){const i=j1(n,e,t);for(const r in n)if(Er(n[r])||Er(e[r])){const o=Xh.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=n[r]}return i}function ZN(n,e){try{e.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const mw=["x","y","width","height","cx","cy","r"],KN={useVisualState:$R({scrapeMotionValuesFromProps:oP,createRenderState:tP,onUpdate:({props:n,prevProps:e,current:t,renderState:i,latestValues:r})=>{if(!t)return;let o=!!n.drag;if(!o){for(const c in r)if(Lf.has(c)){o=!0;break}}if(!o)return;let l=!e;if(e)for(let c=0;c{ZN(t,i),ai.render(()=>{G1(i,r,X1(t.tagName),n.transformTemplate),rP(t,i)})})}})},$N={useVisualState:$R({scrapeMotionValuesFromProps:j1,createRenderState:W1})};function aP(n,e,t){for(const i in e)!Er(e[i])&&!sP(i,t)&&(n[i]=e[i])}function QN({transformTemplate:n},e){return De.useMemo(()=>{const t=W1();return H1(t,e,n),Object.assign({},t.vars,t.style)},[e])}function JN(n,e){const t=n.style||{},i={};return aP(i,t,n),Object.assign(i,QN(n,e)),i}function eL(n,e){const t={},i=JN(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}function tL(n,e,t,i){const r=De.useMemo(()=>{const o=tP();return G1(o,e,X1(i),n.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(n.style){const o={};aP(o,n.style,n),r.style={...o,...r.style}}return r}function nL(n=!1){return(t,i,r,{latestValues:o},l)=>{const d=(F1(t)?tL:eL)(i,o,l,t),p=vN(i,typeof t=="string",n),m=t!==De.Fragment?{...p,...d,ref:r}:{},{children:v}=i,g=De.useMemo(()=>Er(v)?v.get():v,[v]);return De.createElement(t,{...m,children:g})}}function iL(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const l={...F1(i)?KN:$N,preloadedFeatures:n,useRender:nL(r),createVisualElement:e,Component:i};return CN(l)}}function lP(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;iwindow.ScrollTimeline!==void 0);class sL{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i{if(rL()&&r.attachTimeline)return r.attachTimeline(e);if(typeof t=="function")return t(r)});return()=>{i.forEach((r,o)=>{r&&r(),this.animations[o].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]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class oL extends sL{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function Y1(n,e){return n?n[e]||n.default||n:void 0}const Wy=2e4;function uP(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e=Wy?1/0:e}function q1(n){return typeof n=="function"}function gw(n,e){n.timeline=e,n.onfinish=null}const Z1=n=>Array.isArray(n)&&typeof n[0]=="number",aL={linearEasing:void 0};function lL(n,e){const t=L1(n);return()=>{var i;return(i=aL[e])!==null&&i!==void 0?i:t()}}const bv=lL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cP=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let o=0;o`cubic-bezier(${n}, ${e}, ${t}, ${i})`,Xy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:dm([0,.65,.55,1]),circOut:dm([.55,0,1,.45]),backIn:dm([.31,.01,.66,-.59]),backOut:dm([.33,1.53,.69,.99])};function dP(n,e){if(n)return typeof n=="function"&&bv()?cP(n,e):Z1(n)?dm(n):Array.isArray(n)?n.map(t=>dP(t,e)||Xy.easeOut):Xy[n]}const va={x:!1,y:!1};function hP(){return va.x||va.y}function uL(n,e,t){var i;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const o=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(n);return o?Array.from(o):[]}return Array.from(n)}function pP(n,e){const t=uL(n),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[t,r,()=>i.abort()]}function vw(n){return e=>{e.pointerType==="touch"||hP()||n(e)}}function cL(n,e,t={}){const[i,r,o]=pP(n,t),l=vw(c=>{const{target:d}=c,p=e(c);if(typeof p!="function"||!d)return;const m=vw(v=>{p(v),d.removeEventListener("pointerleave",m)});d.addEventListener("pointerleave",m,r)});return i.forEach(c=>{c.addEventListener("pointerenter",l,r)}),o}const mP=(n,e)=>e?n===e?!0:mP(n,e.parentElement):!1,K1=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,fL=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dL(n){return fL.has(n.tagName)||n.tabIndex!==-1}const hm=new WeakSet;function _w(n){return e=>{e.key==="Enter"&&n(e)}}function ax(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const hL=(n,e)=>{const t=n.currentTarget;if(!t)return;const i=_w(()=>{if(hm.has(t))return;ax(t,"down");const r=_w(()=>{ax(t,"up")}),o=()=>ax(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",o,e)});t.addEventListener("keydown",i,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",i),e)};function xw(n){return K1(n)&&!hP()}function pL(n,e,t={}){const[i,r,o]=pP(n,t),l=c=>{const d=c.currentTarget;if(!xw(c)||hm.has(d))return;hm.add(d);const p=e(c),m=(y,E)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",g),!(!xw(y)||!hm.has(d))&&(hm.delete(d),typeof p=="function"&&p(y,{success:E}))},v=y=>{m(y,t.useGlobalTarget||mP(d,y.target))},g=y=>{m(y,!1)};window.addEventListener("pointerup",v,r),window.addEventListener("pointercancel",g,r)};return i.forEach(c=>{!dL(c)&&c.getAttribute("tabindex")===null&&(c.tabIndex=0),(t.useGlobalTarget?window:c).addEventListener("pointerdown",l,r),c.addEventListener("focus",p=>hL(p,r),r)}),o}function mL(n){return n==="x"||n==="y"?va[n]?null:(va[n]=!0,()=>{va[n]=!1}):va.x||va.y?null:(va.x=va.y=!0,()=>{va.x=va.y=!1})}const gP=new Set(["width","height","top","left","right","bottom",...Xh]);let lv;function gL(){lv=void 0}const $a={now:()=>(lv===void 0&&$a.set(Mr.isProcessing||fN.useManualTiming?Mr.timestamp:performance.now()),lv),set:n=>{lv=n,queueMicrotask(gL)}};function $1(n,e){n.indexOf(e)===-1&&n.push(e)}function Q1(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class J1{constructor(){this.subscriptions=[]}add(e){return $1(this.subscriptions,e),()=>Q1(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 o=0;o!isNaN(parseFloat(n)),bm={current:void 0};class _L{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const o=$a.now();this.updatedAt!==o&&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=$a.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=vL(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 J1);const i=this.events[e].add(t);return e==="change"?()=>{i(),ai.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 bm.current&&bm.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=$a.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>yw)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,yw);return vP(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 Nh(n,e){return new _L(n,e)}function xL(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,Nh(t))}function yL(n,e){const t=s_(n,e);let{transitionEnd:i={},transition:r={},...o}=t||{};o={...o,...i};for(const l in o){const c=NN(o[l]);xL(n,l,c)}}function SL(n){return!!(Er(n)&&n.add)}function jy(n,e){const t=n.getValue("willChange");if(SL(t))return t.add(e)}function _P(n){return n.props[qR]}const xP=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,ML=1e-7,EL=12;function wL(n,e,t,i,r){let o,l,c=0;do l=e+(t-e)/2,o=xP(l,i,r)-n,o>0?t=l:e=l;while(Math.abs(o)>ML&&++cwL(o,0,1,n,t);return o=>o===0||o===1?o:xP(r(o),e,i)}const yP=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,SP=n=>e=>1-n(1-e),MP=og(.33,1.53,.69,.99),eM=SP(MP),EP=yP(eM),wP=n=>(n*=2)<1?.5*eM(n):.5*(2-Math.pow(2,-10*(n-1))),tM=n=>1-Math.sin(Math.acos(n)),TP=SP(tM),CP=yP(tM),AP=n=>/^0[^.\s]+$/u.test(n);function TL(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||AP(n):!0}const Dm=n=>Math.round(n*1e5)/1e5,nM=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function CL(n){return n==null}const AL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,iM=(n,e)=>t=>!!(typeof t=="string"&&AL.test(t)&&t.startsWith(n)||e&&!CL(t)&&Object.prototype.hasOwnProperty.call(t,e)),RP=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,o,l,c]=i.match(nM);return{[n]:parseFloat(r),[e]:parseFloat(o),[t]:parseFloat(l),alpha:c!==void 0?parseFloat(c):1}},RL=n=>Jl(0,255,n),lx={...jh,transform:n=>Math.round(RL(n))},pf={test:iM("rgb","red"),parse:RP("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+lx.transform(n)+", "+lx.transform(e)+", "+lx.transform(t)+", "+Dm(Ym.transform(i))+")"};function PL(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 Yy={test:iM("#"),parse:PL,transform:pf.transform},ah={test:iM("hsl","hue"),parse:RP("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ka.transform(Dm(e))+", "+Ka.transform(Dm(t))+", "+Dm(Ym.transform(i))+")"},Zr={test:n=>pf.test(n)||Yy.test(n)||ah.test(n),parse:n=>pf.test(n)?pf.parse(n):ah.test(n)?ah.parse(n):Yy.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?pf.transform(n):ah.transform(n)},bL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DL(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(nM))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(bL))===null||t===void 0?void 0:t.length)||0)>0}const PP="number",bP="color",NL="var",LL="var(",Sw="${}",IL=/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 qm(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let o=0;const c=e.replace(IL,d=>(Zr.test(d)?(i.color.push(o),r.push(bP),t.push(Zr.parse(d))):d.startsWith(LL)?(i.var.push(o),r.push(NL),t.push(d)):(i.number.push(o),r.push(PP),t.push(parseFloat(d))),++o,Sw)).split(Sw);return{values:t,split:c,indexes:i,types:r}}function DP(n){return qm(n).values}function NP(n){const{split:e,types:t}=qm(n),i=e.length;return r=>{let o="";for(let l=0;ltypeof n=="number"?0:n;function OL(n){const e=DP(n);return NP(n)(e.map(kL))}const oc={test:DL,parse:DP,createTransformer:NP,getAnimatableNone:OL},UL=new Set(["brightness","contrast","saturate","opacity"]);function FL(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(nM)||[];if(!i)return n;const r=t.replace(i,"");let o=UL.has(e)?1:0;return i!==t&&(o*=100),e+"("+o+r+")"}const zL=/\b([a-z-]*)\(.*?\)/gu,qy={...oc,getAnimatableNone:n=>{const e=n.match(zL);return e?e.map(FL).join(" "):n}},BL={...V1,color:Zr,backgroundColor:Zr,outlineColor:Zr,fill:Zr,stroke:Zr,borderColor:Zr,borderTopColor:Zr,borderRightColor:Zr,borderBottomColor:Zr,borderLeftColor:Zr,filter:qy,WebkitFilter:qy},rM=n=>BL[n];function LP(n,e){let t=rM(n);return t!==qy&&(t=oc),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const VL=new Set(["auto","none","0"]);function HL(n,e,t){let i=0,r;for(;in===jh||n===Wt,Ew=(n,e)=>parseFloat(n.split(", ")[e]),ww=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return Ew(r[1],e);{const o=i.match(/^matrix\((.+)\)$/u);return o?Ew(o[1],n):0}},GL=new Set(["x","y","z"]),WL=Xh.filter(n=>!GL.has(n));function XL(n){const e=[];return WL.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const Lh={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:ww(4,13),y:ww(5,14)};Lh.translateX=Lh.x;Lh.translateY=Lh.y;const wf=new Set;let Zy=!1,Ky=!1;function IP(){if(Ky){const n=Array.from(wf).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=XL(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(([o,l])=>{var c;(c=i.getValue(o))===null||c===void 0||c.set(l)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}Ky=!1,Zy=!1,wf.forEach(n=>n.complete()),wf.clear()}function kP(){wf.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(Ky=!0)})}function jL(){kP(),IP()}class sM{constructor(e,t,i,r,o,l=!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=o,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(wf.add(this),Zy||(Zy=!0,ai.read(kP),ai.resolveKeyframes(IP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let o=0;o/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),YL=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qL(n){const e=YL.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function UP(n,e,t=1){const[i,r]=qL(n);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const l=o.trim();return OP(l)?parseFloat(l):l}return B1(r)?UP(r,e,t+1):r}const FP=n=>e=>e.test(n),ZL={test:n=>n==="auto",parse:n=>n},zP=[jh,Wt,Ka,Hu,FN,UN,ZL],Tw=n=>zP.find(FP(n));class BP extends sM{constructor(e,t,i,r,o){super(e,t,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let d=0;d{t.getValue(d).set(p)}),this.resolveNoneKeyframes()}}const Cw=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(oc.test(n)||n==="0")&&!n.startsWith("url("));function KL(n){const e=n[0];if(n.length===1)return!0;for(let t=0;tn!==null;function o_(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(QL),o=e&&t!=="loop"&&e%2===1?0:r.length-1;return!o||i===void 0?r[o]:i}const JL=40;class VP{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:l="loop",...c}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$a.now(),this.options={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:o,repeatType:l,...c},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>JL?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&jL(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=$a.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:o,delay:l,onComplete:c,onUpdate:d,isGenerator:p}=this.options;if(!p&&!$L(e,i,r,o))if(l)this.options.duration=0;else{d&&d(o_(e,this.options,t)),c&&c(),this.resolveFinishedPromise();return}const m=this.initPlayback(e,t);m!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...m},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Ai=(n,e,t)=>n+(e-n)*t;function ux(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 eI({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,o=0,l=0;if(!e)r=o=l=t;else{const c=t<.5?t*(1+e):t+e-t*e,d=2*t-c;r=ux(d,c,n+1/3),o=ux(d,c,n),l=ux(d,c,n-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:i}}function Dv(n,e){return t=>t>0?e:n}const cx=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},tI=[Yy,pf,ah],nI=n=>tI.find(e=>e.test(n));function Aw(n){const e=nI(n);if(!e)return!1;let t=e.parse(n);return e===ah&&(t=eI(t)),t}const Rw=(n,e)=>{const t=Aw(n),i=Aw(e);if(!t||!i)return Dv(n,e);const r={...t};return o=>(r.red=cx(t.red,i.red,o),r.green=cx(t.green,i.green,o),r.blue=cx(t.blue,i.blue,o),r.alpha=Ai(t.alpha,i.alpha,o),pf.transform(r))},iI=(n,e)=>t=>e(n(t)),ag=(...n)=>n.reduce(iI),$y=new Set(["none","hidden"]);function rI(n,e){return $y.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function sI(n,e){return t=>Ai(n,e,t)}function oM(n){return typeof n=="number"?sI:typeof n=="string"?B1(n)?Dv:Zr.test(n)?Rw:lI:Array.isArray(n)?HP:typeof n=="object"?Zr.test(n)?Rw:oI:Dv}function HP(n,e){const t=[...n],i=t.length,r=n.map((o,l)=>oM(o)(o,e[l]));return o=>{for(let l=0;l{for(const o in i)t[o]=i[o](r);return t}}function aI(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let o=0;o{const t=oc.createTransformer(e),i=qm(n),r=qm(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?$y.has(n)&&!r.values.length||$y.has(e)&&!i.values.length?rI(n,e):ag(HP(aI(i,r),r.values),t):Dv(n,e)};function GP(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?Ai(n,e,t):oM(n)(n,e)}const uI=5;function WP(n,e,t){const i=Math.max(e-uI,0);return vP(t-n(i),e-i)}const Ni={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},fx=.001;function cI({duration:n=Ni.duration,bounce:e=Ni.bounce,velocity:t=Ni.velocity,mass:i=Ni.mass}){let r,o,l=1-e;l=Jl(Ni.minDamping,Ni.maxDamping,l),n=Jl(Ni.minDuration,Ni.maxDuration,Yl(n)),l<1?(r=p=>{const m=p*l,v=m*n,g=m-t,y=Qy(p,l),E=Math.exp(-v);return fx-g/y*E},o=p=>{const v=p*l*n,g=v*t+t,y=Math.pow(l,2)*Math.pow(p,2)*n,E=Math.exp(-v),C=Qy(Math.pow(p,2),l);return(-r(p)+fx>0?-1:1)*((g-y)*E)/C}):(r=p=>{const m=Math.exp(-p*n),v=(p-t)*n+1;return-fx+m*v},o=p=>{const m=Math.exp(-p*n),v=(t-p)*(n*n);return m*v});const c=5/n,d=dI(r,o,c);if(n=jl(n),isNaN(d))return{stiffness:Ni.stiffness,damping:Ni.damping,duration:n};{const p=Math.pow(d,2)*i;return{stiffness:p,damping:l*2*Math.sqrt(i*p),duration:n}}}const fI=12;function dI(n,e,t){let i=t;for(let r=1;rn[t]!==void 0)}function mI(n){let e={velocity:Ni.velocity,stiffness:Ni.stiffness,damping:Ni.damping,mass:Ni.mass,isResolvedFromDuration:!1,...n};if(!Pw(n,pI)&&Pw(n,hI))if(n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,o=2*Jl(.05,1,1-(n.bounce||0))*Math.sqrt(r);e={...e,mass:Ni.mass,stiffness:r,damping:o}}else{const t=cI(n);e={...e,...t,mass:Ni.mass},e.isResolvedFromDuration=!0}return e}function XP(n=Ni.visualDuration,e=Ni.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const o=t.keyframes[0],l=t.keyframes[t.keyframes.length-1],c={done:!1,value:o},{stiffness:d,damping:p,mass:m,duration:v,velocity:g,isResolvedFromDuration:y}=mI({...t,velocity:-Yl(t.velocity||0)}),E=g||0,C=p/(2*Math.sqrt(d*m)),w=l-o,M=Yl(Math.sqrt(d/m)),P=Math.abs(w)<5;i||(i=P?Ni.restSpeed.granular:Ni.restSpeed.default),r||(r=P?Ni.restDelta.granular:Ni.restDelta.default);let I;if(C<1){const L=Qy(M,C);I=O=>{const U=Math.exp(-C*M*O);return l-U*((E+C*M*w)/L*Math.sin(L*O)+w*Math.cos(L*O))}}else if(C===1)I=L=>l-Math.exp(-M*L)*(w+(E+M*w)*L);else{const L=M*Math.sqrt(C*C-1);I=O=>{const U=Math.exp(-C*M*O),b=Math.min(L*O,300);return l-U*((E+C*M*w)*Math.sinh(b)+L*w*Math.cosh(b))/L}}const D={calculatedDuration:y&&v||null,next:L=>{const O=I(L);if(y)c.done=L>=v;else{let U=0;C<1&&(U=L===0?jl(E):WP(I,L,O));const b=Math.abs(U)<=i,F=Math.abs(l-O)<=r;c.done=b&&F}return c.value=c.done?l:O,c},toString:()=>{const L=Math.min(uP(D),Wy),O=cP(U=>D.next(L*U).value,L,30);return L+"ms "+O}};return D}function bw({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:l,min:c,max:d,restDelta:p=.5,restSpeed:m}){const v=n[0],g={done:!1,value:v},y=b=>c!==void 0&&bd,E=b=>c===void 0?d:d===void 0||Math.abs(c-b)-C*Math.exp(-b/i),I=b=>M+P(b),D=b=>{const F=P(b),H=I(b);g.done=Math.abs(F)<=p,g.value=g.done?M:H};let L,O;const U=b=>{y(g.value)&&(L=b,O=XP({keyframes:[g.value,E(g.value)],velocity:WP(I,b,g.value),damping:r,stiffness:o,restDelta:p,restSpeed:m}))};return U(0),{calculatedDuration:null,next:b=>{let F=!1;return!O&&L===void 0&&(F=!0,D(b),U(b)),L!==void 0&&b>=L?O.next(b-L):(!F&&D(b),g)}}}const gI=og(.42,0,1,1),vI=og(0,0,.58,1),jP=og(.42,0,.58,1),_I=n=>Array.isArray(n)&&typeof n[0]!="number",xI={linear:mo,easeIn:gI,easeInOut:jP,easeOut:vI,circIn:tM,circInOut:CP,circOut:TP,backIn:eM,backInOut:EP,backOut:MP,anticipate:wP},Dw=n=>{if(Z1(n)){GR(n.length===4);const[e,t,i,r]=n;return og(e,t,i,r)}else if(typeof n=="string")return xI[n];return n};function yI(n,e,t){const i=[],r=t||GP,o=n.length-1;for(let l=0;le[0];if(o===2&&e[0]===e[1])return()=>e[1];const l=n[0]===n[1];n[0]>n[o-1]&&(n=[...n].reverse(),e=[...e].reverse());const c=yI(e,i,r),d=c.length,p=m=>{if(l&&m1)for(;vp(Jl(n[0],n[o-1],m)):p}function SI(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=bh(0,e,i);n.push(Ai(t,1,r))}}function MI(n){const e=[0];return SI(e,n.length-1),e}function EI(n,e){return n.map(t=>t*e)}function wI(n,e){return n.map(()=>e||jP).splice(0,n.length-1)}function Nv({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=_I(i)?i.map(Dw):Dw(i),o={done:!1,value:e[0]},l=EI(t&&t.length===e.length?t:MI(e),n),c=YP(l,e,{ease:Array.isArray(r)?r:wI(e,r)});return{calculatedDuration:n,next:d=>(o.value=c(d),o.done=d>=n,o)}}const TI=n=>{const e=({timestamp:t})=>n(t);return{start:()=>ai.update(e,!0),stop:()=>Ql(e),now:()=>Mr.isProcessing?Mr.timestamp:$a.now()}},CI={decay:bw,inertia:bw,tween:Nv,keyframes:Nv,spring:XP},AI=n=>n/100;class a_ extends VP{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:d}=this.options;d&&d()};const{name:t,motionValue:i,element:r,keyframes:o}=this.options,l=(r==null?void 0:r.KeyframeResolver)||sM,c=(d,p)=>this.onKeyframesResolved(d,p);this.resolver=new l(o,c,t,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:l=0}=this.options,c=q1(t)?t:CI[t]||Nv;let d,p;c!==Nv&&typeof e[0]!="number"&&(d=ag(AI,GP(e[0],e[1])),e=[0,100]);const m=c({...this.options,keyframes:e});o==="mirror"&&(p=c({...this.options,keyframes:[...e].reverse(),velocity:-l})),m.calculatedDuration===null&&(m.calculatedDuration=uP(m));const{calculatedDuration:v}=m,g=v+r,y=g*(i+1)-r;return{generator:m,mirroredGenerator:p,mapPercentToKeyframes:d,calculatedDuration:v,resolvedDuration:g,totalDuration:y}}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:b}=this.options;return{done:!0,value:b[b.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:l,mapPercentToKeyframes:c,keyframes:d,calculatedDuration:p,totalDuration:m,resolvedDuration:v}=i;if(this.startTime===null)return o.next(0);const{delay:g,repeat:y,repeatType:E,repeatDelay:C,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-m/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-g*(this.speed>=0?1:-1),P=this.speed>=0?M<0:M>m;this.currentTime=Math.max(M,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=m);let I=this.currentTime,D=o;if(y){const b=Math.min(this.currentTime,m)/v;let F=Math.floor(b),H=b%1;!H&&b>=1&&(H=1),H===1&&F--,F=Math.min(F,y+1),!!(F%2)&&(E==="reverse"?(H=1-H,C&&(H-=C/v)):E==="mirror"&&(D=l)),I=Jl(0,1,H)*v}const L=P?{done:!1,value:d[0]}:D.next(I);c&&(L.value=c(L.value));let{done:O}=L;!P&&p!==null&&(O=this.speed>=0?this.currentTime>=m:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return U&&r!==void 0&&(L.value=o_(d,this.options,r)),w&&w(L.value),U&&this.finish(),L}get duration(){const{resolved:e}=this;return e?Yl(e.calculatedDuration):0}get time(){return Yl(this.currentTime)}set time(e){e=jl(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=Yl(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=TI,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),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??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 RI(n){return new a_(n)}const PI=new Set(["opacity","clipPath","filter","transform"]);function bI(n,e,t,{delay:i=0,duration:r=300,repeat:o=0,repeatType:l="loop",ease:c="easeInOut",times:d}={}){const p={[e]:t};d&&(p.offset=d);const m=dP(c,r);return Array.isArray(m)&&(p.easing=m),n.animate(p,{delay:i,duration:r,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"})}const DI=L1(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Lv=10,NI=2e4;function LI(n){return q1(n.type)||n.type==="spring"||!fP(n.ease)}function II(n,e){const t=new a_({...e,keyframes:n,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:n[0]};const r=[];let o=0;for(;!i.done&&othis.onKeyframesResolved(l,c),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:i=300,times:r,ease:o,type:l,motionValue:c,name:d,startTime:p}=this.options;if(!c.owner||!c.owner.current)return!1;if(typeof o=="string"&&bv()&&kI(o)&&(o=qP[o]),LI(this.options)){const{onComplete:v,onUpdate:g,motionValue:y,element:E,...C}=this.options,w=II(e,C);e=w.keyframes,e.length===1&&(e[1]=e[0]),i=w.duration,r=w.times,o=w.ease,l="keyframes"}const m=bI(c.owner.current,d,e,{...this.options,duration:i,times:r,ease:o});return m.startTime=p??this.calcStartTime(),this.pendingTimeline?(gw(m,this.pendingTimeline),this.pendingTimeline=void 0):m.onfinish=()=>{const{onComplete:v}=this.options;c.set(o_(e,this.options,t)),v&&v(),this.cancel(),this.resolveFinishedPromise()},{animation:m,duration:i,times:r,type:l,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Yl(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Yl(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=jl(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 mo;const{animation:i}=t;gw(i,e)}return mo}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:o,ease:l,times:c}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:m,onComplete:v,element:g,...y}=this.options,E=new a_({...y,keyframes:i,duration:r,type:o,ease:l,times:c,isGenerator:!0}),C=jl(this.time);p.setWithVelocity(E.sample(C-Lv).value,E.sample(C).value,Lv)}const{onStop:d}=this.options;d&&d(),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:o,damping:l,type:c}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:p}=t.owner.getProps();return DI()&&i&&PI.has(i)&&!d&&!p&&!r&&o!=="mirror"&&l!==0&&c!=="inertia"}}const OI={type:"spring",stiffness:500,damping:25,restSpeed:10},UI=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),FI={type:"keyframes",duration:.8},zI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(n,{keyframes:e})=>e.length>2?FI:Lf.has(n)?n.startsWith("scale")?UI(e[1]):OI:zI;function VI({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:l,repeatDelay:c,from:d,elapsed:p,...m}){return!!Object.keys(m).length}const aM=(n,e,t,i={},r,o)=>l=>{const c=Y1(i,n)||{},d=c.delay||i.delay||0;let{elapsed:p=0}=i;p=p-jl(d);let m={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...c,delay:-p,onUpdate:g=>{e.set(g),c.onUpdate&&c.onUpdate(g)},onComplete:()=>{l(),c.onComplete&&c.onComplete()},name:n,motionValue:e,element:o?void 0:r};VI(c)||(m={...m,...BI(n,m)}),m.duration&&(m.duration=jl(m.duration)),m.repeatDelay&&(m.repeatDelay=jl(m.repeatDelay)),m.from!==void 0&&(m.keyframes[0]=m.from);let v=!1;if((m.type===!1||m.duration===0&&!m.repeatDelay)&&(m.duration=0,m.delay===0&&(v=!0)),v&&!o&&e.get()!==void 0){const g=o_(m.keyframes,c);if(g!==void 0)return ai.update(()=>{m.onUpdate(g),m.onComplete()}),new oL([])}return!o&&Nw.supports(m)?new Nw(m):new a_(m)};function HI({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function ZP(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var o;let{transition:l=n.getDefaultTransition(),transitionEnd:c,...d}=e;i&&(l=i);const p=[],m=r&&n.animationState&&n.animationState.getState()[r];for(const v in d){const g=n.getValue(v,(o=n.latestValues[v])!==null&&o!==void 0?o:null),y=d[v];if(y===void 0||m&&HI(m,v))continue;const E={delay:t,...Y1(l||{},v)};let C=!1;if(window.MotionHandoffAnimation){const M=_P(n);if(M){const P=window.MotionHandoffAnimation(M,v,ai);P!==null&&(E.startTime=P,C=!0)}}jy(n,v),g.start(aM(v,g,y,n.shouldReduceMotion&&gP.has(v)?{type:!1}:E,n,C));const w=g.animation;w&&p.push(w)}return c&&Promise.all(p).then(()=>{ai.update(()=>{c&&yL(n,c)})}),p}function Jy(n,e,t={}){var i;const r=s_(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:o=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(o=t.transitionOverride);const l=r?()=>Promise.all(ZP(n,r,t)):()=>Promise.resolve(),c=n.variantChildren&&n.variantChildren.size?(p=0)=>{const{delayChildren:m=0,staggerChildren:v,staggerDirection:g}=o;return GI(n,e,m+p,v,g,t)}:()=>Promise.resolve(),{when:d}=o;if(d){const[p,m]=d==="beforeChildren"?[l,c]:[c,l];return p().then(()=>m())}else return Promise.all([l(),c(t.delay)])}function GI(n,e,t=0,i=0,r=1,o){const l=[],c=(n.variantChildren.size-1)*i,d=r===1?(p=0)=>p*i:(p=0)=>c-p*i;return Array.from(n.variantChildren).sort(WI).forEach((p,m)=>{p.notify("AnimationStart",e),l.push(Jy(p,e,{...o,delay:t+d(m)}).then(()=>p.notify("AnimationComplete",e)))}),Promise.all(l)}function WI(n,e){return n.sortNodePosition(e)}function XI(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>Jy(n,o,t));i=Promise.all(r)}else if(typeof e=="string")i=Jy(n,e,t);else{const r=typeof e=="function"?s_(n,e,t.custom):e;i=Promise.all(ZP(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}const jI=k1.length;function KP(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?KP(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;tPromise.all(e.map(({animation:t,options:i})=>XI(n,t,i)))}function KI(n){let e=ZI(n),t=Lw(),i=!0;const r=d=>(p,m)=>{var v;const g=s_(n,m,d==="exit"?(v=n.presenceContext)===null||v===void 0?void 0:v.custom:void 0);if(g){const{transition:y,transitionEnd:E,...C}=g;p={...p,...C,...E}}return p};function o(d){e=d(n)}function l(d){const{props:p}=n,m=KP(n.parent)||{},v=[],g=new Set;let y={},E=1/0;for(let w=0;wE&&D,F=!1;const H=Array.isArray(I)?I:[I];let W=H.reduce(r(M),{});L===!1&&(W={});const{prevResolvedValues:Y={}}=P,le={...Y,...W},pe=$=>{b=!0,g.has($)&&(F=!0,g.delete($)),P.needsAnimating[$]=!0;const X=n.getValue($);X&&(X.liveStyle=!1)};for(const $ in le){const X=W[$],Q=Y[$];if(y.hasOwnProperty($))continue;let B=!1;Gy(X)&&Gy(Q)?B=!lP(X,Q):B=X!==Q,B?X!=null?pe($):g.add($):X!==void 0&&g.has($)?pe($):P.protectedKeys[$]=!0}P.prevProp=I,P.prevResolvedValues=W,P.isActive&&(y={...y,...W}),i&&n.blockInitialAnimation&&(b=!1),b&&(!(O&&U)||F)&&v.push(...H.map($=>({animation:$,options:{type:M}})))}if(g.size){const w={};g.forEach(M=>{const P=n.getBaseTarget(M),I=n.getValue(M);I&&(I.liveStyle=!0),w[M]=P??null}),v.push({animation:w})}let C=!!v.length;return i&&(p.initial===!1||p.initial===p.animate)&&!n.manuallyAnimateOnMount&&(C=!1),i=!1,C?e(v):Promise.resolve()}function c(d,p){var m;if(t[d].isActive===p)return Promise.resolve();(m=n.variantChildren)===null||m===void 0||m.forEach(g=>{var y;return(y=g.animationState)===null||y===void 0?void 0:y.setActive(d,p)}),t[d].isActive=p;const v=l(d);for(const g in t)t[g].protectedKeys={};return v}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>t,reset:()=>{t=Lw(),i=!0}}}function $I(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!lP(e,n):!1}function Qc(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Lw(){return{animate:Qc(!0),whileInView:Qc(),whileHover:Qc(),whileTap:Qc(),whileDrag:Qc(),whileFocus:Qc(),exit:Qc()}}class fc{constructor(e){this.isMounted=!1,this.node=e}update(){}}class QI extends fc{constructor(e){super(e),e.animationState||(e.animationState=KI(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();i_(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 JI=0;class ek extends fc{constructor(){super(...arguments),this.id=JI++}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 tk={animation:{Feature:QI},exit:{Feature:ek}};function Zm(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function lg(n){return{point:{x:n.pageX,y:n.pageY}}}const nk=n=>e=>K1(e)&&n(e,lg(e));function Nm(n,e,t,i){return Zm(n,e,nk(t),i)}const Iw=(n,e)=>Math.abs(n-e);function ik(n,e){const t=Iw(n.x,e.x),i=Iw(n.y,e.y);return Math.sqrt(t**2+i**2)}class $P{constructor(e,t,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:o=!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 v=hx(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=ik(v.offset,{x:0,y:0})>=3;if(!g&&!y)return;const{point:E}=v,{timestamp:C}=Mr;this.history.push({...E,timestamp:C});const{onStart:w,onMove:M}=this.handlers;g||(w&&w(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,v)},this.handlePointerMove=(v,g)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=dx(g,this.transformPagePoint),ai.update(this.updatePoint,!0)},this.handlePointerUp=(v,g)=>{this.end();const{onEnd:y,onSessionEnd:E,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=hx(v.type==="pointercancel"?this.lastMoveEventInfo:dx(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(v,w),E&&E(v,w)},!K1(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const l=lg(e),c=dx(l,this.transformPagePoint),{point:d}=c,{timestamp:p}=Mr;this.history=[{...d,timestamp:p}];const{onSessionStart:m}=t;m&&m(e,hx(c,this.history)),this.removeListeners=ag(Nm(this.contextWindow,"pointermove",this.handlePointerMove),Nm(this.contextWindow,"pointerup",this.handlePointerUp),Nm(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ql(this.updatePoint)}}function dx(n,e){return e?{point:e(n.point)}:n}function kw(n,e){return{x:n.x-e.x,y:n.y-e.y}}function hx({point:n},e){return{point:n,delta:kw(n,QP(e)),offset:kw(n,rk(e)),velocity:sk(e,.1)}}function rk(n){return n[0]}function QP(n){return n[n.length-1]}function sk(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=QP(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>jl(e)));)t--;if(!i)return{x:0,y:0};const o=Yl(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const l={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const JP=1e-4,ok=1-JP,ak=1+JP,eb=.01,lk=0-eb,uk=0+eb;function _o(n){return n.max-n.min}function ck(n,e,t){return Math.abs(n-e)<=t}function Ow(n,e,t,i=.5){n.origin=i,n.originPoint=Ai(e.min,e.max,n.origin),n.scale=_o(t)/_o(e),n.translate=Ai(t.min,t.max,n.origin)-n.originPoint,(n.scale>=ok&&n.scale<=ak||isNaN(n.scale))&&(n.scale=1),(n.translate>=lk&&n.translate<=uk||isNaN(n.translate))&&(n.translate=0)}function Lm(n,e,t,i){Ow(n.x,e.x,t.x,i?i.originX:void 0),Ow(n.y,e.y,t.y,i?i.originY:void 0)}function Uw(n,e,t){n.min=t.min+e.min,n.max=n.min+_o(e)}function fk(n,e,t){Uw(n.x,e.x,t.x),Uw(n.y,e.y,t.y)}function Fw(n,e,t){n.min=e.min-t.min,n.max=n.min+_o(e)}function Im(n,e,t){Fw(n.x,e.x,t.x),Fw(n.y,e.y,t.y)}function dk(n,{min:e,max:t},i){return e!==void 0&&nt&&(n=i?Ai(t,n,i.max):Math.min(n,t)),n}function zw(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 hk(n,{top:e,left:t,bottom:i,right:r}){return{x:zw(n.x,t,r),y:zw(n.y,e,i)}}function Bw(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.mini?t=bh(e.min,e.max-i,n.min):i>r&&(t=bh(n.min,n.max-r,e.min)),Jl(0,1,t)}function gk(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 eS=.35;function vk(n=eS){return n===!1?n=0:n===!0&&(n=eS),{x:Vw(n,"left","right"),y:Vw(n,"top","bottom")}}function Vw(n,e,t){return{min:Hw(n,e),max:Hw(n,t)}}function Hw(n,e){return typeof n=="number"?n:n[e]||0}const Gw=()=>({translate:0,scale:1,origin:0,originPoint:0}),lh=()=>({x:Gw(),y:Gw()}),Ww=()=>({min:0,max:0}),zi=()=>({x:Ww(),y:Ww()});function Lo(n){return[n("x"),n("y")]}function tb({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function _k({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function xk(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 px(n){return n===void 0||n===1}function tS({scale:n,scaleX:e,scaleY:t}){return!px(n)||!px(e)||!px(t)}function af(n){return tS(n)||nb(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function nb(n){return Xw(n.x)||Xw(n.y)}function Xw(n){return n&&n!=="0%"}function Iv(n,e,t){const i=n-t,r=e*i;return t+r}function jw(n,e,t,i,r){return r!==void 0&&(n=Iv(n,r,i)),Iv(n,t,i)+e}function nS(n,e=0,t=1,i,r){n.min=jw(n.min,e,t,i,r),n.max=jw(n.max,e,t,i,r)}function ib(n,{x:e,y:t}){nS(n.x,e.translate,e.scale,e.originPoint),nS(n.y,t.translate,t.scale,t.originPoint)}const Yw=.999999999999,qw=1.0000000000001;function yk(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let o,l;for(let c=0;cYw&&(e.x=1),e.yYw&&(e.y=1)}function uh(n,e){n.min=n.min+e,n.max=n.max+e}function Zw(n,e,t,i,r=.5){const o=Ai(n.min,n.max,r);nS(n,e,t,o,i)}function ch(n,e){Zw(n.x,e.x,e.scaleX,e.scale,e.originX),Zw(n.y,e.y,e.scaleY,e.scale,e.originY)}function rb(n,e){return tb(xk(n.getBoundingClientRect(),e))}function Sk(n,e,t){const i=rb(n,t),{scroll:r}=e;return r&&(uh(i.x,r.offset.x),uh(i.y,r.offset.y)),i}const sb=({current:n})=>n?n.ownerDocument.defaultView:null,Mk=new WeakMap;class Ek{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=zi(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=m=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(lg(m).point)},o=(m,v)=>{const{drag:g,dragPropagation:y,onDragStart:E}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mL(g),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Lo(w=>{let M=this.getAxisMotionValue(w).get()||0;if(Ka.test(M)){const{projection:P}=this.visualElement;if(P&&P.layout){const I=P.layout.layoutBox[w];I&&(M=_o(I)*(parseFloat(M)/100))}}this.originPoint[w]=M}),E&&ai.postRender(()=>E(m,v)),jy(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(m,v)=>{const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:E,onDrag:C}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:w}=v;if(y&&this.currentDirection===null){this.currentDirection=wk(w),this.currentDirection!==null&&E&&E(this.currentDirection);return}this.updateAxis("x",v.point,w),this.updateAxis("y",v.point,w),this.visualElement.render(),C&&C(m,v)},c=(m,v)=>this.stop(m,v),d=()=>Lo(m=>{var v;return this.getAnimationState(m)==="paused"&&((v=this.getAxisMotionValue(m).animation)===null||v===void 0?void 0:v.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new $P(e,{onSessionStart:r,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:sb(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&ai.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.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!w0(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let l=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(l=dk(l,this.constraints[e],this.elastic[e])),o.set(l)}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,o=this.constraints;t&&oh(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=hk(r.layoutBox,t):this.constraints=!1,this.elastic=vk(i),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Lo(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=gk(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!oh(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=Sk(i,r.root,this.visualElement.getTransformPagePoint());let l=pk(r.layout.layoutBox,o);if(t){const c=t(_k(l));this.hasMutatedConstraints=!!c,c&&(l=tb(c))}return l}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},p=Lo(m=>{if(!w0(m,t,this.currentDirection))return;let v=d&&d[m]||{};l&&(v={min:0,max:0});const g=r?200:1e6,y=r?40:1e7,E={type:"inertia",velocity:i?e[m]:0,bounceStiffness:g,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...o,...v};return this.startAxisValueAnimation(m,E)});return Promise.all(p).then(c)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return jy(this.visualElement,e),i.start(aM(e,i,0,t,this.visualElement,!1))}stopAnimation(){Lo(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Lo(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){Lo(t=>{const{drag:i}=this.getProps();if(!w0(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:l,max:c}=r.layout.layoutBox[t];o.set(e[t]-Ai(l,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!oh(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Lo(l=>{const c=this.getAxisMotionValue(l);if(c&&this.constraints!==!1){const d=c.get();r[l]=mk({min:d,max:d},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),Lo(l=>{if(!w0(l,e,null))return;const c=this.getAxisMotionValue(l),{min:d,max:p}=this.constraints[l];c.set(Ai(d,p,r[l]))})}addListeners(){if(!this.visualElement.current)return;Mk.set(this.visualElement,this);const e=this.visualElement.current,t=Nm(e,"pointerdown",d=>{const{drag:p,dragListener:m=!0}=this.getProps();p&&m&&this.start(d)}),i=()=>{const{dragConstraints:d}=this.getProps();oh(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ai.read(i);const l=Zm(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(Lo(m=>{const v=this.getAxisMotionValue(m);v&&(this.originPoint[m]+=d[m].translate,v.set(v.get()+d[m].translate))}),this.visualElement.render())}));return()=>{l(),t(),o(),c&&c()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:l=eS,dragMomentum:c=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:l,dragMomentum:c}}}function w0(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function wk(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class Tk extends fc{constructor(e){super(e),this.removeGroupControls=mo,this.removeListeners=mo,this.controls=new Ek(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mo}unmount(){this.removeGroupControls(),this.removeListeners()}}const Kw=n=>(e,t)=>{n&&ai.postRender(()=>n(e,t))};class Ck extends fc{constructor(){super(...arguments),this.removePointerDownListener=mo}onPointerDown(e){this.session=new $P(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sb(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:Kw(e),onStart:Kw(t),onMove:i,onEnd:(o,l)=>{delete this.session,r&&ai.postRender(()=>r(o,l))}}}mount(){this.removePointerDownListener=Nm(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 uv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $w(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const jp={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Wt.test(n))n=parseFloat(n);else return n;const t=$w(n,e.target.x),i=$w(n,e.target.y);return`${t}% ${i}%`}},Ak={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=oc.parse(n);if(r.length>5)return i;const o=oc.createTransformer(n),l=typeof r[0]!="number"?1:0,c=t.x.scale*e.x,d=t.y.scale*e.y;r[0+l]/=c,r[1+l]/=d;const p=Ai(c,d,.5);return typeof r[2+l]=="number"&&(r[2+l]/=p),typeof r[3+l]=="number"&&(r[3+l]/=p),o(r)}};class Rk extends De.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;qN(Pk),o&&(t.group&&t.group.add(o),i&&i.register&&r&&i.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),uv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:o}=this.props,l=i.projection;return l&&(l.isPresent=o,r||e.layoutDependency!==t||t===void 0?l.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?l.promote():l.relegate()||ai.postRender(()=>{const c=l.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),U1.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 ob(n){const[e,t]=HR(),i=De.useContext(D1);return Z.jsx(Rk,{...n,layoutGroup:i,switchLayoutGroup:De.useContext(ZR),isPresent:e,safeToRemove:t})}const Pk={borderRadius:{...jp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:jp,borderTopRightRadius:jp,borderBottomLeftRadius:jp,borderBottomRightRadius:jp,boxShadow:Ak};function bk(n,e,t){const i=Er(n)?n:Nh(n);return i.start(aM("",i,e,t)),i.animation}function Dk(n){return n instanceof SVGElement&&n.tagName!=="svg"}const Nk=(n,e)=>n.depth-e.depth;class Lk{constructor(){this.children=[],this.isDirty=!1}add(e){$1(this.children,e),this.isDirty=!0}remove(e){Q1(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Nk),this.isDirty=!1,this.children.forEach(e)}}function Ik(n,e){const t=$a.now(),i=({timestamp:r})=>{const o=r-t;o>=e&&(Ql(i),n(o-e))};return ai.read(i,!0),()=>Ql(i)}const ab=["TopLeft","TopRight","BottomLeft","BottomRight"],kk=ab.length,Qw=n=>typeof n=="string"?parseFloat(n):n,Jw=n=>typeof n=="number"||Wt.test(n);function Ok(n,e,t,i,r,o){r?(n.opacity=Ai(0,t.opacity!==void 0?t.opacity:1,Uk(i)),n.opacityExit=Ai(e.opacity!==void 0?e.opacity:1,0,Fk(i))):o&&(n.opacity=Ai(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let l=0;lie?1:t(bh(n,e,i))}function tT(n,e){n.min=e.min,n.max=e.max}function bo(n,e){tT(n.x,e.x),tT(n.y,e.y)}function nT(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function iT(n,e,t,i,r){return n-=e,n=Iv(n,1/t,i),r!==void 0&&(n=Iv(n,1/r,i)),n}function zk(n,e=0,t=1,i=.5,r,o=n,l=n){if(Ka.test(e)&&(e=parseFloat(e),e=Ai(l.min,l.max,e/100)-l.min),typeof e!="number")return;let c=Ai(o.min,o.max,i);n===o&&(c-=e),n.min=iT(n.min,e,t,c,r),n.max=iT(n.max,e,t,c,r)}function rT(n,e,[t,i,r],o,l){zk(n,e[t],e[i],e[r],e.scale,o,l)}const Bk=["x","scaleX","originX"],Vk=["y","scaleY","originY"];function sT(n,e,t,i){rT(n.x,e,Bk,t?t.x:void 0,i?i.x:void 0),rT(n.y,e,Vk,t?t.y:void 0,i?i.y:void 0)}function oT(n){return n.translate===0&&n.scale===1}function ub(n){return oT(n.x)&&oT(n.y)}function aT(n,e){return n.min===e.min&&n.max===e.max}function Hk(n,e){return aT(n.x,e.x)&&aT(n.y,e.y)}function lT(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function cb(n,e){return lT(n.x,e.x)&&lT(n.y,e.y)}function uT(n){return _o(n.x)/_o(n.y)}function cT(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class Gk{constructor(){this.members=[]}add(e){$1(this.members,e),e.scheduleRender()}remove(e){if(Q1(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 o=this.members[r];if(o.isPresent!==!1){i=o;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 Wk(n,e,t){let i="";const r=n.x.translate/e.x,o=n.y.translate/e.y,l=(t==null?void 0:t.z)||0;if((r||o||l)&&(i=`translate3d(${r}px, ${o}px, ${l}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:p,rotate:m,rotateX:v,rotateY:g,skewX:y,skewY:E}=t;p&&(i=`perspective(${p}px) ${i}`),m&&(i+=`rotate(${m}deg) `),v&&(i+=`rotateX(${v}deg) `),g&&(i+=`rotateY(${g}deg) `),y&&(i+=`skewX(${y}deg) `),E&&(i+=`skewY(${E}deg) `)}const c=n.x.scale*e.x,d=n.y.scale*e.y;return(c!==1||d!==1)&&(i+=`scale(${c}, ${d})`),i||"none"}const lf={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},pm=typeof window<"u"&&window.MotionDebug!==void 0,mx=["","X","Y","Z"],Xk={visibility:"hidden"},fT=1e3;let jk=0;function gx(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function fb(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=_P(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:o}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",ai,!(r||o))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&fb(i)}function db({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(l={},c=e==null?void 0:e()){this.id=jk++,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,pm&&(lf.totalNodes=lf.resolvedTargetDeltas=lf.recalculatedProjection=0),this.nodes.forEach(Zk),this.nodes.forEach(eO),this.nodes.forEach(tO),this.nodes.forEach(Kk),pm&&window.MotionDebug.record(lf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;dthis.root.updateBlockedByResize=!1;n(l,()=>{this.root.updateBlockedByResize=!0,v&&v(),v=Ik(g,250),uv.hasAnimatedSinceResize&&(uv.hasAnimatedSinceResize=!1,this.nodes.forEach(hT))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&m&&(d||p)&&this.addEventListener("didUpdate",({delta:v,hasLayoutChanged:g,hasRelativeTargetChanged:y,layout:E})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||m.getDefaultTransition()||oO,{onLayoutAnimationStart:w,onLayoutAnimationComplete:M}=m.getProps(),P=!this.targetLayout||!cb(this.targetLayout,E)||y,I=!g&&y;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||I||g&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(v,I);const D={...Y1(C,"layout"),onPlay:w,onComplete:M};(m.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else g||hT(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=E})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ql(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(nO),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&fb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{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 d=0;d{const L=D/1e3;pT(v.x,l.x,L),pT(v.y,l.y,L),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Im(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rO(this.relativeTarget,this.relativeTargetOrigin,g,L),I&&Hk(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=zi()),bo(I,this.relativeTarget)),C&&(this.animationValues=m,Ok(m,p,this.latestValues,L,P,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ql(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ai.update(()=>{uv.hasAnimatedSinceResize=!0,this.currentAnimation=bk(0,fT,{...l,onUpdate:c=>{this.mixTargetDelta(c),l.onUpdate&&l.onUpdate(c)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(fT),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:c,target:d,layout:p,latestValues:m}=l;if(!(!c||!d||!p)){if(this!==l&&this.layout&&p&&hb(this.options.animationType,this.layout.layoutBox,p.layoutBox)){d=this.target||zi();const v=_o(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+v;const g=_o(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+g}bo(c,d),ch(c,m),Lm(this.projectionDeltaWithTransform,this.layoutCorrected,c,m)}}registerSharedNode(l,c){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Gk),this.sharedNodes.get(l).add(c);const p=c.options.initialPromotionConfig;c.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(c):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:c}=this.options;return c?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:c}=this.options;return c?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:c,preserveFollowOpacity:d}={}){const p=this.getStack();p&&p.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let c=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const p={};d.z&&gx("z",l,p,this.animationValues);for(let m=0;m{var c;return(c=l.currentAnimation)===null||c===void 0?void 0:c.stop()}),this.root.nodes.forEach(dT),this.root.sharedNodes.clear()}}}function Yk(n){n.updateLayout()}function qk(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:o}=n.options,l=t.source!==n.layout.source;o==="size"?Lo(v=>{const g=l?t.measuredBox[v]:t.layoutBox[v],y=_o(g);g.min=i[v].min,g.max=g.min+y}):hb(o,t.layoutBox,i)&&Lo(v=>{const g=l?t.measuredBox[v]:t.layoutBox[v],y=_o(i[v]);g.max=g.min+y,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[v].max=n.relativeTarget[v].min+y)});const c=lh();Lm(c,i,t.layoutBox);const d=lh();l?Lm(d,n.applyTransform(r,!0),t.measuredBox):Lm(d,i,t.layoutBox);const p=!ub(c);let m=!1;if(!n.resumeFrom){const v=n.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:g,layout:y}=v;if(g&&y){const E=zi();Im(E,t.layoutBox,g.layoutBox);const C=zi();Im(C,i,y.layoutBox),cb(E,C)||(m=!0),v.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=E,n.relativeParent=v)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:d,layoutDelta:c,hasLayoutChanged:p,hasRelativeTargetChanged:m})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function Zk(n){pm&&lf.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 Kk(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function $k(n){n.clearSnapshot()}function dT(n){n.clearMeasurements()}function Qk(n){n.isLayoutDirty=!1}function Jk(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function hT(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function eO(n){n.resolveTargetDelta()}function tO(n){n.calcProjection()}function nO(n){n.resetSkewAndRotation()}function iO(n){n.removeLeadSnapshot()}function pT(n,e,t){n.translate=Ai(e.translate,0,t),n.scale=Ai(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function mT(n,e,t,i){n.min=Ai(e.min,t.min,i),n.max=Ai(e.max,t.max,i)}function rO(n,e,t,i){mT(n.x,e.x,t.x,i),mT(n.y,e.y,t.y,i)}function sO(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const oO={duration:.45,ease:[.4,0,.1,1]},gT=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),vT=gT("applewebkit/")&&!gT("chrome/")?Math.round:mo;function _T(n){n.min=vT(n.min),n.max=vT(n.max)}function aO(n){_T(n.x),_T(n.y)}function hb(n,e,t){return n==="position"||n==="preserve-aspect"&&!ck(uT(e),uT(t),.2)}function lO(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const uO=db({attachResizeListener:(n,e)=>Zm(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vx={current:void 0},pb=db({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!vx.current){const n=new uO({});n.mount(window),n.setOptions({layoutScroll:!0}),vx.current=n}return vx.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),cO={pan:{Feature:Ck},drag:{Feature:Tk,ProjectionNode:pb,MeasureLayout:ob}};function xT(n,e,t){const{props:i}=n;n.animationState&&i.whileHover&&n.animationState.setActive("whileHover",t==="Start");const r="onHover"+t,o=i[r];o&&ai.postRender(()=>o(e,lg(e)))}class fO extends fc{mount(){const{current:e}=this.node;e&&(this.unmount=cL(e,t=>(xT(this.node,t,"Start"),i=>xT(this.node,i,"End"))))}unmount(){}}class dO extends fc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{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=ag(Zm(this.node.current,"focus",()=>this.onFocus()),Zm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function yT(n,e,t){const{props:i}=n;n.animationState&&i.whileTap&&n.animationState.setActive("whileTap",t==="Start");const r="onTap"+(t==="End"?"":t),o=i[r];o&&ai.postRender(()=>o(e,lg(e)))}class hO extends fc{mount(){const{current:e}=this.node;e&&(this.unmount=pL(e,t=>(yT(this.node,t,"Start"),(i,{success:r})=>yT(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const iS=new WeakMap,_x=new WeakMap,pO=n=>{const e=iS.get(n.target);e&&e(n)},mO=n=>{n.forEach(pO)};function gO({root:n,...e}){const t=n||document;_x.has(t)||_x.set(t,{});const i=_x.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(mO,{root:n,...e})),i[r]}function vO(n,e,t){const i=gO(e);return iS.set(n,t),i.observe(n),()=>{iS.delete(n),i.unobserve(n)}}const _O={some:0,all:1};class xO extends fc{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:o}=e,l={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:_O[r]},c=d=>{const{isIntersecting:p}=d;if(this.isInView===p||(this.isInView=p,o&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:m,onViewportLeave:v}=this.node.getProps(),g=p?m:v;g&&g(d)};return vO(this.node.current,l,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(yO(e,t))&&this.startObserver()}unmount(){}}function yO({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const SO={inView:{Feature:xO},tap:{Feature:hO},focus:{Feature:dO},hover:{Feature:fO}},MO={layout:{ProjectionNode:pb,MeasureLayout:ob}},rS={current:null},mb={current:!1};function EO(){if(mb.current=!0,!!N1)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>rS.current=n.matches;n.addListener(e),e()}else rS.current=!1}const wO=[...zP,Zr,oc],TO=n=>wO.find(FP(n)),ST=new WeakMap;function CO(n,e,t){for(const i in e){const r=e[i],o=t[i];if(Er(r))n.addValue(i,r);else if(Er(o))n.addValue(i,Nh(r,{owner:n}));else if(o!==r)if(n.hasValue(i)){const l=n.getValue(i);l.liveStyle===!0?l.jump(r):l.hasAnimated||l.set(r)}else{const l=n.getStaticValue(i);n.addValue(i,Nh(l!==void 0?l:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const MT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class AO{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=sM,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=$a.now();this.renderScheduledAtthis.bindToMotionValue(i,t)),mb.current||EO(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:rS.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ST.delete(this.current),this.projection&&this.projection.unmount(),Ql(this.notifyUpdate),Ql(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=Lf.has(e),r=t.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&ai.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o(),l&&l(),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 Dh){const t=Dh[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 o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):zi()}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=Nh(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"&&(OP(r)||AP(r))?r=parseFloat(r):!TO(r)&&oc.test(t)&&(r=LP(e,t)),this.setBaseTarget(e,Er(r)?r.get():r)),Er(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 l=z1(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);l&&(r=l[e])}if(i&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Er(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new J1),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class gb extends AO{constructor(){super(...arguments),this.KeyframeResolver=BP}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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Er(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function RO(n){return window.getComputedStyle(n)}class PO extends gb{constructor(){super(...arguments),this.type="html",this.renderInstance=nP}readValueFromInstance(e,t){if(Lf.has(t)){const i=rM(t);return i&&i.default||0}else{const i=RO(e),r=(JR(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return rb(e,t)}build(e,t,i){H1(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return j1(e,t,i)}}class bO extends gb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=zi}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Lf.has(t)){const i=rM(t);return i&&i.default||0}return t=iP.has(t)?t:O1(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return oP(e,t,i)}build(e,t,i){G1(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){rP(e,t,i,r)}mount(e){this.isSVGTag=X1(e.tagName),super.mount(e)}}const DO=(n,e)=>F1(n)?new bO(e):new PO(e,{allowProjection:n!==De.Fragment}),NO=iL({...tk,...SO,...cO,...MO},DO),ya=_N(NO);function Ih(n){const e=ig(()=>Nh(n)),{isStatic:t}=De.useContext(rg);if(t){const[,i]=De.useState(n);De.useEffect(()=>e.on("change",i),[])}return e}function vb(n,e){const t=Ih(e()),i=()=>t.set(e());return i(),t_(()=>{const r=()=>ai.preRender(i,!1,!0),o=n.map(l=>l.on("change",r));return()=>{o.forEach(l=>l()),Ql(i)}}),t}function ET(n){return typeof n=="number"?n:parseFloat(n)}function Km(n,e={}){const{isStatic:t}=De.useContext(rg),i=De.useRef(null),r=Ih(Er(n)?ET(n.get()):n),o=De.useRef(r.get()),l=De.useRef(()=>{}),c=()=>{const p=i.current;p&&p.time===0&&p.sample(Mr.delta),d(),i.current=RI({keyframes:[r.get(),o.current],velocity:r.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...e,onUpdate:l.current})},d=()=>{i.current&&i.current.stop()};return De.useInsertionEffect(()=>r.attach((p,m)=>t?m(p):(o.current=p,l.current=m,ai.update(c),r.get()),d),[JSON.stringify(e)]),t_(()=>{if(Er(n))return n.on("change",p=>r.set(ET(p)))},[r]),r}const LO=n=>n&&typeof n=="object"&&n.mix,IO=n=>LO(n)?n.mix:void 0;function kO(...n){const e=!Array.isArray(n[0]),t=e?0:-1,i=n[0+t],r=n[1+t],o=n[2+t],l=n[3+t],c=YP(r,o,{mixer:IO(o[0]),...l});return e?c(i):c}function OO(n){bm.current=[],n();const e=vb(bm.current,n);return bm.current=void 0,e}function $m(n,e,t,i){if(typeof n=="function")return OO(n);const r=typeof e=="function"?e:kO(e,t,i);return Array.isArray(n)?wT(n,r):wT([n],([o])=>r(o))}function wT(n,e){const t=ig(()=>[]);return vb(n,()=>{t.length=0;const i=n.length;for(let r=0;rZ.jsxs("div",{className:"relative flex items-center gap-4 py-3.5",children:[Z.jsx(ya.span,{"aria-hidden":"true",className:"relative z-10 block h-4 w-4 shrink-0 rounded-full border-2 border-hl-primary bg-white",animate:n?void 0:{borderColor:["#415FA8","#FBC774","#415FA8"],scale:[1,1.15,1]},transition:{duration:xx,repeat:1/0,ease:"easeInOut",delay:t/TT.length*xx}}),Z.jsx("span",{className:"text-sm font-semibold text-hl-text-primary/80",children:e})]},e))]})]})}const CT=[{label:"Mar",value:32},{label:"Abr",value:44},{label:"May",value:40},{label:"Jun",value:58},{label:"Jul",value:72},{label:"Hoy",value:100}];function FO(){const n=Ea();return Z.jsxs("div",{className:"flex flex-1 flex-col",children:[Z.jsxs("div",{className:"mb-5 flex items-start justify-between gap-3",children:[Z.jsx("p",{className:"hl-display text-xl text-hl-text-primary md:text-2xl",children:"Conversión que se ve crecer mes a mes."}),Z.jsx("span",{className:"shrink-0 rounded-full bg-hl-accent-gold/15 px-2.5 py-1 text-xs font-bold text-hl-primary-dark",children:"+35%"})]}),Z.jsx("div",{className:"mt-auto flex h-32 gap-2.5 sm:h-36",children:CT.map((e,t)=>Z.jsxs("div",{className:"flex flex-1 flex-col items-center gap-2",children:[Z.jsx("div",{className:"flex w-full flex-1 items-end overflow-hidden rounded-md bg-slate-100",children:Z.jsx(ya.div,{className:`w-full rounded-md ${t===CT.length-1?"bg-gradient-to-t from-hl-accent-gold to-hl-accent-gold/70":"bg-gradient-to-t from-hl-primary to-hl-primary/60"}`,initial:n?{height:`${e.value}%`}:{height:"0%"},whileInView:{height:`${e.value}%`},viewport:{once:!0,amount:.6},transition:{duration:.7,delay:t*.07,ease:"easeOut"}})}),Z.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-hl-text-primary/40",children:e.label})]},e.label))})]})}const yx=[{id:"saas",label:"SaaS Optimizado",body:"Acceso a nuestro ecosistema tecnológico todo en uno: herramientas avanzadas para embudos, automatización de mensajes y CRM intuitivo. Ideal para empresas con equipo técnico interno."},{id:"implementacion",label:"Implementación Experta",body:"Nosotros nos encargamos de todo. Co-creamos la estrategia, diseñamos flujos, integramos canales (WhatsApp, correo, llamadas) y capacitamos a sus asesores. Cero fricción técnica."}];function zO(){const[n,e]=De.useState("saas"),t=yx.find(i=>i.id===n)??yx[0];return Z.jsxs("div",{className:"flex flex-1 flex-col",children:[Z.jsx("p",{className:"hl-display mb-4 text-xl text-hl-text-primary md:text-2xl",children:"Elija el camino que mejor se adapte a su equipo."}),Z.jsx("div",{role:"tablist","aria-label":"Caminos del motor adaptativo",className:"mb-4 flex gap-1.5 rounded-full bg-slate-100 p-1",children:yx.map(i=>{const r=i.id===n;return Z.jsxs("button",{role:"tab",type:"button","aria-selected":r,onClick:()=>e(i.id),className:`relative z-0 flex-1 rounded-full px-3 py-2 text-[11px] font-bold uppercase tracking-wide transition-colors duration-200 ${r?"text-hl-white":"text-hl-text-primary/60 hover:text-hl-text-primary"}`,children:[r&&Z.jsx(ya.span,{layoutId:"adaptive-engine-tab-pill",className:"absolute inset-0 -z-10 rounded-full bg-hl-primary-dark",transition:{type:"spring",stiffness:380,damping:32}}),i.label]},i.id)})}),Z.jsx("div",{className:"relative flex-1",children:Z.jsx(Hy,{mode:"wait",children:Z.jsx(ya.p,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.28,ease:"easeOut"},className:"text-sm leading-relaxed text-hl-text-primary/75",children:t.body},t.id)})})]})}const BO=["Nuevo Lead","Contactado","Propuesta","Cliente"],VO=[["M. Torres","L. Gómez"],["R. Paredes"],["S. Duarte"],["J. Reyes","A. Castillo"]],Yp=["3%","28%","53%","78%"],HO=["N. Salinas","C. Vidal"];function GO(){const n=De.useRef([]),e=Ea();return De.useEffect(()=>{if(e)return;const t=n.current.filter(r=>!!r);if(t.length===0)return;const i=t.map((r,o)=>{_i.set(r,{left:Yp[0],opacity:0});const l=_i.timeline({repeat:-1,delay:o*1.8,repeatDelay:.6});return l.to(r,{opacity:1,duration:.3}).to(r,{left:Yp[1],duration:1,ease:"power2.inOut"}).to(r,{left:Yp[2],duration:1,ease:"power2.inOut"}).to(r,{left:Yp[3],duration:1,ease:"power2.inOut"}).to(r,{opacity:0,duration:.3}).set(r,{left:Yp[0]}),l});return()=>i.forEach(r=>r.kill())},[e]),Z.jsxs("div",{className:"flex flex-1 flex-col",children:[Z.jsx("p",{className:"hl-display mb-5 text-xl text-hl-text-primary md:text-2xl",children:"Su CRM y pipeline comercial, siempre bajo control."}),Z.jsxs("div",{className:"relative grid grid-cols-2 gap-3 sm:grid-cols-4",children:[BO.map((t,i)=>{var r;return Z.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-3",children:[Z.jsx("p",{className:"mb-2 text-[11px] font-bold uppercase tracking-wide text-hl-primary-dark",children:t}),Z.jsx("div",{className:"flex flex-col gap-1.5",children:(r=VO[i])==null?void 0:r.map(o=>Z.jsx("div",{className:"rounded-lg border border-slate-200 bg-white px-2 py-1.5 text-[11px] text-hl-text-primary/70 shadow-sm",children:o},o))})]},t)}),!e&&HO.map((t,i)=>Z.jsx("div",{ref:r=>{n.current[i]=r},className:"pointer-events-none absolute top-8 z-10 hidden rounded-lg border border-hl-accent-gold bg-hl-accent-gold/90 px-2 py-1.5 text-[11px] font-semibold text-hl-text-primary shadow-lg sm:block",children:t},t))]})]})}function WO(){return Z.jsx("section",{id:"motor",className:"hl-dot-grid hl-noise bg-hl-white px-6 py-24 md:px-10",children:Z.jsxs("div",{className:"relative z-10 mx-auto max-w-6xl",children:[Z.jsx("div",{className:"mb-14 max-w-3xl text-center md:text-left",children:Z.jsx("h2",{className:"hl-display text-3xl uppercase text-hl-text-primary sm:text-4xl md:text-5xl",children:"Sistematice su proceso comercial: conecte su captación, CRM, automatizaciones y posventa en un solo motor."})}),Z.jsxs("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-3 md:grid-rows-2",children:[Z.jsx(y0,{title:"Automatización",tint:"blue",className:"md:col-start-1 md:row-start-1 md:row-span-2",children:Z.jsx(UO,{})}),Z.jsx(y0,{title:"Conversión",tint:"gold",className:"md:col-start-2 md:row-start-1 md:min-h-60",children:Z.jsx(FO,{})}),Z.jsx(y0,{title:"Camino flexible",tint:"neutral",className:"md:col-start-3 md:row-start-1 md:min-h-60",children:Z.jsx(zO,{})}),Z.jsx(y0,{title:"Control & CRM",tint:"blue",className:"md:col-start-2 md:col-span-2 md:row-start-2",children:Z.jsx(GO,{})})]})]})})}const AT=n=>{let e;const t=new Set,i=(p,m)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const g=e;e=m??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(y=>y(e,g))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>d,subscribe:p=>(t.add(p),()=>t.delete(p))},d=e=n(i,r,c);return c},XO=(n=>n?AT(n):AT),jO=n=>n;function YO(n,e=jO){const t=s0.useSyncExternalStore(n.subscribe,s0.useCallback(()=>e(n.getState()),[n,e]),s0.useCallback(()=>e(n.getInitialState()),[n,e]));return s0.useDebugValue(t),t}const RT=n=>{const e=XO(n),t=i=>YO(e,i);return Object.assign(t,e),t},qO=(n=>n?RT(n):RT),Jd=["captacion","velocidadRespuesta","visibilidad"],PT=Jd.length+1,ZO=qO((n,e)=>({step:0,answers:{},lead:{},submissionStatus:"idle",maturityScore:null,answerQuestion:(t,i)=>n(r=>({answers:{...r.answers,[t]:i}})),setLeadField:(t,i)=>n(r=>({lead:{...r.lead,[t]:i}})),goToStep:t=>n({step:Math.max(0,Math.min(t,PT-1))}),goNext:()=>n({step:Math.min(e().step+1,PT-1)}),goBack:()=>n({step:Math.max(e().step-1,0)}),setSubmissionStatus:t=>n({submissionStatus:t}),setMaturityScore:t=>n({maturityScore:t}),reset:()=>n({step:0,answers:{},lead:{},submissionStatus:"idle",maturityScore:null})}));var On;(function(n){n.assertEqual=r=>{};function e(r){}n.assertIs=e;function t(r){throw new Error}n.assertNever=t,n.arrayToEnum=r=>{const o={};for(const l of r)o[l]=l;return o},n.getValidEnumValues=r=>{const o=n.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),l={};for(const c of o)l[c]=r[c];return n.objectValues(l)},n.objectValues=r=>n.objectKeys(r).map(function(o){return r[o]}),n.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const l in r)Object.prototype.hasOwnProperty.call(r,l)&&o.push(l);return o},n.find=(r,o)=>{for(const l of r)if(o(l))return l},n.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}n.joinValues=i,n.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(On||(On={}));var bT;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(bT||(bT={}));const Rt=On.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gu=n=>{switch(typeof n){case"undefined":return Rt.undefined;case"string":return Rt.string;case"number":return Number.isNaN(n)?Rt.nan:Rt.number;case"boolean":return Rt.boolean;case"function":return Rt.function;case"bigint":return Rt.bigint;case"symbol":return Rt.symbol;case"object":return Array.isArray(n)?Rt.array:n===null?Rt.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?Rt.promise:typeof Map<"u"&&n instanceof Map?Rt.map:typeof Set<"u"&&n instanceof Set?Rt.set:typeof Date<"u"&&n instanceof Date?Rt.date:Rt.object;default:return Rt.unknown}},it=On.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class eu extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},i={_errors:[]},r=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)i._errors.push(t(l));else{let c=i,d=0;for(;dt.message){const t={},i=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}eu.create=n=>new eu(n);const sS=(n,e)=>{let t;switch(n.code){case it.invalid_type:n.received===Rt.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case it.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,On.jsonStringifyReplacer)}`;break;case it.unrecognized_keys:t=`Unrecognized key(s) in object: ${On.joinValues(n.keys,", ")}`;break;case it.invalid_union:t="Invalid input";break;case it.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${On.joinValues(n.options)}`;break;case it.invalid_enum_value:t=`Invalid enum value. Expected ${On.joinValues(n.options)}, received '${n.received}'`;break;case it.invalid_arguments:t="Invalid function arguments";break;case it.invalid_return_type:t="Invalid function return type";break;case it.invalid_date:t="Invalid date";break;case it.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:On.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case it.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case it.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case it.custom:t="Invalid input";break;case it.invalid_intersection_types:t="Intersection results could not be merged";break;case it.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case it.not_finite:t="Number must be finite";break;default:t=e.defaultError,On.assertNever(n)}return{message:t}};let KO=sS;function $O(){return KO}const QO=n=>{const{data:e,path:t,errorMaps:i,issueData:r}=n,o=[...t,...r.path||[]],l={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="";const d=i.filter(p=>!!p).slice().reverse();for(const p of d)c=p(l,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function vt(n,e){const t=$O(),i=QO({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===sS?void 0:sS].filter(r=>!!r)});n.common.issues.push(i)}class xo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const r of t){if(r.status==="aborted")return nn;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const r of t){const o=await r.key,l=await r.value;i.push({key:o,value:l})}return xo.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const r of t){const{key:o,value:l}=r;if(o.status==="aborted"||l.status==="aborted")return nn;o.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet)&&(i[o.value]=l.value)}return{status:e.value,value:i}}}const nn=Object.freeze({status:"aborted"}),mm=n=>({status:"dirty",value:n}),Go=n=>({status:"valid",value:n}),DT=n=>n.status==="aborted",NT=n=>n.status==="dirty",kh=n=>n.status==="valid",kv=n=>typeof Promise<"u"&&n instanceof Promise;var Nt;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Nt||(Nt={}));class ac{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const LT=(n,e)=>{if(kh(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new eu(n.common.issues);return this._error=t,this._error}}};function _n(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:r}=n;if(e&&(t||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(l,c)=>{const{message:d}=n;return l.code==="invalid_enum_value"?{message:d??c.defaultError}:typeof c.data>"u"?{message:d??i??c.defaultError}:l.code!=="invalid_type"?{message:c.defaultError}:{message:d??t??c.defaultError}},description:r}}class In{get description(){return this._def.description}_getType(e){return Gu(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Gu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xo,ctx:{common:e.parent.common,data:e.data,parsedType:Gu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(kv(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gu(e)},r=this._parseSync({data:e,path:i.path,parent:i});return LT(i,r)}"~validate"(e){var i,r;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gu(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:t});return kh(o)?{value:o.value}:{issues:t.common.issues}}catch(o){(r=(i=o==null?void 0:o.message)==null?void 0:i.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(o=>kh(o)?{value:o.value}:{issues:t.common.issues})}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gu(e)},r=this._parse({data:e,path:i.path,parent:i}),o=await(kv(r)?r:Promise.resolve(r));return LT(i,o)}refine(e,t){const i=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const l=e(r),c=()=>o.addIssue({code:it.custom,...i(r)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(c(),!1)):l?!0:(c(),!1)})}refinement(e,t){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof t=="function"?t(i,r):t),!1))}_refinement(e){return new Fh({schema:this,typeName:rn.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return tc.create(this,this._def)}nullable(){return zh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qa.create(this)}promise(){return zv.create(this,this._def)}or(e){return Uv.create([this,e],this._def)}and(e){return Fv.create(this,e,this._def)}transform(e){return new Fh({..._n(this._def),schema:this,typeName:rn.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new aS({..._n(this._def),innerType:this,defaultValue:t,typeName:rn.ZodDefault})}brand(){return new SU({typeName:rn.ZodBranded,type:this,..._n(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new lS({..._n(this._def),innerType:this,catchValue:t,typeName:rn.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return lM.create(this,e)}readonly(){return uS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const JO=/^c[^\s-]{8,}$/i,eU=/^[0-9a-z]+$/,tU=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,iU=/^[a-z0-9_-]{21}$/i,rU=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sU=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,oU=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Sx;const lU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,cU=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fU=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dU=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hU=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_b="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pU=new RegExp(`^${_b}$`);function xb(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function mU(n){return new RegExp(`^${xb(n)}$`)}function gU(n){let e=`${_b}T${xb(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function vU(n,e){return!!((e==="v4"||!e)&&lU.test(n)||(e==="v6"||!e)&&cU.test(n))}function _U(n,e){if(!rU.test(n))return!1;try{const[t]=n.split(".");if(!t)return!1;const i=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function xU(n,e){return!!((e==="v4"||!e)&&uU.test(n)||(e==="v6"||!e)&&fU.test(n))}class Ku extends In{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Rt.string){const o=this._getOrReturnCtx(e);return vt(o,{code:it.invalid_type,expected:Rt.string,received:o.parsedType}),nn}const i=new xo;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(r=this._getOrReturnCtx(e,r),vt(r,{code:it.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){const l=e.data.length>o.value,c=e.data.lengthe.test(r),{validation:t,code:it.invalid_string,...Nt.errToObj(i)})}_addCheck(e){return new Ku({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Nt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Nt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Nt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Nt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Nt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Nt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Nt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Nt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Nt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Nt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Nt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Nt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Nt.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Nt.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Nt.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Nt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Nt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Nt.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Nt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Nt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Nt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Nt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Nt.errToObj(t)})}nonempty(e){return this.min(1,Nt.errToObj(e))}trim(){return new Ku({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ku({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ku({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Ku({checks:[],typeName:rn.ZodString,coerce:(n==null?void 0:n.coerce)??!1,..._n(n)});function yU(n,e){const t=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=t>i?t:i,o=Number.parseInt(n.toFixed(r).replace(".","")),l=Number.parseInt(e.toFixed(r).replace(".",""));return o%l/10**r}class Oh extends In{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Rt.number){const o=this._getOrReturnCtx(e);return vt(o,{code:it.invalid_type,expected:Rt.number,received:o.parsedType}),nn}let i;const r=new xo;for(const o of this._def.checks)o.kind==="int"?On.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),vt(i,{code:it.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),vt(i,{code:it.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?yU(e.data,o.value)!==0&&(i=this._getOrReturnCtx(e,i),vt(i,{code:it.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),vt(i,{code:it.not_finite,message:o.message}),r.dirty()):On.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Nt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nt.toString(t))}setLimit(e,t,i,r){return new Oh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:Nt.toString(r)}]})}_addCheck(e){return new Oh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Nt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Nt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&On.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(t===null||i.value>t)&&(t=i.value):i.kind==="max"&&(e===null||i.valuenew Oh({checks:[],typeName:rn.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,..._n(n)});class Qm extends In{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Rt.bigint)return this._getInvalidInput(e);let i;const r=new xo;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(i=this._getOrReturnCtx(e,i),vt(i,{code:it.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),vt(i,{code:it.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):On.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return vt(t,{code:it.invalid_type,expected:Rt.bigint,received:t.parsedType}),nn}gte(e,t){return this.setLimit("min",e,!0,Nt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Nt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Nt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Nt.toString(t))}setLimit(e,t,i,r){return new Qm({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:Nt.toString(r)}]})}_addCheck(e){return new Qm({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Nt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Qm({checks:[],typeName:rn.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,..._n(n)});class IT extends In{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Rt.boolean){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.boolean,received:i.parsedType}),nn}return Go(e.data)}}IT.create=n=>new IT({typeName:rn.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,..._n(n)});class Ov extends In{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Rt.date){const o=this._getOrReturnCtx(e);return vt(o,{code:it.invalid_type,expected:Rt.date,received:o.parsedType}),nn}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return vt(o,{code:it.invalid_date}),nn}const i=new xo;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(r=this._getOrReturnCtx(e,r),vt(r,{code:it.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):On.assertNever(o);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ov({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Nt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Nt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Ov({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:rn.ZodDate,..._n(n)});class kT extends In{_parse(e){if(this._getType(e)!==Rt.symbol){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.symbol,received:i.parsedType}),nn}return Go(e.data)}}kT.create=n=>new kT({typeName:rn.ZodSymbol,..._n(n)});class OT extends In{_parse(e){if(this._getType(e)!==Rt.undefined){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.undefined,received:i.parsedType}),nn}return Go(e.data)}}OT.create=n=>new OT({typeName:rn.ZodUndefined,..._n(n)});class UT extends In{_parse(e){if(this._getType(e)!==Rt.null){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.null,received:i.parsedType}),nn}return Go(e.data)}}UT.create=n=>new UT({typeName:rn.ZodNull,..._n(n)});class FT extends In{constructor(){super(...arguments),this._any=!0}_parse(e){return Go(e.data)}}FT.create=n=>new FT({typeName:rn.ZodAny,..._n(n)});class zT extends In{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Go(e.data)}}zT.create=n=>new zT({typeName:rn.ZodUnknown,..._n(n)});class lc extends In{_parse(e){const t=this._getOrReturnCtx(e);return vt(t,{code:it.invalid_type,expected:Rt.never,received:t.parsedType}),nn}}lc.create=n=>new lc({typeName:rn.ZodNever,..._n(n)});class BT extends In{_parse(e){if(this._getType(e)!==Rt.undefined){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.void,received:i.parsedType}),nn}return Go(e.data)}}BT.create=n=>new BT({typeName:rn.ZodVoid,..._n(n)});class Qa extends In{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==Rt.array)return vt(t,{code:it.invalid_type,expected:Rt.array,received:t.parsedType}),nn;if(r.exactLength!==null){const l=t.data.length>r.exactLength.value,c=t.data.lengthr.maxLength.value&&(vt(t,{code:it.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((l,c)=>r.type._parseAsync(new ac(t,l,t.path,c)))).then(l=>xo.mergeArray(i,l));const o=[...t.data].map((l,c)=>r.type._parseSync(new ac(t,l,t.path,c)));return xo.mergeArray(i,o)}get element(){return this._def.type}min(e,t){return new Qa({...this._def,minLength:{value:e,message:Nt.toString(t)}})}max(e,t){return new Qa({...this._def,maxLength:{value:e,message:Nt.toString(t)}})}length(e,t){return new Qa({...this._def,exactLength:{value:e,message:Nt.toString(t)}})}nonempty(e){return this.min(1,e)}}Qa.create=(n,e)=>new Qa({type:n,minLength:null,maxLength:null,exactLength:null,typeName:rn.ZodArray,..._n(e)});function eh(n){if(n instanceof Ji){const e={};for(const t in n.shape){const i=n.shape[t];e[t]=tc.create(eh(i))}return new Ji({...n._def,shape:()=>e})}else return n instanceof Qa?new Qa({...n._def,type:eh(n.element)}):n instanceof tc?tc.create(eh(n.unwrap())):n instanceof zh?zh.create(eh(n.unwrap())):n instanceof Rf?Rf.create(n.items.map(e=>eh(e))):n}class Ji extends In{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=On.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Rt.object){const p=this._getOrReturnCtx(e);return vt(p,{code:it.invalid_type,expected:Rt.object,received:p.parsedType}),nn}const{status:i,ctx:r}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),c=[];if(!(this._def.catchall instanceof lc&&this._def.unknownKeys==="strip"))for(const p in r.data)l.includes(p)||c.push(p);const d=[];for(const p of l){const m=o[p],v=r.data[p];d.push({key:{status:"valid",value:p},value:m._parse(new ac(r,v,r.path,p)),alwaysSet:p in r.data})}if(this._def.catchall instanceof lc){const p=this._def.unknownKeys;if(p==="passthrough")for(const m of c)d.push({key:{status:"valid",value:m},value:{status:"valid",value:r.data[m]}});else if(p==="strict")c.length>0&&(vt(r,{code:it.unrecognized_keys,keys:c}),i.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const m of c){const v=r.data[m];d.push({key:{status:"valid",value:m},value:p._parse(new ac(r,v,r.path,m)),alwaysSet:m in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const p=[];for(const m of d){const v=await m.key,g=await m.value;p.push({key:v,value:g,alwaysSet:m.alwaysSet})}return p}).then(p=>xo.mergeObjectSync(i,p)):xo.mergeObjectSync(i,d)}get shape(){return this._def.shape()}strict(e){return Nt.errToObj,new Ji({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,i)=>{var o,l;const r=((l=(o=this._def).errorMap)==null?void 0:l.call(o,t,i).message)??i.defaultError;return t.code==="unrecognized_keys"?{message:Nt.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new Ji({...this._def,unknownKeys:"strip"})}passthrough(){return new Ji({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ji({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ji({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rn.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ji({...this._def,catchall:e})}pick(e){const t={};for(const i of On.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new Ji({...this._def,shape:()=>t})}omit(e){const t={};for(const i of On.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new Ji({...this._def,shape:()=>t})}deepPartial(){return eh(this)}partial(e){const t={};for(const i of On.objectKeys(this.shape)){const r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}return new Ji({...this._def,shape:()=>t})}required(e){const t={};for(const i of On.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof tc;)o=o._def.innerType;t[i]=o}return new Ji({...this._def,shape:()=>t})}keyof(){return yb(On.objectKeys(this.shape))}}Ji.create=(n,e)=>new Ji({shape:()=>n,unknownKeys:"strip",catchall:lc.create(),typeName:rn.ZodObject,..._n(e)});Ji.strictCreate=(n,e)=>new Ji({shape:()=>n,unknownKeys:"strict",catchall:lc.create(),typeName:rn.ZodObject,..._n(e)});Ji.lazycreate=(n,e)=>new Ji({shape:n,unknownKeys:"strip",catchall:lc.create(),typeName:rn.ZodObject,..._n(e)});class Uv extends In{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;function r(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const l=o.map(c=>new eu(c.ctx.common.issues));return vt(t,{code:it.invalid_union,unionErrors:l}),nn}if(t.common.async)return Promise.all(i.map(async o=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(r);{let o;const l=[];for(const d of i){const p={...t,common:{...t.common,issues:[]},parent:null},m=d._parseSync({data:t.data,path:t.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!o&&(o={result:m,ctx:p}),p.common.issues.length&&l.push(p.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const c=l.map(d=>new eu(d));return vt(t,{code:it.invalid_union,unionErrors:c}),nn}}get options(){return this._def.options}}Uv.create=(n,e)=>new Uv({options:n,typeName:rn.ZodUnion,..._n(e)});function oS(n,e){const t=Gu(n),i=Gu(e);if(n===e)return{valid:!0,data:n};if(t===Rt.object&&i===Rt.object){const r=On.objectKeys(e),o=On.objectKeys(n).filter(c=>r.indexOf(c)!==-1),l={...n,...e};for(const c of o){const d=oS(n[c],e[c]);if(!d.valid)return{valid:!1};l[c]=d.data}return{valid:!0,data:l}}else if(t===Rt.array&&i===Rt.array){if(n.length!==e.length)return{valid:!1};const r=[];for(let o=0;o{if(DT(o)||DT(l))return nn;const c=oS(o.value,l.value);return c.valid?((NT(o)||NT(l))&&t.dirty(),{status:t.value,value:c.data}):(vt(i,{code:it.invalid_intersection_types}),nn)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,l])=>r(o,l)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Fv.create=(n,e,t)=>new Fv({left:n,right:e,typeName:rn.ZodIntersection,..._n(t)});class Rf extends In{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Rt.array)return vt(i,{code:it.invalid_type,expected:Rt.array,received:i.parsedType}),nn;if(i.data.lengththis._def.items.length&&(vt(i,{code:it.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...i.data].map((l,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new ac(i,l,i.path,c)):null}).filter(l=>!!l);return i.common.async?Promise.all(o).then(l=>xo.mergeArray(t,l)):xo.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Rf({...this._def,rest:e})}}Rf.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rf({items:n,typeName:rn.ZodTuple,rest:null,..._n(e)})};class VT extends In{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Rt.map)return vt(i,{code:it.invalid_type,expected:Rt.map,received:i.parsedType}),nn;const r=this._def.keyType,o=this._def.valueType,l=[...i.data.entries()].map(([c,d],p)=>({key:r._parse(new ac(i,c,i.path,[p,"key"])),value:o._parse(new ac(i,d,i.path,[p,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of l){const p=await d.key,m=await d.value;if(p.status==="aborted"||m.status==="aborted")return nn;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const d of l){const p=d.key,m=d.value;if(p.status==="aborted"||m.status==="aborted")return nn;(p.status==="dirty"||m.status==="dirty")&&t.dirty(),c.set(p.value,m.value)}return{status:t.value,value:c}}}}VT.create=(n,e,t)=>new VT({valueType:e,keyType:n,typeName:rn.ZodMap,..._n(t)});class Jm extends In{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Rt.set)return vt(i,{code:it.invalid_type,expected:Rt.set,received:i.parsedType}),nn;const r=this._def;r.minSize!==null&&i.data.sizer.maxSize.value&&(vt(i,{code:it.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function l(d){const p=new Set;for(const m of d){if(m.status==="aborted")return nn;m.status==="dirty"&&t.dirty(),p.add(m.value)}return{status:t.value,value:p}}const c=[...i.data.values()].map((d,p)=>o._parse(new ac(i,d,i.path,p)));return i.common.async?Promise.all(c).then(d=>l(d)):l(c)}min(e,t){return new Jm({...this._def,minSize:{value:e,message:Nt.toString(t)}})}max(e,t){return new Jm({...this._def,maxSize:{value:e,message:Nt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Jm.create=(n,e)=>new Jm({valueType:n,minSize:null,maxSize:null,typeName:rn.ZodSet,..._n(e)});class HT extends In{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}HT.create=(n,e)=>new HT({getter:n,typeName:rn.ZodLazy,..._n(e)});class GT extends In{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return vt(t,{received:t.data,code:it.invalid_literal,expected:this._def.value}),nn}return{status:"valid",value:e.data}}get value(){return this._def.value}}GT.create=(n,e)=>new GT({value:n,typeName:rn.ZodLiteral,..._n(e)});function yb(n,e){return new Uh({values:n,typeName:rn.ZodEnum,..._n(e)})}class Uh extends In{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),i=this._def.values;return vt(t,{expected:On.joinValues(i),received:t.parsedType,code:it.invalid_type}),nn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),i=this._def.values;return vt(t,{received:t.data,code:it.invalid_enum_value,options:i}),nn}return Go(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Uh.create(e,{...this._def,...t})}exclude(e,t=this._def){return Uh.create(this.options.filter(i=>!e.includes(i)),{...this._def,...t})}}Uh.create=yb;class WT extends In{_parse(e){const t=On.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Rt.string&&i.parsedType!==Rt.number){const r=On.objectValues(t);return vt(i,{expected:On.joinValues(r),received:i.parsedType,code:it.invalid_type}),nn}if(this._cache||(this._cache=new Set(On.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=On.objectValues(t);return vt(i,{received:i.data,code:it.invalid_enum_value,options:r}),nn}return Go(e.data)}get enum(){return this._def.values}}WT.create=(n,e)=>new WT({values:n,typeName:rn.ZodNativeEnum,..._n(e)});class zv extends In{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Rt.promise&&t.common.async===!1)return vt(t,{code:it.invalid_type,expected:Rt.promise,received:t.parsedType}),nn;const i=t.parsedType===Rt.promise?t.data:Promise.resolve(t.data);return Go(i.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}zv.create=(n,e)=>new zv({type:n,typeName:rn.ZodPromise,..._n(e)});class Fh extends In{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rn.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:l=>{vt(i,l),l.fatal?t.abort():t.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const l=r.transform(i.data,o);if(i.common.async)return Promise.resolve(l).then(async c=>{if(t.value==="aborted")return nn;const d=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return d.status==="aborted"?nn:d.status==="dirty"||t.value==="dirty"?mm(d.value):d});{if(t.value==="aborted")return nn;const c=this._def.schema._parseSync({data:l,path:i.path,parent:i});return c.status==="aborted"?nn:c.status==="dirty"||t.value==="dirty"?mm(c.value):c}}if(r.type==="refinement"){const l=c=>{const d=r.refinement(c,o);if(i.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?nn:(c.status==="dirty"&&t.dirty(),l(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?nn:(c.status==="dirty"&&t.dirty(),l(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){const l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!kh(l))return nn;const c=r.transform(l.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>kh(l)?Promise.resolve(r.transform(l.value,o)).then(c=>({status:t.value,value:c})):nn);On.assertNever(r)}}Fh.create=(n,e,t)=>new Fh({schema:n,typeName:rn.ZodEffects,effect:e,..._n(t)});Fh.createWithPreprocess=(n,e,t)=>new Fh({schema:e,effect:{type:"preprocess",transform:n},typeName:rn.ZodEffects,..._n(t)});class tc extends In{_parse(e){return this._getType(e)===Rt.undefined?Go(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tc.create=(n,e)=>new tc({innerType:n,typeName:rn.ZodOptional,..._n(e)});class zh extends In{_parse(e){return this._getType(e)===Rt.null?Go(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}zh.create=(n,e)=>new zh({innerType:n,typeName:rn.ZodNullable,..._n(e)});class aS extends In{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===Rt.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}aS.create=(n,e)=>new aS({innerType:n,typeName:rn.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._n(e)});class lS extends In{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return kv(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new eu(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new eu(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}lS.create=(n,e)=>new lS({innerType:n,typeName:rn.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._n(e)});class XT extends In{_parse(e){if(this._getType(e)!==Rt.nan){const i=this._getOrReturnCtx(e);return vt(i,{code:it.invalid_type,expected:Rt.nan,received:i.parsedType}),nn}return{status:"valid",value:e.data}}}XT.create=n=>new XT({typeName:rn.ZodNaN,..._n(n)});class SU extends In{_parse(e){const{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class lM extends In{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?nn:o.status==="dirty"?(t.dirty(),mm(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?nn:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,t){return new lM({in:e,out:t,typeName:rn.ZodPipeline})}}class uS extends In{_parse(e){const t=this._def.innerType._parse(e),i=r=>(kh(r)&&(r.value=Object.freeze(r.value)),r);return kv(t)?t.then(r=>i(r)):i(t)}unwrap(){return this._def.innerType}}uS.create=(n,e)=>new uS({innerType:n,typeName:rn.ZodReadonly,..._n(e)});var rn;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(rn||(rn={}));const Mx=Ku.create,Ex=Oh.create;lc.create;Qa.create;const Sb=Ji.create;Uv.create;Fv.create;Rf.create;Uh.create;zv.create;tc.create;zh.create;const MU=Sb({captacion:Ex().int().min(0).max(2),velocidadRespuesta:Ex().int().min(0).max(2),visibilidad:Ex().int().min(0).max(2)}),Mb=Sb({nombre:Mx().trim().min(2,"Ingrese su nombre completo"),emailCorporativo:Mx().trim().email("Ingrese un correo corporativo válido"),telefono:Mx().trim().min(7,"Ingrese un teléfono válido").regex(/^[\d\s+()-]+$/,"Solo números, espacios y símbolos telefónicos")}),EU=MU.extend(Mb.shape);async function wU(n){const t=await fetch("https://services.leadconnectorhq.com/hooks/iV3yXhM4FBzojQmnrJuU/webhook-trigger/0d08ad9e-704d-49c3-8675-f6bd56a04675",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"heilead-scorecard",submittedAt:new Date().toISOString(),nombre:n.nombre,email:n.emailCorporativo,telefono:n.telefono,maturityScore:Eb(n),respuestas:{captacion:n.captacion,velocidadRespuesta:n.velocidadRespuesta,visibilidad:n.visibilidad}})});if(!t.ok)throw new Error(`GHL webhook respondió ${t.status}`);return{success:!0}}function Eb(n){const t=n.captacion+n.velocidadRespuesta+n.visibilidad;return Math.round(t/6*100)}function jT(n,e){const i=Object.values(n).reduce((o,l)=>o+(l??0),0),r=2*e;return r===0?0:Math.round(i/r*100)}const cS=42,YT=2*Math.PI*cS;function TU({score:n}){const e=Ea(),t=Km(0,e?{stiffness:1e3,damping:100}:{stiffness:140,damping:20}),[i,r]=De.useState(0),o=$m(t,l=>YT*(1-l/100));return De.useEffect(()=>{t.set(n)},[n,t]),De.useEffect(()=>{const l=t.on("change",c=>r(Math.round(c)));return()=>l()},[t]),Z.jsxs("div",{className:"flex items-center gap-4",children:[Z.jsxs("div",{className:"relative h-16 w-16 shrink-0",children:[Z.jsxs("svg",{viewBox:"0 0 100 100",className:"h-full w-full -rotate-90",children:[Z.jsx("circle",{cx:"50",cy:"50",r:cS,fill:"none",stroke:"rgba(255,255,255,0.12)",strokeWidth:"8"}),Z.jsx(ya.circle,{cx:"50",cy:"50",r:cS,fill:"none",stroke:"#FBC774",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:YT,style:{strokeDashoffset:o,filter:"drop-shadow(0 0 4px rgba(251,199,116,0.6))"}})]}),Z.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-sm font-bold text-white",style:{fontVariantNumeric:"tabular-nums"},children:[i,"%"]})]}),Z.jsxs("div",{children:[Z.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-white/45",children:"Nivel de madurez digital"}),Z.jsx("p",{className:"hl-display text-lg text-white",children:"Diagnóstico en vivo"})]})]})}function CU({label:n,selected:e,onSelect:t}){const i=Ea(),r=De.useRef(null),o=De.useRef(null),l=Ih(0),c=Ih(0),d=Km($m(c,[-.5,.5],[6,-6]),{stiffness:260,damping:24}),p=Km($m(l,[-.5,.5],[-6,6]),{stiffness:260,damping:24}),m=g=>{var w,M;if(i||!r.current)return;const y=r.current.getBoundingClientRect(),E=g.clientX-y.left,C=g.clientY-y.top;l.set(E/y.width-.5),c.set(C/y.height-.5),(w=o.current)==null||w.style.setProperty("--hl-halo-x",`${E/y.width*100}%`),(M=o.current)==null||M.style.setProperty("--hl-halo-y",`${C/y.height*100}%`)},v=()=>{l.set(0),c.set(0)};return Z.jsxs(ya.button,{ref:r,type:"button",onClick:t,onPointerMove:m,onPointerLeave:v,whileTap:i?void 0:{scale:.97},style:{rotateX:i?0:d,rotateY:i?0:p,transformPerspective:800},className:`group relative overflow-hidden rounded-xl border px-5 py-4 text-left text-sm font-medium transition-colors duration-150 ${e?"border-hl-accent-gold bg-hl-accent-gold text-hl-text-primary":"border-white/10 bg-white/[0.03] text-white/85 hover:border-hl-accent-gold/60"}`,children:[!e&&Z.jsx("div",{ref:o,"aria-hidden":"true",className:"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(180px circle at var(--hl-halo-x, 50%) var(--hl-halo-y, 50%), rgba(251, 199, 116, 0.25), transparent 70%)"}}),Z.jsx("span",{className:"relative z-10",children:n})]})}const qT={captacion:{prompt:"¿Cómo se registran los contactos de internet, redes o eventos presenciales?",options:["Manual en notas/WhatsApp","Correo/Excel centralizado","CRM automatizado en tiempo real"]},velocidadRespuesta:{prompt:"¿Cuánto tiempo pasa antes de atender a un cliente interesado?",options:["Más de 4 horas","Entre 1 y 3 horas","Menos de 5 minutos automatizado"]},visibilidad:{prompt:"¿Tiene visibilidad clara de la etapa de cada cliente?",options:["Disperso en chats","Tablero manual","Pipeline automatizado"]}},AU=33,RU=[{key:"nombre",label:"Nombre",type:"text",autoComplete:"name"},{key:"emailCorporativo",label:"Email Corporativo",type:"email",autoComplete:"email"},{key:"telefono",label:"Teléfono",type:"tel",autoComplete:"tel"}];function ZT({children:n}){const e=Ea(),t=De.useRef(null),i=Ih(0),r=Ih(0),o=Km($m(r,[-.5,.5],[8,-8]),{stiffness:220,damping:22}),l=Km($m(i,[-.5,.5],[-8,8]),{stiffness:220,damping:22}),c=p=>{if(e||!t.current)return;const m=t.current.getBoundingClientRect(),v=(p.clientX-m.left)/m.width,g=(p.clientY-m.top)/m.height;i.set(v-.5),r.set(g-.5),t.current.style.setProperty("--hl-glow-x",`${v*100}%`),t.current.style.setProperty("--hl-glow-y",`${g*100}%`)},d=()=>{i.set(0),r.set(0)};return Z.jsxs(ya.div,{ref:t,onPointerMove:c,onPointerLeave:d,style:{rotateX:e?0:o,rotateY:e?0:l,transformPerspective:1e3},className:"hl-console-border relative w-full max-w-xl overflow-hidden rounded-2xl border border-white/10 bg-hl-deep-surface p-8 shadow-2xl md:p-10",children:[!e&&Z.jsx("span",{"aria-hidden":"true",className:"hl-scan-sweep pointer-events-none absolute inset-x-0 top-0 z-20 h-16 bg-gradient-to-b from-hl-accent-gold/25 via-hl-accent-gold/5 to-transparent"}),Z.jsxs("span",{className:"absolute right-6 top-6 z-10 hidden items-center gap-1.5 rounded-full border border-hl-accent-gold/25 bg-hl-accent-gold/10 px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide text-hl-accent-gold sm:inline-flex",children:[Z.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[Z.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-hl-accent-gold opacity-75"}),Z.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-hl-accent-gold"})]}),"Escaneando"]}),n]})}function PU({step:n,total:e}){return Z.jsx("div",{className:"mb-8 flex gap-1.5",role:"progressbar","aria-valuenow":n+1,"aria-valuemin":1,"aria-valuemax":e,children:Array.from({length:e},(t,i)=>Z.jsx("div",{className:`h-2 flex-1 rounded-sm transition-all duration-300 ${i<=n?"bg-hl-accent-gold shadow-[0_0_8px_rgba(251,199,116,0.65)]":"bg-white/10"}`},i))})}function bU(){const{step:n,answers:e,lead:t,submissionStatus:i,maturityScore:r,answerQuestion:o,setLeadField:l,goNext:c,goBack:d,setSubmissionStatus:p,setMaturityScore:m}=ZO(),v=De.useRef({}),[g,y]=De.useState(null),E=Jd.length+1,C=nMb.safeParse(t),[t]),P=De.useMemo(()=>jT(e,Jd.length),[e]);async function I(L,O){o(L,O);const U=jT({...e,[L]:O},Jd.length);y({key:Date.now(),score:U}),setTimeout(()=>y(null),1400),setTimeout(c,220)}async function D(){if(!M.success){v.current=Object.fromEntries(M.error.issues.map(O=>[O.path[0],O.message]));return}const L=EU.safeParse({...e,...t});if(L.success){p("submitting");try{await wU(L.data),m(Eb(L.data)),p("success")}catch{p("error")}}}if(i==="success"&&r!==null){const L=r<=AU,O="https://api.leadconnectorhq.com/widget/booking/6VKsf0Z6w7af0pcM5rHl";return Z.jsxs(ZT,{children:[Z.jsx("p",{className:"text-sm font-semibold uppercase tracking-wide text-white/50",children:"Reporte de madurez comercial"}),Z.jsxs("p",{className:"hl-display my-4 text-6xl text-hl-accent-gold",style:{fontVariantNumeric:"tabular-nums"},children:[r,"%"]}),L&&O?Z.jsxs(Z.Fragment,{children:[Z.jsx("p",{className:"text-sm leading-relaxed text-white/75",children:"Su diagnóstico muestra cuellos de botella críticos en captación y visibilidad — son exactamente los que más ventas le están costando hoy. Reserve una llamada ahora mismo con un asesor, sin esperar a que le contactemos."}),Z.jsx("a",{href:O,target:"_blank",rel:"noopener noreferrer",className:"mt-6 inline-flex w-full items-center justify-center rounded-full bg-hl-accent-gold px-8 py-4 text-sm font-bold uppercase tracking-wide text-hl-text-primary transition-transform duration-200 hover:scale-[1.01]",children:"Reservar mi llamada ahora"})]}):Z.jsx("p",{className:"text-sm leading-relaxed text-white/75",children:"Un asesor Heilead revisará sus respuestas y le contactará con recomendaciones puntuales para cerrar sus cuellos de botella de captación, respuesta y visibilidad."})]})}return Z.jsxs(ZT,{children:[Z.jsxs("div",{className:"relative mb-6",children:[Z.jsx(TU,{score:P}),Z.jsx(Hy,{children:g&&Z.jsxs(ya.span,{initial:{opacity:0,y:6,scale:.85},animate:{opacity:1,y:-2,scale:1},exit:{opacity:0,y:-12},transition:{duration:.5,ease:"easeOut"},className:"absolute -top-2 right-0 rounded-full bg-hl-accent-gold px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide text-hl-text-primary shadow-lg z-10",children:["Puntuación provisional: ",g.score,"%"]},g.key)})]}),Z.jsx(PU,{step:n,total:E}),Z.jsx(Hy,{mode:"wait",children:C&&w?Z.jsxs(ya.div,{initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:-24},transition:{duration:.25,ease:"easeOut"},children:[Z.jsx("h3",{className:"hl-display mb-6 text-xl text-white md:text-2xl",children:qT[w].prompt}),Z.jsx("div",{className:"flex flex-col gap-3",children:qT[w].options.map((L,O)=>Z.jsx(CU,{label:L,selected:e[w]===O,onSelect:()=>I(w,O)},L))}),n>0&&Z.jsx("button",{type:"button",onClick:d,className:"mt-6 text-xs font-semibold uppercase tracking-wide text-white/45 hover:text-white",children:"← Volver"})]},w):Z.jsxs(ya.div,{initial:{opacity:0,x:24},animate:{opacity:1,x:0},exit:{opacity:0,x:-24},transition:{duration:.25,ease:"easeOut"},children:[Z.jsx("h3",{className:"hl-display mb-6 text-xl text-white md:text-2xl",children:"Reciba su reporte de madurez comercial"}),Z.jsx("div",{className:"flex flex-col gap-4",children:RU.map(L=>Z.jsxs("div",{className:"flex flex-col gap-1.5",children:[Z.jsx("label",{htmlFor:L.key,className:"text-xs font-semibold uppercase tracking-wide text-white/50",children:L.label}),Z.jsx("input",{id:L.key,type:L.type,autoComplete:L.autoComplete,value:t[L.key]??"",onChange:O=>l(L.key,O.target.value),className:"rounded-xl border border-white/15 bg-white/[0.04] px-4 py-3 text-sm text-white outline-none transition-colors duration-150 placeholder:text-white/30 focus:border-hl-accent-gold"}),v.current[L.key]&&Z.jsx("span",{className:"text-xs text-red-400",children:v.current[L.key]})]},L.key))}),Z.jsx("button",{type:"button",onClick:D,disabled:i==="submitting",className:"mt-6 w-full rounded-full bg-hl-accent-gold px-8 py-4 text-sm font-bold uppercase tracking-wide text-hl-text-primary transition-transform duration-200 hover:scale-[1.01] disabled:cursor-not-allowed disabled:opacity-60",children:i==="submitting"?"Procesando…":"Obtener mi reporte de madurez"}),Z.jsx("button",{type:"button",onClick:d,className:"mt-4 text-xs font-semibold uppercase tracking-wide text-white/45 hover:text-white",children:"← Volver"})]},"lead-form")})]})}function DU(){return Z.jsx("section",{id:"diagnostico",className:"hl-dot-grid hl-noise bg-white px-6 py-24 md:px-10",children:Z.jsxs("div",{className:"relative z-10",children:[Z.jsxs("div",{className:"mx-auto mb-12 max-w-3xl text-center",children:[Z.jsx("h2",{className:"hl-display text-3xl uppercase text-hl-text-primary sm:text-4xl md:text-5xl",children:"Descubra los cuellos de botella que están frenando sus ventas hoy."}),Z.jsx("p",{className:"mt-4 text-base text-hl-text-primary/70 md:text-lg",children:"Responda este diagnóstico interactivo de preguntas rápidas y reciba al instante un reporte de madurez comercial."})]}),Z.jsx("div",{className:"flex justify-center",children:Z.jsx(bU,{})})]})})}_i.registerPlugin(Kt);function wx({target:n,prefix:e="",suffix:t="",label:i}){const r=De.useRef(null),o=Ea();return De.useEffect(()=>{const l=r.current;if(!l)return;if(o){l.textContent=`${e}${n}${t}`;return}const c={value:0},d=_i.to(c,{value:n,duration:1.6,ease:"power2.out",scrollTrigger:{trigger:l,start:"top 85%",once:!0},onUpdate:()=>{l.textContent=`${e}${Math.round(c.value)}${t}`}});return()=>{var p;(p=d.scrollTrigger)==null||p.kill(),d.kill()}},[n,e,t,o]),Z.jsxs("div",{className:"flex flex-col gap-1",children:[Z.jsxs("span",{ref:r,className:"hl-display text-4xl text-hl-accent-gold md:text-5xl",children:[e,"0",t]}),Z.jsx("span",{className:"text-sm text-hl-text-primary/70",children:i})]})}const KT={title:"Venta Directa Consultiva (Feria a Cierre)",testimonial:"Sistematizamos la captación en stand: cada visitante registrado en feria entra al CRM en tiempo real, con seguimiento automático hasta el cierre, sin depender de la memoria del asesor."},$T={title:"Sistematización de Servicios y Posventa",testimonial:"Automatizamos el nurturing y la posventa de la cartera de clientes, liberando al equipo comercial de tareas repetitivas de seguimiento manual para enfocarse en cerrar y fidelizar."};function NU(){return Z.jsx("section",{id:"evidencia",className:"hl-noise bg-hl-white px-6 py-24 md:px-10",children:Z.jsxs("div",{className:"relative z-10",children:[Z.jsx("div",{className:"mx-auto mb-14 max-w-3xl text-center",children:Z.jsx("h2",{className:"hl-display text-3xl uppercase text-hl-text-primary sm:text-4xl md:text-5xl",children:"Evidencia sin complicaciones. Resultados que entiende su línea de flotación financiera."})}),Z.jsxs("div",{className:"mx-auto grid max-w-5xl gap-6 md:grid-cols-2",children:[Z.jsxs("article",{className:"rounded-2xl border border-slate-200 bg-hl-white p-8 shadow-2xl",children:[Z.jsx("h3",{className:"hl-display mb-6 text-lg uppercase text-hl-primary-dark",children:KT.title}),Z.jsxs("div",{className:"mb-6 flex flex-wrap gap-8",children:[Z.jsx(wx,{target:0,label:"Leads perdidos"}),Z.jsx(wx,{target:35,prefix:"+",suffix:"%",label:"Agendamiento efectivo"})]}),Z.jsx("p",{className:"text-sm leading-relaxed text-hl-text-primary/85",children:KT.testimonial})]}),Z.jsxs("article",{className:"rounded-2xl border border-slate-200 bg-hl-white p-8 shadow-2xl",children:[Z.jsx("h3",{className:"hl-display mb-6 text-lg uppercase text-hl-primary-dark",children:$T.title}),Z.jsx("div",{className:"mb-6 flex flex-wrap gap-8",children:Z.jsx(wx,{target:18,suffix:"h",label:"Ahorro semanal en seguimiento manual"})}),Z.jsx("p",{className:"text-sm leading-relaxed text-hl-text-primary/85",children:$T.testimonial})]})]})]})})}_i.registerPlugin(Kt);const LU=[{number:"1",title:"Diagnóstico",body:"Mapeamos su pipeline actual y detectamos los cuellos de botella reales."},{number:"2",title:"Blueprint & Construcción",body:"Diseñamos y construimos el ecosistema: CRM, automatizaciones y flujos a medida."},{number:"3",title:"Acompañamiento y Medición",body:"Capacitamos a su equipo y medimos resultados con ajustes continuos."}];function IU(){const n=De.useRef(null),e=De.useRef(null),t=Ea();return De.useEffect(()=>{const i=n.current,r=e.current;if(!i||!r)return;if(t){_i.set(i,{strokeDashoffset:0});return}const o=i.getTotalLength();_i.set(i,{strokeDasharray:o,strokeDashoffset:o});const l=_i.to(i,{strokeDashoffset:0,ease:"none",scrollTrigger:{trigger:r,start:"top 75%",end:"bottom 60%",scrub:.6}});return()=>{var c;(c=l.scrollTrigger)==null||c.kill(),l.kill()}},[t]),Z.jsxs("div",{ref:e,className:"relative mx-auto max-w-5xl px-6 py-8",children:[Z.jsx("svg",{viewBox:"0 0 800 40",className:"absolute left-0 top-[38px] hidden w-full md:block",preserveAspectRatio:"none","aria-hidden":"true",children:Z.jsx("path",{ref:n,d:"M 80 20 L 400 20 L 720 20",fill:"none",stroke:"#FBC774",strokeWidth:"3",strokeLinecap:"round"})}),Z.jsx("div",{className:"relative grid gap-10 md:grid-cols-3",children:LU.map(i=>Z.jsxs("div",{className:"flex flex-col items-center text-center",children:[Z.jsx("span",{className:"hl-display flex h-16 w-16 items-center justify-center rounded-full border-2 border-hl-accent-gold bg-hl-primary-dark text-2xl text-hl-accent-gold",children:i.number}),Z.jsx("h3",{className:"hl-display mt-4 text-lg uppercase text-hl-white",children:i.title}),Z.jsx("p",{className:"mt-2 max-w-xs text-sm text-white/75",children:i.body})]},i.number))})]})}function kU(){return Z.jsx("section",{id:"proceso",className:"hl-noise bg-hl-primary-dark px-6 py-24 md:px-10",children:Z.jsxs("div",{className:"relative z-10",children:[Z.jsx("div",{className:"mx-auto mb-16 max-w-3xl text-center",children:Z.jsx("h2",{className:"hl-display text-3xl uppercase text-hl-white sm:text-4xl md:text-5xl",children:"Un proceso claro, de diagnóstico a resultados medibles."})}),Z.jsx(IU,{}),Z.jsx("div",{className:"mt-16 flex justify-center",children:Z.jsx("a",{href:"#diagnostico",className:"inline-flex items-center justify-center rounded-full bg-hl-accent-gold px-10 py-4 text-sm font-bold uppercase tracking-wide text-hl-text-primary transition-transform duration-200 hover:scale-[1.03] active:scale-[0.98]",children:"Iniciar mi auditoría de madurez"})})]})})}function OU(){const n=new Date().getFullYear();return Z.jsx("footer",{className:"hl-noise bg-hl-primary-dark px-6 py-12 text-white/80 md:px-10",children:Z.jsxs("div",{className:"relative z-10 mx-auto flex max-w-6xl flex-col gap-8",children:[Z.jsx("img",{src:ov.logos.footerWhite,alt:"Heilead",className:"h-auto w-auto max-w-[180px] object-contain"}),Z.jsx("p",{className:"max-w-2xl text-sm leading-relaxed",children:"Heilead está comprometido con la inclusión digital. Nuestra plataforma web respeta las preferencias del sistema del usuario a través del soporte nativo para prefers-reduced-motion e interpolación inercial adaptativa."}),Z.jsxs("div",{className:"flex flex-col gap-2 border-t border-white/15 pt-6 text-xs text-white/60 sm:flex-row sm:items-center sm:justify-between",children:[Z.jsxs("span",{children:["© ",n," Heilead. Todos los derechos reservados."]}),Z.jsx("a",{href:ov.attribution.fontCreditLink,target:"_blank",rel:"noopener noreferrer",className:"underline decoration-white/30 underline-offset-2 hover:text-white",children:ov.attribution.fontCreditText})]})]})})}function UU(){return Z.jsxs(Z.Fragment,{children:[Z.jsx(WD,{}),Z.jsx(qD,{}),Z.jsxs("main",{children:[Z.jsx(sN,{}),Z.jsx(YD,{}),Z.jsx(WO,{}),Z.jsx(DU,{}),Z.jsx(NU,{}),Z.jsx(kU,{})]}),Z.jsx(OU,{})]})}const Tx=document.getElementById("root-heilead");Tx?(Object.assign(Tx.style,{width:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw"}),q2.createRoot(Tx).render(Z.jsx(UU,{}))):console.error('[heilead-bundle] No element with id="root-heilead" found on the page.');/** * @license * Copyright 2010-2026 Three.js Authors * SPDX-License-Identifier: MIT */const uM="185",FU=0,QT=1,zU=2,BU=0,km=1,cv=2,fh=3,uc=0,Hs=1,Xa=2,ql=0,yh=1,JT=2,eC=3,tC=4,VU=5,cf=100,HU=101,GU=102,WU=103,XU=104,jU=200,YU=201,qU=202,ZU=203,fS=204,dS=205,KU=206,$U=207,QU=208,JU=209,eF=210,tF=211,nF=212,iF=213,rF=214,hS=0,pS=1,mS=2,Bh=3,gS=4,vS=5,_S=6,xS=7,wb=0,sF=1,oF=2,Sa=0,Tb=1,Cb=2,Ab=3,cM=4,Rb=5,Pb=6,bb=7,Db=300,Pf=301,Vh=302,Cx=303,Ax=304,l_=306,yS=1e3,Wl=1001,SS=1002,kr=1003,aF=1004,T0=1005,Jr=1006,Rx=1007,mf=1008,co=1009,Nb=1010,Lb=1011,eg=1012,fM=1013,tl=1014,xa=1015,tu=1016,dM=1017,hM=1018,tg=1020,Ib=35902,kb=35899,Ob=1021,Ub=1022,Bo=1023,nu=1026,gf=1027,pM=1028,mM=1029,bf=1030,gM=1031,vM=1033,fv=33776,dv=33777,hv=33778,pv=33779,MS=35840,ES=35841,wS=35842,TS=35843,CS=36196,AS=37492,RS=37496,PS=37488,bS=37489,Bv=37490,DS=37491,NS=37808,LS=37809,IS=37810,kS=37811,OS=37812,US=37813,FS=37814,zS=37815,BS=37816,VS=37817,HS=37818,GS=37819,WS=37820,XS=37821,jS=36492,YS=36494,qS=36495,ZS=36283,KS=36284,Vv=36285,$S=36286,lF=3200,QS=0,uF=1,Wu="",Io="srgb",Hv="srgb-linear",Gv="linear",Zn="srgb",Id=7680,nC=519,cF=512,fF=513,dF=514,_M=515,hF=516,pF=517,xM=518,mF=519,iC=35044,rC="300 es",qa=2e3,Wv=2001;function gF(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}function Xv(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function vF(){const n=Xv("canvas");return n.style.display="block",n}const sC={};function oC(...n){const e="THREE."+n.shift();console.log(e,...n)}function Fb(n){const e=n[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=n[1];t&&t.isStackTrace?n[0]+=" "+t.getLocation():n[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return n}function jt(...n){n=Fb(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...n)}}function Pn(...n){n=Fb(n);const e="THREE."+n.shift();{const t=n[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...n)}}function Sh(...n){const e=n.join(" ");e in sC||(sC[e]=!0,jt(...n))}function _F(n,e,t){return new Promise(function(i,r){function o(){switch(n.clientWaitSync(e,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(o,t);break;default:i()}}setTimeout(o,t)})}const xF={[hS]:pS,[mS]:_S,[gS]:xS,[Bh]:vS,[pS]:hS,[_S]:mS,[xS]:gS,[vS]:Bh};class If{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){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners;if(i===void 0)return;const r=i[e];if(r!==void 0){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const i=t[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let o=0,l=r.length;o>8&255]+jr[n>>16&255]+jr[n>>24&255]+"-"+jr[e&255]+jr[e>>8&255]+"-"+jr[e>>16&15|64]+jr[e>>24&255]+"-"+jr[t&63|128]+jr[t>>8&255]+"-"+jr[t>>16&255]+jr[t>>24&255]+jr[i&255]+jr[i>>8&255]+jr[i>>16&255]+jr[i>>24&255]).toLowerCase()}function wn(n,e,t){return Math.max(e,Math.min(t,n))}function yF(n,e){return(n%e+e)%e}function bx(n,e,t){return(1-t)*n+t*e}function qp(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("THREE.MathUtils: Invalid component type.")}}function ks(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("THREE.MathUtils: Invalid component type.")}}const RM=class RM{constructor(e=0,t=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("THREE.Vector2: 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("THREE.Vector2: 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=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(wn(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(wn(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),o=this.x-e.x,l=this.y-e.y;return this.x=o*i-l*r+e.x,this.y=o*r+l*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};RM.prototype.isVector2=!0;let Dn=RM;class Yh{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,o,l,c){let d=i[r+0],p=i[r+1],m=i[r+2],v=i[r+3],g=o[l+0],y=o[l+1],E=o[l+2],C=o[l+3];if(v!==C||d!==g||p!==y||m!==E){let w=d*g+p*y+m*E+v*C;w<0&&(g=-g,y=-y,E=-E,C=-C,w=-w);let M=1-c;if(w<.9995){const P=Math.acos(w),I=Math.sin(P);M=Math.sin(M*P)/I,c=Math.sin(c*P)/I,d=d*M+g*c,p=p*M+y*c,m=m*M+E*c,v=v*M+C*c}else{d=d*M+g*c,p=p*M+y*c,m=m*M+E*c,v=v*M+C*c;const P=1/Math.sqrt(d*d+p*p+m*m+v*v);d*=P,p*=P,m*=P,v*=P}}e[t]=d,e[t+1]=p,e[t+2]=m,e[t+3]=v}static multiplyQuaternionsFlat(e,t,i,r,o,l){const c=i[r],d=i[r+1],p=i[r+2],m=i[r+3],v=o[l],g=o[l+1],y=o[l+2],E=o[l+3];return e[t]=c*E+m*v+d*y-p*g,e[t+1]=d*E+m*g+p*v-c*y,e[t+2]=p*E+m*y+c*g-d*v,e[t+3]=m*E-c*v-d*g-p*y,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,o=e._z,l=e._order,c=Math.cos,d=Math.sin,p=c(i/2),m=c(r/2),v=c(o/2),g=d(i/2),y=d(r/2),E=d(o/2);switch(l){case"XYZ":this._x=g*m*v+p*y*E,this._y=p*y*v-g*m*E,this._z=p*m*E+g*y*v,this._w=p*m*v-g*y*E;break;case"YXZ":this._x=g*m*v+p*y*E,this._y=p*y*v-g*m*E,this._z=p*m*E-g*y*v,this._w=p*m*v+g*y*E;break;case"ZXY":this._x=g*m*v-p*y*E,this._y=p*y*v+g*m*E,this._z=p*m*E+g*y*v,this._w=p*m*v-g*y*E;break;case"ZYX":this._x=g*m*v-p*y*E,this._y=p*y*v+g*m*E,this._z=p*m*E-g*y*v,this._w=p*m*v+g*y*E;break;case"YZX":this._x=g*m*v+p*y*E,this._y=p*y*v+g*m*E,this._z=p*m*E-g*y*v,this._w=p*m*v-g*y*E;break;case"XZY":this._x=g*m*v-p*y*E,this._y=p*y*v-g*m*E,this._z=p*m*E+g*y*v,this._w=p*m*v+g*y*E;break;default:jt("Quaternion: .setFromEuler() encountered an unknown order: "+l)}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],o=t[8],l=t[1],c=t[5],d=t[9],p=t[2],m=t[6],v=t[10],g=i+c+v;if(g>0){const y=.5/Math.sqrt(g+1);this._w=.25/y,this._x=(m-d)*y,this._y=(o-p)*y,this._z=(l-r)*y}else if(i>c&&i>v){const y=2*Math.sqrt(1+i-c-v);this._w=(m-d)/y,this._x=.25*y,this._y=(r+l)/y,this._z=(o+p)/y}else if(c>v){const y=2*Math.sqrt(1+c-i-v);this._w=(o-p)/y,this._x=(r+l)/y,this._y=.25*y,this._z=(d+m)/y}else{const y=2*Math.sqrt(1+v-i-c);this._w=(l-r)/y,this._x=(o+p)/y,this._y=(d+m)/y,this._z=.25*y}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._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(wn(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,o=e._z,l=e._w,c=t._x,d=t._y,p=t._z,m=t._w;return this._x=i*m+l*c+r*p-o*d,this._y=r*m+l*d+o*c-i*p,this._z=o*m+l*p+i*d-r*c,this._w=l*m-i*c-r*d-o*p,this._onChangeCallback(),this}slerp(e,t){let i=e._x,r=e._y,o=e._z,l=e._w,c=this.dot(e);c<0&&(i=-i,r=-r,o=-o,l=-l,c=-c);let d=1-t;if(c<.9995){const p=Math.acos(c),m=Math.sin(p);d=Math.sin(d*p)/m,t=Math.sin(t*p)/m,this._x=this._x*d+i*t,this._y=this._y*d+r*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this._onChangeCallback()}else this._x=this._x*d+i*t,this._y=this._y*d+r*t,this._z=this._z*d+o*t,this._w=this._w*d+l*t,this.normalize();return 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),o=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),o*Math.sin(t),o*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}}const PM=class PM{constructor(e=0,t=0,i=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("THREE.Vector3: 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("THREE.Vector3: 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(aC.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(aC.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,o=e.elements;return this.x=o[0]*t+o[3]*i+o[6]*r,this.y=o[1]*t+o[4]*i+o[7]*r,this.z=o[2]*t+o[5]*i+o[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,o=e.elements,l=1/(o[3]*t+o[7]*i+o[11]*r+o[15]);return this.x=(o[0]*t+o[4]*i+o[8]*r+o[12])*l,this.y=(o[1]*t+o[5]*i+o[9]*r+o[13])*l,this.z=(o[2]*t+o[6]*i+o[10]*r+o[14])*l,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,o=e.x,l=e.y,c=e.z,d=e.w,p=2*(l*r-c*i),m=2*(c*t-o*r),v=2*(o*i-l*t);return this.x=t+d*p+l*v-c*m,this.y=i+d*m+c*p-o*v,this.z=r+d*v+o*m-l*p,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,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r,this.y=o[1]*t+o[5]*i+o[9]*r,this.z=o[2]*t+o[6]*i+o[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=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this.z=wn(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this.z=wn(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(wn(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}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,o=e.z,l=t.x,c=t.y,d=t.z;return this.x=r*d-o*c,this.y=o*l-i*d,this.z=i*c-r*l,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 Dx.copy(this).projectOnVector(e),this.sub(Dx)}reflect(e){return this.sub(Dx.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(wn(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}};PM.prototype.isVector3=!0;let xe=PM;const Dx=new xe,aC=new Yh,bM=class bM{constructor(e,t,i,r,o,l,c,d,p){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,o,l,c,d,p)}set(e,t,i,r,o,l,c,d,p){const m=this.elements;return m[0]=e,m[1]=r,m[2]=c,m[3]=t,m[4]=o,m[5]=d,m[6]=i,m[7]=l,m[8]=p,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,o=this.elements,l=i[0],c=i[3],d=i[6],p=i[1],m=i[4],v=i[7],g=i[2],y=i[5],E=i[8],C=r[0],w=r[3],M=r[6],P=r[1],I=r[4],D=r[7],L=r[2],O=r[5],U=r[8];return o[0]=l*C+c*P+d*L,o[3]=l*w+c*I+d*O,o[6]=l*M+c*D+d*U,o[1]=p*C+m*P+v*L,o[4]=p*w+m*I+v*O,o[7]=p*M+m*D+v*U,o[2]=g*C+y*P+E*L,o[5]=g*w+y*I+E*O,o[8]=g*M+y*D+E*U,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],o=e[3],l=e[4],c=e[5],d=e[6],p=e[7],m=e[8];return t*l*m-t*c*p-i*o*m+i*c*d+r*o*p-r*l*d}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],o=e[3],l=e[4],c=e[5],d=e[6],p=e[7],m=e[8],v=m*l-c*p,g=c*d-m*o,y=p*o-l*d,E=t*v+i*g+r*y;if(E===0)return this.set(0,0,0,0,0,0,0,0,0);const C=1/E;return e[0]=v*C,e[1]=(r*p-m*i)*C,e[2]=(c*i-r*l)*C,e[3]=g*C,e[4]=(m*t-r*d)*C,e[5]=(r*o-c*t)*C,e[6]=y*C,e[7]=(i*d-p*t)*C,e[8]=(l*t-i*o)*C,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,o,l,c){const d=Math.cos(o),p=Math.sin(o);return this.set(i*d,i*p,-i*(d*l+p*c)+l+e,-r*p,r*d,-r*(-p*l+d*c)+c+t,0,0,1),this}scale(e,t){return Sh("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Nx.makeScale(e,t)),this}rotate(e){return Sh("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Nx.makeRotation(-e)),this}translate(e,t){return Sh("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Nx.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)}};bM.prototype.isMatrix3=!0;let tn=bM;const Nx=new tn,lC=new tn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),uC=new tn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function SF(){const n={enabled:!0,workingColorSpace:Hv,spaces:{},convert:function(r,o,l){return this.enabled===!1||o===l||!o||!l||(this.spaces[o].transfer===Zn&&(r.r=Zl(r.r),r.g=Zl(r.g),r.b=Zl(r.b)),this.spaces[o].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[o].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Zn&&(r.r=Mh(r.r),r.g=Mh(r.g),r.b=Mh(r.b))),r},workingToColorSpace:function(r,o){return this.convert(r,this.workingColorSpace,o)},colorSpaceToWorking:function(r,o){return this.convert(r,o,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Wu?Gv:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,o=this.workingColorSpace){return r.fromArray(this.spaces[o].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,o,l){return r.copy(this.spaces[o].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,o){return Sh("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,o)},toWorkingColorSpace:function(r,o){return Sh("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,o)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],i=[.3127,.329];return n.define({[Hv]:{primaries:e,whitePoint:i,transfer:Gv,toXYZ:lC,fromXYZ:uC,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Io},outputColorSpaceConfig:{drawingBufferColorSpace:Io}},[Io]:{primaries:e,whitePoint:i,transfer:Zn,toXYZ:lC,fromXYZ:uC,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Io}}}),n}const En=SF();function Zl(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Mh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let kd;class MF{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{kd===void 0&&(kd=Xv("canvas")),kd.width=e.width,kd.height=e.height;const r=kd.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),i=kd}return i.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Xv("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),o=r.data;for(let l=0;l1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Ix).x}get height(){return this.source.getSize(Ix).y}get depth(){return this.source.getSize(Ix).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(i===void 0){jt(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){jt(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&i&&r.isVector2&&i.isVector2||r&&i&&r.isVector3&&i.isVector3||r&&i&&r.isMatrix3&&i.isMatrix3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Db)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case yS:e.x=e.x-Math.floor(e.x);break;case Wl:e.x=e.x<0?0:1;break;case SS: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 yS:e.y=e.y-Math.floor(e.y);break;case Wl:e.y=e.y<0?0:1;break;case SS: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++}}ts.DEFAULT_IMAGE=null;ts.DEFAULT_MAPPING=Db;ts.DEFAULT_ANISOTROPY=1;const DM=class DM{constructor(e=0,t=0,i=0,r=1){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("THREE.Vector4: 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("THREE.Vector4: 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,o=this.w,l=e.elements;return this.x=l[0]*t+l[4]*i+l[8]*r+l[12]*o,this.y=l[1]*t+l[5]*i+l[9]*r+l[13]*o,this.z=l[2]*t+l[6]*i+l[10]*r+l[14]*o,this.w=l[3]*t+l[7]*i+l[11]*r+l[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);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,o;const d=e.elements,p=d[0],m=d[4],v=d[8],g=d[1],y=d[5],E=d[9],C=d[2],w=d[6],M=d[10];if(Math.abs(m-g)<.01&&Math.abs(v-C)<.01&&Math.abs(E-w)<.01){if(Math.abs(m+g)<.1&&Math.abs(v+C)<.1&&Math.abs(E+w)<.1&&Math.abs(p+y+M-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const I=(p+1)/2,D=(y+1)/2,L=(M+1)/2,O=(m+g)/4,U=(v+C)/4,b=(E+w)/4;return I>D&&I>L?I<.01?(i=0,r=.707106781,o=.707106781):(i=Math.sqrt(I),r=O/i,o=U/i):D>L?D<.01?(i=.707106781,r=0,o=.707106781):(r=Math.sqrt(D),i=O/r,o=b/r):L<.01?(i=.707106781,r=.707106781,o=0):(o=Math.sqrt(L),i=U/o,r=b/o),this.set(i,r,o,t),this}let P=Math.sqrt((w-E)*(w-E)+(v-C)*(v-C)+(g-m)*(g-m));return Math.abs(P)<.001&&(P=1),this.x=(w-E)/P,this.y=(v-C)/P,this.z=(g-m)/P,this.w=Math.acos((p+y+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=wn(this.x,e.x,t.x),this.y=wn(this.y,e.y,t.y),this.z=wn(this.z,e.z,t.z),this.w=wn(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=wn(this.x,e,t),this.y=wn(this.y,e,t),this.z=wn(this.z,e,t),this.w=wn(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(wn(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}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}};DM.prototype.isVector4=!0;let Li=DM;class TF extends If{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Jr,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Li(0,0,e,t),this.scissorTest=!1,this.viewport=new Li(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:i.depth},o=new ts(r),l=i.count;for(let c=0;c1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t>>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.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),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.geometryInfo=this._geometryInfo.map(c=>({...c,boundingBox:c.boundingBox?c.boundingBox.toJSON():void 0,boundingSphere:c.boundingSphere?c.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(c=>({...c})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function o(c,d){return c[d.uuid]===void 0&&(c[d.uuid]=d.toJSON(e)),d.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=o(e.geometries,this.geometry);const c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){const d=c.shapes;if(Array.isArray(d))for(let p=0,m=d.length;p0){r.children=[];for(let c=0;c0){r.animations=[];for(let c=0;c0&&(i.geometries=c),d.length>0&&(i.materials=d),p.length>0&&(i.textures=p),m.length>0&&(i.images=m),v.length>0&&(i.shapes=v),g.length>0&&(i.skeletons=g),y.length>0&&(i.animations=y),E.length>0&&(i.nodes=E)}return i.object=r,i;function l(c){const d=[];for(const p in c){const m=c[p];delete m.metadata,d.push(m)}return d}}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.pivot=e.pivot!==null?e.pivot.clone():null,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.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;iy+E?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!p.inputState.pinching&&g<=y-E&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else d!==null&&e.gripSpace&&(o=t.getPose(e.gripSpace,i),o!==null&&(d.matrix.fromArray(o.transform.matrix),d.matrix.decompose(d.position,d.rotation,d.scale),d.matrixWorldNeedsUpdate=!0,o.linearVelocity?(d.hasLinearVelocity=!0,d.linearVelocity.copy(o.linearVelocity)):d.hasLinearVelocity=!1,o.angularVelocity?(d.hasAngularVelocity=!0,d.angularVelocity.copy(o.angularVelocity)):d.hasAngularVelocity=!1,d.eventsEnabled&&d.dispatchEvent({type:"gripUpdated",data:e,target:this})));c!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&o!==null&&(r=o),r!==null&&(c.matrix.fromArray(r.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,r.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(r.linearVelocity)):c.hasLinearVelocity=!1,r.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(r.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(LF)))}return c!==null&&(c.visible=r!==null),d!==null&&(d.visible=o!==null),p!==null&&(p.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new gm;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const Bb={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},ku={h:0,s:0,l:0},R0={h:0,s:0,l:0};function Ux(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 bn{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=Io){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,En.colorSpaceToWorking(this,t),this}setRGB(e,t,i,r=En.workingColorSpace){return this.r=e,this.g=t,this.b=i,En.colorSpaceToWorking(this,r),this}setHSL(e,t,i,r=En.workingColorSpace){if(e=yF(e,1),t=wn(t,0,1),i=wn(i,0,1),t===0)this.r=this.g=this.b=i;else{const o=i<=.5?i*(1+t):i+t-i*t,l=2*i-o;this.r=Ux(l,o,e+1/3),this.g=Ux(l,o,e),this.b=Ux(l,o,e-1/3)}return En.colorSpaceToWorking(this,r),this}setStyle(e,t=Io){function i(o){o!==void 0&&parseFloat(o)<1&&jt("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const l=r[1],c=r[2];switch(l){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,t);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,t);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(c))return i(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,t);break;default:jt("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=r[1],l=o.length;if(l===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(o,16),t);jt("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Io){const i=Bb[e.toLowerCase()];return i!==void 0?this.setHex(i,t):jt("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=Zl(e.r),this.g=Zl(e.g),this.b=Zl(e.b),this}copyLinearToSRGB(e){return this.r=Mh(e.r),this.g=Mh(e.g),this.b=Mh(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Io){return En.workingToColorSpace(Yr.copy(this),e),Math.round(wn(Yr.r*255,0,255))*65536+Math.round(wn(Yr.g*255,0,255))*256+Math.round(wn(Yr.b*255,0,255))}getHexString(e=Io){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=En.workingColorSpace){En.workingToColorSpace(Yr.copy(this),t);const i=Yr.r,r=Yr.g,o=Yr.b,l=Math.max(i,r,o),c=Math.min(i,r,o);let d,p;const m=(c+l)/2;if(c===l)d=0,p=0;else{const v=l-c;switch(p=m<=.5?v/(l+c):v/(2-l-c),l){case i:d=(r-o)/v+(r0&&(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}};const pa=new xe,Ol=new xe,Fx=new xe,Ul=new xe,zd=new xe,Bd=new xe,vC=new xe,zx=new xe,Bx=new xe,Vx=new xe,Hx=new Li,Gx=new Li,Wx=new Li;class _a{constructor(e=new xe,t=new xe,i=new xe){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,r){r.subVectors(i,t),pa.subVectors(e,t),r.cross(pa);const o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(e,t,i,r,o){pa.subVectors(r,t),Ol.subVectors(i,t),Fx.subVectors(e,t);const l=pa.dot(pa),c=pa.dot(Ol),d=pa.dot(Fx),p=Ol.dot(Ol),m=Ol.dot(Fx),v=l*p-c*c;if(v===0)return o.set(0,0,0),null;const g=1/v,y=(p*d-c*m)*g,E=(l*m-c*d)*g;return o.set(1-y-E,E,y)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ul)===null?!1:Ul.x>=0&&Ul.y>=0&&Ul.x+Ul.y<=1}static getInterpolation(e,t,i,r,o,l,c,d){return this.getBarycoord(e,t,i,r,Ul)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(o,Ul.x),d.addScaledVector(l,Ul.y),d.addScaledVector(c,Ul.z),d)}static getInterpolatedAttribute(e,t,i,r,o,l){return Hx.setScalar(0),Gx.setScalar(0),Wx.setScalar(0),Hx.fromBufferAttribute(e,t),Gx.fromBufferAttribute(e,i),Wx.fromBufferAttribute(e,r),l.setScalar(0),l.addScaledVector(Hx,o.x),l.addScaledVector(Gx,o.y),l.addScaledVector(Wx,o.z),l}static isFrontFacing(e,t,i,r){return pa.subVectors(i,t),Ol.subVectors(e,t),pa.cross(Ol).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 pa.subVectors(this.c,this.b),Ol.subVectors(this.a,this.b),pa.cross(Ol).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return _a.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return _a.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,o){return _a.getInterpolation(e,this.a,this.b,this.c,t,i,r,o)}containsPoint(e){return _a.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return _a.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,o=this.c;let l,c;zd.subVectors(r,i),Bd.subVectors(o,i),zx.subVectors(e,i);const d=zd.dot(zx),p=Bd.dot(zx);if(d<=0&&p<=0)return t.copy(i);Bx.subVectors(e,r);const m=zd.dot(Bx),v=Bd.dot(Bx);if(m>=0&&v<=m)return t.copy(r);const g=d*v-m*p;if(g<=0&&d>=0&&m<=0)return l=d/(d-m),t.copy(i).addScaledVector(zd,l);Vx.subVectors(e,o);const y=zd.dot(Vx),E=Bd.dot(Vx);if(E>=0&&y<=E)return t.copy(o);const C=y*p-d*E;if(C<=0&&p>=0&&E<=0)return c=p/(p-E),t.copy(i).addScaledVector(Bd,c);const w=m*E-y*v;if(w<=0&&v-m>=0&&y-E>=0)return vC.subVectors(o,r),c=(v-m)/(v-m+(y-E)),t.copy(r).addScaledVector(vC,c);const M=1/(w+C+g);return l=C*M,c=g*M,t.copy(i).addScaledVector(zd,l).addScaledVector(Bd,c)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class kf{constructor(e=new xe(1/0,1/0,1/0),t=new xe(-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,ma),ma.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(Kp),b0.subVectors(this.max,Kp),Vd.subVectors(e.a,Kp),Hd.subVectors(e.b,Kp),Gd.subVectors(e.c,Kp),Ou.subVectors(Hd,Vd),Uu.subVectors(Gd,Hd),Jc.subVectors(Vd,Gd);let t=[0,-Ou.z,Ou.y,0,-Uu.z,Uu.y,0,-Jc.z,Jc.y,Ou.z,0,-Ou.x,Uu.z,0,-Uu.x,Jc.z,0,-Jc.x,-Ou.y,Ou.x,0,-Uu.y,Uu.x,0,-Jc.y,Jc.x,0];return!Xx(t,Vd,Hd,Gd,b0)||(t=[1,0,0,0,1,0,0,0,1],!Xx(t,Vd,Hd,Gd,b0))?!1:(D0.crossVectors(Ou,Uu),t=[D0.x,D0.y,D0.z],Xx(t,Vd,Hd,Gd,b0))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,ma).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(ma).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:(Fl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Fl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Fl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Fl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Fl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Fl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Fl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Fl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Fl),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Fl=[new xe,new xe,new xe,new xe,new xe,new xe,new xe,new xe],ma=new xe,P0=new kf,Vd=new xe,Hd=new xe,Gd=new xe,Ou=new xe,Uu=new xe,Jc=new xe,Kp=new xe,b0=new xe,D0=new xe,ef=new xe;function Xx(n,e,t,i,r){for(let o=0,l=n.length-3;o<=l;o+=3){ef.fromArray(n,o);const c=r.x*Math.abs(ef.x)+r.y*Math.abs(ef.y)+r.z*Math.abs(ef.z),d=e.dot(ef),p=t.dot(ef),m=i.dot(ef);if(Math.max(-Math.max(d,p,m),Math.min(d,p,m))>c)return!1}return!0}const $i=new xe,N0=new Dn;let kF=0;class Ma extends If{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:kF++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=iC,this.updateRanges=[],this.gpuType=xa,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,o=this.itemSize;rthis.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;$p.subVectors(e,this.center);const t=$p.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector($p,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):(jx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint($p.copy(e.center).add(jx)),this.expandByPoint($p.copy(e.center).sub(jx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let UF=0;const Do=new yi,Yx=new Gs,Wd=new xe,io=new kf,Qp=new kf,xr=new xe;class wa extends If{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:UF++}),this.uuid=ug(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(gF(e)?Hb:Vb)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const o=new tn().getNormalMatrix(e);i.applyNormalMatrix(o),i.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Do.makeRotationFromQuaternion(e),this.applyMatrix4(Do),this}rotateX(e){return Do.makeRotationX(e),this.applyMatrix4(Do),this}rotateY(e){return Do.makeRotationY(e),this.applyMatrix4(Do),this}rotateZ(e){return Do.makeRotationZ(e),this.applyMatrix4(Do),this}translate(e,t,i){return Do.makeTranslation(e,t,i),this.applyMatrix4(Do),this}scale(e,t,i){return Do.makeScale(e,t,i),this.applyMatrix4(Do),this}lookAt(e){return Yx.lookAt(e),Yx.updateMatrix(),this.applyMatrix4(Yx.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Wd).negate(),this.translate(Wd.x,Wd.y,Wd.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const i=[];for(let r=0,o=e.length;rt.count&&jt("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new kf);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Pn("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new xe(-1/0,-1/0,-1/0),new xe(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let i=0,r=t.length;i0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){const d=this.parameters;for(const p in d)d[p]!==void 0&&(e[p]=d[p]);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 d in i){const p=i[d];e.data.attributes[d]=p.toJSON(e.data)}const r={};let o=!1;for(const d in this.morphAttributes){const p=this.morphAttributes[d],m=[];for(let v=0,g=p.length;v0&&(r[d]=m,o=!0)}o&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const c=this.boundingSphere;return c!==null&&(e.data.boundingSphere=c.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const r=e.attributes;for(const p in r){const m=r[p];this.setAttribute(p,m.clone(t))}const o=e.morphAttributes;for(const p in o){const m=[],v=o[p];for(let g=0,y=v.length;g0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}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){jt(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){jt(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector2&&i&&i.isVector2||r&&r.isEuler&&i&&i.isEuler||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.7,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.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),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!==yh&&(i.blending=this.blending),this.side!==uc&&(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!==fS&&(i.blendSrc=this.blendSrc),this.blendDst!==dS&&(i.blendDst=this.blendDst),this.blendEquation!==cf&&(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!==Bh&&(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!==nC&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Id&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Id&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Id&&(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.allowOverride===!1&&(i.allowOverride=!1),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(o){const l=[];for(const c in o){const d=o[c];delete d.metadata,l.push(d)}return l}if(t){const o=r(e.textures),l=r(e.images);o.length>0&&(i.textures=o),l.length>0&&(i.images=l)}return i}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new bn().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),this.normalScale=new Dn().fromArray(i)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new Dn().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}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 o=0;o!==r;++o)i[o]=t[o].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.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const zl=new xe,qx=new xe,L0=new xe,Fu=new xe,Zx=new xe,I0=new xe,Kx=new xe;class Gb{constructor(e=new xe,t=new xe(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,zl)),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=zl.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(zl.copy(this.origin).addScaledVector(this.direction,t),zl.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){qx.copy(e).add(t).multiplyScalar(.5),L0.copy(t).sub(e).normalize(),Fu.copy(this.origin).sub(qx);const o=e.distanceTo(t)*.5,l=-this.direction.dot(L0),c=Fu.dot(this.direction),d=-Fu.dot(L0),p=Fu.lengthSq(),m=Math.abs(1-l*l);let v,g,y,E;if(m>0)if(v=l*d-c,g=l*c-d,E=o*m,v>=0)if(g>=-E)if(g<=E){const C=1/m;v*=C,g*=C,y=v*(v+l*g+2*c)+g*(l*v+g+2*d)+p}else g=o,v=Math.max(0,-(l*g+c)),y=-v*v+g*(g+2*d)+p;else g=-o,v=Math.max(0,-(l*g+c)),y=-v*v+g*(g+2*d)+p;else g<=-E?(v=Math.max(0,-(-l*o+c)),g=v>0?-o:Math.min(Math.max(-o,-d),o),y=-v*v+g*(g+2*d)+p):g<=E?(v=0,g=Math.min(Math.max(-o,-d),o),y=g*(g+2*d)+p):(v=Math.max(0,-(l*o+c)),g=v>0?o:Math.min(Math.max(-o,-d),o),y=-v*v+g*(g+2*d)+p);else g=l>0?-o:o,v=Math.max(0,-(l*g+c)),y=-v*v+g*(g+2*d)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,v),r&&r.copy(qx).addScaledVector(L0,g),y}intersectSphere(e,t){zl.subVectors(e.center,this.origin);const i=zl.dot(this.direction),r=zl.dot(zl)-i*i,o=e.radius*e.radius;if(r>o)return null;const l=Math.sqrt(o-r),c=i-l,d=i+l;return d<0?null:c<0?this.at(d,t):this.at(c,t)}intersectsSphere(e){return e.radius<0?!1: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,o,l,c,d;const p=1/this.direction.x,m=1/this.direction.y,v=1/this.direction.z,g=this.origin;return p>=0?(i=(e.min.x-g.x)*p,r=(e.max.x-g.x)*p):(i=(e.max.x-g.x)*p,r=(e.min.x-g.x)*p),m>=0?(o=(e.min.y-g.y)*m,l=(e.max.y-g.y)*m):(o=(e.max.y-g.y)*m,l=(e.min.y-g.y)*m),i>l||o>r||((o>i||isNaN(i))&&(i=o),(l=0?(c=(e.min.z-g.z)*v,d=(e.max.z-g.z)*v):(c=(e.max.z-g.z)*v,d=(e.min.z-g.z)*v),i>d||c>r)||((c>i||i!==i)&&(i=c),(d=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,zl)!==null}intersectTriangle(e,t,i,r,o){Zx.subVectors(t,e),I0.subVectors(i,e),Kx.crossVectors(Zx,I0);let l=this.direction.dot(Kx),c;if(l>0){if(r)return null;c=1}else if(l<0)c=-1,l=-l;else return null;Fu.subVectors(this.origin,e);const d=c*this.direction.dot(I0.crossVectors(Fu,I0));if(d<0)return null;const p=c*this.direction.dot(Zx.cross(Fu));if(p<0||d+p>l)return null;const m=-c*Fu.dot(Kx);return m<0?null:this.at(m/l,o)}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 SM extends fg{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new bn(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 Df,this.combine=wb,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 _C=new yi,tf=new Gb,k0=new cg,xC=new xe,O0=new xe,U0=new xe,F0=new xe,$x=new xe,z0=new xe,yC=new xe,B0=new xe;class Ho extends Gs{constructor(e=new wa,t=new SM){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,l=r.length;o(e.far-e.near)**2))&&(_C.copy(o).invert(),tf.copy(e.ray).applyMatrix4(_C),!(i.boundingBox!==null&&tf.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,tf)))}_computeIntersections(e,t,i){let r;const o=this.geometry,l=this.material,c=o.index,d=o.attributes.position,p=o.attributes.uv,m=o.attributes.uv1,v=o.attributes.normal,g=o.groups,y=o.drawRange;if(c!==null)if(Array.isArray(l))for(let E=0,C=g.length;Et.far?null:{distance:p,point:B0.clone(),object:n}}function V0(n,e,t,i,r,o,l,c,d,p){n.getVertexPosition(c,O0),n.getVertexPosition(d,U0),n.getVertexPosition(p,F0);const m=zF(n,e,t,i,O0,U0,F0,yC);if(m){const v=new xe;_a.getBarycoord(yC,O0,U0,F0,v),r&&(m.uv=_a.getInterpolatedAttribute(r,c,d,p,v,new Dn)),o&&(m.uv1=_a.getInterpolatedAttribute(o,c,d,p,v,new Dn)),l&&(m.normal=_a.getInterpolatedAttribute(l,c,d,p,v,new xe),m.normal.dot(i.direction)>0&&m.normal.multiplyScalar(-1));const g={a:c,b:d,c:p,normal:new xe,materialIndex:0};_a.getNormal(O0,U0,F0,g.normal),m.face=g,m.barycoord=v}return m}class Wb extends ts{constructor(e=null,t=1,i=1,r,o,l,c,d,p=kr,m=kr,v,g){super(null,l,c,d,p,m,r,o,v,g),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class SC extends Ma{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Xd=new yi,MC=new yi,H0=[],EC=new kf,BF=new yi,Jp=new Ho,em=new cg;class VF extends Ho{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new SC(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r1)?null:t.copy(e.start).addScaledVector(r,l)}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||GF.getNormalMatrix(e),r=this.coplanarPoint(Qx).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(o),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 nf=new cg,WF=new Dn(.5,.5),G0=new xe;class Xb{constructor(e=new uf,t=new uf,i=new uf,r=new uf,o=new uf,l=new uf){this.planes=[e,t,i,r,o,l]}set(e,t,i,r,o,l){const c=this.planes;return c[0].copy(e),c[1].copy(t),c[2].copy(i),c[3].copy(r),c[4].copy(o),c[5].copy(l),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=qa,i=!1){const r=this.planes,o=e.elements,l=o[0],c=o[1],d=o[2],p=o[3],m=o[4],v=o[5],g=o[6],y=o[7],E=o[8],C=o[9],w=o[10],M=o[11],P=o[12],I=o[13],D=o[14],L=o[15];if(r[0].setComponents(p-l,y-m,M-E,L-P).normalize(),r[1].setComponents(p+l,y+m,M+E,L+P).normalize(),r[2].setComponents(p+c,y+v,M+C,L+I).normalize(),r[3].setComponents(p-c,y-v,M-C,L-I).normalize(),i)r[4].setComponents(d,g,w,D).normalize(),r[5].setComponents(p-d,y-g,M-w,L-D).normalize();else if(r[4].setComponents(p-d,y-g,M-w,L-D).normalize(),t===qa)r[5].setComponents(p+d,y+g,M+w,L+D).normalize();else if(t===Wv)r[5].setComponents(d,g,w,D).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(),nf.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),nf.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(nf)}intersectsSprite(e){nf.center.set(0,0,0);const t=WF.distanceTo(e.center);return nf.radius=.7071067811865476+t,nf.applyMatrix4(e.matrixWorld),this.intersectsSphere(nf)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let o=0;o<6;o++)if(t[o].distanceToPoint(i)0?e.max.x:e.min.x,G0.y=r.normal.y>0?e.max.y:e.min.y,G0.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(G0)<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)}}class jb extends ts{constructor(e=[],t=Pf,i,r,o,l,c,d,p,m){super(e,t,i,r,o,l,c,d,p,m),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class XF extends ts{constructor(e,t,i,r,o,l,c,d,p){super(e,t,i,r,o,l,c,d,p),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Hh extends ts{constructor(e,t,i=tl,r,o,l,c=kr,d=kr,p,m=nu,v=1){if(m!==nu&&m!==gf)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const g={width:e,height:t,depth:v};super(g,r,o,l,c,d,m,i,p),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new yM(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class jF extends Hh{constructor(e,t=tl,i=Pf,r,o,l=kr,c=kr,d,p=nu){const m={width:e,height:e,depth:1},v=[m,m,m,m,m,m];super(e,e,t,i,r,o,l,c,d,p),this.image=v,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Yb extends ts{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class dg extends wa{constructor(e=1,t=1,i=1,r=1,o=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:l};const c=this;r=Math.floor(r),o=Math.floor(o),l=Math.floor(l);const d=[],p=[],m=[],v=[];let g=0,y=0;E("z","y","x",-1,-1,i,t,e,l,o,0),E("z","y","x",1,-1,i,t,-e,l,o,1),E("x","z","y",1,1,e,i,t,r,l,2),E("x","z","y",1,-1,e,i,-t,r,l,3),E("x","y","z",1,-1,e,t,i,r,o,4),E("x","y","z",-1,-1,e,t,-i,r,o,5),this.setIndex(d),this.setAttribute("position",new Ss(p,3)),this.setAttribute("normal",new Ss(m,3)),this.setAttribute("uv",new Ss(v,2));function E(C,w,M,P,I,D,L,O,U,b,F){const H=D/U,W=L/b,Y=D/2,le=L/2,pe=O/2,ee=U+1,ce=b+1;let $=0,X=0;const Q=new xe;for(let B=0;B0?1:-1,m.push(Q.x,Q.y,Q.z),v.push(te/U),v.push(1-B/b),$+=1}}for(let B=0;B0)&&y.push(I,D,O),(M!==i-1||d0&&(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}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(const i in e.uniforms){const r=e.uniforms[i];switch(this.uniforms[i]={},r.type){case"t":this.uniforms[i].value=t[r.value]||null;break;case"c":this.uniforms[i].value=new bn().setHex(r.value);break;case"v2":this.uniforms[i].value=new Dn().fromArray(r.value);break;case"v3":this.uniforms[i].value=new xe().fromArray(r.value);break;case"v4":this.uniforms[i].value=new Li().fromArray(r.value);break;case"m3":this.uniforms[i].value=new tn().fromArray(r.value);break;case"m4":this.uniforms[i].value=new yi().fromArray(r.value);break;default:this.uniforms[i].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(const i in e.extensions)this.extensions[i]=e.extensions[i];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}}class $F extends nl{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class QF extends fg{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=lF,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 JF extends fg{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}}class ez extends fg{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new bn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=QS,this.normalScale=new Dn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,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.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}const W0=new xe,X0=new Yh,za=new xe;class wM extends Gs{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new yi,this.projectionMatrix=new yi,this.projectionMatrixInverse=new yi,this.coordinateSystem=qa,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(W0,X0,za),za.x===1&&za.y===1&&za.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(W0,X0,za.set(1,1,1)).invert()}updateWorldMatrix(e,t,i=!1){super.updateWorldMatrix(e,t,i),this.matrixWorld.decompose(W0,X0,za),za.x===1&&za.y===1&&za.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(W0,X0,za.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const zu=new xe,TC=new Dn,CC=new Dn;class Uo extends wM{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=JS*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Px*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return JS*2*Math.atan(Math.tan(Px*.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){zu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(zu.x,zu.y).multiplyScalar(-e/zu.z),zu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(zu.x,zu.y).multiplyScalar(-e/zu.z)}getViewSize(e,t){return this.getViewBounds(e,TC,CC),t.subVectors(CC,TC)}setViewOffset(e,t,i,r,o,l){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=o,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Px*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,o=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const d=l.fullWidth,p=l.fullHeight;o+=l.offsetX*r/d,t-=l.offsetY*i/p,r*=l.width/d,i*=l.height/p}const c=this.filmOffset;c!==0&&(o+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),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}}class TM extends wM{constructor(e=-1,t=1,i=1,r=-1,o=.1,l=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=o,this.far=l,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,o,l){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=o,this.view.height=l,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 o=i-e,l=i+e,c=r+t,d=r-t;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=p*this.view.offsetX,l=o+p*this.view.width,c-=m*this.view.offsetY,d=c-m*this.view.height}this.projectionMatrix.makeOrthographic(o,l,c,d,this.near,this.far,this.coordinateSystem,this.reversedDepth),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 jd=-90,Yd=1;class tz extends Gs{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Uo(jd,Yd,e,t);r.layers=this.layers,this.add(r);const o=new Uo(jd,Yd,e,t);o.layers=this.layers,this.add(o);const l=new Uo(jd,Yd,e,t);l.layers=this.layers,this.add(l);const c=new Uo(jd,Yd,e,t);c.layers=this.layers,this.add(c);const d=new Uo(jd,Yd,e,t);d.layers=this.layers,this.add(d);const p=new Uo(jd,Yd,e,t);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,o,l,c,d]=t;for(const p of t)this.remove(p);if(e===qa)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),c.up.set(0,1,0),c.lookAt(0,0,1),d.up.set(0,1,0),d.lookAt(0,0,-1);else if(e===Wv)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),c.up.set(0,-1,0),c.lookAt(0,0,1),d.up.set(0,-1,0),d.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const p of t)this.add(p),p.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[o,l,c,d,p,m]=this.children,v=e.getRenderTarget(),g=e.getActiveCubeFace(),y=e.getActiveMipmapLevel(),E=e.xr.enabled;e.xr.enabled=!1;const C=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let w=!1;e.isWebGLRenderer===!0?w=e.state.buffers.depth.getReversed():w=e.reversedDepthBuffer,e.setRenderTarget(i,0,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(i,1,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(i,2,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),e.setRenderTarget(i,3,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,d),e.setRenderTarget(i,4,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,p),i.texture.generateMipmaps=C,e.setRenderTarget(i,5,r),w&&e.autoClear===!1&&e.clearDepth(),e.render(t,m),e.setRenderTarget(v,g,y),e.xr.enabled=E,i.texture.needsPMREMUpdate=!0}}class nz extends Uo{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const AC=new yi;class iz{constructor(e,t,i=0,r=1/0){this.ray=new Gb(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Eh,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,t.projectionMatrix.elements[14]).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Pn("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return AC.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(AC),this}intersectObject(e,t=!0,i=[]){return e1(e,this,i,t),i.sort(RC),i}intersectObjects(e,t=!0,i=[]){for(let r=0,o=e.length;ry.start-E.start);let g=0;for(let y=1;y 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`,Ez=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,wz=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,Tz=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,Cz=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #endif`,Az=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) varying vec4 vColor; #endif`,Rz=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) varying vec4 vColor; #endif`,Pz=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) vColor = vec4( 1.0 ); #endif #ifdef USE_COLOR_ALPHA vColor *= color; #elif defined( USE_COLOR ) vColor.rgb *= color; #endif #ifdef USE_INSTANCING_COLOR vColor.rgb *= instanceColor.rgb; #endif #ifdef USE_BATCHING_COLOR vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); #endif`,bz=`#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 ); } #define inverseTransformDirection transformDirectionByInverseViewMatrix vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) { return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz ); } vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) { return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz ); } 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`,Dz=`#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`,Nz=`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; #endif`,Lz=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,Iz=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); #endif`,kz=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE emissiveColor = sRGBTransferEOTF( emissiveColor ); #endif totalEmissiveRadiance *= emissiveColor.rgb; #endif`,Oz=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,Uz="gl_FragColor = linearToOutputTexel( gl_FragColor );",Fz=`vec4 LinearTransferOETF( in vec4 value ) { return value; } vec4 sRGBTransferEOTF( in vec4 value ) { return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); } 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 ); }`,zz=`#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 = transformNormalByInverseViewMatrix( 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 * reflectVec ); #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 #endif`,Bz=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform mat3 envMapRotation; #ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #else uniform sampler2D envMap; #endif #endif`,Vz=`#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`,Hz=`#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`,Gz=`#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 = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); #ifdef ENVMAP_MODE_REFLECTION vReflect = reflect( cameraToVertex, worldNormal ); #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif #endif`,Wz=`#ifdef USE_FOG vFogDepth = - mvPosition.z; #endif`,Xz=`#ifdef USE_FOG varying float vFogDepth; #endif`,jz=`#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`,Yz=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,qz=`#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 }`,Zz=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,Kz=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularStrength = specularStrength;`,$z=`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`,Qz=`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 = transformNormalByInverseViewMatrix( 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 #include `,Jz=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = transformNormalByInverseViewMatrix( 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, pow4( roughness ) ) ); reflectVec = transformDirectionByInverseViewMatrix( 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`,e4=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,t4=`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`,n4=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,i4=`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`,r4=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb; material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); material.metalness = 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 = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); #else material.specularColor = vec3( 0.04 ); material.specularColorBlended = mix( material.specularColor, 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.0001, 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`,s4=`uniform sampler2D dfgLUT; struct PhysicalMaterial { vec3 diffuseColor; vec3 diffuseContribution; vec3 specularColor; vec3 specularColorBlended; float roughness; float metalness; 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; vec3 iridescenceFresnelDielectric; vec3 iridescenceFresnelMetallic; #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 ) ); return 0.5 / max( gv + gl, EPSILON ); } 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.specularColorBlended; 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 * transpose( 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 rInv = 1.0 / ( roughness + 0.1 ); float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; float DG = exp( a * dotNV + b ); return saturate( DG ); } vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { float dotNV = saturate( dot( normal, viewDir ) ); vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 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 float dotNV = saturate( dot( normal, viewDir ) ); vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; #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; } vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); float dotNL = saturate( dot( normal, lightDir ) ); float dotNV = saturate( dot( normal, viewDir ) ); vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; float Ess_V = dfgV.x + dfgV.y; float Ess_L = dfgL.x + dfgL.y; float Ems_V = 1.0 - Ess_V; float Ems_L = 1.0 - Ess_L; vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); float compensationFactor = Ems_V * Ems_L; vec3 multiScatter = Fms * compensationFactor; return singleScatter + multiScatter; } #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.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); #ifdef USE_CLEARCOAT vec3 Ncc = geometryClearcoatNormal; vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); mat3 mInvClearcoat = mat3( vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), vec3( 0, 1, 0 ), vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) ); vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); #endif } #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 ); float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); irradiance *= sheenEnergyComp; #endif reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); } 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 ) { vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); #ifdef USE_SHEEN float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; diffuse *= sheenEnergyComp; #endif reflectedLight.indirectDiffuse += diffuse; } 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 ) * RECIPROCAL_PI; #endif vec3 singleScatteringDielectric = vec3( 0.0 ); vec3 multiScatteringDielectric = vec3( 0.0 ); vec3 singleScatteringMetallic = vec3( 0.0 ); vec3 multiScatteringMetallic = vec3( 0.0 ); #ifdef USE_IRIDESCENCE computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); #else computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); #endif vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; vec3 indirectSpecular = radiance * singleScattering; indirectSpecular += multiScattering * cosineWeightedIrradiance; vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; #ifdef USE_SHEEN float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; indirectSpecular *= sheenEnergyComp; indirectDiffuse *= sheenEnergyComp; #endif reflectedLight.indirectSpecular += indirectSpecular; reflectedLight.indirectDiffuse += indirectDiffuse; } #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 ); }`,o4=` 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.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 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 ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 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 #ifdef USE_LIGHT_PROBES_GRID vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix ); irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); #endif #endif #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); #endif`,a4=`#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( ENVMAP_TYPE_CUBE_UV ) #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) iblIrradiance += getIBLIrradiance( geometryNormal ); #endif #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`,l4=`#if defined( RE_IndirectDiffuse ) #if defined( LAMBERT ) || defined( PHONG ) irradiance += iblIrradiance; #endif 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`,u4=`#ifdef USE_LIGHT_PROBES_GRID uniform highp sampler3D probesSH; uniform vec3 probesMin; uniform vec3 probesMax; uniform vec3 probesResolution; vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { vec3 res = probesResolution; vec3 gridRange = probesMax - probesMin; vec3 resMinusOne = res - 1.0; vec3 probeSpacing = gridRange / resMinusOne; vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); uvw = uvw * resMinusOne / res + 0.5 / res; float nz = res.z; float paddedSlices = nz + 2.0; float atlasDepth = 7.0 * paddedSlices; float uvZBase = uvw.z * nz + 1.0; vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); vec3 c0 = s0.xyz; vec3 c1 = vec3( s0.w, s1.xy ); vec3 c2 = vec3( s1.zw, s2.x ); vec3 c3 = s2.yzw; vec3 c4 = s3.xyz; vec3 c5 = vec3( s3.w, s4.xy ); vec3 c6 = vec3( s4.zw, s5.x ); vec3 c7 = s5.yzw; vec3 c8 = s6.xyz; float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; vec3 result = c0 * 0.886227; result += c1 * 2.0 * 0.511664 * y; result += c2 * 2.0 * 0.511664 * z; result += c3 * 2.0 * 0.511664 * x; result += c4 * 2.0 * 0.429043 * x * y; result += c5 * 2.0 * 0.429043 * y * z; result += c6 * ( 0.743125 * z * z - 0.247708 ); result += c7 * 2.0 * 0.429043 * x * z; result += c8 * 0.429043 * ( x * x - y * y ); return max( result, vec3( 0.0 ) ); } #endif`,c4=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,f4=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,d4=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER varying float vFragDepth; varying float vIsPerspective; #endif`,h4=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); #endif`,p4=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); #endif diffuseColor *= sampledDiffuseColor; #endif`,m4=`#ifdef USE_MAP uniform sampler2D map; #endif`,g4=`#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`,v4=`#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`,_4=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; #endif`,x4=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,y4=`#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`,S4=`#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`,M4=`#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`,E4=`#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`,w4=`#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`,T4=`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 #ifdef DOUBLE_SIDED 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 #ifdef DOUBLE_SIDED tbn2[0] *= faceDirection; tbn2[1] *= faceDirection; #endif #endif vec3 nonPerturbedNormal = normal;`,C4=`#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; #if defined( USE_PACKED_NORMALMAP ) mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); #endif mapN.xy *= normalScale; normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); #endif`,A4=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,R4=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif #endif`,P4=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #ifdef FLIP_SIDED vBitangent = - vBitangent; #endif #endif #endif`,b4=`#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`,D4=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; #endif`,N4=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); #endif`,L4=`#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`,I4=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; #endif`,k4=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,O4=`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 ) { #ifdef USE_REVERSED_DEPTH_BUFFER return depth * ( far - near ) - far; #else return depth * ( near - far ) - near; #endif } 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 ) { #ifdef USE_REVERSED_DEPTH_BUFFER return ( near * far ) / ( ( near - far ) * depth - near ); #else return ( near * far ) / ( ( far - near ) * depth - far ); #endif }`,U4=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,F4=`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;`,z4=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,B4=`#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`,V4=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; #endif`,H4=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,G4=`#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 #if defined( SHADOWMAP_TYPE_PCF ) uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; #else uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; #endif 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 #if defined( SHADOWMAP_TYPE_PCF ) uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; #else uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; #endif 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 #if defined( SHADOWMAP_TYPE_PCF ) uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; #elif defined( SHADOWMAP_TYPE_BASIC ) uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; #endif 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 #if defined( SHADOWMAP_TYPE_PCF ) float interleavedGradientNoise( vec2 position ) { return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); } vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { const float goldenAngle = 2.399963229728653; float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); float theta = float( sampleIndex ) * goldenAngle + phi; return vec2( cos( theta ), sin( theta ) ) * r; } #endif #if defined( SHADOWMAP_TYPE_PCF ) float getShadow( sampler2DShadow 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 ) { vec2 texelSize = vec2( 1.0 ) / shadowMapSize; float radius = shadowRadius * texelSize.x; float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; shadow = ( texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) ) * 0.2; } return mix( 1.0, shadow, shadowIntensity ); } #elif defined( SHADOWMAP_TYPE_VSM ) float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; #ifdef USE_REVERSED_DEPTH_BUFFER shadowCoord.z -= shadowBias; #else shadowCoord.z += shadowBias; #endif 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 ) { vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; float mean = distribution.x; float variance = distribution.y * distribution.y; #ifdef USE_REVERSED_DEPTH_BUFFER float hard_shadow = step( mean, shadowCoord.z ); #else float hard_shadow = step( shadowCoord.z, mean ); #endif if ( hard_shadow == 1.0 ) { shadow = 1.0; } else { variance = max( variance, 0.0000001 ); float d = shadowCoord.z - mean; float p_max = variance / ( variance + d * d ); p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); shadow = max( hard_shadow, p_max ); } } return mix( 1.0, shadow, shadowIntensity ); } #else float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { float shadow = 1.0; shadowCoord.xyz /= shadowCoord.w; #ifdef USE_REVERSED_DEPTH_BUFFER shadowCoord.z -= shadowBias; #else shadowCoord.z += shadowBias; #endif 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 ) { float depth = texture2D( shadowMap, shadowCoord.xy ).r; #ifdef USE_REVERSED_DEPTH_BUFFER shadow = step( depth, shadowCoord.z ); #else shadow = step( shadowCoord.z, depth ); #endif } return mix( 1.0, shadow, shadowIntensity ); } #endif #if NUM_POINT_LIGHT_SHADOWS > 0 #if defined( SHADOWMAP_TYPE_PCF ) float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { float shadow = 1.0; vec3 lightToPosition = shadowCoord.xyz; vec3 bd3D = normalize( lightToPosition ); vec3 absVec = abs( lightToPosition ); float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { #ifdef USE_REVERSED_DEPTH_BUFFER float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); dp -= shadowBias; #else float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); dp += shadowBias; #endif float texelSize = shadowRadius / shadowMapSize.x; vec3 absDir = abs( bd3D ); vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); tangent = normalize( cross( bd3D, tangent ) ); vec3 bitangent = cross( bd3D, tangent ); float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; vec2 sample0 = vogelDiskSample( 0, 5, phi ); vec2 sample1 = vogelDiskSample( 1, 5, phi ); vec2 sample2 = vogelDiskSample( 2, 5, phi ); vec2 sample3 = vogelDiskSample( 3, 5, phi ); vec2 sample4 = vogelDiskSample( 4, 5, phi ); shadow = ( texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) ) * 0.2; } return mix( 1.0, shadow, shadowIntensity ); } #elif defined( SHADOWMAP_TYPE_BASIC ) float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { float shadow = 1.0; vec3 lightToPosition = shadowCoord.xyz; vec3 absVec = abs( lightToPosition ); float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); dp += shadowBias; vec3 bd3D = normalize( lightToPosition ); float depth = textureCube( shadowMap, bd3D ).r; #ifdef USE_REVERSED_DEPTH_BUFFER depth = 1.0 - depth; #endif shadow = step( dp, depth ); } return mix( 1.0, shadow, shadowIntensity ); } #endif #endif #endif`,W4=`#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`,X4=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) #ifdef HAS_NORMAL vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); #else vec3 shadowWorldNormal = vec3( 0.0 ); #endif 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`,j4=`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 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 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; }`,Y4=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,q4=`#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`,Z4=`#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`,K4=`#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`,$4=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,Q4=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,J4=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,eB=`#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 CineonToneMapping( 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; }`,tB=`#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 = transformNormalByInverseViewMatrix( normal, viewMatrix ); vec4 transmitted = getIBLVolumeRefraction( n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, 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`,nB=`#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`,iB=`#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`,rB=`#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`,sB=`#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`,oB=`#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 aB=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,lB=`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 }`,uB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,cB=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; #endif uniform float backgroundBlurriness; uniform float backgroundIntensity; uniform mat3 backgroundRotation; varying vec3 vWorldDirection; #include void main() { #ifdef ENVMAP_TYPE_CUBE vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); #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 }`,fB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,dB=`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 }`,hB=`#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; }`,pB=`#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 #ifdef USE_REVERSED_DEPTH_BUFFER float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; #else float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; #endif #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 }`,mB=`#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; }`,gB=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; varying vec3 vWorldPosition; #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 = vec4( dist, 0.0, 0.0, 1.0 ); }`,vB=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,_B=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { vec3 direction = normalize( vWorldDirection ); vec2 sampleUV = equirectUv( direction ); gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include }`,xB=`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 }`,yB=`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 }`,SB=`#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 }`,MB=`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 }`,EB=`#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 }`,wB=`#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 #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 }`,TB=`#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; }`,CB=`#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 }`,AB=`#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 }`,RB=`#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 void main() { vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); #include #include #include #include gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); #ifdef OPAQUE gl_FragColor.a = 1.0; #endif }`,PB=`#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 }`,bB=`#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 #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 }`,DB=`#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 }`,NB=`#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 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 outgoingLight = outgoingLight + 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 }`,LB=`#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 }`,IB=`#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 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 }`,kB=`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 }`,OB=`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 }`,UB=`#include #include #include #include #include #include #include void main() { #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include }`,FB=`uniform vec3 color; uniform float opacity; #include #include #include #include #include #include #include void main() { #include gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); #include #include #include #include }`,zB=`uniform float rotation; uniform vec2 center; #include #include #include #include #include void main() { #include vec4 mvPosition = modelViewMatrix[ 3 ]; vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); #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 }`,BB=`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 }`,cn={alphahash_fragment:az,alphahash_pars_fragment:lz,alphamap_fragment:uz,alphamap_pars_fragment:cz,alphatest_fragment:fz,alphatest_pars_fragment:dz,aomap_fragment:hz,aomap_pars_fragment:pz,batching_pars_vertex:mz,batching_vertex:gz,begin_vertex:vz,beginnormal_vertex:_z,bsdfs:xz,iridescence_fragment:yz,bumpmap_pars_fragment:Sz,clipping_planes_fragment:Mz,clipping_planes_pars_fragment:Ez,clipping_planes_pars_vertex:wz,clipping_planes_vertex:Tz,color_fragment:Cz,color_pars_fragment:Az,color_pars_vertex:Rz,color_vertex:Pz,common:bz,cube_uv_reflection_fragment:Dz,defaultnormal_vertex:Nz,displacementmap_pars_vertex:Lz,displacementmap_vertex:Iz,emissivemap_fragment:kz,emissivemap_pars_fragment:Oz,colorspace_fragment:Uz,colorspace_pars_fragment:Fz,envmap_fragment:zz,envmap_common_pars_fragment:Bz,envmap_pars_fragment:Vz,envmap_pars_vertex:Hz,envmap_physical_pars_fragment:Jz,envmap_vertex:Gz,fog_vertex:Wz,fog_pars_vertex:Xz,fog_fragment:jz,fog_pars_fragment:Yz,gradientmap_pars_fragment:qz,lightmap_pars_fragment:Zz,lights_lambert_fragment:Kz,lights_lambert_pars_fragment:$z,lights_pars_begin:Qz,lights_toon_fragment:e4,lights_toon_pars_fragment:t4,lights_phong_fragment:n4,lights_phong_pars_fragment:i4,lights_physical_fragment:r4,lights_physical_pars_fragment:s4,lights_fragment_begin:o4,lights_fragment_maps:a4,lights_fragment_end:l4,lightprobes_pars_fragment:u4,logdepthbuf_fragment:c4,logdepthbuf_pars_fragment:f4,logdepthbuf_pars_vertex:d4,logdepthbuf_vertex:h4,map_fragment:p4,map_pars_fragment:m4,map_particle_fragment:g4,map_particle_pars_fragment:v4,metalnessmap_fragment:_4,metalnessmap_pars_fragment:x4,morphinstance_vertex:y4,morphcolor_vertex:S4,morphnormal_vertex:M4,morphtarget_pars_vertex:E4,morphtarget_vertex:w4,normal_fragment_begin:T4,normal_fragment_maps:C4,normal_pars_fragment:A4,normal_pars_vertex:R4,normal_vertex:P4,normalmap_pars_fragment:b4,clearcoat_normal_fragment_begin:D4,clearcoat_normal_fragment_maps:N4,clearcoat_pars_fragment:L4,iridescence_pars_fragment:I4,opaque_fragment:k4,packing:O4,premultiplied_alpha_fragment:U4,project_vertex:F4,dithering_fragment:z4,dithering_pars_fragment:B4,roughnessmap_fragment:V4,roughnessmap_pars_fragment:H4,shadowmap_pars_fragment:G4,shadowmap_pars_vertex:W4,shadowmap_vertex:X4,shadowmask_pars_fragment:j4,skinbase_vertex:Y4,skinning_pars_vertex:q4,skinning_vertex:Z4,skinnormal_vertex:K4,specularmap_fragment:$4,specularmap_pars_fragment:Q4,tonemapping_fragment:J4,tonemapping_pars_fragment:eB,transmission_fragment:tB,transmission_pars_fragment:nB,uv_pars_fragment:iB,uv_pars_vertex:rB,uv_vertex:sB,worldpos_vertex:oB,background_vert:aB,background_frag:lB,backgroundCube_vert:uB,backgroundCube_frag:cB,cube_vert:fB,cube_frag:dB,depth_vert:hB,depth_frag:pB,distance_vert:mB,distance_frag:gB,equirect_vert:vB,equirect_frag:_B,linedashed_vert:xB,linedashed_frag:yB,meshbasic_vert:SB,meshbasic_frag:MB,meshlambert_vert:EB,meshlambert_frag:wB,meshmatcap_vert:TB,meshmatcap_frag:CB,meshnormal_vert:AB,meshnormal_frag:RB,meshphong_vert:PB,meshphong_frag:bB,meshphysical_vert:DB,meshphysical_frag:NB,meshtoon_vert:LB,meshtoon_frag:IB,points_vert:kB,points_frag:OB,shadow_vert:UB,shadow_frag:FB,sprite_vert:zB,sprite_frag:BB},ft={common:{diffuse:{value:new bn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new tn},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new tn}},envmap:{envMap:{value:null},envMapRotation:{value:new tn},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new tn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new tn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new tn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new tn},normalScale:{value:new Dn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new tn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new tn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new tn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new tn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new bn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new xe},probesMax:{value:new xe},probesResolution:{value:new xe}},points:{diffuse:{value:new bn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0},uvTransform:{value:new tn}},sprite:{diffuse:{value:new bn(16777215)},opacity:{value:1},center:{value:new Dn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new tn},alphaMap:{value:null},alphaMapTransform:{value:new tn},alphaTest:{value:0}}},Ga={basic:{uniforms:gs([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.fog]),vertexShader:cn.meshbasic_vert,fragmentShader:cn.meshbasic_frag},lambert:{uniforms:gs([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new bn(0)},envMapIntensity:{value:1}}]),vertexShader:cn.meshlambert_vert,fragmentShader:cn.meshlambert_frag},phong:{uniforms:gs([ft.common,ft.specularmap,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,ft.lights,{emissive:{value:new bn(0)},specular:{value:new bn(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:cn.meshphong_vert,fragmentShader:cn.meshphong_frag},standard:{uniforms:gs([ft.common,ft.envmap,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.roughnessmap,ft.metalnessmap,ft.fog,ft.lights,{emissive:{value:new bn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag},toon:{uniforms:gs([ft.common,ft.aomap,ft.lightmap,ft.emissivemap,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.gradientmap,ft.fog,ft.lights,{emissive:{value:new bn(0)}}]),vertexShader:cn.meshtoon_vert,fragmentShader:cn.meshtoon_frag},matcap:{uniforms:gs([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,ft.fog,{matcap:{value:null}}]),vertexShader:cn.meshmatcap_vert,fragmentShader:cn.meshmatcap_frag},points:{uniforms:gs([ft.points,ft.fog]),vertexShader:cn.points_vert,fragmentShader:cn.points_frag},dashed:{uniforms:gs([ft.common,ft.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cn.linedashed_vert,fragmentShader:cn.linedashed_frag},depth:{uniforms:gs([ft.common,ft.displacementmap]),vertexShader:cn.depth_vert,fragmentShader:cn.depth_frag},normal:{uniforms:gs([ft.common,ft.bumpmap,ft.normalmap,ft.displacementmap,{opacity:{value:1}}]),vertexShader:cn.meshnormal_vert,fragmentShader:cn.meshnormal_frag},sprite:{uniforms:gs([ft.sprite,ft.fog]),vertexShader:cn.sprite_vert,fragmentShader:cn.sprite_frag},background:{uniforms:{uvTransform:{value:new tn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:cn.background_vert,fragmentShader:cn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new tn}},vertexShader:cn.backgroundCube_vert,fragmentShader:cn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:cn.cube_vert,fragmentShader:cn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cn.equirect_vert,fragmentShader:cn.equirect_frag},distance:{uniforms:gs([ft.common,ft.displacementmap,{referencePosition:{value:new xe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cn.distance_vert,fragmentShader:cn.distance_frag},shadow:{uniforms:gs([ft.lights,ft.fog,{color:{value:new bn(0)},opacity:{value:1}}]),vertexShader:cn.shadow_vert,fragmentShader:cn.shadow_frag}};Ga.physical={uniforms:gs([Ga.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new tn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new tn},clearcoatNormalScale:{value:new Dn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new tn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new tn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new tn},sheen:{value:0},sheenColor:{value:new bn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new tn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new tn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new tn},transmissionSamplerSize:{value:new Dn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new tn},attenuationDistance:{value:0},attenuationColor:{value:new bn(0)},specularColor:{value:new bn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new tn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new tn},anisotropyVector:{value:new Dn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new tn}}]),vertexShader:cn.meshphysical_vert,fragmentShader:cn.meshphysical_frag};const j0={r:0,b:0,g:0},VB=new yi,Kb=new tn;Kb.set(-1,0,0,0,1,0,0,0,1);function HB(n,e,t,i,r,o){const l=new bn(0);let c=r===!0?0:1,d,p,m=null,v=0,g=null;function y(P){let I=P.isScene===!0?P.background:null;if(I&&I.isTexture){const D=P.backgroundBlurriness>0;I=e.get(I,D)}return I}function E(P){let I=!1;const D=y(P);D===null?w(l,c):D&&D.isColor&&(w(D,1),I=!0);const L=n.xr.getEnvironmentBlendMode();L==="additive"?t.buffers.color.setClear(0,0,0,1,o):L==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,o),(n.autoClear||I)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function C(P,I){const D=y(I);D&&(D.isCubeTexture||D.mapping===l_)?(p===void 0&&(p=new Ho(new dg(1,1,1),new nl({name:"BackgroundCubeMaterial",uniforms:Gh(Ga.backgroundCube.uniforms),vertexShader:Ga.backgroundCube.vertexShader,fragmentShader:Ga.backgroundCube.fragmentShader,side:Hs,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(L,O,U){this.matrixWorld.copyPosition(U.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(p)),p.material.uniforms.envMap.value=D,p.material.uniforms.backgroundBlurriness.value=I.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=I.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(VB.makeRotationFromEuler(I.backgroundRotation)).transpose(),D.isCubeTexture&&D.isRenderTargetTexture===!1&&p.material.uniforms.backgroundRotation.value.premultiply(Kb),p.material.toneMapped=En.getTransfer(D.colorSpace)!==Zn,(m!==D||v!==D.version||g!==n.toneMapping)&&(p.material.needsUpdate=!0,m=D,v=D.version,g=n.toneMapping),p.layers.enableAll(),P.unshift(p,p.geometry,p.material,0,0,null)):D&&D.isTexture&&(d===void 0&&(d=new Ho(new u_(2,2),new nl({name:"BackgroundMaterial",uniforms:Gh(Ga.background.uniforms),vertexShader:Ga.background.vertexShader,fragmentShader:Ga.background.fragmentShader,side:uc,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(d)),d.material.uniforms.t2D.value=D,d.material.uniforms.backgroundIntensity.value=I.backgroundIntensity,d.material.toneMapped=En.getTransfer(D.colorSpace)!==Zn,D.matrixAutoUpdate===!0&&D.updateMatrix(),d.material.uniforms.uvTransform.value.copy(D.matrix),(m!==D||v!==D.version||g!==n.toneMapping)&&(d.material.needsUpdate=!0,m=D,v=D.version,g=n.toneMapping),d.layers.enableAll(),P.unshift(d,d.geometry,d.material,0,0,null))}function w(P,I){P.getRGB(j0,qb(n)),t.buffers.color.setClear(j0.r,j0.g,j0.b,I,o)}function M(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}return{getClearColor:function(){return l},setClearColor:function(P,I=1){l.set(P),c=I,w(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(P){c=P,w(l,c)},render:E,addToRenderList:C,dispose:M}}function GB(n,e){const t=n.getParameter(n.MAX_VERTEX_ATTRIBS),i={},r=g(null);let o=r,l=!1;function c(W,Y,le,pe,ee){let ce=!1;const $=v(W,pe,le,Y);o!==$&&(o=$,p(o.object)),ce=y(W,pe,le,ee),ce&&E(W,pe,le,ee),ee!==null&&e.update(ee,n.ELEMENT_ARRAY_BUFFER),(ce||l)&&(l=!1,D(W,Y,le,pe),ee!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(ee).buffer))}function d(){return n.createVertexArray()}function p(W){return n.bindVertexArray(W)}function m(W){return n.deleteVertexArray(W)}function v(W,Y,le,pe){const ee=pe.wireframe===!0;let ce=i[Y.id];ce===void 0&&(ce={},i[Y.id]=ce);const $=W.isInstancedMesh===!0?W.id:0;let X=ce[$];X===void 0&&(X={},ce[$]=X);let Q=X[le.id];Q===void 0&&(Q={},X[le.id]=Q);let B=Q[ee];return B===void 0&&(B=g(d()),Q[ee]=B),B}function g(W){const Y=[],le=[],pe=[];for(let ee=0;ee=0){const G=ee[Q];let te=ce[Q];if(te===void 0&&(Q==="instanceMatrix"&&W.instanceMatrix&&(te=W.instanceMatrix),Q==="instanceColor"&&W.instanceColor&&(te=W.instanceColor)),G===void 0||G.attribute!==te||te&&G.data!==te.data)return!0;$++}return o.attributesNum!==$||o.index!==pe}function E(W,Y,le,pe){const ee={},ce=Y.attributes;let $=0;const X=le.getAttributes();for(const Q in X)if(X[Q].location>=0){let G=ce[Q];G===void 0&&(Q==="instanceMatrix"&&W.instanceMatrix&&(G=W.instanceMatrix),Q==="instanceColor"&&W.instanceColor&&(G=W.instanceColor));const te={};te.attribute=G,G&&G.data&&(te.data=G.data),ee[Q]=te,$++}o.attributes=ee,o.attributesNum=$,o.index=pe}function C(){const W=o.newAttributes;for(let Y=0,le=W.length;Y=0){let B=ee[X];if(B===void 0&&(X==="instanceMatrix"&&W.instanceMatrix&&(B=W.instanceMatrix),X==="instanceColor"&&W.instanceColor&&(B=W.instanceColor)),B!==void 0){const G=B.normalized,te=B.itemSize,Oe=e.get(B);if(Oe===void 0)continue;const We=Oe.buffer,qe=Oe.type,fe=Oe.bytesPerElement,Ae=qe===n.INT||qe===n.UNSIGNED_INT||B.gpuType===fM;if(B.isInterleavedBufferAttribute){const Te=B.data,Ze=Te.stride,pt=B.offset;if(Te.isInstancedInterleavedBuffer){for(let ot=0;ot0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";U="mediump"}return U==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=t.precision!==void 0?t.precision:"highp";const m=d(p);m!==p&&(jt("WebGLRenderer:",p,"not supported, using",m,"instead."),p=m);const v=t.logarithmicDepthBuffer===!0,g=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&g===!1&&jt("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const y=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),E=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),C=n.getParameter(n.MAX_TEXTURE_SIZE),w=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),M=n.getParameter(n.MAX_VERTEX_ATTRIBS),P=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),I=n.getParameter(n.MAX_VARYING_VECTORS),D=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),L=n.getParameter(n.MAX_SAMPLES),O=n.getParameter(n.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:o,getMaxPrecision:d,textureFormatReadable:l,textureTypeReadable:c,precision:p,logarithmicDepthBuffer:v,reversedDepthBuffer:g,maxTextures:y,maxVertexTextures:E,maxTextureSize:C,maxCubemapSize:w,maxAttributes:M,maxVertexUniforms:P,maxVaryings:I,maxFragmentUniforms:D,maxSamples:L,samples:O}}function jB(n){const e=this;let t=null,i=0,r=!1,o=!1;const l=new uf,c=new tn,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(v,g){const y=v.length!==0||g||i!==0||r;return r=g,i=v.length,y},this.beginShadows=function(){o=!0,m(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(v,g){t=m(v,g,0)},this.setState=function(v,g,y){const E=v.clippingPlanes,C=v.clipIntersection,w=v.clipShadows,M=n.get(v);if(!r||E===null||E.length===0||o&&!w)o?m(null):p();else{const P=o?0:i,I=P*4;let D=M.clippingState||null;d.value=D,D=m(E,g,I,y);for(let L=0;L!==I;++L)D[L]=t[L];M.clippingState=D,this.numIntersection=C?this.numPlanes:0,this.numPlanes+=P}};function p(){d.value!==t&&(d.value=t,d.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function m(v,g,y,E){const C=v!==null?v.length:0;let w=null;if(C!==0){if(w=d.value,E!==!0||w===null){const M=y+C*4,P=g.matrixWorldInverse;c.getNormalMatrix(P),(w===null||w.length0&&this._blur(d,0,0,t),this._applyPMREM(d),this._cleanup(d),d}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=OC(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=kC(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?L:0,L,L),v.setRenderTarget(r),M&&v.render(C,d),v.render(e,d)}v.toneMapping=y,v.autoClear=g,e.background=P}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===Pf||e.mapping===Vh;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=OC()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=kC());const o=r?this._cubemapMaterial:this._equirectMaterial,l=this._lodMeshes[0];l.material=o;const c=o.uniforms;c.envMap.value=e;const d=this._cubeSize;qd(t,0,0,3*d,2*d),i.setRenderTarget(t),i.render(l,tm)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;const r=this._lodMeshes.length;for(let o=1;oE-$u?i-E+$u:0),M=4*(this._cubeSize-C);d.envMap.value=e.texture,d.roughness.value=y,d.mipInt.value=E-t,qd(o,w,M,3*C,2*C),r.setRenderTarget(o),r.render(c,tm),d.envMap.value=o.texture,d.roughness.value=0,d.mipInt.value=E-i,qd(e,w,M,3*C,2*C),r.setRenderTarget(e),r.render(c,tm)}_blur(e,t,i,r,o){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,i,r,"latitudinal",o),this._halfBlur(l,e,i,i,r,"longitudinal",o)}_halfBlur(e,t,i,r,o,l,c){const d=this._renderer,p=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&Pn("blur direction must be either latitudinal or longitudinal!");const m=3,v=this._lodMeshes[r];v.material=p;const g=p.uniforms,y=this._sizeLods[i]-1,E=isFinite(o)?Math.PI/(2*y):2*Math.PI/(2*ff-1),C=o/E,w=isFinite(o)?1+Math.floor(m*C):ff;w>ff&&jt(`sigmaRadians, ${o}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${ff}`);const M=[];let P=0;for(let U=0;UI-$u?r-I+$u:0),O=4*(this._cubeSize-D);qd(t,L,O,3*D,2*D),d.setRenderTarget(t),d.render(v,tm)}}function ZB(n){const e=[],t=[],i=[];let r=n;const o=n-$u+1+DC.length;for(let l=0;ln-$u?d=DC[l-n+$u-1]:l===0&&(d=0),t.push(d);const p=1/(c-2),m=-p,v=1+p,g=[m,m,v,m,v,v,m,m,v,v,m,v],y=6,E=6,C=3,w=2,M=1,P=new Float32Array(C*E*y),I=new Float32Array(w*E*y),D=new Float32Array(M*E*y);for(let O=0;O2?0:-1,F=[U,b,0,U+2/3,b,0,U+2/3,b+1,0,U,b,0,U+2/3,b+1,0,U,b+1,0];P.set(F,C*E*O),I.set(g,w*E*O);const H=[O,O,O,O,O,O];D.set(H,M*E*O)}const L=new wa;L.setAttribute("position",new Ma(P,C)),L.setAttribute("uv",new Ma(I,w)),L.setAttribute("faceIndex",new Ma(D,M)),i.push(new Ho(L,null)),r>$u&&r--}return{lodMeshes:i,sizeLods:e,sigmas:t}}function IC(n,e,t){const i=new Ja(n,e,t);return i.texture.mapping=l_,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function qd(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function KB(n,e,t){return new nl({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:YB,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:c_(),fragmentShader:` precision highp float; precision highp int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform float roughness; uniform float mipInt; #define ENVMAP_TYPE_CUBE_UV #include #define PI 3.14159265359 // Van der Corput radical inverse float radicalInverse_VdC(uint bits) { bits = (bits << 16u) | (bits >> 16u); bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); return float(bits) * 2.3283064365386963e-10; // / 0x100000000 } // Hammersley sequence vec2 hammersley(uint i, uint N) { return vec2(float(i) / float(N), radicalInverse_VdC(i)); } // GGX VNDF importance sampling (Eric Heitz 2018) // "Sampling the GGX Distribution of Visible Normals" // https://jcgt.org/published/0007/04/01/ vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { float alpha = roughness * roughness; // Section 4.1: Orthonormal basis vec3 T1 = vec3(1.0, 0.0, 0.0); vec3 T2 = cross(V, T1); // Section 4.2: Parameterization of projected area float r = sqrt(Xi.x); float phi = 2.0 * PI * Xi.y; float t1 = r * cos(phi); float t2 = r * sin(phi); float s = 0.5 * (1.0 + V.z); t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; // Section 4.3: Reprojection onto hemisphere vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; // Section 3.4: Transform back to ellipsoid configuration return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); } void main() { vec3 N = normalize(vOutputDirection); vec3 V = N; // Assume view direction equals normal for pre-filtering vec3 prefilteredColor = vec3(0.0); float totalWeight = 0.0; // For very low roughness, just sample the environment directly if (roughness < 0.001) { gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); return; } // Tangent space basis for VNDF sampling vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); vec3 tangent = normalize(cross(up, N)); vec3 bitangent = cross(N, tangent); for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); // For PMREM, V = N, so in tangent space V is always (0, 0, 1) vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); // Transform H back to world space vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); vec3 L = normalize(2.0 * dot(V, H) * H - V); float NdotL = max(dot(N, L), 0.0); if(NdotL > 0.0) { // Sample environment at fixed mip level // VNDF importance sampling handles the distribution filtering vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); // Weight by NdotL for the split-sum approximation // VNDF PDF naturally accounts for the visible microfacet distribution prefilteredColor += sampleColor * NdotL; totalWeight += NdotL; } } if (totalWeight > 0.0) { prefilteredColor = prefilteredColor / totalWeight; } gl_FragColor = vec4(prefilteredColor, 1.0); } `,blending:ql,depthTest:!1,depthWrite:!1})}function $B(n,e,t){const i=new Float32Array(ff),r=new xe(0,1,0);return new nl({name:"SphericalGaussianBlur",defines:{n:ff,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:c_(),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:ql,depthTest:!1,depthWrite:!1})}function kC(){return new nl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:c_(),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:ql,depthTest:!1,depthWrite:!1})}function OC(){return new nl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:c_(),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:ql,depthTest:!1,depthWrite:!1})}function c_(){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 ); } `}class $b extends Ja{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 jb(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}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 dg(5,5,5),o=new nl({name:"CubemapFromEquirect",uniforms:Gh(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Hs,blending:ql});o.uniforms.tEquirect.value=t;const l=new Ho(r,o),c=t.minFilter;return t.minFilter===mf&&(t.minFilter=Jr),new tz(1,10,this).update(e,l),t.minFilter=c,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,i=!0,r=!0){const o=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,i,r);e.setRenderTarget(o)}}function QB(n){let e=new WeakMap,t=new WeakMap,i=null;function r(g,y=!1){return g==null?null:y?l(g):o(g)}function o(g){if(g&&g.isTexture){const y=g.mapping;if(y===Cx||y===Ax)if(e.has(g)){const E=e.get(g).texture;return c(E,g.mapping)}else{const E=g.image;if(E&&E.height>0){const C=new $b(E.height);return C.fromEquirectangularTexture(n,g),e.set(g,C),g.addEventListener("dispose",p),c(C.texture,g.mapping)}else return null}}return g}function l(g){if(g&&g.isTexture){const y=g.mapping,E=y===Cx||y===Ax,C=y===Pf||y===Vh;if(E||C){let w=t.get(g);const M=w!==void 0?w.texture.pmremVersion:0;if(g.isRenderTargetTexture&&g.pmremVersion!==M)return i===null&&(i=new LC(n)),w=E?i.fromEquirectangular(g,w):i.fromCubemap(g,w),w.texture.pmremVersion=g.pmremVersion,t.set(g,w),w.texture;if(w!==void 0)return w.texture;{const P=g.image;return E&&P&&P.height>0||C&&P&&d(P)?(i===null&&(i=new LC(n)),w=E?i.fromEquirectangular(g):i.fromCubemap(g),w.texture.pmremVersion=g.pmremVersion,t.set(g,w),g.addEventListener("dispose",m),w.texture):null}}}return g}function c(g,y){return y===Cx?g.mapping=Pf:y===Ax&&(g.mapping=Vh),g}function d(g){let y=0;const E=6;for(let C=0;C=65535?Hb:Vb)(g,1);w.version=C;const M=o.get(v);M&&e.remove(M),o.set(v,w)}function m(v){const g=o.get(v);if(g){const y=v.index;y!==null&&g.versione.maxTextureSize&&(O=Math.ceil(L/e.maxTextureSize),L=e.maxTextureSize);const U=new Float32Array(L*O*4*v),b=new zb(U,L,O,v);b.type=xa,b.needsUpdate=!0;const F=D*4;for(let W=0;W #include void main() { gl_FragColor = texture2D( tDiffuse, vUv ); #ifdef LINEAR_TONE_MAPPING gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); #elif defined( REINHARD_TONE_MAPPING ) gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); #elif defined( CINEON_TONE_MAPPING ) gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); #elif defined( ACES_FILMIC_TONE_MAPPING ) gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); #elif defined( AGX_TONE_MAPPING ) gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); #elif defined( NEUTRAL_TONE_MAPPING ) gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); #elif defined( CUSTOM_TONE_MAPPING ) gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); #endif #ifdef SRGB_TRANSFER gl_FragColor = sRGBTransferOETF( gl_FragColor ); #endif }`,depthTest:!1,depthWrite:!1}),m=new Ho(d,p),v=new TM(-1,1,1,-1,0,1);let g=null,y=null,E=!1,C,w=null,M=[],P=!1;this.setSize=function(I,D){l.setSize(I,D),c.setSize(I,D);for(let L=0;L0&&M[0].isRenderPass===!0;const D=l.width,L=l.height;for(let O=0;O0)return n;const r=e*t;let o=UC[r];if(o===void 0&&(o=new Float32Array(r),UC[r]=o),e!==0){i.toArray(o,0);for(let l=1,c=0;l!==e;++l)c+=t,n[l].toArray(o,c)}return o}function dr(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0&&(this.seq=r.concat(o))}setValue(e,t,i,r){const o=this.map[t];o!==void 0&&o.setValue(e,i,r)}setOptional(e,t,i){const r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let o=0,l=t.length;o!==l;++o){const c=t[o],d=i[c.id];d.needsUpdate!==!1&&c.setValue(e,d.value,r)}}static seqWithValue(e,t){const i=[];for(let r=0,o=e.length;r!==o;++r){const l=e[r];l.id in t&&i.push(l)}return i}}function GC(n,e,t){const i=n.createShader(e);return n.shaderSource(i,t),n.compileShader(i),i}const $V=37297;let QV=0;function JV(n,e){const t=n.split(` `),i=[],r=Math.max(e-6,0),o=Math.min(e+6,t.length);for(let l=r;l":" "} ${c}: ${t[l]}`)}return i.join(` `)}const WC=new tn;function e5(n){En._getMatrix(WC,En.workingColorSpace,n);const e=`mat3( ${WC.elements.map(t=>t.toFixed(4))} )`;switch(En.getTransfer(n)){case Gv:return[e,"LinearTransferOETF"];case Zn:return[e,"sRGBTransferOETF"];default:return jt("WebGLProgram: Unsupported color space: ",n),[e,"LinearTransferOETF"]}}function XC(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),o=(n.getShaderInfoLog(e)||"").trim();if(i&&o==="")return"";const l=/ERROR: 0:(\d+)/.exec(o);if(l){const c=parseInt(l[1]);return t.toUpperCase()+` `+o+` `+JV(n.getShaderSource(e),c)}else return o}function t5(n,e){const t=e5(e);return[`vec4 ${n}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` `)}const n5={[Tb]:"Linear",[Cb]:"Reinhard",[Ab]:"Cineon",[cM]:"ACESFilmic",[Pb]:"AgX",[bb]:"Neutral",[Rb]:"Custom"};function i5(n,e){const t=n5[e];return t===void 0?(jt("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+n+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Y0=new xe;function r5(){En.getLuminanceCoefficients(Y0);const n=Y0.x.toFixed(4),e=Y0.y.toFixed(4),t=Y0.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` `)}function s5(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(vm).join(` `)}function o5(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function a5(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function n1(n){return n.replace(l5,c5)}const u5=new Map;function c5(n,e){let t=cn[e];if(t===void 0){const i=u5.get(e);if(i!==void 0)t=cn[i],jt('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("THREE.WebGLProgram: Can not resolve #include <"+e+">")}return n1(t)}const f5=/#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 qC(n){return n.replace(f5,d5)}function d5(n,e,t,i){let r="";for(let o=parseInt(e);o0&&(w+=` `),M=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E].filter(vm).join(` `),M.length>0&&(M+=` `)):(w=[ZC(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,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 "+m:"",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.vertexNormals?"#define HAS_NORMAL":"",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 "+d:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(vm).join(` `),M=[ZC(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,E,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 "+p:"",t.envMap?"#define "+m:"",t.envMap?"#define "+v:"",g?"#define CUBEUV_TEXEL_WIDTH "+g.texelWidth:"",g?"#define CUBEUV_TEXEL_HEIGHT "+g.texelHeight:"",g?"#define CUBEUV_MAX_MIP "+g.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.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",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?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#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 "+d:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Sa?"#define TONE_MAPPING":"",t.toneMapping!==Sa?cn.tonemapping_pars_fragment:"",t.toneMapping!==Sa?i5("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",cn.colorspace_pars_fragment,t5("linearToOutputTexel",t.outputColorSpace),r5(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(vm).join(` `)),l=n1(l),l=jC(l,t),l=YC(l,t),c=n1(c),c=jC(c,t),c=YC(c,t),l=qC(l),c=qC(c),t.isRawShaderMaterial!==!0&&(P=`#version 300 es `,w=[y,"#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+w,M=["#define varying in",t.glslVersion===rC?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===rC?"":"#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 I=P+w+l,D=P+M+c,L=GC(r,r.VERTEX_SHADER,I),O=GC(r,r.FRAGMENT_SHADER,D);r.attachShader(C,L),r.attachShader(C,O),t.index0AttributeName!==void 0?r.bindAttribLocation(C,0,t.index0AttributeName):t.hasPositionAttribute===!0&&r.bindAttribLocation(C,0,"position"),r.linkProgram(C);function U(W){if(n.debug.checkShaderErrors){const Y=r.getProgramInfoLog(C)||"",le=r.getShaderInfoLog(L)||"",pe=r.getShaderInfoLog(O)||"",ee=Y.trim(),ce=le.trim(),$=pe.trim();let X=!0,Q=!0;if(r.getProgramParameter(C,r.LINK_STATUS)===!1)if(X=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,C,L,O);else{const B=XC(r,L,"vertex"),G=XC(r,O,"fragment");Pn("WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(C,r.VALIDATE_STATUS)+` Material Name: `+W.name+` Material Type: `+W.type+` Program Info Log: `+ee+` `+B+` `+G)}else ee!==""?jt("WebGLProgram: Program Info Log:",ee):(ce===""||$==="")&&(Q=!1);Q&&(W.diagnostics={runnable:X,programLog:ee,vertexShader:{log:ce,prefix:w},fragmentShader:{log:$,prefix:M}})}r.deleteShader(L),r.deleteShader(O),b=new mv(r,C),F=a5(r,C)}let b;this.getUniforms=function(){return b===void 0&&U(this),b};let F;this.getAttributes=function(){return F===void 0&&U(this),F};let H=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return H===!1&&(H=r.getProgramParameter(C,$V)),H},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(C),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=QV++,this.cacheKey=e,this.usedTimes=1,this.program=C,this.vertexShader=L,this.fragmentShader=O,this}let E5=0;class w5{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,i){const r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(i)===!1&&(r.add(i),i.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}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}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 T5(e),t.set(e,i)),i}}class T5{constructor(e){this.id=E5++,this.code=e,this.usedTimes=0}}function C5(n){return n===bf||n===Bv||n===Vv}function A5(n,e,t,i,r,o){const l=new Eh,c=new w5,d=new Set,p=[],m=new Map,v=i.logarithmicDepthBuffer;let g=i.precision;const y={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function E(b){return d.add(b),b===0?"uv":`uv${b}`}function C(b,F,H,W,Y,le){const pe=W.fog,ee=Y.geometry,ce=b.isMeshStandardMaterial||b.isMeshLambertMaterial||b.isMeshPhongMaterial?W.environment:null,$=b.isMeshStandardMaterial||b.isMeshLambertMaterial&&!b.envMap||b.isMeshPhongMaterial&&!b.envMap,X=e.get(b.envMap||ce,$),Q=X&&X.mapping===l_?X.image.height:null,B=y[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&jt("WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const G=ee.morphAttributes.position||ee.morphAttributes.normal||ee.morphAttributes.color,te=G!==void 0?G.length:0;let Oe=0;ee.morphAttributes.position!==void 0&&(Oe=1),ee.morphAttributes.normal!==void 0&&(Oe=2),ee.morphAttributes.color!==void 0&&(Oe=3);let We,qe,fe,Ae;if(B){const Le=Ga[B];We=Le.vertexShader,qe=Le.fragmentShader}else{We=b.vertexShader,qe=b.fragmentShader;const Le=c.getVertexShaderStage(b),Tt=c.getFragmentShaderStage(b);c.update(b,Le,Tt),fe=Le.id,Ae=Tt.id}const Te=n.getRenderTarget(),Ze=n.state.buffers.depth.getReversed(),pt=Y.isInstancedMesh===!0,ot=Y.isBatchedMesh===!0,$t=!!b.map,et=!!b.matcap,Lt=!!X,Ht=!!b.aoMap,Ft=!!b.lightMap,ve=!!b.bumpMap&&b.wireframe===!1,hn=!!b.normalMap,Cn=!!b.displacementMap,pn=!!b.emissiveMap,kt=!!b.metalnessMap,xn=!!b.roughnessMap,ie=b.anisotropy>0,Un=b.clearcoat>0,Ut=b.dispersion>0,j=b.iridescence>0,k=b.sheen>0,ae=b.transmission>0,me=ie&&!!b.anisotropyMap,Me=Un&&!!b.clearcoatMap,He=Un&&!!b.clearcoatNormalMap,ze=Un&&!!b.clearcoatRoughnessMap,Ce=j&&!!b.iridescenceMap,Re=j&&!!b.iridescenceThicknessMap,nt=k&&!!b.sheenColorMap,mt=k&&!!b.sheenRoughnessMap,Ke=!!b.specularMap,$e=!!b.specularColorMap,Ge=!!b.specularIntensityMap,Mt=ae&&!!b.transmissionMap,wt=ae&&!!b.thicknessMap,J=!!b.gradientMap,Xe=!!b.alphaMap,Pe=b.alphaTest>0,Je=!!b.alphaHash,rt=!!b.extensions;let Ne=Sa;b.toneMapped&&(Te===null||Te.isXRRenderTarget===!0)&&(Ne=n.toneMapping);const ke={shaderID:B,shaderType:b.type,shaderName:b.name,vertexShader:We,fragmentShader:qe,defines:b.defines,customVertexShaderID:fe,customFragmentShaderID:Ae,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:ot,batchingColor:ot&&Y._colorsTexture!==null,instancing:pt,instancingColor:pt&&Y.instanceColor!==null,instancingMorph:pt&&Y.morphTexture!==null,outputColorSpace:Te===null?n.outputColorSpace:Te.isXRRenderTarget===!0?Te.texture.colorSpace:En.workingColorSpace,alphaToCoverage:!!b.alphaToCoverage,map:$t,matcap:et,envMap:Lt,envMapMode:Lt&&X.mapping,envMapCubeUVHeight:Q,aoMap:Ht,lightMap:Ft,bumpMap:ve,normalMap:hn,displacementMap:Cn,emissiveMap:pn,normalMapObjectSpace:hn&&b.normalMapType===uF,normalMapTangentSpace:hn&&b.normalMapType===QS,packedNormalMap:hn&&b.normalMapType===QS&&C5(b.normalMap.format),metalnessMap:kt,roughnessMap:xn,anisotropy:ie,anisotropyMap:me,clearcoat:Un,clearcoatMap:Me,clearcoatNormalMap:He,clearcoatRoughnessMap:ze,dispersion:Ut,iridescence:j,iridescenceMap:Ce,iridescenceThicknessMap:Re,sheen:k,sheenColorMap:nt,sheenRoughnessMap:mt,specularMap:Ke,specularColorMap:$e,specularIntensityMap:Ge,transmission:ae,transmissionMap:Mt,thicknessMap:wt,gradientMap:J,opaque:b.transparent===!1&&b.blending===yh&&b.alphaToCoverage===!1,alphaMap:Xe,alphaTest:Pe,alphaHash:Je,combine:b.combine,mapUv:$t&&E(b.map.channel),aoMapUv:Ht&&E(b.aoMap.channel),lightMapUv:Ft&&E(b.lightMap.channel),bumpMapUv:ve&&E(b.bumpMap.channel),normalMapUv:hn&&E(b.normalMap.channel),displacementMapUv:Cn&&E(b.displacementMap.channel),emissiveMapUv:pn&&E(b.emissiveMap.channel),metalnessMapUv:kt&&E(b.metalnessMap.channel),roughnessMapUv:xn&&E(b.roughnessMap.channel),anisotropyMapUv:me&&E(b.anisotropyMap.channel),clearcoatMapUv:Me&&E(b.clearcoatMap.channel),clearcoatNormalMapUv:He&&E(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ze&&E(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Ce&&E(b.iridescenceMap.channel),iridescenceThicknessMapUv:Re&&E(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&E(b.sheenColorMap.channel),sheenRoughnessMapUv:mt&&E(b.sheenRoughnessMap.channel),specularMapUv:Ke&&E(b.specularMap.channel),specularColorMapUv:$e&&E(b.specularColorMap.channel),specularIntensityMapUv:Ge&&E(b.specularIntensityMap.channel),transmissionMapUv:Mt&&E(b.transmissionMap.channel),thicknessMapUv:wt&&E(b.thicknessMap.channel),alphaMapUv:Xe&&E(b.alphaMap.channel),vertexTangents:!!ee.attributes.tangent&&(hn||ie),vertexNormals:!!ee.attributes.normal,vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!ee.attributes.color&&ee.attributes.color.itemSize===4,pointsUvs:Y.isPoints===!0&&!!ee.attributes.uv&&($t||Xe),fog:!!pe,useFog:b.fog===!0,fogExp2:!!pe&&pe.isFogExp2,flatShading:b.wireframe===!1&&(b.flatShading===!0||ee.attributes.normal===void 0&&hn===!1&&(b.isMeshLambertMaterial||b.isMeshPhongMaterial||b.isMeshStandardMaterial||b.isMeshPhysicalMaterial)),sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:v,reversedDepthBuffer:Ze,skinning:Y.isSkinnedMesh===!0,hasPositionAttribute:ee.attributes.position!==void 0,morphTargets:ee.morphAttributes.position!==void 0,morphNormals:ee.morphAttributes.normal!==void 0,morphColors:ee.morphAttributes.color!==void 0,morphTargetsCount:te,morphTextureStride:Oe,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numSpotLightMaps:F.spotLightMap.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numSpotLightShadowsWithMaps:F.numSpotLightShadowsWithMaps,numLightProbes:F.numLightProbes,numLightProbeGrids:le.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:n.shadowMap.enabled&&H.length>0,shadowMapType:n.shadowMap.type,toneMapping:Ne,decodeVideoTexture:$t&&b.map.isVideoTexture===!0&&En.getTransfer(b.map.colorSpace)===Zn,decodeVideoTextureEmissive:pn&&b.emissiveMap.isVideoTexture===!0&&En.getTransfer(b.emissiveMap.colorSpace)===Zn,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Xa,flipSided:b.side===Hs,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:rt&&b.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(rt&&b.extensions.multiDraw===!0||ot)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return ke.vertexUv1s=d.has(1),ke.vertexUv2s=d.has(2),ke.vertexUv3s=d.has(3),d.clear(),ke}function w(b){const F=[];if(b.shaderID?F.push(b.shaderID):(F.push(b.customVertexShaderID),F.push(b.customFragmentShaderID)),b.defines!==void 0)for(const H in b.defines)F.push(H),F.push(b.defines[H]);return b.isRawShaderMaterial===!1&&(M(F,b),P(F,b),F.push(n.outputColorSpace)),F.push(b.customProgramCacheKey),F.join()}function M(b,F){b.push(F.precision),b.push(F.outputColorSpace),b.push(F.envMapMode),b.push(F.envMapCubeUVHeight),b.push(F.mapUv),b.push(F.alphaMapUv),b.push(F.lightMapUv),b.push(F.aoMapUv),b.push(F.bumpMapUv),b.push(F.normalMapUv),b.push(F.displacementMapUv),b.push(F.emissiveMapUv),b.push(F.metalnessMapUv),b.push(F.roughnessMapUv),b.push(F.anisotropyMapUv),b.push(F.clearcoatMapUv),b.push(F.clearcoatNormalMapUv),b.push(F.clearcoatRoughnessMapUv),b.push(F.iridescenceMapUv),b.push(F.iridescenceThicknessMapUv),b.push(F.sheenColorMapUv),b.push(F.sheenRoughnessMapUv),b.push(F.specularMapUv),b.push(F.specularColorMapUv),b.push(F.specularIntensityMapUv),b.push(F.transmissionMapUv),b.push(F.thicknessMapUv),b.push(F.combine),b.push(F.fogExp2),b.push(F.sizeAttenuation),b.push(F.morphTargetsCount),b.push(F.morphAttributeCount),b.push(F.numDirLights),b.push(F.numPointLights),b.push(F.numSpotLights),b.push(F.numSpotLightMaps),b.push(F.numHemiLights),b.push(F.numRectAreaLights),b.push(F.numDirLightShadows),b.push(F.numPointLightShadows),b.push(F.numSpotLightShadows),b.push(F.numSpotLightShadowsWithMaps),b.push(F.numLightProbes),b.push(F.shadowMapType),b.push(F.toneMapping),b.push(F.numClippingPlanes),b.push(F.numClipIntersection),b.push(F.depthPacking)}function P(b,F){l.disableAll(),F.instancing&&l.enable(0),F.instancingColor&&l.enable(1),F.instancingMorph&&l.enable(2),F.matcap&&l.enable(3),F.envMap&&l.enable(4),F.normalMapObjectSpace&&l.enable(5),F.normalMapTangentSpace&&l.enable(6),F.clearcoat&&l.enable(7),F.iridescence&&l.enable(8),F.alphaTest&&l.enable(9),F.vertexColors&&l.enable(10),F.vertexAlphas&&l.enable(11),F.vertexUv1s&&l.enable(12),F.vertexUv2s&&l.enable(13),F.vertexUv3s&&l.enable(14),F.vertexTangents&&l.enable(15),F.anisotropy&&l.enable(16),F.alphaHash&&l.enable(17),F.batching&&l.enable(18),F.dispersion&&l.enable(19),F.batchingColor&&l.enable(20),F.gradientMap&&l.enable(21),F.packedNormalMap&&l.enable(22),F.vertexNormals&&l.enable(23),b.push(l.mask),l.disableAll(),F.fog&&l.enable(0),F.useFog&&l.enable(1),F.flatShading&&l.enable(2),F.logarithmicDepthBuffer&&l.enable(3),F.reversedDepthBuffer&&l.enable(4),F.skinning&&l.enable(5),F.morphTargets&&l.enable(6),F.morphNormals&&l.enable(7),F.morphColors&&l.enable(8),F.premultipliedAlpha&&l.enable(9),F.shadowMapEnabled&&l.enable(10),F.doubleSided&&l.enable(11),F.flipSided&&l.enable(12),F.useDepthPacking&&l.enable(13),F.dithering&&l.enable(14),F.transmission&&l.enable(15),F.sheen&&l.enable(16),F.opaque&&l.enable(17),F.pointsUvs&&l.enable(18),F.decodeVideoTexture&&l.enable(19),F.decodeVideoTextureEmissive&&l.enable(20),F.alphaToCoverage&&l.enable(21),F.numLightProbeGrids>0&&l.enable(22),F.hasPositionAttribute&&l.enable(23),b.push(l.mask)}function I(b){const F=y[b.type];let H;if(F){const W=Ga[F];H=qF.clone(W.uniforms)}else H=b.uniforms;return H}function D(b,F){let H=m.get(F);return H!==void 0?++H.usedTimes:(H=new M5(n,F,b,r),p.push(H),m.set(F,H)),H}function L(b){if(--b.usedTimes===0){const F=p.indexOf(b);p[F]=p[p.length-1],p.pop(),m.delete(b.cacheKey),b.destroy()}}function O(b){c.remove(b)}function U(){c.dispose()}return{getParameters:C,getProgramCacheKey:w,getUniforms:I,acquireProgram:D,releaseProgram:L,releaseShaderCache:O,programs:p,dispose:U}}function R5(){let n=new WeakMap;function e(l){return n.has(l)}function t(l){let c=n.get(l);return c===void 0&&(c={},n.set(l,c)),c}function i(l){n.delete(l)}function r(l,c,d){n.get(l)[c]=d}function o(){n=new WeakMap}return{has:e,get:t,remove:i,update:r,dispose:o}}function P5(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.material.id!==e.material.id?n.material.id-e.material.id:n.materialVariant!==e.materialVariant?n.materialVariant-e.materialVariant:n.z!==e.z?n.z-e.z:n.id-e.id}function KC(n,e){return n.groupOrder!==e.groupOrder?n.groupOrder-e.groupOrder:n.renderOrder!==e.renderOrder?n.renderOrder-e.renderOrder:n.z!==e.z?e.z-n.z:n.id-e.id}function $C(){const n=[];let e=0;const t=[],i=[],r=[];function o(){e=0,t.length=0,i.length=0,r.length=0}function l(g){let y=0;return g.isInstancedMesh&&(y+=2),g.isSkinnedMesh&&(y+=1),y}function c(g,y,E,C,w,M){let P=n[e];return P===void 0?(P={id:g.id,object:g,geometry:y,material:E,materialVariant:l(g),groupOrder:C,renderOrder:g.renderOrder,z:w,group:M},n[e]=P):(P.id=g.id,P.object=g,P.geometry=y,P.material=E,P.materialVariant=l(g),P.groupOrder=C,P.renderOrder=g.renderOrder,P.z=w,P.group=M),e++,P}function d(g,y,E,C,w,M){const P=c(g,y,E,C,w,M);E.transmission>0?i.push(P):E.transparent===!0?r.push(P):t.push(P)}function p(g,y,E,C,w,M){const P=c(g,y,E,C,w,M);E.transmission>0?i.unshift(P):E.transparent===!0?r.unshift(P):t.unshift(P)}function m(g,y,E){t.length>1&&t.sort(g||P5),i.length>1&&i.sort(y||KC),r.length>1&&r.sort(y||KC),E&&(t.reverse(),i.reverse(),r.reverse())}function v(){for(let g=e,y=n.length;g=o.length?(l=new $C,o.push(l)):l=o[r],l}function t(){n=new WeakMap}return{get:e,dispose:t}}function D5(){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 xe,color:new bn};break;case"SpotLight":t={position:new xe,direction:new xe,color:new bn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new xe,color:new bn,distance:0,decay:0};break;case"HemisphereLight":t={direction:new xe,skyColor:new bn,groundColor:new bn};break;case"RectAreaLight":t={color:new bn,position:new xe,halfWidth:new xe,halfHeight:new xe};break}return n[e.id]=t,t}}}function N5(){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 Dn};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Dn};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Dn,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let L5=0;function I5(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function k5(n){const e=new D5,t=N5(),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 p=0;p<9;p++)i.probe.push(new xe);const r=new xe,o=new yi,l=new yi;function c(p){let m=0,v=0,g=0;for(let F=0;F<9;F++)i.probe[F].set(0,0,0);let y=0,E=0,C=0,w=0,M=0,P=0,I=0,D=0,L=0,O=0,U=0;p.sort(I5);for(let F=0,H=p.length;F0&&(n.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ft.LTC_FLOAT_1,i.rectAreaLTC2=ft.LTC_FLOAT_2):(i.rectAreaLTC1=ft.LTC_HALF_1,i.rectAreaLTC2=ft.LTC_HALF_2)),i.ambient[0]=m,i.ambient[1]=v,i.ambient[2]=g;const b=i.hash;(b.directionalLength!==y||b.pointLength!==E||b.spotLength!==C||b.rectAreaLength!==w||b.hemiLength!==M||b.numDirectionalShadows!==P||b.numPointShadows!==I||b.numSpotShadows!==D||b.numSpotMaps!==L||b.numLightProbes!==U)&&(i.directional.length=y,i.spot.length=C,i.rectArea.length=w,i.point.length=E,i.hemi.length=M,i.directionalShadow.length=P,i.directionalShadowMap.length=P,i.pointShadow.length=I,i.pointShadowMap.length=I,i.spotShadow.length=D,i.spotShadowMap.length=D,i.directionalShadowMatrix.length=P,i.pointShadowMatrix.length=I,i.spotLightMatrix.length=D+L-O,i.spotLightMap.length=L,i.numSpotLightShadowsWithMaps=O,i.numLightProbes=U,b.directionalLength=y,b.pointLength=E,b.spotLength=C,b.rectAreaLength=w,b.hemiLength=M,b.numDirectionalShadows=P,b.numPointShadows=I,b.numSpotShadows=D,b.numSpotMaps=L,b.numLightProbes=U,i.version=L5++)}function d(p,m){let v=0,g=0,y=0,E=0,C=0;const w=m.matrixWorldInverse;for(let M=0,P=p.length;M=l.length?(c=new QC(n),l.push(c)):c=l[o],c}function i(){e=new WeakMap}return{get:t,dispose:i}}const U5=`void main() { gl_Position = vec4( position, 1.0 ); }`,F5=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; 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 = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; mean += distribution.x; squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; #else float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; mean += depth; squared_mean += depth * depth; #endif } mean = mean / samples; squared_mean = squared_mean / samples; float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); }`,z5=[new xe(1,0,0),new xe(-1,0,0),new xe(0,1,0),new xe(0,-1,0),new xe(0,0,1),new xe(0,0,-1)],B5=[new xe(0,-1,0),new xe(0,-1,0),new xe(0,0,1),new xe(0,0,-1),new xe(0,-1,0),new xe(0,-1,0)],JC=new yi,nm=new xe,ry=new xe;function V5(n,e,t){let i=new Xb;const r=new Dn,o=new Dn,l=new Li,c=new QF,d=new JF,p={},m=t.maxTextureSize,v={[uc]:Hs,[Hs]:uc,[Xa]:Xa},g=new nl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Dn},radius:{value:4}},vertexShader:U5,fragmentShader:F5}),y=g.clone();y.defines.HORIZONTAL_PASS=1;const E=new wa;E.setAttribute("position",new Ma(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const C=new Ho(E,g),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=km;let M=this.type;this.render=function(O,U,b){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||O.length===0)return;this.type===cv&&(jt("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=km);const F=n.getRenderTarget(),H=n.getActiveCubeFace(),W=n.getActiveMipmapLevel(),Y=n.state;Y.setBlending(ql),Y.buffers.depth.getReversed()===!0?Y.buffers.color.setClear(0,0,0,0):Y.buffers.color.setClear(1,1,1,1),Y.buffers.depth.setTest(!0),Y.setScissorTest(!1);const le=M!==this.type;le&&U.traverse(function(pe){pe.material&&(Array.isArray(pe.material)?pe.material.forEach(ee=>ee.needsUpdate=!0):pe.material.needsUpdate=!0)});for(let pe=0,ee=O.length;pem||r.y>m)&&(r.x>m&&(o.x=Math.floor(m/X.x),r.x=o.x*X.x,$.mapSize.x=o.x),r.y>m&&(o.y=Math.floor(m/X.y),r.y=o.y*X.y,$.mapSize.y=o.y));const Q=n.state.buffers.depth.getReversed();if($.camera._reversedDepth=Q,$.map===null||le===!0){if($.map!==null&&($.map.depthTexture!==null&&($.map.depthTexture.dispose(),$.map.depthTexture=null),$.map.dispose()),this.type===fh){if(ce.isPointLight){jt("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}$.map=new Ja(r.x,r.y,{format:bf,type:tu,minFilter:Jr,magFilter:Jr,generateMipmaps:!1}),$.map.texture.name=ce.name+".shadowMap",$.map.depthTexture=new Hh(r.x,r.y,xa),$.map.depthTexture.name=ce.name+".shadowMapDepth",$.map.depthTexture.format=nu,$.map.depthTexture.compareFunction=null,$.map.depthTexture.minFilter=kr,$.map.depthTexture.magFilter=kr}else ce.isPointLight?($.map=new $b(r.x),$.map.depthTexture=new jF(r.x,tl)):($.map=new Ja(r.x,r.y),$.map.depthTexture=new Hh(r.x,r.y,tl)),$.map.depthTexture.name=ce.name+".shadowMap",$.map.depthTexture.format=nu,this.type===km?($.map.depthTexture.compareFunction=Q?xM:_M,$.map.depthTexture.minFilter=Jr,$.map.depthTexture.magFilter=Jr):($.map.depthTexture.compareFunction=null,$.map.depthTexture.minFilter=kr,$.map.depthTexture.magFilter=kr);$.camera.updateProjectionMatrix()}const B=$.map.isWebGLCubeRenderTarget?6:1;for(let G=0;G0||U.map&&U.alphaTest>0||U.alphaToCoverage===!0){const Y=H.uuid,le=U.uuid;let pe=p[Y];pe===void 0&&(pe={},p[Y]=pe);let ee=pe[le];ee===void 0&&(ee=H.clone(),pe[le]=ee,U.addEventListener("dispose",L)),H=ee}if(H.visible=U.visible,H.wireframe=U.wireframe,F===fh?H.side=U.shadowSide!==null?U.shadowSide:U.side:H.side=U.shadowSide!==null?U.shadowSide:v[U.side],H.alphaMap=U.alphaMap,H.alphaTest=U.alphaToCoverage===!0?.5:U.alphaTest,H.map=U.map,H.clipShadows=U.clipShadows,H.clippingPlanes=U.clippingPlanes,H.clipIntersection=U.clipIntersection,H.displacementMap=U.displacementMap,H.displacementScale=U.displacementScale,H.displacementBias=U.displacementBias,H.wireframeLinewidth=U.wireframeLinewidth,H.linewidth=U.linewidth,b.isPointLight===!0&&H.isMeshDistanceMaterial===!0){const Y=n.properties.get(H);Y.light=b}return H}function D(O,U,b,F,H){if(O.visible===!1)return;if(O.layers.test(U.layers)&&(O.isMesh||O.isLine||O.isPoints)&&(O.castShadow||O.receiveShadow&&H===fh)&&(!O.frustumCulled||i.intersectsObject(O))){O.modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,O.matrixWorld);const le=e.update(O),pe=O.material;if(Array.isArray(pe)){const ee=le.groups;for(let ce=0,$=ee.length;ce<$;ce++){const X=ee[ce],Q=pe[X.materialIndex];if(Q&&Q.visible){const B=I(O,Q,F,H);O.onBeforeShadow(n,O,U,b,le,B,X),n.renderBufferDirect(b,null,le,B,O,X),O.onAfterShadow(n,O,U,b,le,B,X)}}}else if(pe.visible){const ee=I(O,pe,F,H);O.onBeforeShadow(n,O,U,b,le,ee,null),n.renderBufferDirect(b,null,le,ee,O,null),O.onAfterShadow(n,O,U,b,le,ee,null)}}const Y=O.children;for(let le=0,pe=Y.length;le=1):Q.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),$=X>=2);let B=null,G={};const te=n.getParameter(n.SCISSOR_BOX),Oe=n.getParameter(n.VIEWPORT),We=new Li().fromArray(te),qe=new Li().fromArray(Oe);function fe(J,Xe,Pe,Je){const rt=new Uint8Array(4),Ne=n.createTexture();n.bindTexture(J,Ne),n.texParameteri(J,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(J,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let ke=0;ke"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new Dn,m=new WeakMap,v=new Set;let g;const y=new WeakMap;let E=!1;try{E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function C(j,k){return E?new OffscreenCanvas(j,k):Xv("canvas")}function w(j,k,ae){let me=1;const Me=Ut(j);if((Me.width>ae||Me.height>ae)&&(me=ae/Math.max(Me.width,Me.height)),me<1)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap||typeof VideoFrame<"u"&&j instanceof VideoFrame){const He=Math.floor(me*Me.width),ze=Math.floor(me*Me.height);g===void 0&&(g=C(He,ze));const Ce=k?C(He,ze):g;return Ce.width=He,Ce.height=ze,Ce.getContext("2d").drawImage(j,0,0,He,ze),jt("WebGLRenderer: Texture has been resized from ("+Me.width+"x"+Me.height+") to ("+He+"x"+ze+")."),Ce}else return"data"in j&&jt("WebGLRenderer: Image in DataTexture is too big ("+Me.width+"x"+Me.height+")."),j;return j}function M(j){return j.generateMipmaps}function P(j){n.generateMipmap(j)}function I(j){return j.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:j.isWebGL3DRenderTarget?n.TEXTURE_3D:j.isWebGLArrayRenderTarget||j.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function D(j,k,ae,me,Me,He=!1){if(j!==null){if(n[j]!==void 0)return n[j];jt("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let ze;me&&(ze=e.get("EXT_texture_norm16"),ze||jt("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let Ce=k;if(k===n.RED&&(ae===n.FLOAT&&(Ce=n.R32F),ae===n.HALF_FLOAT&&(Ce=n.R16F),ae===n.UNSIGNED_BYTE&&(Ce=n.R8),ae===n.UNSIGNED_SHORT&&ze&&(Ce=ze.R16_EXT),ae===n.SHORT&&ze&&(Ce=ze.R16_SNORM_EXT)),k===n.RED_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ce=n.R8UI),ae===n.UNSIGNED_SHORT&&(Ce=n.R16UI),ae===n.UNSIGNED_INT&&(Ce=n.R32UI),ae===n.BYTE&&(Ce=n.R8I),ae===n.SHORT&&(Ce=n.R16I),ae===n.INT&&(Ce=n.R32I)),k===n.RG&&(ae===n.FLOAT&&(Ce=n.RG32F),ae===n.HALF_FLOAT&&(Ce=n.RG16F),ae===n.UNSIGNED_BYTE&&(Ce=n.RG8),ae===n.UNSIGNED_SHORT&&ze&&(Ce=ze.RG16_EXT),ae===n.SHORT&&ze&&(Ce=ze.RG16_SNORM_EXT)),k===n.RG_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ce=n.RG8UI),ae===n.UNSIGNED_SHORT&&(Ce=n.RG16UI),ae===n.UNSIGNED_INT&&(Ce=n.RG32UI),ae===n.BYTE&&(Ce=n.RG8I),ae===n.SHORT&&(Ce=n.RG16I),ae===n.INT&&(Ce=n.RG32I)),k===n.RGB_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ce=n.RGB8UI),ae===n.UNSIGNED_SHORT&&(Ce=n.RGB16UI),ae===n.UNSIGNED_INT&&(Ce=n.RGB32UI),ae===n.BYTE&&(Ce=n.RGB8I),ae===n.SHORT&&(Ce=n.RGB16I),ae===n.INT&&(Ce=n.RGB32I)),k===n.RGBA_INTEGER&&(ae===n.UNSIGNED_BYTE&&(Ce=n.RGBA8UI),ae===n.UNSIGNED_SHORT&&(Ce=n.RGBA16UI),ae===n.UNSIGNED_INT&&(Ce=n.RGBA32UI),ae===n.BYTE&&(Ce=n.RGBA8I),ae===n.SHORT&&(Ce=n.RGBA16I),ae===n.INT&&(Ce=n.RGBA32I)),k===n.RGB&&(ae===n.UNSIGNED_SHORT&&ze&&(Ce=ze.RGB16_EXT),ae===n.SHORT&&ze&&(Ce=ze.RGB16_SNORM_EXT),ae===n.UNSIGNED_INT_5_9_9_9_REV&&(Ce=n.RGB9_E5),ae===n.UNSIGNED_INT_10F_11F_11F_REV&&(Ce=n.R11F_G11F_B10F)),k===n.RGBA){const Re=He?Gv:En.getTransfer(Me);ae===n.FLOAT&&(Ce=n.RGBA32F),ae===n.HALF_FLOAT&&(Ce=n.RGBA16F),ae===n.UNSIGNED_BYTE&&(Ce=Re===Zn?n.SRGB8_ALPHA8:n.RGBA8),ae===n.UNSIGNED_SHORT&&ze&&(Ce=ze.RGBA16_EXT),ae===n.SHORT&&ze&&(Ce=ze.RGBA16_SNORM_EXT),ae===n.UNSIGNED_SHORT_4_4_4_4&&(Ce=n.RGBA4),ae===n.UNSIGNED_SHORT_5_5_5_1&&(Ce=n.RGB5_A1)}return(Ce===n.R16F||Ce===n.R32F||Ce===n.RG16F||Ce===n.RG32F||Ce===n.RGBA16F||Ce===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ce}function L(j,k){let ae;return j?k===null||k===tl||k===tg?ae=n.DEPTH24_STENCIL8:k===xa?ae=n.DEPTH32F_STENCIL8:k===eg&&(ae=n.DEPTH24_STENCIL8,jt("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):k===null||k===tl||k===tg?ae=n.DEPTH_COMPONENT24:k===xa?ae=n.DEPTH_COMPONENT32F:k===eg&&(ae=n.DEPTH_COMPONENT16),ae}function O(j,k){return M(j)===!0||j.isFramebufferTexture&&j.minFilter!==kr&&j.minFilter!==Jr?Math.log2(Math.max(k.width,k.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?k.mipmaps.length:1}function U(j){const k=j.target;k.removeEventListener("dispose",U),F(k),k.isVideoTexture&&m.delete(k),k.isHTMLTexture&&v.delete(k)}function b(j){const k=j.target;k.removeEventListener("dispose",b),W(k)}function F(j){const k=i.get(j);if(k.__webglInit===void 0)return;const ae=j.source,me=y.get(ae);if(me){const Me=me[k.__cacheKey];Me.usedTimes--,Me.usedTimes===0&&H(j),Object.keys(me).length===0&&y.delete(ae)}i.remove(j)}function H(j){const k=i.get(j);n.deleteTexture(k.__webglTexture);const ae=j.source,me=y.get(ae);delete me[k.__cacheKey],l.memory.textures--}function W(j){const k=i.get(j);if(j.depthTexture&&(j.depthTexture.dispose(),i.remove(j.depthTexture)),j.isWebGLCubeRenderTarget)for(let me=0;me<6;me++){if(Array.isArray(k.__webglFramebuffer[me]))for(let Me=0;Me=r.maxTextures&&jt("WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+r.maxTextures),Y+=1,j}function $(j){const k=[];return k.push(j.wrapS),k.push(j.wrapT),k.push(j.wrapR||0),k.push(j.magFilter),k.push(j.minFilter),k.push(j.anisotropy),k.push(j.internalFormat),k.push(j.format),k.push(j.type),k.push(j.generateMipmaps),k.push(j.premultiplyAlpha),k.push(j.flipY),k.push(j.unpackAlignment),k.push(j.colorSpace),k.join()}function X(j,k){const ae=i.get(j);if(j.isVideoTexture&&ie(j),j.isRenderTargetTexture===!1&&j.isExternalTexture!==!0&&j.version>0&&ae.__version!==j.version){const me=j.image;if(me===null)jt("WebGLRenderer: Texture marked for update but no image data found.");else if(me.complete===!1)jt("WebGLRenderer: Texture marked for update but image is incomplete");else{Ze(ae,j,k);return}}else j.isExternalTexture&&(ae.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(n.TEXTURE_2D,ae.__webglTexture,n.TEXTURE0+k)}function Q(j,k){const ae=i.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ae.__version!==j.version){Ze(ae,j,k);return}else j.isExternalTexture&&(ae.__webglTexture=j.sourceTexture?j.sourceTexture:null);t.bindTexture(n.TEXTURE_2D_ARRAY,ae.__webglTexture,n.TEXTURE0+k)}function B(j,k){const ae=i.get(j);if(j.isRenderTargetTexture===!1&&j.version>0&&ae.__version!==j.version){Ze(ae,j,k);return}t.bindTexture(n.TEXTURE_3D,ae.__webglTexture,n.TEXTURE0+k)}function G(j,k){const ae=i.get(j);if(j.isCubeDepthTexture!==!0&&j.version>0&&ae.__version!==j.version){pt(ae,j,k);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ae.__webglTexture,n.TEXTURE0+k)}const te={[yS]:n.REPEAT,[Wl]:n.CLAMP_TO_EDGE,[SS]:n.MIRRORED_REPEAT},Oe={[kr]:n.NEAREST,[aF]:n.NEAREST_MIPMAP_NEAREST,[T0]:n.NEAREST_MIPMAP_LINEAR,[Jr]:n.LINEAR,[Rx]:n.LINEAR_MIPMAP_NEAREST,[mf]:n.LINEAR_MIPMAP_LINEAR},We={[cF]:n.NEVER,[mF]:n.ALWAYS,[fF]:n.LESS,[_M]:n.LEQUAL,[dF]:n.EQUAL,[xM]:n.GEQUAL,[hF]:n.GREATER,[pF]:n.NOTEQUAL};function qe(j,k){if(k.type===xa&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===Jr||k.magFilter===Rx||k.magFilter===T0||k.magFilter===mf||k.minFilter===Jr||k.minFilter===Rx||k.minFilter===T0||k.minFilter===mf)&&jt("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(j,n.TEXTURE_WRAP_S,te[k.wrapS]),n.texParameteri(j,n.TEXTURE_WRAP_T,te[k.wrapT]),(j===n.TEXTURE_3D||j===n.TEXTURE_2D_ARRAY)&&n.texParameteri(j,n.TEXTURE_WRAP_R,te[k.wrapR]),n.texParameteri(j,n.TEXTURE_MAG_FILTER,Oe[k.magFilter]),n.texParameteri(j,n.TEXTURE_MIN_FILTER,Oe[k.minFilter]),k.compareFunction&&(n.texParameteri(j,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(j,n.TEXTURE_COMPARE_FUNC,We[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===kr||k.minFilter!==T0&&k.minFilter!==mf||k.type===xa&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||i.get(k).__currentAnisotropy){const ae=e.get("EXT_texture_filter_anisotropic");n.texParameterf(j,ae.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,r.getMaxAnisotropy())),i.get(k).__currentAnisotropy=k.anisotropy}}}function fe(j,k){let ae=!1;j.__webglInit===void 0&&(j.__webglInit=!0,k.addEventListener("dispose",U));const me=k.source;let Me=y.get(me);Me===void 0&&(Me={},y.set(me,Me));const He=$(k);if(He!==j.__cacheKey){Me[He]===void 0&&(Me[He]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,ae=!0),Me[He].usedTimes++;const ze=Me[j.__cacheKey];ze!==void 0&&(Me[j.__cacheKey].usedTimes--,ze.usedTimes===0&&H(k)),j.__cacheKey=He,j.__webglTexture=Me[He].texture}return ae}function Ae(j,k,ae){return Math.floor(Math.floor(j/ae)/k)}function Te(j,k,ae,me){const He=j.updateRanges;if(He.length===0)t.texSubImage2D(n.TEXTURE_2D,0,0,0,k.width,k.height,ae,me,k.data);else{He.sort((mt,Ke)=>mt.start-Ke.start);let ze=0;for(let mt=1;mt0){Mt&&wt&&t.texStorage2D(n.TEXTURE_2D,Xe,Ke,Ge[0].width,Ge[0].height);for(let Pe=0,Je=Ge.length;Pe0){const rt=bC($e.width,$e.height,k.format,k.type);for(const Ne of k.layerUpdates){const ke=$e.data.subarray(Ne*rt/$e.data.BYTES_PER_ELEMENT,(Ne+1)*rt/$e.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,Ne,$e.width,$e.height,1,nt,ke)}k.clearLayerUpdates()}else t.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,nt,$e.data)}else t.compressedTexImage3D(n.TEXTURE_2D_ARRAY,Pe,Ke,$e.width,$e.height,Re.depth,0,$e.data,0,0);else jt("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Mt?J&&t.texSubImage3D(n.TEXTURE_2D_ARRAY,Pe,0,0,0,$e.width,$e.height,Re.depth,nt,mt,$e.data):t.texImage3D(n.TEXTURE_2D_ARRAY,Pe,Ke,$e.width,$e.height,Re.depth,0,nt,mt,$e.data)}else{Mt&&wt&&t.texStorage2D(n.TEXTURE_2D,Xe,Ke,Ge[0].width,Ge[0].height);for(let Pe=0,Je=Ge.length;Pe0){const Pe=bC(Re.width,Re.height,k.format,k.type);for(const Je of k.layerUpdates){const rt=Re.data.subarray(Je*Pe/Re.data.BYTES_PER_ELEMENT,(Je+1)*Pe/Re.data.BYTES_PER_ELEMENT);t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,Je,Re.width,Re.height,1,nt,mt,rt)}k.clearLayerUpdates()}else t.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,Re.width,Re.height,Re.depth,nt,mt,Re.data)}else t.texImage3D(n.TEXTURE_2D_ARRAY,0,Ke,Re.width,Re.height,Re.depth,0,nt,mt,Re.data);else if(k.isData3DTexture)Mt?(wt&&t.texStorage3D(n.TEXTURE_3D,Xe,Ke,Re.width,Re.height,Re.depth),J&&t.texSubImage3D(n.TEXTURE_3D,0,0,0,0,Re.width,Re.height,Re.depth,nt,mt,Re.data)):t.texImage3D(n.TEXTURE_3D,0,Ke,Re.width,Re.height,Re.depth,0,nt,mt,Re.data);else if(k.isFramebufferTexture){if(wt)if(Mt)t.texStorage2D(n.TEXTURE_2D,Xe,Ke,Re.width,Re.height);else{let Pe=Re.width,Je=Re.height;for(let rt=0;rt>=1,Je>>=1}}else if(k.isHTMLTexture){if("texElementImage2D"in n){const Pe=n.canvas;if(Pe.hasAttribute("layoutsubtree")||Pe.setAttribute("layoutsubtree","true"),Re.parentNode!==Pe){Pe.appendChild(Re),v.add(k),Pe.onpaint=Je=>{const rt=Je.changedElements;for(const Ne of v)rt.includes(Ne.image)&&(Ne.needsUpdate=!0)},Pe.requestPaint();return}if(n.texElementImage2D.length===3)n.texElementImage2D(n.TEXTURE_2D,n.RGBA8,Re);else{const rt=n.RGBA,Ne=n.RGBA,ke=n.UNSIGNED_BYTE;n.texElementImage2D(n.TEXTURE_2D,0,rt,Ne,ke,Re)}n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE)}}else if(Ge.length>0){if(Mt&&wt){const Pe=Ut(Ge[0]);t.texStorage2D(n.TEXTURE_2D,Xe,Ke,Pe.width,Pe.height)}for(let Pe=0,Je=Ge.length;Pe0&&Je++;const Ne=Ut(Ke[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,Je,wt,Ne.width,Ne.height)}for(let Ne=0;Ne<6;Ne++)if(mt){J?Pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,0,0,Ke[Ne].width,Ke[Ne].height,Ge,Mt,Ke[Ne].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+Ne,0,wt,Ke[Ne].width,Ke[Ne].height,0,Ge,Mt,Ke[Ne].data);for(let ke=0;ke>He),$e=Math.max(1,k.height>>He);Me===n.TEXTURE_3D||Me===n.TEXTURE_2D_ARRAY?t.texImage3D(Me,He,Re,Ke,$e,k.depth,0,ze,Ce,null):t.texImage2D(Me,He,Re,Ke,$e,0,ze,Ce,null)}t.bindFramebuffer(n.FRAMEBUFFER,j),xn(k)?c.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,me,Me,mt.__webglTexture,0,kt(k)):(Me===n.TEXTURE_2D||Me>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&Me<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,me,Me,mt.__webglTexture,He),t.bindFramebuffer(n.FRAMEBUFFER,null)}function $t(j,k,ae){if(n.bindRenderbuffer(n.RENDERBUFFER,j),k.depthBuffer){const me=k.depthTexture,Me=me&&me.isDepthTexture?me.type:null,He=L(k.stencilBuffer,Me),ze=k.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;xn(k)?c.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,kt(k),He,k.width,k.height):ae?n.renderbufferStorageMultisample(n.RENDERBUFFER,kt(k),He,k.width,k.height):n.renderbufferStorage(n.RENDERBUFFER,He,k.width,k.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,ze,n.RENDERBUFFER,j)}else{const me=k.textures;for(let Me=0;Me{delete k.__boundDepthTexture,delete k.__depthDisposeCallback,me.removeEventListener("dispose",Me)};me.addEventListener("dispose",Me),k.__depthDisposeCallback=Me}k.__boundDepthTexture=me}if(j.depthTexture&&!k.__autoAllocateDepthBuffer)if(ae)for(let me=0;me<6;me++)et(k.__webglFramebuffer[me],j,me);else{const me=j.texture.mipmaps;me&&me.length>0?et(k.__webglFramebuffer[0],j,0):et(k.__webglFramebuffer,j,0)}else if(ae){k.__webglDepthbuffer=[];for(let me=0;me<6;me++)if(t.bindFramebuffer(n.FRAMEBUFFER,k.__webglFramebuffer[me]),k.__webglDepthbuffer[me]===void 0)k.__webglDepthbuffer[me]=n.createRenderbuffer(),$t(k.__webglDepthbuffer[me],j,!1);else{const Me=j.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,He=k.__webglDepthbuffer[me];n.bindRenderbuffer(n.RENDERBUFFER,He),n.framebufferRenderbuffer(n.FRAMEBUFFER,Me,n.RENDERBUFFER,He)}}else{const me=j.texture.mipmaps;if(me&&me.length>0?t.bindFramebuffer(n.FRAMEBUFFER,k.__webglFramebuffer[0]):t.bindFramebuffer(n.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer===void 0)k.__webglDepthbuffer=n.createRenderbuffer(),$t(k.__webglDepthbuffer,j,!1);else{const Me=j.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,He=k.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,He),n.framebufferRenderbuffer(n.FRAMEBUFFER,Me,n.RENDERBUFFER,He)}}t.bindFramebuffer(n.FRAMEBUFFER,null)}function Ht(j,k,ae){const me=i.get(j);k!==void 0&&ot(me.__webglFramebuffer,j,j.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),ae!==void 0&&Lt(j)}function Ft(j){const k=j.texture,ae=i.get(j),me=i.get(k);j.addEventListener("dispose",b);const Me=j.textures,He=j.isWebGLCubeRenderTarget===!0,ze=Me.length>1;if(ze||(me.__webglTexture===void 0&&(me.__webglTexture=n.createTexture()),me.__version=k.version,l.memory.textures++),He){ae.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0){ae.__webglFramebuffer[Ce]=[];for(let Re=0;Re0){ae.__webglFramebuffer=[];for(let Ce=0;Ce0&&xn(j)===!1){ae.__webglMultisampledFramebuffer=n.createFramebuffer(),ae.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ae.__webglMultisampledFramebuffer);for(let Ce=0;Ce0)for(let Re=0;Re0)for(let Re=0;Re0){if(xn(j)===!1){const k=j.textures,ae=j.width,me=j.height;let Me=n.COLOR_BUFFER_BIT;const He=j.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ze=i.get(j),Ce=k.length>1;if(Ce)for(let nt=0;nt0?t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ze.__webglFramebuffer[0]):t.bindFramebuffer(n.DRAW_FRAMEBUFFER,ze.__webglFramebuffer);for(let nt=0;nt0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function ie(j){const k=l.render.frame;m.get(j)!==k&&(m.set(j,k),j.update())}function Un(j,k){const ae=j.colorSpace,me=j.format,Me=j.type;return j.isCompressedTexture===!0||j.isVideoTexture===!0||ae!==Hv&&ae!==Wu&&(En.getTransfer(ae)===Zn?(me!==Bo||Me!==co)&&jt("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Pn("WebGLTextures: Unsupported texture color space:",ae)),k}function Ut(j){return typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement?(p.width=j.naturalWidth||j.width,p.height=j.naturalHeight||j.height):typeof VideoFrame<"u"&&j instanceof VideoFrame?(p.width=j.displayWidth,p.height=j.displayHeight):(p.width=j.width,p.height=j.height),p}this.allocateTextureUnit=ce,this.resetTextureUnits=le,this.getTextureUnits=pe,this.setTextureUnits=ee,this.setTexture2D=X,this.setTexture2DArray=Q,this.setTexture3D=B,this.setTextureCube=G,this.rebindTextures=Ht,this.setupRenderTarget=Ft,this.updateRenderTargetMipmap=ve,this.updateMultisampleRenderTarget=pn,this.setupDepthRenderbuffer=Lt,this.setupFrameBufferTexture=ot,this.useMultisampledRTT=xn,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function W5(n,e){function t(i,r=Wu){let o;const l=En.getTransfer(r);if(i===co)return n.UNSIGNED_BYTE;if(i===dM)return n.UNSIGNED_SHORT_4_4_4_4;if(i===hM)return n.UNSIGNED_SHORT_5_5_5_1;if(i===Ib)return n.UNSIGNED_INT_5_9_9_9_REV;if(i===kb)return n.UNSIGNED_INT_10F_11F_11F_REV;if(i===Nb)return n.BYTE;if(i===Lb)return n.SHORT;if(i===eg)return n.UNSIGNED_SHORT;if(i===fM)return n.INT;if(i===tl)return n.UNSIGNED_INT;if(i===xa)return n.FLOAT;if(i===tu)return n.HALF_FLOAT;if(i===Ob)return n.ALPHA;if(i===Ub)return n.RGB;if(i===Bo)return n.RGBA;if(i===nu)return n.DEPTH_COMPONENT;if(i===gf)return n.DEPTH_STENCIL;if(i===pM)return n.RED;if(i===mM)return n.RED_INTEGER;if(i===bf)return n.RG;if(i===gM)return n.RG_INTEGER;if(i===vM)return n.RGBA_INTEGER;if(i===fv||i===dv||i===hv||i===pv)if(l===Zn)if(o=e.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(i===fv)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===dv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===hv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===pv)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(i===fv)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===dv)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===hv)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===pv)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===MS||i===ES||i===wS||i===TS)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(i===MS)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===ES)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===wS)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===TS)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===CS||i===AS||i===RS||i===PS||i===bS||i===Bv||i===DS)if(o=e.get("WEBGL_compressed_texture_etc"),o!==null){if(i===CS||i===AS)return l===Zn?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(i===RS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC;if(i===PS)return o.COMPRESSED_R11_EAC;if(i===bS)return o.COMPRESSED_SIGNED_R11_EAC;if(i===Bv)return o.COMPRESSED_RG11_EAC;if(i===DS)return o.COMPRESSED_SIGNED_RG11_EAC}else return null;if(i===NS||i===LS||i===IS||i===kS||i===OS||i===US||i===FS||i===zS||i===BS||i===VS||i===HS||i===GS||i===WS||i===XS)if(o=e.get("WEBGL_compressed_texture_astc"),o!==null){if(i===NS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===LS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===IS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===kS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===OS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===US)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===FS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===zS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===BS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===VS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===HS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===GS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===WS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===XS)return l===Zn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===jS||i===YS||i===qS)if(o=e.get("EXT_texture_compression_bptc"),o!==null){if(i===jS)return l===Zn?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===YS)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===qS)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===ZS||i===KS||i===Vv||i===$S)if(o=e.get("EXT_texture_compression_rgtc"),o!==null){if(i===ZS)return o.COMPRESSED_RED_RGTC1_EXT;if(i===KS)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===Vv)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===$S)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===tg?n.UNSIGNED_INT_24_8:n[i]!==void 0?n[i]:null}return{convert:t}}const X5=` void main() { gl_Position = vec4( position, 1.0 ); }`,j5=` 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 Y5{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const i=new Yb(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,i=new nl({vertexShader:X5,fragmentShader:j5,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Ho(new u_(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class q5 extends If{constructor(e,t){super();const i=this;let r=null,o=1,l=null,c="local-floor",d=1,p=null,m=null,v=null,g=null,y=null,E=null;const C=typeof XRWebGLBinding<"u",w=new Y5,M={},P=t.getContextAttributes();let I=null,D=null;const L=[],O=[],U=new Dn;let b=null;const F=new Uo;F.viewport=new Li;const H=new Uo;H.viewport=new Li;const W=[F,H],Y=new nz;let le=null,pe=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(fe){let Ae=L[fe];return Ae===void 0&&(Ae=new Ox,L[fe]=Ae),Ae.getTargetRaySpace()},this.getControllerGrip=function(fe){let Ae=L[fe];return Ae===void 0&&(Ae=new Ox,L[fe]=Ae),Ae.getGripSpace()},this.getHand=function(fe){let Ae=L[fe];return Ae===void 0&&(Ae=new Ox,L[fe]=Ae),Ae.getHandSpace()};function ee(fe){const Ae=O.indexOf(fe.inputSource);if(Ae===-1)return;const Te=L[Ae];Te!==void 0&&(Te.update(fe.inputSource,fe.frame,p||l),Te.dispatchEvent({type:fe.type,data:fe.inputSource}))}function ce(){r.removeEventListener("select",ee),r.removeEventListener("selectstart",ee),r.removeEventListener("selectend",ee),r.removeEventListener("squeeze",ee),r.removeEventListener("squeezestart",ee),r.removeEventListener("squeezeend",ee),r.removeEventListener("end",ce),r.removeEventListener("inputsourceschange",$);for(let fe=0;fe=0&&(O[Ze]=null,L[Ze].disconnect(Te))}for(let Ae=0;Ae=O.length){O.push(Te),Ze=ot;break}else if(O[ot]===null){O[ot]=Te,Ze=ot;break}if(Ze===-1)break}const pt=L[Ze];pt&&pt.connect(Te)}}const X=new xe,Q=new xe;function B(fe,Ae,Te){X.setFromMatrixPosition(Ae.matrixWorld),Q.setFromMatrixPosition(Te.matrixWorld);const Ze=X.distanceTo(Q),pt=Ae.projectionMatrix.elements,ot=Te.projectionMatrix.elements,$t=pt[14]/(pt[10]-1),et=pt[14]/(pt[10]+1),Lt=(pt[9]+1)/pt[5],Ht=(pt[9]-1)/pt[5],Ft=(pt[8]-1)/pt[0],ve=(ot[8]+1)/ot[0],hn=$t*Ft,Cn=$t*ve,pn=Ze/(-Ft+ve),kt=pn*-Ft;if(Ae.matrixWorld.decompose(fe.position,fe.quaternion,fe.scale),fe.translateX(kt),fe.translateZ(pn),fe.matrixWorld.compose(fe.position,fe.quaternion,fe.scale),fe.matrixWorldInverse.copy(fe.matrixWorld).invert(),pt[10]===-1)fe.projectionMatrix.copy(Ae.projectionMatrix),fe.projectionMatrixInverse.copy(Ae.projectionMatrixInverse);else{const xn=$t+pn,ie=et+pn,Un=hn-kt,Ut=Cn+(Ze-kt),j=Lt*et/ie*xn,k=Ht*et/ie*xn;fe.projectionMatrix.makePerspective(Un,Ut,j,k,xn,ie),fe.projectionMatrixInverse.copy(fe.projectionMatrix).invert()}}function G(fe,Ae){Ae===null?fe.matrixWorld.copy(fe.matrix):fe.matrixWorld.multiplyMatrices(Ae.matrixWorld,fe.matrix),fe.matrixWorldInverse.copy(fe.matrixWorld).invert()}this.updateCamera=function(fe){if(r===null)return;let Ae=fe.near,Te=fe.far;w.texture!==null&&(w.depthNear>0&&(Ae=w.depthNear),w.depthFar>0&&(Te=w.depthFar)),Y.near=H.near=F.near=Ae,Y.far=H.far=F.far=Te,(le!==Y.near||pe!==Y.far)&&(r.updateRenderState({depthNear:Y.near,depthFar:Y.far}),le=Y.near,pe=Y.far),Y.layers.mask=fe.layers.mask|6,F.layers.mask=Y.layers.mask&-5,H.layers.mask=Y.layers.mask&-3;const Ze=fe.parent,pt=Y.cameras;G(Y,Ze);for(let ot=0;ot0&&(w.alphaTest.value=M.alphaTest);const P=e.get(M),I=P.envMap,D=P.envMapRotation;I&&(w.envMap.value=I,w.envMapRotation.value.setFromMatrix4(Z5.makeRotationFromEuler(D)).transpose(),I.isCubeTexture&&I.isRenderTargetTexture===!1&&w.envMapRotation.value.premultiply(n2),w.reflectivity.value=M.reflectivity,w.ior.value=M.ior,w.refractionRatio.value=M.refractionRatio),M.lightMap&&(w.lightMap.value=M.lightMap,w.lightMapIntensity.value=M.lightMapIntensity,t(M.lightMap,w.lightMapTransform)),M.aoMap&&(w.aoMap.value=M.aoMap,w.aoMapIntensity.value=M.aoMapIntensity,t(M.aoMap,w.aoMapTransform))}function l(w,M){w.diffuse.value.copy(M.color),w.opacity.value=M.opacity,M.map&&(w.map.value=M.map,t(M.map,w.mapTransform))}function c(w,M){w.dashSize.value=M.dashSize,w.totalSize.value=M.dashSize+M.gapSize,w.scale.value=M.scale}function d(w,M,P,I){w.diffuse.value.copy(M.color),w.opacity.value=M.opacity,w.size.value=M.size*P,w.scale.value=I*.5,M.map&&(w.map.value=M.map,t(M.map,w.uvTransform)),M.alphaMap&&(w.alphaMap.value=M.alphaMap,t(M.alphaMap,w.alphaMapTransform)),M.alphaTest>0&&(w.alphaTest.value=M.alphaTest)}function p(w,M){w.diffuse.value.copy(M.color),w.opacity.value=M.opacity,w.rotation.value=M.rotation,M.map&&(w.map.value=M.map,t(M.map,w.mapTransform)),M.alphaMap&&(w.alphaMap.value=M.alphaMap,t(M.alphaMap,w.alphaMapTransform)),M.alphaTest>0&&(w.alphaTest.value=M.alphaTest)}function m(w,M){w.specular.value.copy(M.specular),w.shininess.value=Math.max(M.shininess,1e-4)}function v(w,M){M.gradientMap&&(w.gradientMap.value=M.gradientMap)}function g(w,M){w.metalness.value=M.metalness,M.metalnessMap&&(w.metalnessMap.value=M.metalnessMap,t(M.metalnessMap,w.metalnessMapTransform)),w.roughness.value=M.roughness,M.roughnessMap&&(w.roughnessMap.value=M.roughnessMap,t(M.roughnessMap,w.roughnessMapTransform)),M.envMap&&(w.envMapIntensity.value=M.envMapIntensity)}function y(w,M,P){w.ior.value=M.ior,M.sheen>0&&(w.sheenColor.value.copy(M.sheenColor).multiplyScalar(M.sheen),w.sheenRoughness.value=M.sheenRoughness,M.sheenColorMap&&(w.sheenColorMap.value=M.sheenColorMap,t(M.sheenColorMap,w.sheenColorMapTransform)),M.sheenRoughnessMap&&(w.sheenRoughnessMap.value=M.sheenRoughnessMap,t(M.sheenRoughnessMap,w.sheenRoughnessMapTransform))),M.clearcoat>0&&(w.clearcoat.value=M.clearcoat,w.clearcoatRoughness.value=M.clearcoatRoughness,M.clearcoatMap&&(w.clearcoatMap.value=M.clearcoatMap,t(M.clearcoatMap,w.clearcoatMapTransform)),M.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=M.clearcoatRoughnessMap,t(M.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),M.clearcoatNormalMap&&(w.clearcoatNormalMap.value=M.clearcoatNormalMap,t(M.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(M.clearcoatNormalScale),M.side===Hs&&w.clearcoatNormalScale.value.negate())),M.dispersion>0&&(w.dispersion.value=M.dispersion),M.iridescence>0&&(w.iridescence.value=M.iridescence,w.iridescenceIOR.value=M.iridescenceIOR,w.iridescenceThicknessMinimum.value=M.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=M.iridescenceThicknessRange[1],M.iridescenceMap&&(w.iridescenceMap.value=M.iridescenceMap,t(M.iridescenceMap,w.iridescenceMapTransform)),M.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=M.iridescenceThicknessMap,t(M.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),M.transmission>0&&(w.transmission.value=M.transmission,w.transmissionSamplerMap.value=P.texture,w.transmissionSamplerSize.value.set(P.width,P.height),M.transmissionMap&&(w.transmissionMap.value=M.transmissionMap,t(M.transmissionMap,w.transmissionMapTransform)),w.thickness.value=M.thickness,M.thicknessMap&&(w.thicknessMap.value=M.thicknessMap,t(M.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=M.attenuationDistance,w.attenuationColor.value.copy(M.attenuationColor)),M.anisotropy>0&&(w.anisotropyVector.value.set(M.anisotropy*Math.cos(M.anisotropyRotation),M.anisotropy*Math.sin(M.anisotropyRotation)),M.anisotropyMap&&(w.anisotropyMap.value=M.anisotropyMap,t(M.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=M.specularIntensity,w.specularColor.value.copy(M.specularColor),M.specularColorMap&&(w.specularColorMap.value=M.specularColorMap,t(M.specularColorMap,w.specularColorMapTransform)),M.specularIntensityMap&&(w.specularIntensityMap.value=M.specularIntensityMap,t(M.specularIntensityMap,w.specularIntensityMapTransform))}function E(w,M){M.matcap&&(w.matcap.value=M.matcap)}function C(w,M){const P=e.get(M).light;w.referencePosition.value.setFromMatrixPosition(P.matrixWorld),w.nearDistance.value=P.shadow.camera.near,w.farDistance.value=P.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function $5(n,e,t,i){let r={},o={},l=[];const c=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function d(D,L){const O=L.program;i.uniformBlockBinding(D,O)}function p(D,L){let O=r[D.id];O===void 0&&(w(D),O=m(D),r[D.id]=O,D.addEventListener("dispose",P));const U=L.program;i.updateUBOMapping(D,U);const b=e.render.frame;o[D.id]!==b&&(g(D),o[D.id]=b)}function m(D){const L=v();D.__bindingPointIndex=L;const O=n.createBuffer(),U=D.__size,b=D.usage;return n.bindBuffer(n.UNIFORM_BUFFER,O),n.bufferData(n.UNIFORM_BUFFER,U,b),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,L,O),O}function v(){for(let D=0;D0&&(O+=U-b),D.__size=O,D.__cache={},this}function M(D){const L={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(L.boundary=4,L.storage=4):D.isVector2?(L.boundary=8,L.storage=8):D.isVector3||D.isColor?(L.boundary=16,L.storage=12):D.isVector4?(L.boundary=16,L.storage=16):D.isMatrix3?(L.boundary=48,L.storage=48):D.isMatrix4?(L.boundary=64,L.storage=64):D.isTexture?jt("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(D)?(L.boundary=16,L.storage=D.byteLength):jt("WebGLRenderer: Unsupported uniform value type.",D),L}function P(D){const L=D.target;L.removeEventListener("dispose",P);const O=l.indexOf(L.__bindingPointIndex);l.splice(O,1),n.deleteBuffer(r[L.id]),delete r[L.id],delete o[L.id]}function I(){for(const D in r)n.deleteBuffer(r[D]);l=[],r={},o={}}return{bind:d,update:p,dispose:I}}const Q5=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let Ba=null;function J5(){return Ba===null&&(Ba=new Wb(Q5,16,16,bf,tu),Ba.name="DFG_LUT",Ba.minFilter=Jr,Ba.magFilter=Jr,Ba.wrapS=Wl,Ba.wrapT=Wl,Ba.generateMipmaps=!1,Ba.needsUpdate=!0),Ba}class eH{constructor(e={}){const{canvas:t=vF(),context:i=null,depth:r=!0,stencil:o=!1,alpha:l=!1,antialias:c=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:p=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:v=!1,reversedDepthBuffer:g=!1,outputBufferType:y=co}=e;this.isWebGLRenderer=!0;let E;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=i.getContextAttributes().alpha}else E=l;const C=y,w=new Set([vM,gM,mM]),M=new Set([co,tl,eg,tg,dM,hM]),P=new Uint32Array(4),I=new Int32Array(4),D=new xe;let L=null,O=null;const U=[],b=[];let F=null;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.toneMapping=Sa,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const H=this;let W=!1,Y=null,le=null,pe=null,ee=null;this._outputColorSpace=Io;let ce=0,$=0,X=null,Q=-1,B=null;const G=new Li,te=new Li;let Oe=null;const We=new bn(0);let qe=0,fe=t.width,Ae=t.height,Te=1,Ze=null,pt=null;const ot=new Li(0,0,fe,Ae),$t=new Li(0,0,fe,Ae);let et=!1;const Lt=new Xb;let Ht=!1,Ft=!1;const ve=new yi,hn=new xe,Cn=new Li,pn={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let kt=!1;function xn(){return X===null?Te:1}let ie=i;function Un(V,se){return t.getContext(V,se)}try{const V={alpha:!0,depth:r,stencil:o,antialias:c,premultipliedAlpha:d,preserveDrawingBuffer:p,powerPreference:m,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${uM}`),t.addEventListener("webglcontextlost",Tt,!1),t.addEventListener("webglcontextrestored",Ue,!1),t.addEventListener("webglcontextcreationerror",Ct,!1),ie===null){const se="webgl2";if(ie=Un(se,V),ie===null)throw Un(se)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}}catch(V){throw Pn("WebGLRenderer: "+V.message),V}let Ut,j,k,ae,me,Me,He,ze,Ce,Re,nt,mt,Ke,$e,Ge,Mt,wt,J,Xe,Pe,Je,rt,Ne;function ke(){Ut=new JB(ie),Ut.init(),Je=new W5(ie,Ut),j=new XB(ie,Ut,e,Je),k=new H5(ie,Ut),j.reversedDepthBuffer&&g&&k.buffers.depth.setReversed(!0),le=ie.createFramebuffer(),pe=ie.createFramebuffer(),ee=ie.createFramebuffer(),ae=new nV(ie),me=new R5,Me=new G5(ie,Ut,k,me,j,Je,ae),He=new QB(H),ze=new oz(ie),rt=new GB(ie,ze),Ce=new eV(ie,ze,ae,rt),Re=new rV(ie,Ce,ze,rt,ae),J=new iV(ie,j,Me),Ge=new jB(me),nt=new A5(H,He,Ut,j,rt,Ge),mt=new K5(H,me),Ke=new b5,$e=new O5(Ut),wt=new HB(H,He,k,Re,E,d),Mt=new V5(H,Re,j),Ne=new $5(ie,ae,j,k),Xe=new WB(ie,Ut,ae),Pe=new tV(ie,Ut,ae),ae.programs=nt.programs,H.capabilities=j,H.extensions=Ut,H.properties=me,H.renderLists=Ke,H.shadowMap=Mt,H.state=k,H.info=ae}ke(),C!==co&&(F=new oV(C,t.width,t.height,c,r,o));const Le=new q5(H,ie);this.xr=Le,this.getContext=function(){return ie},this.getContextAttributes=function(){return ie.getContextAttributes()},this.forceContextLoss=function(){const V=Ut.get("WEBGL_lose_context");V&&V.loseContext()},this.forceContextRestore=function(){const V=Ut.get("WEBGL_lose_context");V&&V.restoreContext()},this.getPixelRatio=function(){return Te},this.setPixelRatio=function(V){V!==void 0&&(Te=V,this.setSize(fe,Ae,!1))},this.getSize=function(V){return V.set(fe,Ae)},this.setSize=function(V,se,_e=!0){if(Le.isPresenting){jt("WebGLRenderer: Can't change size while VR device is presenting.");return}fe=V,Ae=se,t.width=Math.floor(V*Te),t.height=Math.floor(se*Te),_e===!0&&(t.style.width=V+"px",t.style.height=se+"px"),F!==null&&F.setSize(t.width,t.height),this.setViewport(0,0,V,se)},this.getDrawingBufferSize=function(V){return V.set(fe*Te,Ae*Te).floor()},this.setDrawingBufferSize=function(V,se,_e){fe=V,Ae=se,Te=_e,t.width=Math.floor(V*_e),t.height=Math.floor(se*_e),this.setViewport(0,0,V,se)},this.setEffects=function(V){if(C===co){Pn("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(V){for(let se=0;se{function Ie(){if(de.forEach(function(Fe){me.get(Fe).currentProgram.isReady()&&de.delete(Fe)}),de.size===0){he(V);return}setTimeout(Ie,10)}Ut.get("KHR_parallel_shader_compile")!==null?Ie():setTimeout(Ie,10)})};let Fn=null;function Ri(V){Fn&&Fn(V)}function Wn(){Qt.stop()}function zn(){Qt.start()}const Qt=new Zb;Qt.setAnimationLoop(Ri),typeof self<"u"&&Qt.setContext(self),this.setAnimationLoop=function(V){Fn=V,Le.setAnimationLoop(V),V===null?Qt.stop():Qt.start()},Le.addEventListener("sessionstart",Wn),Le.addEventListener("sessionend",zn),this.render=function(V,se){if(se!==void 0&&se.isCamera!==!0){Pn("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(W===!0)return;Y!==null&&Y.renderStart(V,se);const _e=Le.enabled===!0&&Le.isPresenting===!0,de=F!==null&&(X===null||_e)&&F.begin(H,X);if(V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),se.parent===null&&se.matrixWorldAutoUpdate===!0&&se.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(F===null||F.isCompositing()===!1)&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(se),se=Le.getCamera()),V.isScene===!0&&V.onBeforeRender(H,V,se,X),O=$e.get(V,b.length),O.init(se),O.state.textureUnits=Me.getTextureUnits(),b.push(O),ve.multiplyMatrices(se.projectionMatrix,se.matrixWorldInverse),Lt.setFromProjectionMatrix(ve,qa,se.reversedDepth),Ft=this.localClippingEnabled,Ht=Ge.init(this.clippingPlanes,Ft),L=Ke.get(V,U.length),L.init(),U.push(L),Le.enabled===!0&&Le.isPresenting===!0){const Fe=H.xr.getDepthSensingMesh();Fe!==null&&Hi(Fe,se,-1/0,H.sortObjects)}Hi(V,se,0,H.sortObjects),L.finish(),H.sortObjects===!0&&L.sort(Ze,pt,se.reversedDepth),kt=Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1,kt&&wt.addToRenderList(L,V),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),Ht===!0&&Ge.beginShadows();const he=O.state.shadowsArray;if(Mt.render(he,V,se),Ht===!0&&Ge.endShadows(),(de&&F.hasRenderPass())===!1){const Fe=L.opaque,Ye=L.transmissive;if(O.setupLights(),se.isArrayCamera){const lt=se.cameras;if(Ye.length>0)for(let dt=0,zt=lt.length;dt0&&ki(Fe,Ye,V,se),kt&&wt.render(V),Bn(L,V,se)}X!==null&&$===0&&(Me.updateMultisampleRenderTarget(X),Me.updateRenderTargetMipmap(X)),de&&F.end(H),V.isScene===!0&&V.onAfterRender(H,V,se),rt.resetDefaultState(),Q=-1,B=null,b.pop(),b.length>0?(O=b[b.length-1],Me.setTextureUnits(O.state.textureUnits),Ht===!0&&Ge.setGlobalState(H.clippingPlanes,O.state.camera)):O=null,U.pop(),U.length>0?L=U[U.length-1]:L=null,Y!==null&&Y.renderEnd()};function Hi(V,se,_e,de){if(V.visible===!1)return;if(V.layers.test(se.layers)){if(V.isGroup)_e=V.renderOrder;else if(V.isLOD)V.autoUpdate===!0&&V.update(se);else if(V.isLightProbeGrid)O.pushLightProbeGrid(V);else if(V.isLight)O.pushLight(V),V.castShadow&&O.pushShadow(V);else if(V.isSprite){if(!V.frustumCulled||Lt.intersectsSprite(V)){de&&Cn.setFromMatrixPosition(V.matrixWorld).applyMatrix4(ve);const Fe=Re.update(V),Ye=V.material;Ye.visible&&L.push(V,Fe,Ye,_e,Cn.z,null)}}else if((V.isMesh||V.isLine||V.isPoints)&&(!V.frustumCulled||Lt.intersectsObject(V))){const Fe=Re.update(V),Ye=V.material;if(de&&(V.boundingSphere!==void 0?(V.boundingSphere===null&&V.computeBoundingSphere(),Cn.copy(V.boundingSphere.center)):(Fe.boundingSphere===null&&Fe.computeBoundingSphere(),Cn.copy(Fe.boundingSphere.center)),Cn.applyMatrix4(V.matrixWorld).applyMatrix4(ve)),Array.isArray(Ye)){const lt=Fe.groups;for(let dt=0,zt=lt.length;dt0&&Gi(he,se,_e),Ie.length>0&&Gi(Ie,se,_e),Fe.length>0&&Gi(Fe,se,_e),k.buffers.depth.setTest(!0),k.buffers.depth.setMask(!0),k.buffers.color.setMask(!0),k.setPolygonOffset(!1)}function ki(V,se,_e,de){if((_e.isScene===!0?_e.overrideMaterial:null)!==null)return;if(O.state.transmissionRenderTarget[de.id]===void 0){const ut=Ut.has("EXT_color_buffer_half_float")||Ut.has("EXT_color_buffer_float");O.state.transmissionRenderTarget[de.id]=new Ja(1,1,{generateMipmaps:!0,type:ut?tu:co,minFilter:mf,samples:Math.max(4,j.samples),stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:En.workingColorSpace})}const Ie=O.state.transmissionRenderTarget[de.id],Fe=de.viewport||G;Ie.setSize(Fe.z*H.transmissionResolutionScale,Fe.w*H.transmissionResolutionScale);const Ye=H.getRenderTarget(),lt=H.getActiveCubeFace(),dt=H.getActiveMipmapLevel();H.setRenderTarget(Ie),H.getClearColor(We),qe=H.getClearAlpha(),qe<1&&H.setClearColor(16777215,.5),H.clear(),kt&&wt.render(_e);const zt=H.toneMapping;H.toneMapping=Sa;const Gt=de.viewport;if(de.viewport!==void 0&&(de.viewport=void 0),O.setupLightsView(de),Ht===!0&&Ge.setGlobalState(H.clippingPlanes,de),Gi(V,_e,de),Me.updateMultisampleRenderTarget(Ie),Me.updateRenderTargetMipmap(Ie),Ut.has("WEBGL_multisampled_render_to_texture")===!1){let ut=!1;for(let fn=0,jn=se.length;fn0,de.currentProgram=Gt,de.uniformsList=null,Gt}function pi(V){if(V.uniformsList===null){const se=V.currentProgram.getUniforms();V.uniformsList=mv.seqWithValue(se.seq,V.uniforms)}return V.uniformsList}function Ms(V,se){const _e=me.get(V);_e.outputColorSpace=se.outputColorSpace,_e.batching=se.batching,_e.batchingColor=se.batchingColor,_e.instancing=se.instancing,_e.instancingColor=se.instancingColor,_e.instancingMorph=se.instancingMorph,_e.skinning=se.skinning,_e.morphTargets=se.morphTargets,_e.morphNormals=se.morphNormals,_e.morphColors=se.morphColors,_e.morphTargetsCount=se.morphTargetsCount,_e.numClippingPlanes=se.numClippingPlanes,_e.numIntersection=se.numClipIntersection,_e.vertexAlphas=se.vertexAlphas,_e.vertexTangents=se.vertexTangents,_e.toneMapping=se.toneMapping}function Ta(V,se){if(V.length===0)return null;if(V.length===1)return V[0].texture!==null?V[0]:null;D.setFromMatrixPosition(se.matrixWorld);for(let _e=0,de=V.length;_e0),ut=!!_e.morphAttributes.position,fn=!!_e.morphAttributes.normal,jn=!!_e.morphAttributes.color;let ti=Sa;de.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(ti=H.toneMapping);const An=_e.morphAttributes.position||_e.morphAttributes.normal||_e.morphAttributes.color,Si=An!==void 0?An.length:0,at=me.get(de),tr=O.state.lights;if(Ht===!0&&(Ft===!0||V!==B)){const Nn=V===B&&de.id===Q;Ge.setState(de,V,Nn)}let ln=!1;de.version===at.__version?(at.needsLights&&at.lightsStateVersion!==tr.state.version||at.outputColorSpace!==Ye||he.isBatchedMesh&&at.batching===!1||!he.isBatchedMesh&&at.batching===!0||he.isBatchedMesh&&at.batchingColor===!0&&he.colorTexture===null||he.isBatchedMesh&&at.batchingColor===!1&&he.colorTexture!==null||he.isInstancedMesh&&at.instancing===!1||!he.isInstancedMesh&&at.instancing===!0||he.isSkinnedMesh&&at.skinning===!1||!he.isSkinnedMesh&&at.skinning===!0||he.isInstancedMesh&&at.instancingColor===!0&&he.instanceColor===null||he.isInstancedMesh&&at.instancingColor===!1&&he.instanceColor!==null||he.isInstancedMesh&&at.instancingMorph===!0&&he.morphTexture===null||he.isInstancedMesh&&at.instancingMorph===!1&&he.morphTexture!==null||at.envMap!==dt||de.fog===!0&&at.fog!==Ie||at.numClippingPlanes!==void 0&&(at.numClippingPlanes!==Ge.numPlanes||at.numIntersection!==Ge.numIntersection)||at.vertexAlphas!==zt||at.vertexTangents!==Gt||at.morphTargets!==ut||at.morphNormals!==fn||at.morphColors!==jn||at.toneMapping!==ti||at.morphTargetsCount!==Si||!!at.lightProbeGrid!=O.state.lightProbeGridArray.length>0)&&(ln=!0):(ln=!0,at.__version=de.version);let Ur=at.currentProgram;ln===!0&&(Ur=ei(de,se,he),Y&&de.isNodeMaterial&&Y.onUpdateProgram(de,Ur,at));let nr=!1,sn=!1,ns=!1;const Sn=Ur.getUniforms(),ni=at.uniforms;if(k.useProgram(Ur.program)&&(nr=!0,sn=!0,ns=!0),de.id!==Q&&(Q=de.id,sn=!0),at.needsLights){const Nn=Ta(O.state.lightProbeGridArray,he);at.lightProbeGrid!==Nn&&(at.lightProbeGrid=Nn,sn=!0)}if(nr||B!==V){k.buffers.depth.getReversed()&&V.reversedDepth!==!0&&(V._reversedDepth=!0,V.updateProjectionMatrix()),Sn.setValue(ie,"projectionMatrix",V.projectionMatrix),Sn.setValue(ie,"viewMatrix",V.matrixWorldInverse);const is=Sn.map.cameraPosition;is!==void 0&&is.setValue(ie,hn.setFromMatrixPosition(V.matrixWorld)),j.logarithmicDepthBuffer&&Sn.setValue(ie,"logDepthBufFC",2/(Math.log(V.far+1)/Math.LN2)),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&Sn.setValue(ie,"isOrthographic",V.isOrthographicCamera===!0),B!==V&&(B=V,sn=!0,ns=!0)}if(at.needsLights&&(tr.state.directionalShadowMap.length>0&&Sn.setValue(ie,"directionalShadowMap",tr.state.directionalShadowMap,Me),tr.state.spotShadowMap.length>0&&Sn.setValue(ie,"spotShadowMap",tr.state.spotShadowMap,Me),tr.state.pointShadowMap.length>0&&Sn.setValue(ie,"pointShadowMap",tr.state.pointShadowMap,Me)),he.isSkinnedMesh){Sn.setOptional(ie,he,"bindMatrix"),Sn.setOptional(ie,he,"bindMatrixInverse");const Nn=he.skeleton;Nn&&(Nn.boneTexture===null&&Nn.computeBoneTexture(),Sn.setValue(ie,"boneTexture",Nn.boneTexture,Me))}he.isBatchedMesh&&(Sn.setOptional(ie,he,"batchingTexture"),Sn.setValue(ie,"batchingTexture",he._matricesTexture,Me),Sn.setOptional(ie,he,"batchingIdTexture"),Sn.setValue(ie,"batchingIdTexture",he._indirectTexture,Me),Sn.setOptional(ie,he,"batchingColorTexture"),he._colorsTexture!==null&&Sn.setValue(ie,"batchingColorTexture",he._colorsTexture,Me));const Xs=_e.morphAttributes;if((Xs.position!==void 0||Xs.normal!==void 0||Xs.color!==void 0)&&J.update(he,_e,Ur),(sn||at.receiveShadow!==he.receiveShadow)&&(at.receiveShadow=he.receiveShadow,Sn.setValue(ie,"receiveShadow",he.receiveShadow)),(de.isMeshStandardMaterial||de.isMeshLambertMaterial||de.isMeshPhongMaterial)&&de.envMap===null&&se.environment!==null&&(ni.envMapIntensity.value=se.environmentIntensity),ni.dfgLUT!==void 0&&(ni.dfgLUT.value=J5()),sn){if(Sn.setValue(ie,"toneMappingExposure",H.toneMappingExposure),at.needsLights&&Xn(ni,ns),Ie&&de.fog===!0&&mt.refreshFogUniforms(ni,Ie),mt.refreshMaterialUniforms(ni,de,Te,Ae,O.state.transmissionRenderTarget[V.id]),at.needsLights&&at.lightProbeGrid){const Nn=at.lightProbeGrid;ni.probesSH.value=Nn.texture,ni.probesMin.value.copy(Nn.boundingBox.min),ni.probesMax.value.copy(Nn.boundingBox.max),ni.probesResolution.value.copy(Nn.resolution)}mv.upload(ie,pi(at),ni,Me)}if(de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(mv.upload(ie,pi(at),ni,Me),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&Sn.setValue(ie,"center",he.center),Sn.setValue(ie,"modelViewMatrix",he.modelViewMatrix),Sn.setValue(ie,"normalMatrix",he.normalMatrix),Sn.setValue(ie,"modelMatrix",he.matrixWorld),de.uniformsGroups!==void 0){const Nn=de.uniformsGroups;for(let is=0,Fr=Nn.length;is0&&Me.useMultisampledRTT(V)===!1?de=me.get(V).__webglMultisampledFramebuffer:Array.isArray(dt)?de=dt[_e]:de=dt,G.copy(V.viewport),te.copy(V.scissor),Oe=V.scissorTest}else G.copy(ot).multiplyScalar(Te).floor(),te.copy($t).multiplyScalar(Te).floor(),Oe=et;if(_e!==0&&(de=le),k.bindFramebuffer(ie.FRAMEBUFFER,de)&&k.drawBuffers(V,de),k.viewport(G),k.scissor(te),k.setScissorTest(Oe),he){const Ye=me.get(V.texture);ie.framebufferTexture2D(ie.FRAMEBUFFER,ie.COLOR_ATTACHMENT0,ie.TEXTURE_CUBE_MAP_POSITIVE_X+se,Ye.__webglTexture,_e)}else if(Ie){const Ye=se;for(let lt=0;lt1&&ie.readBuffer(ie.COLOR_ATTACHMENT0+Ye),!j.textureFormatReadable(zt)){Pn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!j.textureTypeReadable(Gt)){Pn("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}se>=0&&se<=V.width-de&&_e>=0&&_e<=V.height-he&&ie.readPixels(se,_e,de,he,Je.convert(zt),Je.convert(Gt),Ie)}finally{const dt=X!==null?me.get(X).__webglFramebuffer:null;k.bindFramebuffer(ie.FRAMEBUFFER,dt)}}},this.readRenderTargetPixelsAsync=async function(V,se,_e,de,he,Ie,Fe,Ye=0){if(!(V&&V.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let lt=me.get(V).__webglFramebuffer;if(V.isWebGLCubeRenderTarget&&Fe!==void 0&&(lt=lt[Fe]),lt)if(se>=0&&se<=V.width-de&&_e>=0&&_e<=V.height-he){k.bindFramebuffer(ie.FRAMEBUFFER,lt);const dt=V.textures[Ye],zt=dt.format,Gt=dt.type;if(V.textures.length>1&&ie.readBuffer(ie.COLOR_ATTACHMENT0+Ye),!j.textureFormatReadable(zt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!j.textureTypeReadable(Gt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ut=ie.createBuffer();ie.bindBuffer(ie.PIXEL_PACK_BUFFER,ut),ie.bufferData(ie.PIXEL_PACK_BUFFER,Ie.byteLength,ie.STREAM_READ),ie.readPixels(se,_e,de,he,Je.convert(zt),Je.convert(Gt),0);const fn=X!==null?me.get(X).__webglFramebuffer:null;k.bindFramebuffer(ie.FRAMEBUFFER,fn);const jn=ie.fenceSync(ie.SYNC_GPU_COMMANDS_COMPLETE,0);return ie.flush(),await _F(ie,jn,4),ie.bindBuffer(ie.PIXEL_PACK_BUFFER,ut),ie.getBufferSubData(ie.PIXEL_PACK_BUFFER,0,Ie),ie.deleteBuffer(ut),ie.deleteSync(jn),Ie}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(V,se=null,_e=0){const de=Math.pow(2,-_e),he=Math.floor(V.image.width*de),Ie=Math.floor(V.image.height*de),Fe=se!==null?se.x:0,Ye=se!==null?se.y:0;Me.setTexture2D(V,0),ie.copyTexSubImage2D(ie.TEXTURE_2D,_e,0,0,Fe,Ye,he,Ie),k.unbindTexture()},this.copyTextureToTexture=function(V,se,_e=null,de=null,he=0,Ie=0){let Fe,Ye,lt,dt,zt,Gt,ut,fn,jn;const ti=V.isCompressedTexture?V.mipmaps[Ie]:V.image;if(_e!==null)Fe=_e.max.x-_e.min.x,Ye=_e.max.y-_e.min.y,lt=_e.isBox3?_e.max.z-_e.min.z:1,dt=_e.min.x,zt=_e.min.y,Gt=_e.isBox3?_e.min.z:0;else{const ni=Math.pow(2,-he);Fe=Math.floor(ti.width*ni),Ye=Math.floor(ti.height*ni),V.isDataArrayTexture?lt=ti.depth:V.isData3DTexture?lt=Math.floor(ti.depth*ni):lt=1,dt=0,zt=0,Gt=0}de!==null?(ut=de.x,fn=de.y,jn=de.z):(ut=0,fn=0,jn=0);const An=Je.convert(se.format),Si=Je.convert(se.type);let at;se.isData3DTexture?(Me.setTexture3D(se,0),at=ie.TEXTURE_3D):se.isDataArrayTexture||se.isCompressedArrayTexture?(Me.setTexture2DArray(se,0),at=ie.TEXTURE_2D_ARRAY):(Me.setTexture2D(se,0),at=ie.TEXTURE_2D),k.activeTexture(ie.TEXTURE0),k.pixelStorei(ie.UNPACK_FLIP_Y_WEBGL,se.flipY),k.pixelStorei(ie.UNPACK_PREMULTIPLY_ALPHA_WEBGL,se.premultiplyAlpha),k.pixelStorei(ie.UNPACK_ALIGNMENT,se.unpackAlignment);const tr=k.getParameter(ie.UNPACK_ROW_LENGTH),ln=k.getParameter(ie.UNPACK_IMAGE_HEIGHT),Ur=k.getParameter(ie.UNPACK_SKIP_PIXELS),nr=k.getParameter(ie.UNPACK_SKIP_ROWS),sn=k.getParameter(ie.UNPACK_SKIP_IMAGES);k.pixelStorei(ie.UNPACK_ROW_LENGTH,ti.width),k.pixelStorei(ie.UNPACK_IMAGE_HEIGHT,ti.height),k.pixelStorei(ie.UNPACK_SKIP_PIXELS,dt),k.pixelStorei(ie.UNPACK_SKIP_ROWS,zt),k.pixelStorei(ie.UNPACK_SKIP_IMAGES,Gt);const ns=V.isDataArrayTexture||V.isData3DTexture,Sn=se.isDataArrayTexture||se.isData3DTexture;if(V.isDepthTexture){const ni=me.get(V),Xs=me.get(se),Nn=me.get(ni.__renderTarget),is=me.get(Xs.__renderTarget);k.bindFramebuffer(ie.READ_FRAMEBUFFER,Nn.__webglFramebuffer),k.bindFramebuffer(ie.DRAW_FRAMEBUFFER,is.__webglFramebuffer);for(let Fr=0;Fr{const v=typeof p=="function"?p(e):p;if(v!==e){const g=e;e=m?v:Object.assign({},e,v),t.forEach(y=>y(e,g))}},r=()=>e,o=(p,m=r,v=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=m(e);function y(){const E=m(e);if(!v(g,E)){const C=g;p(g=E,C)}}return t.add(y),()=>t.delete(y)},d={setState:i,getState:r,subscribe:(p,m,v)=>m||v?o(p,m,v):(t.add(p),()=>t.delete(p)),destroy:()=>t.clear()};return e=n(i,r,d),d}const rH=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),nA=rH?De.useEffect:De.useLayoutEffect;function sH(n){const e=typeof n=="function"?iH(n):n,t=(i=e.getState,r=Object.is)=>{const[,o]=De.useReducer(w=>w+1,0),l=e.getState(),c=De.useRef(l),d=De.useRef(i),p=De.useRef(r),m=De.useRef(!1),v=De.useRef();v.current===void 0&&(v.current=i(l));let g,y=!1;(c.current!==l||d.current!==i||p.current!==r||m.current)&&(g=i(l),y=!r(v.current,g)),nA(()=>{y&&(v.current=g),c.current=l,d.current=i,p.current=r,m.current=!1});const E=De.useRef(l);nA(()=>{const w=()=>{try{const P=e.getState(),I=d.current(P);p.current(v.current,I)||(c.current=P,v.current=I,o())}catch{m.current=!0,o()}},M=e.subscribe(w);return e.getState()!==E.current&&w(),M},[]);const C=y?g:v.current;return De.useDebugValue(C),C};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}var oy={exports:{}},ay={exports:{}},ly={};/** * @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. */var iA;function oH(){return iA||(iA=1,(function(n){function e(X,Q){var B=X.length;X.push(Q);e:for(;0>>1,te=X[G];if(0>>1;Gr(qe,B))fer(Ae,qe)?(X[G]=Ae,X[fe]=B,G=fe):(X[G]=qe,X[We]=B,G=We);else if(fer(Ae,B))X[G]=Ae,X[fe]=B,G=fe;else break e}}return Q}function r(X,Q){var B=X.sortIndex-Q.sortIndex;return B!==0?B:X.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();n.unstable_now=function(){return l.now()-c}}var d=[],p=[],m=1,v=null,g=3,y=!1,E=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function I(X){for(var Q=t(p);Q!==null;){if(Q.callback===null)i(p);else if(Q.startTime<=X)i(p),Q.sortIndex=Q.expirationTime,e(d,Q);else break;Q=t(p)}}function D(X){if(C=!1,I(X),!E)if(t(d)!==null)E=!0,ce(L);else{var Q=t(p);Q!==null&&$(D,Q.startTime-X)}}function L(X,Q){E=!1,C&&(C=!1,M(b),b=-1),y=!0;var B=g;try{for(I(Q),v=t(d);v!==null&&(!(v.expirationTime>Q)||X&&!W());){var G=v.callback;if(typeof G=="function"){v.callback=null,g=v.priorityLevel;var te=G(v.expirationTime<=Q);Q=n.unstable_now(),typeof te=="function"?v.callback=te:v===t(d)&&i(d),I(Q)}else i(d);v=t(d)}if(v!==null)var Oe=!0;else{var We=t(p);We!==null&&$(D,We.startTime-Q),Oe=!1}return Oe}finally{v=null,g=B,y=!1}}var O=!1,U=null,b=-1,F=5,H=-1;function W(){return!(n.unstable_now()-HX||125G?(X.sortIndex=B,e(p,X),t(d)===null&&X===t(p)&&(C?(M(b),b=-1):C=!0,$(D,B-G))):(X.sortIndex=te,e(d,X),E||y||(E=!0,ce(L))),X},n.unstable_shouldYield=W,n.unstable_wrapCallback=function(X){var Q=g;return function(){var B=g;g=Q;try{return X.apply(this,arguments)}finally{g=B}}}})(ly)),ly}var rA;function i2(){return rA||(rA=1,ay.exports=oH()),ay.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 uy,sA;function aH(){return sA||(sA=1,uy=function(e){var t={},i=Zv(),r=i2(),o=Object.assign;function l(u){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+u,_=1;_oe||A[q]!==N[oe]){var be=` `+A[q].replace(" at new "," at ");return u.displayName&&be.includes("")&&(be=be.replace("",u.displayName)),be}while(1<=q&&0<=oe);break}}}finally{Wi=!1,Error.prepareStackTrace=_}return(u=u?u.displayName||u.name:"")?Xn(u):""}var se=Object.prototype.hasOwnProperty,_e=[],de=-1;function he(u){return{current:u}}function Ie(u){0>de||(u.current=_e[de],_e[de]=null,de--)}function Fe(u,f){de++,_e[de]=u.current,u.current=f}var Ye={},lt=he(Ye),dt=he(!1),zt=Ye;function Gt(u,f){var _=u.type.contextTypes;if(!_)return Ye;var S=u.stateNode;if(S&&S.__reactInternalMemoizedUnmaskedChildContext===f)return S.__reactInternalMemoizedMaskedChildContext;var A={},N;for(N in _)A[N]=f[N];return S&&(u=u.stateNode,u.__reactInternalMemoizedUnmaskedChildContext=f,u.__reactInternalMemoizedMaskedChildContext=A),A}function ut(u){return u=u.childContextTypes,u!=null}function fn(){Ie(dt),Ie(lt)}function jn(u,f,_){if(lt.current!==Ye)throw Error(l(168));Fe(lt,f),Fe(dt,_)}function ti(u,f,_){var S=u.stateNode;if(f=f.childContextTypes,typeof S.getChildContext!="function")return _;S=S.getChildContext();for(var A in S)if(!(A in f))throw Error(l(108,b(u)||"Unknown",A));return o({},_,S)}function An(u){return u=(u=u.stateNode)&&u.__reactInternalMemoizedMergedChildContext||Ye,zt=lt.current,Fe(lt,u),Fe(dt,dt.current),!0}function Si(u,f,_){var S=u.stateNode;if(!S)throw Error(l(169));_?(u=ti(u,f,zt),S.__reactInternalMemoizedMergedChildContext=u,Ie(dt),Ie(lt),Fe(lt,u)):Ie(dt),Fe(dt,_)}var at=Math.clz32?Math.clz32:Ur,tr=Math.log,ln=Math.LN2;function Ur(u){return u>>>=0,u===0?32:31-(tr(u)/ln|0)|0}var nr=64,sn=4194304;function ns(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 Sn(u,f){var _=u.pendingLanes;if(_===0)return 0;var S=0,A=u.suspendedLanes,N=u.pingedLanes,q=_&268435455;if(q!==0){var oe=q&~A;oe!==0?S=ns(oe):(N&=q,N!==0&&(S=ns(N)))}else q=_&~A,q!==0?S=ns(q):N!==0&&(S=ns(N));if(S===0)return 0;if(f!==0&&f!==S&&(f&A)===0&&(A=S&-S,N=f&-f,A>=N||A===16&&(N&4194240)!==0))return f;if((S&4)!==0&&(S|=_&16),f=u.entangledLanes,f!==0)for(u=u.entanglements,f&=S;0_;_++)f.push(u);return f}function Fr(u,f,_){u.pendingLanes|=f,f!==536870912&&(u.suspendedLanes=0,u.pingedLanes=0),u=u.eventTimes,f=31-at(f),u[f]=_}function il(u,f){var _=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 S=u.eventTimes;for(u=u.expirationTimes;0<_;){var A=31-at(_),N=1<>=q,A-=q,Yo=1<<32-at(f)+A|_<Mn?(bi=Zt,Zt=null):bi=Zt.sibling;var yn=Ot(Se,Zt,we[Mn],ct);if(yn===null){Zt===null&&(Zt=bi);break}u&&Zt&&yn.alternate===null&&f(Se,Zt),ue=N(yn,ue,Mn),en===null?Pt=yn:en.sibling=yn,en=yn,Zt=bi}if(Mn===we.length)return _(Se,Zt),li&&cl(Se,Mn),Pt;if(Zt===null){for(;MnMn?(bi=Zt,Zt=null):bi=Zt.sibling;var ua=Ot(Se,Zt,yn.value,ct);if(ua===null){Zt===null&&(Zt=bi);break}u&&Zt&&ua.alternate===null&&f(Se,Zt),ue=N(ua,ue,Mn),en===null?Pt=ua:en.sibling=ua,en=ua,Zt=bi}if(yn.done)return _(Se,Zt),li&&cl(Se,Mn),Pt;if(Zt===null){for(;!yn.done;Mn++,yn=we.next())yn=qt(Se,yn.value,ct),yn!==null&&(ue=N(yn,ue,Mn),en===null?Pt=yn:en.sibling=yn,en=yn);return li&&cl(Se,Mn),Pt}for(Zt=S(Se,Zt);!yn.done;Mn++,yn=we.next())yn=an(Zt,Se,Mn,yn.value,ct),yn!==null&&(u&&yn.alternate!==null&&Zt.delete(yn.key===null?Mn:yn.key),ue=N(yn,ue,Mn),en===null?Pt=yn:en.sibling=yn,en=yn);return u&&Zt.forEach(function(kp){return f(Se,kp)}),li&&cl(Se,Mn),Pt}function ds(Se,ue,we,ct){if(typeof we=="object"&&we!==null&&we.type===m&&we.key===null&&(we=we.props.children),typeof we=="object"&&we!==null){switch(we.$$typeof){case d:e:{for(var Pt=we.key,en=ue;en!==null;){if(en.key===Pt){if(Pt=we.type,Pt===m){if(en.tag===7){_(Se,en.sibling),ue=A(en,we.props.children),ue.return=Se,Se=ue;break e}}else if(en.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===I&&cu(Pt)===en.type){_(Se,en.sibling),ue=A(en,we.props),ue.ref=uu(Se,en,we),ue.return=Se,Se=ue;break e}_(Se,en);break}else f(Se,en);en=en.sibling}we.type===m?(ue=Nl(we.props.children,Se.mode,ct,we.key),ue.return=Se,Se=ue):(ct=Sd(we.type,we.key,we.props,null,Se.mode,ct),ct.ref=uu(Se,ue,we),ct.return=Se,Se=ct)}return q(Se);case p:e:{for(en=we.key;ue!==null;){if(ue.key===en)if(ue.tag===4&&ue.stateNode.containerInfo===we.containerInfo&&ue.stateNode.implementation===we.implementation){_(Se,ue.sibling),ue=A(ue,we.children||[]),ue.return=Se,Se=ue;break e}else{_(Se,ue);break}else f(Se,ue);ue=ue.sibling}ue=Ed(we,Se.mode,ct),ue.return=Se,Se=ue}return q(Se);case I:return en=we._init,ds(Se,ue,en(we._payload),ct)}if(ee(we))return ht(Se,ue,we,ct);if(O(we))return lr(Se,ue,we,ct);ba(Se,we)}return typeof we=="string"&&we!==""||typeof we=="number"?(we=""+we,ue!==null&&ue.tag===6?(_(Se,ue.sibling),ue=A(ue,we),ue.return=Se,Se=ue):(_(Se,ue),ue=Md(we,Se.mode,ct),ue.return=Se,Se=ue),q(Se)):_(Se,ue)}return ds}var Zo=yg(!0),Sg=yg(!1),fu={},Vr=he(fu),fl=he(fu),dl=he(fu);function Ys(u){if(u===fu)throw Error(l(174));return u}function Kf(u,f){Fe(dl,f),Fe(fl,u),Fe(Vr,fu),u=$(f),Ie(Vr),Fe(Vr,u)}function du(){Ie(Vr),Ie(fl),Ie(dl)}function Mg(u){var f=Ys(dl.current),_=Ys(Vr.current);f=X(_,u.type,f),_!==f&&(Fe(fl,u),Fe(Vr,f))}function sp(u){fl.current===u&&(Ie(Vr),Ie(fl))}var fi=he(0);function $f(u){for(var f=u;f!==null;){if(f.tag===13){var _=f.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||_t(_)||It(_)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)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 ss=[];function hl(){for(var u=0;u_?_:4,u(!0);var S=os.transition;os.transition={};try{u(!1),f()}finally{un=_,os.transition=S}}function gl(){return Zs().memoizedState}function wg(u,f,_){var S=Js(u);_={lane:S,action:_,hasEagerState:!1,eagerState:null,next:null},Tg(u)?cp(f,_):(Tc(u,f,_),_=Rn(),u=gr(u,S,_),u!==null&&Cc(u,f,S))}function p_(u,f,_){var S=Js(u),A={lane:S,action:_,hasEagerState:!1,eagerState:null,next:null};if(Tg(u))cp(f,A);else{Tc(u,f,A);var N=u.alternate;if(u.lanes===0&&(N===null||N.lanes===0)&&(N=f.lastRenderedReducer,N!==null))try{var q=f.lastRenderedState,oe=N(q,_);if(A.hasEagerState=!0,A.eagerState=oe,Tr(oe,q))return}catch{}finally{}_=Rn(),u=gr(u,S,_),u!==null&&Cc(u,f,S)}}function Tg(u){var f=u.alternate;return u===di||f!==null&&f===di}function cp(u,f){Mo=Qf=!0;var _=u.pending;_===null?f.next=f:(f.next=_.next,_.next=f),u.pending=f}function Tc(u,f,_){Ei!==null&&(u.mode&1)!==0&&(on&2)===0?(u=f.interleaved,u===null?(_.next=_,Ts===null?Ts=[f]:Ts.push(f)):(_.next=u.next,u.next=_),f.interleaved=_):(u=f.pending,u===null?_.next=_:(_.next=u.next,u.next=_),f.pending=_)}function Cc(u,f,_){if((_&4194240)!==0){var S=f.lanes;S&=u.pendingLanes,_|=S,f.lanes=_,yo(u,_)}}var vu={readContext:Br,useCallback:Yi,useContext:Yi,useEffect:Yi,useImperativeHandle:Yi,useInsertionEffect:Yi,useLayoutEffect:Yi,useMemo:Yi,useReducer:Yi,useRef:Yi,useState:Yi,useDebugValue:Yi,useDeferredValue:Yi,useTransition:Yi,useMutableSource:Yi,useSyncExternalStore:Yi,useId:Yi,unstable_isNewReconciler:!1},fp={readContext:Br,useCallback:function(u,f){return qs().memoizedState=[u,f===void 0?null:f],u},useContext:Br,useEffect:nd,useImperativeHandle:function(u,f,_){return _=_!=null?_.concat([u]):null,Na(4194308,4,wc.bind(null,f,u),_)},useLayoutEffect:function(u,f){return Na(4194308,4,u,f)},useInsertionEffect:function(u,f){return Na(4,2,u,f)},useMemo:function(u,f){var _=qs();return f=f===void 0?null:f,u=u(),_.memoizedState=[u,f],u},useReducer:function(u,f,_){var S=qs();return f=_!==void 0?_(f):f,S.memoizedState=S.baseState=f,u={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:f},S.queue=u,u=u.dispatch=wg.bind(null,di,u),[S.memoizedState,u]},useRef:function(u){var f=qs();return u={current:u},f.memoizedState=u},useState:Mc,useDebugValue:rd,useDeferredValue:function(u){var f=Mc(u),_=f[0],S=f[1];return nd(function(){var A=os.transition;os.transition={};try{S(u)}finally{os.transition=A}},[u]),_},useTransition:function(){var u=Mc(!1),f=u[0];return u=od.bind(null,u[1]),qs().memoizedState=u,[f,u]},useMutableSource:function(){},useSyncExternalStore:function(u,f,_){var S=di,A=qs();if(li){if(_===void 0)throw Error(l(407));_=_()}else{if(_=f(),Ei===null)throw Error(l(349));(pl&30)!==0||lp(S,f,_)}A.memoizedState=_;var N={value:_,getSnapshot:f};return A.queue=N,nd(Ko.bind(null,S,N,u),[u]),S.flags|=2048,Ec(9,up.bind(null,S,N,_,f),void 0,null),_},useId:function(){var u=qs(),f=Ei.identifierPrefix;if(li){var _=qo,S=Yo;_=(S&~(1<<32-at(S)-1)).toString(32)+_,f=":"+f+"R"+_,_=ml++,0<_&&(f+="H"+_.toString(32)),f+=":"}else _=xc++,f=":"+f+"r"+_.toString(32)+":";return u.memoizedState=f},unstable_isNewReconciler:!1},dp={readContext:Br,useCallback:sd,useContext:Br,useEffect:pu,useImperativeHandle:mu,useInsertionEffect:Kn,useLayoutEffect:id,useMemo:gu,useReducer:yc,useRef:Eg,useState:function(){return yc(Eo)},useDebugValue:rd,useDeferredValue:function(u){var f=yc(Eo),_=f[0],S=f[1];return pu(function(){var A=os.transition;os.transition={};try{S(u)}finally{os.transition=A}},[u]),_},useTransition:function(){var u=yc(Eo)[0],f=Zs().memoizedState;return[u,f]},useMutableSource:op,useSyncExternalStore:ap,useId:gl,unstable_isNewReconciler:!1},hp={readContext:Br,useCallback:sd,useContext:Br,useEffect:pu,useImperativeHandle:mu,useInsertionEffect:Kn,useLayoutEffect:id,useMemo:gu,useReducer:Sc,useRef:Eg,useState:function(){return Sc(Eo)},useDebugValue:rd,useDeferredValue:function(u){var f=Sc(Eo),_=f[0],S=f[1];return pu(function(){var A=os.transition;os.transition={};try{S(u)}finally{os.transition=A}},[u]),_},useTransition:function(){var u=Sc(Eo)[0],f=Zs().memoizedState;return[u,f]},useMutableSource:op,useSyncExternalStore:ap,useId:gl,unstable_isNewReconciler:!1};function pp(u,f){try{var _="",S=f;do _+=Kh(S),S=S.return;while(S);var A=_}catch(N){A=` Error generating stack: `+N.message+` `+N.stack}return{value:u,source:f,stack:A}}function ad(u,f){try{console.error(f.value)}catch(_){setTimeout(function(){throw _})}}var m_=typeof WeakMap=="function"?WeakMap:Map;function Cg(u,f,_){_=jo(-1,_),_.tag=3,_.payload={element:null};var S=f.value;return _.callback=function(){Eu||(Eu=!0,ri=S),ad(u,f)},_}function ld(u,f,_){_=jo(-1,_),_.tag=3;var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var A=f.value;_.payload=function(){return S(A)},_.callback=function(){ad(u,f)}}var N=u.stateNode;return N!==null&&typeof N.componentDidCatch=="function"&&(_.callback=function(){ad(u,f),typeof S!="function"&&(Qs===null?Qs=new Set([this]):Qs.add(this));var q=f.stack;this.componentDidCatch(f.value,{componentStack:q!==null?q:""})}),_}function $o(u,f,_){var S=u.pingCache;if(S===null){S=u.pingCache=new m_;var A=new Set;S.set(f,A)}else A=S.get(f),A===void 0&&(A=new Set,S.set(f,A));A.has(_)||(A.add(_),u=Np.bind(null,u,f,_),f.then(u,u))}function mp(u){do{var f;if((f=u.tag===13)&&(f=u.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return u;u=u.return}while(u!==null);return null}function vl(u,f,_,S,A){return(u.mode&1)===0?(u===f?u.flags|=65536:(u.flags|=128,_.flags|=131072,_.flags&=-52805,_.tag===1&&(_.alternate===null?_.tag=17:(f=jo(-1,1),f.tag=2,Aa(_,f))),_.lanes|=1),u):(u.flags|=65536,u.lanes=A,u)}function Ui(u){u.flags|=4}function _u(u,f){if(u!==null&&u.child===f.child)return!0;if((f.flags&16)!==0)return!1;for(u=f.child;u!==null;){if((u.flags&12854)!==0||(u.subtreeFlags&12854)!==0)return!1;u=u.sibling}return!0}var as,_l,ud,cd;if(ot)as=function(u,f){for(var _=f.child;_!==null;){if(_.tag===5||_.tag===6)te(u,_.stateNode);else if(_.tag!==4&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===f)break;for(;_.sibling===null;){if(_.return===null||_.return===f)return;_=_.return}_.sibling.return=_.return,_=_.sibling}},_l=function(){},ud=function(u,f,_,S,A){if(u=u.memoizedProps,u!==S){var N=f.stateNode,q=Ys(Vr.current);_=We(N,_,u,S,A,q),(f.updateQueue=_)&&Ui(f)}},cd=function(u,f,_,S){_!==S&&Ui(f)};else if($t){as=function(u,f,_,S){for(var A=f.child;A!==null;){if(A.tag===5){var N=A.stateNode;_&&S&&(N=ke(N,A.type,A.memoizedProps,A)),te(u,N)}else if(A.tag===6)N=A.stateNode,_&&S&&(N=Le(N,A.memoizedProps,A)),te(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),as(u,A,!0,!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===f)break;for(;A.sibling===null;){if(A.return===null||A.return===f)return;A=A.return}A.sibling.return=A.return,A=A.sibling}};var La=function(u,f,_,S){for(var A=f.child;A!==null;){if(A.tag===5){var N=A.stateNode;_&&S&&(N=ke(N,A.type,A.memoizedProps,A)),Je(u,N)}else if(A.tag===6)N=A.stateNode,_&&S&&(N=Le(N,A.memoizedProps,A)),Je(u,N);else if(A.tag!==4){if(A.tag===22&&A.memoizedState!==null)N=A.child,N!==null&&(N.return=A),La(u,A,!0,!0);else if(A.child!==null){A.child.return=A,A=A.child;continue}}if(A===f)break;for(;A.sibling===null;){if(A.return===null||A.return===f)return;A=A.return}A.sibling.return=A.return,A=A.sibling}};_l=function(u,f){var _=f.stateNode;if(!_u(u,f)){u=_.containerInfo;var S=Pe(u);La(S,f,!1,!1),_.pendingChildren=S,Ui(f),rt(u,S)}},ud=function(u,f,_,S,A){var N=u.stateNode,q=u.memoizedProps;if((u=_u(u,f))&&q===S)f.stateNode=N;else{var oe=f.stateNode,be=Ys(Vr.current),Qe=null;q!==S&&(Qe=We(oe,_,q,S,A,be)),u&&Qe===null?f.stateNode=N:(N=Xe(N,Qe,_,q,S,f,u,oe),Oe(N,_,S,A,be)&&Ui(f),f.stateNode=N,u?Ui(f):as(N,f,!1,!1))}},cd=function(u,f,_,S){_!==S?(u=Ys(dl.current),_=Ys(Vr.current),f.stateNode=fe(S,u,_,f),Ui(f)):f.stateNode=u.stateNode}}else _l=function(){},ud=function(){},cd=function(){};function Qo(u,f){if(!li)switch(u.tailMode){case"hidden":f=u.tail;for(var _=null;f!==null;)f.alternate!==null&&(_=f),f=f.sibling;_===null?u.tail=null:_.sibling=null;break;case"collapsed":_=u.tail;for(var S=null;_!==null;)_.alternate!==null&&(S=_),_=_.sibling;S===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:S.sibling=null}}function Mi(u){var f=u.alternate!==null&&u.alternate.child===u.child,_=0,S=0;if(f)for(var A=u.child;A!==null;)_|=A.lanes|A.childLanes,S|=A.subtreeFlags&14680064,S|=A.flags&14680064,A.return=u,A=A.sibling;else for(A=u.child;A!==null;)_|=A.lanes|A.childLanes,S|=A.subtreeFlags,S|=A.flags,A.return=u,A=A.sibling;return u.subtreeFlags|=S,u.childLanes=_,f}function fd(u,f,_){var S=f.pendingProps;switch(np(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mi(f),null;case 1:return ut(f.type)&&fn(),Mi(f),null;case 3:return S=f.stateNode,du(),Ie(dt),Ie(lt),hl(),S.pendingContext&&(S.context=S.pendingContext,S.pendingContext=null),(u===null||u.child===null)&&(vc(f)?Ui(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Rs!==null&&(zc(Rs),Rs=null))),_l(u,f),Mi(f),null;case 5:sp(f),_=Ys(dl.current);var A=f.type;if(u!==null&&f.stateNode!=null)ud(u,f,A,S,_),u.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!S){if(f.stateNode===null)throw Error(l(166));return Mi(f),null}if(u=Ys(Vr.current),vc(f)){if(!et)throw Error(l(175));u=zn(f.stateNode,f.type,f.memoizedProps,_,u,f,!au),f.updateQueue=u,u!==null&&Ui(f)}else{var N=G(A,S,_,u,f);as(N,f,!1,!1),f.stateNode=N,Oe(N,A,S,_,u)&&Ui(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Mi(f),null;case 6:if(u&&f.stateNode!=null)cd(u,f,u.memoizedProps,S);else{if(typeof S!="string"&&f.stateNode===null)throw Error(l(166));if(u=Ys(dl.current),_=Ys(Vr.current),vc(f)){if(!et)throw Error(l(176));if(u=f.stateNode,S=f.memoizedProps,(_=Qt(u,S,f,!au))&&(A=Ar,A!==null))switch(N=(A.mode&1)!==0,A.tag){case 3:Ms(A.stateNode.containerInfo,u,S,N);break;case 5:Ta(A.type,A.memoizedProps,A.stateNode,u,S,N)}_&&Ui(f)}else f.stateNode=fe(S,u,_,f)}return Mi(f),null;case 13:if(Ie(fi),S=f.memoizedState,li&&ir!==null&&(f.mode&1)!==0&&(f.flags&128)===0){for(u=ir;u;)u=Xt(u);return lu(),f.flags|=98560,f}if(S!==null&&S.dehydrated!==null){if(S=vc(f),u===null){if(!S)throw Error(l(318));if(!et)throw Error(l(344));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(l(317));Hi(u,f)}else lu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;return Mi(f),null}return Rs!==null&&(zc(Rs),Rs=null),(f.flags&128)!==0?(f.lanes=_,f):(S=S!==null,_=!1,u===null?vc(f):_=u.memoizedState!==null,S&&!_&&(f.child.flags|=8192,(f.mode&1)!==0&&(u===null||(fi.current&1)!==0?gi===0&&(gi=3):_d())),f.updateQueue!==null&&(f.flags|=4),Mi(f),null);case 4:return du(),_l(u,f),u===null&&Ht(f.stateNode.containerInfo),Mi(f),null;case 10:return gc(f.type._context),Mi(f),null;case 17:return ut(f.type)&&fn(),Mi(f),null;case 19:if(Ie(fi),A=f.memoizedState,A===null)return Mi(f),null;if(S=(f.flags&128)!==0,N=A.rendering,N===null)if(S)Qo(A,!1);else{if(gi!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(N=$f(u),N!==null){for(f.flags|=128,Qo(A,!1),u=N.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),f.subtreeFlags=0,u=_,S=f.child;S!==null;)_=S,A=u,_.flags&=14680066,N=_.alternate,N===null?(_.childLanes=0,_.lanes=A,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=N.childLanes,_.lanes=N.lanes,_.child=N.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=N.memoizedProps,_.memoizedState=N.memoizedState,_.updateQueue=N.updateQueue,_.type=N.type,A=N.dependencies,_.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),S=S.sibling;return Fe(fi,fi.current&1|2),f.child}u=u.sibling}A.tail!==null&&Oi()>Oa&&(f.flags|=128,S=!0,Qo(A,!1),f.lanes=4194304)}else{if(!S)if(u=$f(N),u!==null){if(f.flags|=128,S=!0,u=u.updateQueue,u!==null&&(f.updateQueue=u,f.flags|=4),Qo(A,!0),A.tail===null&&A.tailMode==="hidden"&&!N.alternate&&!li)return Mi(f),null}else 2*Oi()-A.renderingStartTime>Oa&&_!==1073741824&&(f.flags|=128,S=!0,Qo(A,!1),f.lanes=4194304);A.isBackwards?(N.sibling=f.child,f.child=N):(u=A.last,u!==null?u.sibling=N:f.child=N,A.last=N)}return A.tail!==null?(f=A.tail,A.rendering=f,A.tail=f.sibling,A.renderingStartTime=Oi(),f.sibling=null,u=fi.current,Fe(fi,S?u&1|2:u&1),f):(Mi(f),null);case 22:case 23:return Bc(),S=f.memoizedState!==null,u!==null&&u.memoizedState!==null!==S&&(f.flags|=8192),S&&(f.mode&1)!==0?(mr&1073741824)!==0&&(Mi(f),ot&&f.subtreeFlags&6&&(f.flags|=8192)):Mi(f),null;case 24:return null;case 25:return null}throw Error(l(156,f.tag))}var gp=c.ReactCurrentOwner,qi=!1;function mi(u,f,_,S){f.child=u===null?Sg(f,null,_,S):Zo(f,u.child,_,S)}function $n(u,f,_,S,A){_=_.render;var N=f.ref;return ru(f,A),S=hu(u,f,_,S,N,A),_=Da(),u!==null&&!qi?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~A,Hr(u,f,A)):(li&&_&&tp(f),f.flags|=1,mi(u,f,S,A),f.child)}function Yn(u,f,_,S,A){if(u===null){var N=_.type;return typeof N=="function"&&!yd(N)&&N.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(f.tag=15,f.type=N,Jo(u,f,N,S,A)):(u=Sd(_.type,null,S,f,f.mode,A),u.ref=f.ref,u.return=f,f.child=u)}if(N=u.child,(u.lanes&A)===0){var q=N.memoizedProps;if(_=_.compare,_=_!==null?_:js,_(q,S)&&u.ref===f.ref)return Hr(u,f,A)}return f.flags|=1,u=la(N,S),u.ref=f.ref,u.return=f,f.child=u}function Jo(u,f,_,S,A){if(u!==null&&js(u.memoizedProps,S)&&u.ref===f.ref)if(qi=!1,(u.lanes&A)!==0)(u.flags&131072)!==0&&(qi=!0);else return f.lanes=u.lanes,Hr(u,f,A);return ea(u,f,_,S,A)}function rr(u,f,_){var S=f.pendingProps,A=S.children,N=u!==null?u.memoizedState:null;if(S.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null},Fe(Al,mr),mr|=_;else if((_&1073741824)!==0)f.memoizedState={baseLanes:0,cachePool:null},S=N!==null?N.baseLanes:_,Fe(Al,mr),mr|=S;else return u=N!==null?N.baseLanes|_:_,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:u,cachePool:null},f.updateQueue=null,Fe(Al,mr),mr|=u,null;else N!==null?(S=N.baseLanes|_,f.memoizedState=null):S=_,Fe(Al,mr),mr|=S;return mi(u,f,A,_),f.child}function Rr(u,f){var _=f.ref;(u===null&&_!==null||u!==null&&u.ref!==_)&&(f.flags|=512,f.flags|=2097152)}function ea(u,f,_,S,A){var N=ut(_)?zt:lt.current;return N=Gt(f,N),ru(f,A),_=hu(u,f,_,S,N,A),S=Da(),u!==null&&!qi?(f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~A,Hr(u,f,A)):(li&&S&&tp(f),f.flags|=1,mi(u,f,_,A),f.child)}function xl(u,f,_,S,A){if(ut(_)){var N=!0;An(f)}else N=!1;if(ru(f,A),f.stateNode===null)u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),gg(f,_,S),ep(f,_,S,A),S=!0;else if(u===null){var q=f.stateNode,oe=f.memoizedProps;q.props=oe;var be=q.context,Qe=_.contextType;typeof Qe=="object"&&Qe!==null?Qe=Br(Qe):(Qe=ut(_)?zt:lt.current,Qe=Gt(f,Qe));var xt=_.getDerivedStateFromProps,qt=typeof xt=="function"||typeof q.getSnapshotBeforeUpdate=="function";qt||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(oe!==S||be!==Qe)&&vg(f,q,S,Qe),Cs=!1;var Ot=f.memoizedState;q.state=Ot,Wf(f,S,q,A),be=f.memoizedState,oe!==S||Ot!==be||dt.current||Cs?(typeof xt=="function"&&(Qh(f,_,xt,S),be=f.memoizedState),(oe=Cs||Jh(f,_,oe,S,Ot,be,Qe))?(qt||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(f.flags|=4194308)):(typeof q.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=S,f.memoizedState=be),q.props=S,q.state=be,q.context=Qe,S=oe):(typeof q.componentDidMount=="function"&&(f.flags|=4194308),S=!1)}else{q=f.stateNode,$h(u,f),oe=f.memoizedProps,Qe=f.type===f.elementType?oe:zr(f.type,oe),q.props=Qe,qt=f.pendingProps,Ot=q.context,be=_.contextType,typeof be=="object"&&be!==null?be=Br(be):(be=ut(_)?zt:lt.current,be=Gt(f,be));var an=_.getDerivedStateFromProps;(xt=typeof an=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(oe!==qt||Ot!==be)&&vg(f,q,S,be),Cs=!1,Ot=f.memoizedState,q.state=Ot,Wf(f,S,q,A);var ht=f.memoizedState;oe!==qt||Ot!==ht||dt.current||Cs?(typeof an=="function"&&(Qh(f,_,an,S),ht=f.memoizedState),(Qe=Cs||Jh(f,_,Qe,S,Ot,ht,be)||!1)?(xt||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(S,ht,be),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(S,ht,be)),typeof q.componentDidUpdate=="function"&&(f.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof q.componentDidUpdate!="function"||oe===u.memoizedProps&&Ot===u.memoizedState||(f.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||oe===u.memoizedProps&&Ot===u.memoizedState||(f.flags|=1024),f.memoizedProps=S,f.memoizedState=ht),q.props=S,q.state=ht,q.context=be,S=Qe):(typeof q.componentDidUpdate!="function"||oe===u.memoizedProps&&Ot===u.memoizedState||(f.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||oe===u.memoizedProps&&Ot===u.memoizedState||(f.flags|=1024),S=!1)}return pr(u,f,_,S,N,A)}function pr(u,f,_,S,A,N){Rr(u,f);var q=(f.flags&128)!==0;if(!S&&!q)return A&&Si(f,_,!1),Hr(u,f,N);S=f.stateNode,gp.current=f;var oe=q&&typeof _.getDerivedStateFromError!="function"?null:S.render();return f.flags|=1,u!==null&&q?(f.child=Zo(f,u.child,null,N),f.child=Zo(f,null,oe,N)):mi(u,f,oe,N),f.memoizedState=S.state,A&&Si(f,_,!0),f.child}function Ac(u){var f=u.stateNode;f.pendingContext?jn(u,f.pendingContext,f.pendingContext!==f.context):f.context&&jn(u,f.context,!1),Kf(u,f.containerInfo)}function vp(u,f,_,S,A){return lu(),Zf(A),f.flags|=256,mi(u,f,_,S),f.child}var Rc={dehydrated:null,treeContext:null,retryLane:0};function yl(u){return{baseLanes:u,cachePool:null}}function _p(u,f,_){var S=f.pendingProps,A=fi.current,N=!1,q=(f.flags&128)!==0,oe;if((oe=q)||(oe=u!==null&&u.memoizedState===null?!1:(A&2)!==0),oe?(N=!0,f.flags&=-129):(u===null||u.memoizedState!==null)&&(A|=1),Fe(fi,A&1),u===null)return Pa(f),u=f.memoizedState,u!==null&&(u=u.dehydrated,u!==null)?((f.mode&1)===0?f.lanes=1:It(u)?f.lanes=8:f.lanes=1073741824,null):(A=S.children,u=S.fallback,N?(S=f.mode,N=f.child,A={mode:"hidden",children:A},(S&1)===0&&N!==null?(N.childLanes=0,N.pendingProps=A):N=Gc(A,S,0,null),u=Nl(u,S,_,null),N.return=f,u.return=f,N.sibling=u,f.child=N,f.child.memoizedState=yl(_),f.memoizedState=Rc,u):Ks(f,A));if(A=u.memoizedState,A!==null){if(oe=A.dehydrated,oe!==null){if(q)return f.flags&256?(f.flags&=-257,bc(u,f,_,Error(l(422)))):f.memoizedState!==null?(f.child=u.child,f.flags|=128,null):(N=S.fallback,A=f.mode,S=Gc({mode:"visible",children:S.children},A,0,null),N=Nl(N,A,_,null),N.flags|=2,S.return=f,N.return=f,S.sibling=N,f.child=S,(f.mode&1)!==0&&Zo(f,u.child,null,_),f.child.memoizedState=yl(_),f.memoizedState=Rc,N);if((f.mode&1)===0)f=bc(u,f,_,null);else if(It(oe))f=bc(u,f,_,Error(l(419)));else if(S=(_&u.childLanes)!==0,qi||S){if(S=Ei,S!==null){switch(_&-_){case 4:N=2;break;case 16:N=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:N=32;break;case 536870912:N=268435456;break;default:N=0}S=(N&(S.suspendedLanes|_))!==0?0:N,S!==0&&S!==A.retryLane&&(A.retryLane=S,gr(u,S,-1))}_d(),f=bc(u,f,_,Error(l(421)))}else _t(oe)?(f.flags|=128,f.child=u.child,f=Dg.bind(null,u),Jn(oe,f),f=null):(_=A.treeContext,et&&(ir=Wn(oe),Ar=f,li=!0,Rs=null,au=!1,_!==null&&(As[rs++]=Yo,As[rs++]=qo,As[rs++]=ul,Yo=_.id,qo=_.overflow,ul=f)),f=Ks(f,f.pendingProps.children),f.flags|=4096);return f}return N?(S=dd(u,f,S.children,S.fallback,_),N=f.child,A=u.child.memoizedState,N.memoizedState=A===null?yl(_):{baseLanes:A.baseLanes|_,cachePool:null},N.childLanes=u.childLanes&~_,f.memoizedState=Rc,S):(_=Pc(u,f,S.children,_),f.memoizedState=null,_)}return N?(S=dd(u,f,S.children,S.fallback,_),N=f.child,A=u.child.memoizedState,N.memoizedState=A===null?yl(_):{baseLanes:A.baseLanes|_,cachePool:null},N.childLanes=u.childLanes&~_,f.memoizedState=Rc,S):(_=Pc(u,f,S.children,_),f.memoizedState=null,_)}function Ks(u,f){return f=Gc({mode:"visible",children:f},u.mode,0,null),f.return=u,u.child=f}function Pc(u,f,_,S){var A=u.child;return u=A.sibling,_=la(A,{mode:"visible",children:_}),(f.mode&1)===0&&(_.lanes=S),_.return=f,_.sibling=null,u!==null&&(S=f.deletions,S===null?(f.deletions=[u],f.flags|=16):S.push(u)),f.child=_}function dd(u,f,_,S,A){var N=f.mode;u=u.child;var q=u.sibling,oe={mode:"hidden",children:_};return(N&1)===0&&f.child!==u?(_=f.child,_.childLanes=0,_.pendingProps=oe,f.deletions=null):(_=la(u,oe),_.subtreeFlags=u.subtreeFlags&14680064),q!==null?S=la(q,S):(S=Nl(S,N,A,null),S.flags|=2),S.return=f,_.return=f,_.sibling=S,f.child=_,S}function bc(u,f,_,S){return S!==null&&Zf(S),Zo(f,u.child,null,_),u=Ks(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function Ag(u,f,_){u.lanes|=f;var S=u.alternate;S!==null&&(S.lanes|=f),ll(u.return,f,_)}function wo(u,f,_,S,A){var N=u.memoizedState;N===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:S,tail:_,tailMode:A}:(N.isBackwards=f,N.rendering=null,N.renderingStartTime=0,N.last=S,N.tail=_,N.tailMode=A)}function Sl(u,f,_){var S=f.pendingProps,A=S.revealOrder,N=S.tail;if(mi(u,f,S.children,_),S=fi.current,(S&2)!==0)S=S&1|2,f.flags|=128;else{if(u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&Ag(u,_,f);else if(u.tag===19)Ag(u,_,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}S&=1}if(Fe(fi,S),(f.mode&1)===0)f.memoizedState=null;else switch(A){case"forwards":for(_=f.child,A=null;_!==null;)u=_.alternate,u!==null&&$f(u)===null&&(A=_),_=_.sibling;_=A,_===null?(A=f.child,f.child=null):(A=_.sibling,_.sibling=null),wo(f,!1,A,_,N);break;case"backwards":for(_=null,A=f.child,f.child=null;A!==null;){if(u=A.alternate,u!==null&&$f(u)===null){f.child=A;break}u=A.sibling,A.sibling=_,_=A,A=u}wo(f,!0,_,null,N);break;case"together":wo(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Hr(u,f,_){if(u!==null&&(f.dependencies=u.dependencies),To|=f.lanes,(_&f.childLanes)===0)return null;if(u!==null&&f.child!==u.child)throw Error(l(153));if(f.child!==null){for(u=f.child,_=la(u,u.pendingProps),f.child=_,_.return=f;u.sibling!==null;)u=u.sibling,_=_.sibling=la(u,u.pendingProps),_.return=f;_.sibling=null}return f.child}function hd(u,f,_){switch(f.tag){case 3:Ac(f),lu();break;case 5:Mg(f);break;case 1:ut(f.type)&&An(f);break;case 4:Kf(f,f.stateNode.containerInfo);break;case 10:al(f,f.type._context,f.memoizedProps.value);break;case 13:var S=f.memoizedState;if(S!==null)return S.dehydrated!==null?(Fe(fi,fi.current&1),f.flags|=128,null):(_&f.child.childLanes)!==0?_p(u,f,_):(Fe(fi,fi.current&1),u=Hr(u,f,_),u!==null?u.sibling:null);Fe(fi,fi.current&1);break;case 19:if(S=(_&f.childLanes)!==0,(u.flags&128)!==0){if(S)return Sl(u,f,_);f.flags|=128}var A=f.memoizedState;if(A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),Fe(fi,fi.current),S)break;return null;case 22:case 23:return f.lanes=0,rr(u,f,_)}return Hr(u,f,_)}function pd(u,f){switch(np(f),f.tag){case 1:return ut(f.type)&&fn(),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return du(),Ie(dt),Ie(lt),hl(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 5:return sp(f),null;case 13:if(Ie(fi),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(l(340));lu()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return Ie(fi),null;case 4:return du(),null;case 10:return gc(f.type._context),null;case 22:case 23:return Bc(),null;case 24:return null;default:return null}}var Pr=!1,Zi=!1,Ml=typeof WeakSet=="function"?WeakSet:Set,st=null;function Ps(u,f){var _=u.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(S){Dr(u,f,S)}else _.current=null}function ta(u,f,_){try{_()}catch(S){Dr(u,f,S)}}var xp=!1;function yp(u,f){for(Q(u.containerInfo),st=f;st!==null;)if(u=st,f=u.child,(u.subtreeFlags&1028)!==0&&f!==null)f.return=u,st=f;else for(;st!==null;){u=st;try{var _=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var S=_.memoizedProps,A=_.memoizedState,N=u.stateNode,q=N.getSnapshotBeforeUpdate(u.elementType===u.type?S:zr(u.type,S),A);N.__reactInternalSnapshotBeforeUpdate=q}break;case 3:ot&&J(u.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(oe){Dr(u,u.return,oe)}if(f=u.sibling,f!==null){f.return=u.return,st=f;break}st=u.return}return _=xp,xp=!1,_}function na(u,f,_){var S=f.updateQueue;if(S=S!==null?S.lastEffect:null,S!==null){var A=S=S.next;do{if((A.tag&u)===u){var N=A.destroy;A.destroy=void 0,N!==void 0&&ta(f,_,N)}A=A.next}while(A!==S)}}function sr(u,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var _=f=f.next;do{if((_.tag&u)===u){var S=_.create;_.destroy=S()}_=_.next}while(_!==f)}}function br(u){var f=u.ref;if(f!==null){var _=u.stateNode;switch(u.tag){case 5:u=ce(_);break;default:u=_}typeof f=="function"?f(u):f.current=u}}function ii(u,f,_){if(So&&typeof So.onCommitFiberUnmount=="function")try{So.onCommitFiberUnmount(dc,f)}catch{}switch(f.tag){case 0:case 11:case 14:case 15:if(u=f.updateQueue,u!==null&&(u=u.lastEffect,u!==null)){var S=u=u.next;do{var A=S,N=A.destroy;A=A.tag,N!==void 0&&((A&2)!==0||(A&4)!==0)&&ta(f,_,N),S=S.next}while(S!==u)}break;case 1:if(Ps(f,_),u=f.stateNode,typeof u.componentWillUnmount=="function")try{u.props=f.memoizedProps,u.state=f.memoizedState,u.componentWillUnmount()}catch(q){Dr(f,_,q)}break;case 5:Ps(f,_);break;case 4:ot?Ep(u,f,_):$t&&$t&&(f=f.stateNode.containerInfo,_=Pe(f),Ne(f,_))}}function bs(u,f,_){for(var S=f;;)if(ii(u,S,_),S.child===null||ot&&S.tag===4){if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return}S.sibling.return=S.return,S=S.sibling}else S.child.return=S,S=S.child}function Sp(u){var f=u.alternate;f!==null&&(u.alternate=null,Sp(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&ve(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 Mp(u){return u.tag===5||u.tag===3||u.tag===4}function md(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||Mp(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 gd(u){if(ot){e:{for(var f=u.return;f!==null;){if(Mp(f))break e;f=f.return}throw Error(l(160))}var _=f;switch(_.tag){case 5:f=_.stateNode,_.flags&32&&(Ke(f),_.flags&=-33),_=md(u),xu(u,_,f);break;case 3:case 4:f=_.stateNode.containerInfo,_=md(u),vd(u,_,f);break;default:throw Error(l(161))}}}function vd(u,f,_){var S=u.tag;if(S===5||S===6)u=u.stateNode,f?Re(_,u,f):me(_,u);else if(S!==4&&(u=u.child,u!==null))for(vd(u,f,_),u=u.sibling;u!==null;)vd(u,f,_),u=u.sibling}function xu(u,f,_){var S=u.tag;if(S===5||S===6)u=u.stateNode,f?Ce(_,u,f):ae(_,u);else if(S!==4&&(u=u.child,u!==null))for(xu(u,f,_),u=u.sibling;u!==null;)xu(u,f,_),u=u.sibling}function Ep(u,f,_){for(var S=f,A=!1,N,q;;){if(!A){A=S.return;e:for(;;){if(A===null)throw Error(l(160));switch(N=A.stateNode,A.tag){case 5:q=!1;break e;case 3:N=N.containerInfo,q=!0;break e;case 4:N=N.containerInfo,q=!0;break e}A=A.return}A=!0}if(S.tag===5||S.tag===6)bs(u,S,_),q?mt(N,S.stateNode):nt(N,S.stateNode);else if(S.tag===18)q?ei(N,S.stateNode):ci(N,S.stateNode);else if(S.tag===4){if(S.child!==null){N=S.stateNode.containerInfo,q=!0,S.child.return=S,S=S.child;continue}}else if(ii(u,S,_),S.child!==null){S.child.return=S,S=S.child;continue}if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return,S.tag===4&&(A=!1)}S.sibling.return=S.return,S=S.sibling}}function Ia(u,f){if(ot){switch(f.tag){case 0:case 11:case 14:case 15:na(3,f,f.return),sr(3,f),na(5,f,f.return);return;case 1:return;case 5:var _=f.stateNode;if(_!=null){var S=f.memoizedProps;u=u!==null?u.memoizedProps:S;var A=f.type,N=f.updateQueue;f.updateQueue=null,N!==null&&ze(_,N,A,u,S,f)}return;case 6:if(f.stateNode===null)throw Error(l(162));_=f.memoizedProps,Me(f.stateNode,u!==null?u.memoizedProps:_,_);return;case 3:et&&u!==null&&u.memoizedState.isDehydrated&&ki(f.stateNode.containerInfo);return;case 12:return;case 13:yu(f);return;case 19:yu(f);return;case 17:return}throw Error(l(163))}switch(f.tag){case 0:case 11:case 14:case 15:na(3,f,f.return),sr(3,f),na(5,f,f.return);return;case 12:return;case 13:yu(f);return;case 19:yu(f);return;case 3:et&&u!==null&&u.memoizedState.isDehydrated&&ki(f.stateNode.containerInfo);break;case 22:case 23:return}e:if($t){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Ne(f.containerInfo,f.pendingChildren);break e}throw Error(l(163))}}function yu(u){var f=u.updateQueue;if(f!==null){u.updateQueue=null;var _=u.stateNode;_===null&&(_=u.stateNode=new Ml),f.forEach(function(S){var A=Ng.bind(null,u,S);_.has(S)||(_.add(S),S.then(A,A))})}}function g_(u,f){for(st=f;st!==null;){f=st;var _=f.deletions;if(_!==null)for(var S=0;S<_.length;S++){var A=_[S];try{var N=u;ot?Ep(N,A,f):bs(N,A,f);var q=A.alternate;q!==null&&(q.return=null),A.return=null}catch(Pt){Dr(A,f,Pt)}}if(_=f.child,(f.subtreeFlags&12854)!==0&&_!==null)_.return=f,st=_;else for(;st!==null;){f=st;try{var oe=f.flags;if(oe&32&&ot&&Ke(f.stateNode),oe&512){var be=f.alternate;if(be!==null){var Qe=be.ref;Qe!==null&&(typeof Qe=="function"?Qe(null):Qe.current=null)}}if(oe&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var xt=f.alternate;(xt===null||xt.memoizedState===null)&&(Uc=Oi())}break;case 22:var qt=f.memoizedState!==null,Ot=f.alternate,an=Ot!==null&&Ot.memoizedState!==null;if(_=f,ot){e:if(S=_,A=qt,N=null,ot)for(var ht=S;;){if(ht.tag===5){if(N===null){N=ht;var lr=ht.stateNode;A?$e(lr):Mt(ht.stateNode,ht.memoizedProps)}}else if(ht.tag===6){if(N===null){var ds=ht.stateNode;A?Ge(ds):wt(ds,ht.memoizedProps)}}else if((ht.tag!==22&&ht.tag!==23||ht.memoizedState===null||ht===S)&&ht.child!==null){ht.child.return=ht,ht=ht.child;continue}if(ht===S)break;for(;ht.sibling===null;){if(ht.return===null||ht.return===S)break e;N===ht&&(N=null),ht=ht.return}N===ht&&(N=null),ht.sibling.return=ht.return,ht=ht.sibling}}if(qt&&!an&&(_.mode&1)!==0){st=_;for(var Se=_.child;Se!==null;){for(_=st=Se;st!==null;){S=st;var ue=S.child;switch(S.tag){case 0:case 11:case 14:case 15:na(4,S,S.return);break;case 1:Ps(S,S.return);var we=S.stateNode;if(typeof we.componentWillUnmount=="function"){var ct=S.return;try{we.props=S.memoizedProps,we.state=S.memoizedState,we.componentWillUnmount()}catch(Pt){Dr(S,ct,Pt)}}break;case 5:Ps(S,S.return);break;case 22:if(S.memoizedState!==null){Tp(_);continue}}ue!==null?(ue.return=S,st=ue):Tp(_)}Se=Se.sibling}}}switch(oe&4102){case 2:gd(f),f.flags&=-3;break;case 6:gd(f),f.flags&=-3,Ia(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,Ia(f.alternate,f);break;case 4:Ia(f.alternate,f)}}catch(Pt){Dr(f,f.return,Pt)}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}}function Dc(u,f,_){st=u,Nc(u)}function Nc(u,f,_){for(var S=(u.mode&1)!==0;st!==null;){var A=st,N=A.child;if(A.tag===22&&S){var q=A.memoizedState!==null||Pr;if(!q){var oe=A.alternate,be=oe!==null&&oe.memoizedState!==null||Zi;oe=Pr;var Qe=Zi;if(Pr=q,(Zi=be)&&!Qe)for(st=A;st!==null;)q=st,be=q.child,q.tag===22&&q.memoizedState!==null?El(A):be!==null?(be.return=q,st=be):El(A);for(;N!==null;)st=N,Nc(N),N=N.sibling;st=A,Pr=oe,Zi=Qe}wp(u)}else(A.subtreeFlags&8772)!==0&&N!==null?(N.return=A,st=N):wp(u)}}function wp(u){for(;st!==null;){var f=st;if((f.flags&8772)!==0){var _=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:Zi||sr(5,f);break;case 1:var S=f.stateNode;if(f.flags&4&&!Zi)if(_===null)S.componentDidMount();else{var A=f.elementType===f.type?_.memoizedProps:zr(f.type,_.memoizedProps);S.componentDidUpdate(A,_.memoizedState,S.__reactInternalSnapshotBeforeUpdate)}var N=f.updateQueue;N!==null&&pg(f,N,S);break;case 3:var q=f.updateQueue;if(q!==null){if(_=null,f.child!==null)switch(f.child.tag){case 5:_=ce(f.child.stateNode);break;case 1:_=f.child.stateNode}pg(f,q,_)}break;case 5:var oe=f.stateNode;_===null&&f.flags&4&&He(oe,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(et&&f.memoizedState===null){var be=f.alternate;if(be!==null){var Qe=be.memoizedState;if(Qe!==null){var xt=Qe.dehydrated;xt!==null&&Gi(xt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(l(163))}Zi||f.flags&512&&br(f)}catch(qt){Dr(f,f.return,qt)}}if(f===u){st=null;break}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}function Tp(u){for(;st!==null;){var f=st;if(f===u){st=null;break}var _=f.sibling;if(_!==null){_.return=f.return,st=_;break}st=f.return}}function El(u){for(;st!==null;){var f=st;try{switch(f.tag){case 0:case 11:case 15:var _=f.return;try{sr(4,f)}catch(be){Dr(f,_,be)}break;case 1:var S=f.stateNode;if(typeof S.componentDidMount=="function"){var A=f.return;try{S.componentDidMount()}catch(be){Dr(f,A,be)}}var N=f.return;try{br(f)}catch(be){Dr(f,N,be)}break;case 5:var q=f.return;try{br(f)}catch(be){Dr(f,q,be)}}}catch(be){Dr(f,f.return,be)}if(f===u){st=null;break}var oe=f.sibling;if(oe!==null){oe.return=f.return,st=oe;break}st=f.return}}var Lc=0,wl=1,Tl=2,ia=3,Su=4;if(typeof Symbol=="function"&&Symbol.for){var Cl=Symbol.for;Lc=Cl("selector.component"),wl=Cl("selector.has_pseudo_class"),Tl=Cl("selector.role"),ia=Cl("selector.test_id"),Su=Cl("selector.text")}function Ic(u){var f=Lt(u);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(l(364));return f}if(u=kt(u),u===null)throw Error(l(362));return u.stateNode.current}function kc(u,f){switch(f.$$typeof){case Lc:if(u.type===f.value)return!0;break;case wl:e:{f=f.value,u=[u,0];for(var _=0;_";case wl:return":has("+(ka(u)||"")+")";case Tl:return'[role="'+u.value+'"]';case Su:return'"'+u.value+'"';case ia:return'[data-testname="'+u.value+'"]';default:throw Error(l(365))}}function ls(u,f){var _=[];u=[u,0];for(var S=0;SA&&(A=q),S&=~N}if(S=A,S=Oi()-S,S=(120>S?120:480>S?480:1080>S?1080:1920>S?1920:3e3>S?3e3:4320>S?4320:1960*Cp(S/1960))-S,10u?16:u,Co===null)var S=!1;else{if(u=Co,Co=null,bl=0,(on&6)!==0)throw Error(l(331));var A=on;for(on|=4,st=u.current;st!==null;){var N=st,q=N.child;if((st.flags&16)!==0){var oe=N.deletions;if(oe!==null){for(var be=0;beOi()-Uc?aa(u,0):Rl|=_),Gr(u,f)}function Lp(u,f){f===0&&((u.mode&1)===0?f=1:(f=sn,sn<<=1,(sn&130023424)===0&&(sn=4194304)));var _=Rn();u=Ua(u,f),u!==null&&(Fr(u,f,_),Gr(u,_))}function Dg(u){var f=u.memoizedState,_=0;f!==null&&(_=f.retryLane),Lp(u,_)}function Ng(u,f){var _=0;switch(u.tag){case 13:var S=u.stateNode,A=u.memoizedState;A!==null&&(_=A.retryLane);break;case 19:S=u.stateNode;break;default:throw Error(l(314))}S!==null&&S.delete(f),Lp(u,_)}var Ip;Ip=function(u,f,_){if(u!==null)if(u.memoizedProps!==f.pendingProps||dt.current)qi=!0;else{if((u.lanes&_)===0&&(f.flags&128)===0)return qi=!1,hd(u,f,_);qi=(u.flags&131072)!==0}else qi=!1,li&&(f.flags&1048576)!==0&&_g(f,Yf,f.index);switch(f.lanes=0,f.tag){case 2:var S=f.type;u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),u=f.pendingProps;var A=Gt(f,lt.current);ru(f,_),A=hu(null,f,S,u,A,_);var N=Da();return f.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,ut(S)?(N=!0,An(f)):N=!1,f.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,su(f),A.updater=Xf,f.stateNode=A,A._reactInternals=f,ep(f,S,u,_),f=pr(null,f,S,!0,N,_)):(f.tag=0,li&&N&&tp(f),mi(null,f,A,_),f=f.child),f;case 16:S=f.elementType;e:{switch(u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),u=f.pendingProps,A=S._init,S=A(S._payload),f.type=S,A=f.tag=v_(S),u=zr(S,u),A){case 0:f=ea(null,f,S,u,_);break e;case 1:f=xl(null,f,S,u,_);break e;case 11:f=$n(null,f,S,u,_);break e;case 14:f=Yn(null,f,S,zr(S.type,u),_);break e}throw Error(l(306,S,""))}return f;case 0:return S=f.type,A=f.pendingProps,A=f.elementType===S?A:zr(S,A),ea(u,f,S,A,_);case 1:return S=f.type,A=f.pendingProps,A=f.elementType===S?A:zr(S,A),xl(u,f,S,A,_);case 3:e:{if(Ac(f),u===null)throw Error(l(387));S=f.pendingProps,N=f.memoizedState,A=N.element,$h(u,f),Wf(f,S,null,_);var q=f.memoizedState;if(S=q.element,et&&N.isDehydrated)if(N={element:S,isDehydrated:!1,cache:q.cache,transitions:q.transitions},f.updateQueue.baseState=N,f.memoizedState=N,f.flags&256){A=Error(l(423)),f=vp(u,f,S,_,A);break e}else if(S!==A){A=Error(l(424)),f=vp(u,f,S,_,A);break e}else for(et&&(ir=Ri(f.stateNode.containerInfo),Ar=f,li=!0,Rs=null,au=!1),_=Sg(f,null,S,_),f.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(lu(),S===A){f=Hr(u,f,_);break e}mi(u,f,S,_)}f=f.child}return f;case 5:return Mg(f),u===null&&Pa(f),S=f.type,A=f.pendingProps,N=u!==null?u.memoizedProps:null,q=A.children,qe(S,A)?q=null:N!==null&&qe(S,N)&&(f.flags|=32),Rr(u,f),mi(u,f,q,_),f.child;case 6:return u===null&&Pa(f),null;case 13:return _p(u,f,_);case 4:return Kf(f,f.stateNode.containerInfo),S=f.pendingProps,u===null?f.child=Zo(f,null,S,_):mi(u,f,S,_),f.child;case 11:return S=f.type,A=f.pendingProps,A=f.elementType===S?A:zr(S,A),$n(u,f,S,A,_);case 7:return mi(u,f,f.pendingProps,_),f.child;case 8:return mi(u,f,f.pendingProps.children,_),f.child;case 12:return mi(u,f,f.pendingProps.children,_),f.child;case 10:e:{if(S=f.type._context,A=f.pendingProps,N=f.memoizedProps,q=A.value,al(f,S,q),N!==null)if(Tr(N.value,q)){if(N.children===A.children&&!dt.current){f=Hr(u,f,_);break e}}else for(N=f.child,N!==null&&(N.return=f);N!==null;){var oe=N.dependencies;if(oe!==null){q=N.child;for(var be=oe.firstContext;be!==null;){if(be.context===S){if(N.tag===1){be=jo(-1,_&-_),be.tag=2;var Qe=N.updateQueue;if(Qe!==null){Qe=Qe.shared;var xt=Qe.pending;xt===null?be.next=be:(be.next=xt.next,xt.next=be),Qe.pending=be}}N.lanes|=_,be=N.alternate,be!==null&&(be.lanes|=_),ll(N.return,_,f),oe.lanes|=_;break}be=be.next}}else if(N.tag===10)q=N.type===f.type?null:N.child;else if(N.tag===18){if(q=N.return,q===null)throw Error(l(341));q.lanes|=_,oe=q.alternate,oe!==null&&(oe.lanes|=_),ll(q,_,f),q=N.sibling}else q=N.child;if(q!==null)q.return=N;else for(q=N;q!==null;){if(q===f){q=null;break}if(N=q.sibling,N!==null){N.return=q.return,q=N;break}q=q.return}N=q}mi(u,f,A.children,_),f=f.child}return f;case 9:return A=f.type,S=f.pendingProps.children,ru(f,_),A=Br(A),S=S(A),f.flags|=1,mi(u,f,S,_),f.child;case 14:return S=f.type,A=zr(S,f.pendingProps),A=zr(S.type,A),Yn(u,f,S,A,_);case 15:return Jo(u,f,f.type,f.pendingProps,_);case 17:return S=f.type,A=f.pendingProps,A=f.elementType===S?A:zr(S,A),u!==null&&(u.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,ut(S)?(u=!0,An(f)):u=!1,ru(f,_),gg(f,S,A),ep(f,S,A,_),pr(null,f,S,!0,u,_);case 19:return Sl(u,f,_);case 22:return rr(u,f,_)}throw Error(l(156,f.tag))};function xd(u,f){return rl(u,f)}function Lg(u,f,_,S){this.tag=u,this.key=_,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=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(u,f,_,S){return new Lg(u,f,_,S)}function yd(u){return u=u.prototype,!(!u||!u.isReactComponent)}function v_(u){if(typeof u=="function")return yd(u)?1:0;if(u!=null){if(u=u.$$typeof,u===C)return 11;if(u===P)return 14}return 2}function la(u,f){var _=u.alternate;return _===null?(_=fs(u.tag,f,u.key,u.mode),_.elementType=u.elementType,_.type=u.type,_.stateNode=u.stateNode,_.alternate=u,u.alternate=_):(_.pendingProps=f,_.type=u.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=u.flags&14680064,_.childLanes=u.childLanes,_.lanes=u.lanes,_.child=u.child,_.memoizedProps=u.memoizedProps,_.memoizedState=u.memoizedState,_.updateQueue=u.updateQueue,f=u.dependencies,_.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},_.sibling=u.sibling,_.index=u.index,_.ref=u.ref,_}function Sd(u,f,_,S,A,N){var q=2;if(S=u,typeof u=="function")yd(u)&&(q=1);else if(typeof u=="string")q=5;else e:switch(u){case m:return Nl(_.children,A,N,f);case v:q=8,A|=8;break;case g:return u=fs(12,_,f,A|2),u.elementType=g,u.lanes=N,u;case w:return u=fs(13,_,f,A),u.elementType=w,u.lanes=N,u;case M:return u=fs(19,_,f,A),u.elementType=M,u.lanes=N,u;case D:return Gc(_,A,N,f);default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case y:q=10;break e;case E:q=9;break e;case C:q=11;break e;case P:q=14;break e;case I:q=16,S=null;break e}throw Error(l(130,u==null?u:typeof u,""))}return f=fs(q,_,f,A),f.elementType=u,f.type=S,f.lanes=N,f}function Nl(u,f,_,S){return u=fs(7,u,S,f),u.lanes=_,u}function Gc(u,f,_,S){return u=fs(22,u,S,f),u.elementType=D,u.lanes=_,u.stateNode={},u}function Md(u,f,_){return u=fs(6,u,null,f),u.lanes=_,u}function Ed(u,f,_){return f=fs(4,u.children!==null?u.children:[],u.key,f),f.lanes=_,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}function wd(u,f,_,S,A){this.tag=f,this.containerInfo=u,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ze,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=is(0),this.expirationTimes=is(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=is(0),this.identifierPrefix=S,this.onRecoverableError=A,et&&(this.mutableSourceEagerHydrationData=null)}function Ig(u,f,_,S,A,N,q,oe,be){return u=new wd(u,f,_,oe,be),f===1?(f=1,N===!0&&(f|=8)):f=0,N=fs(3,null,null,f),u.current=N,N.stateNode=u,N.memoizedState={element:S,isDehydrated:_,cache:null,transitions:null},su(N),u}function kg(u){if(!u)return Ye;u=u._reactInternals;e:{if(F(u)!==u||u.tag!==1)throw Error(l(170));var f=u;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(ut(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(l(171))}if(u.tag===1){var _=u.type;if(ut(_))return ti(u,_,f)}return f}function Og(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(l(188)):(u=Object.keys(u).join(","),Error(l(268,u)));return u=Y(f),u===null?null:u.stateNode}function Ds(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var _=u.retryLane;u.retryLane=_!==0&&_=Qe&&N>=qt&&A<=xt&&q<=Ot){u.splice(f,1);break}else if(S!==Qe||_.width!==be.width||Otq){if(!(N!==qt||_.height!==be.height||xtA)){Qe>S&&(be.width+=Qe-S,be.x=S),xtN&&(be.height+=qt-N,be.y=N),Ot_&&(_=q)),q ")+` 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 ce(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:c.ReactCurrentDispatcher,findHostInstanceByFiber:Td,findFiberByHostInstance:u.findFiberByHostInstance||Ug,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")u=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)u=!0;else{try{dc=f.inject(u),So=f}catch{}u=!!f.checkDCE}}return u},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(u,f,_,S){if(!pn)throw Error(l(363));u=ra(u,f);var A=k(u,_,S).disconnect;return{disconnect:function(){A()}}},t.registerMutableSourceForHydration=function(u,f){var _=f._getVersion;_=_(f._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[f,_]:u.mutableSourceEagerHydrationData.push(f,_)},t.runWithPriority=function(u,f){var _=un;try{return un=u,f()}finally{un=_}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(u,f,_,S){var A=f.current,N=Rn(),q=Js(A);return _=kg(_),f.context===null?f.context=_:f.pendingContext=_,f=jo(N,q),f.payload={element:u},S=S===void 0?null:S,S!==null&&(f.callback=S),Aa(A,f),u=gr(A,q,N),u!==null&&Hf(u,A,q),q},t}),uy}var oA;function lH(){return oA||(oA=1,oy.exports=aH()),oy.exports}var uH=lH();const cH=gA(uH);var aA=i2();const CM={},fH=n=>void Object.assign(CM,n);function dH(n,e){function t(m,{args:v=[],attach:g,...y},E){let C=`${m[0].toUpperCase()}${m.slice(1)}`,w;if(m==="primitive"){if(y.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const M=y.object;w=th(M,{type:m,root:E,attach:g,primitive:!0})}else{const M=CM[C];if(!M)throw new Error(`R3F: ${C} 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(v))throw new Error("R3F: The args prop must be an array!");w=th(new M(...v),{type:m,root:E,attach:g,memoizedProps:{args:v}})}return w.__r3f.attach===void 0&&(w.isBufferGeometry?w.__r3f.attach="geometry":w.isMaterial&&(w.__r3f.attach="material")),C!=="inject"&&dy(w,y),w}function i(m,v){let g=!1;if(v){var y,E;(y=v.__r3f)!=null&&y.attach?fy(m,v,v.__r3f.attach):v.isObject3D&&m.isObject3D&&(m.add(v),g=!0),g||(E=m.__r3f)==null||E.objects.push(v),v.__r3f||th(v,{}),v.__r3f.parent=m,r1(v),nh(v)}}function r(m,v,g){let y=!1;if(v){var E,C;if((E=v.__r3f)!=null&&E.attach)fy(m,v,v.__r3f.attach);else if(v.isObject3D&&m.isObject3D){v.parent=m,v.dispatchEvent({type:"added"}),m.dispatchEvent({type:"childadded",child:v});const w=m.children.filter(P=>P!==v),M=w.indexOf(g);m.children=[...w.slice(0,M),v,...w.slice(M)],y=!0}y||(C=m.__r3f)==null||C.objects.push(v),v.__r3f||th(v,{}),v.__r3f.parent=m,r1(v),nh(v)}}function o(m,v,g=!1){m&&[...m].forEach(y=>l(v,y,g))}function l(m,v,g){if(v){var y,E,C;if(v.__r3f&&(v.__r3f.parent=null),(y=m.__r3f)!=null&&y.objects&&(m.__r3f.objects=m.__r3f.objects.filter(D=>D!==v)),(E=v.__r3f)!=null&&E.attach)dA(m,v,v.__r3f.attach);else if(v.isObject3D&&m.isObject3D){var w;m.remove(v),(w=v.__r3f)!=null&&w.root&&xH(gv(v),v)}const P=(C=v.__r3f)==null?void 0:C.primitive,I=!P&&(g===void 0?v.dispose!==null:g);if(!P){var M;o((M=v.__r3f)==null?void 0:M.objects,v,I),o(v.children,v,I)}if(delete v.__r3f,I&&v.dispose&&v.type!=="Scene"){const D=()=>{try{v.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?aA.unstable_scheduleCallback(aA.unstable_IdlePriority,D):D()}nh(m)}}function c(m,v,g,y){var E;const C=(E=m.__r3f)==null?void 0:E.parent;if(!C)return;const w=t(v,g,m.__r3f.root);if(m.children){for(const M of m.children)M.__r3f&&i(w,M);m.children=m.children.filter(M=>!M.__r3f)}m.__r3f.objects.forEach(M=>i(w,M)),m.__r3f.objects=[],m.__r3f.autoRemovedBeforeAppend||l(C,m),w.parent&&(w.__r3f.autoRemovedBeforeAppend=!0),i(C,w),w.raycast&&w.__r3f.eventCount&&gv(w).getState().internal.interaction.push(w),[y,y.alternate].forEach(M=>{M!==null&&(M.stateNode=w,M.ref&&(typeof M.ref=="function"?M.ref(w):M.ref.current=w))})}const d=()=>{};return{reconciler:cH({createInstance:t,removeChild:l,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(m,v)=>{if(!v)return;const g=m.getState().scene;g.__r3f&&(g.__r3f.root=m,i(g,v))},removeChildFromContainer:(m,v)=>{v&&l(m.getState().scene,v)},insertInContainerBefore:(m,v,g)=>{if(!v||!g)return;const y=m.getState().scene;y.__r3f&&r(y,v,g)},getRootHostContext:()=>null,getChildHostContext:m=>m,finalizeInitialChildren(m){var v;return!!((v=m==null?void 0:m.__r3f)!=null?v:{}).handlers},prepareUpdate(m,v,g,y){var E;if(((E=m==null?void 0:m.__r3f)!=null?E:{}).primitive&&y.object&&y.object!==m)return[!0];{const{args:w=[],children:M,...P}=y,{args:I=[],children:D,...L}=g;if(!Array.isArray(w))throw new Error("R3F: the args prop must be an array!");if(w.some((U,b)=>U!==I[b]))return[!0];const O=l2(m,P,L,!0);return O.changes.length?[!1,O]:null}},commitUpdate(m,[v,g],y,E,C,w){v?c(m,y,C,w):dy(m,g)},commitMount(m,v,g,y){var E;const C=(E=m.__r3f)!=null?E:{};m.raycast&&C.handlers&&C.eventCount&&gv(m).getState().internal.interaction.push(m)},getPublicInstance:m=>m,prepareForCommit:()=>null,preparePortalMount:m=>th(m.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(m){var v;const{attach:g,parent:y}=(v=m.__r3f)!=null?v:{};g&&y&&dA(y,m,g),m.isObject3D&&(m.visible=!1),nh(m)},unhideInstance(m,v){var g;const{attach:y,parent:E}=(g=m.__r3f)!=null?g:{};y&&E&&fy(E,m,y),(m.isObject3D&&v.visible==null||v.visible)&&(m.visible=!0),nh(m)},createTextInstance:d,hideTextInstance:d,unhideTextInstance:d,getCurrentEventPriority:()=>e?e():dh.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&hi.fun(performance.now)?performance.now:hi.fun(Date.now)?Date.now:()=>0,scheduleTimeout:hi.fun(setTimeout)?setTimeout:void 0,cancelTimeout:hi.fun(clearTimeout)?clearTimeout:void 0}),applyProps:dy}}var lA,uA;const cy=n=>"colorSpace"in n||"outputColorSpace"in n,r2=()=>{var n;return(n=CM.ColorManagement)!=null?n:null},s2=n=>n&&n.isOrthographicCamera,AM=typeof window<"u"&&((lA=window.document)!=null&&lA.createElement||((uA=window.navigator)==null?void 0:uA.product)==="ReactNative")?De.useLayoutEffect:De.useEffect;function hH(n){const e=De.useRef(n);return AM(()=>void(e.current=n),[n]),e}class pH extends De.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}pH.getDerivedStateFromError=()=>({error:!0});const o2="__default",cA=new Map,mH=n=>n&&!!n.memoized&&!!n.changes;function a2(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const im=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function gv(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const hi={obj:n=>n===Object(n)&&!hi.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(hi.str(n)||hi.num(n)||hi.boo(n))return n===e;const o=hi.obj(n);if(o&&i==="reference")return n===e;const l=hi.arr(n);if(l&&t==="reference")return n===e;if((l||o)&&n===e)return!0;let c;for(c in n)if(!(c in e))return!1;if(o&&t==="shallow"&&i==="shallow"){for(c in r?e:n)if(!hi.equ(n[c],e[c],{strict:r,objects:"reference"}))return!1}else for(c in r?e:n)if(n[c]!==e[c])return!1;if(hi.und(c)){if(l&&n.length===0&&e.length===0||o&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function gH(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function th(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function i1(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((o,l)=>o[l],n),{target:t,key:r}}else return{target:t,key:e}}const fA=/-\d+$/;function fy(n,e,t){if(hi.str(t)){if(fA.test(t)){const o=t.replace(fA,""),{target:l,key:c}=i1(n,o);Array.isArray(l[c])||(l[c]=[])}const{target:i,key:r}=i1(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function dA(n,e,t){var i,r;if(hi.str(t)){const{target:o,key:l}=i1(n,t),c=e.__r3f.previousAttach;c===void 0?delete o[l]:o[l]=c}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function l2(n,{children:e,key:t,ref:i,...r},{children:o,key:l,ref:c,...d}={},p=!1){const m=n.__r3f,v=Object.entries(r),g=[];if(p){const E=Object.keys(d);for(let C=0;C{var w;if((w=n.__r3f)!=null&&w.primitive&&E==="object"||hi.equ(C,d[E]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(E))return g.push([E,C,!0,[]]);let M=[];E.includes("-")&&(M=E.split("-")),g.push([E,C,!1,M]);for(const P in r){const I=r[P];P.startsWith(`${E}-`)&&g.push([P,I,!1,P.split("-")])}});const y={...r};return m!=null&&m.memoizedProps&&m!=null&&m.memoizedProps.args&&(y.args=m.memoizedProps.args),m!=null&&m.memoizedProps&&m!=null&&m.memoizedProps.attach&&(y.attach=m.memoizedProps.attach),{memoized:y,changes:g}}function dy(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,o=r==null||r.getState==null?void 0:r.getState(),{memoized:l,changes:c}=mH(e)?e:l2(n,e),d=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let g=0;gI[D],n),!(P&&P.set))){const[I,...D]=w.reverse();M=D.reverse().reduce((L,O)=>L[O],n),y=I}if(E===o2+"remove")if(M.constructor){let I=cA.get(M.constructor);I||(I=new M.constructor,cA.set(M.constructor,I)),E=I[y]}else E=0;if(C&&i)E?i.handlers[y]=E:delete i.handlers[y],i.eventCount=Object.keys(i.handlers).length;else if(P&&P.set&&(P.copy||P instanceof Eh)){if(Array.isArray(E))P.fromArray?P.fromArray(E):P.set(...E);else if(P.copy&&E&&E.constructor&&P.constructor===E.constructor)P.copy(E);else if(E!==void 0){var p;const I=(p=P)==null?void 0:p.isColor;!I&&P.setScalar?P.setScalar(E):P instanceof Eh&&E instanceof Eh?P.mask=E.mask:P.set(E),!r2()&&o&&!o.linear&&I&&P.convertSRGBToLinear()}}else{var m;if(M[y]=E,(m=M[y])!=null&&m.isTexture&&M[y].format===Bo&&M[y].type===co&&o){const I=M[y];cy(I)&&cy(o.gl)?I.colorSpace=o.gl.outputColorSpace:I.encoding=o.gl.outputEncoding}}nh(n)}if(i&&i.parent&&n.raycast&&d!==i.eventCount){const g=gv(n).getState().internal,y=g.interaction.indexOf(n);y>-1&&g.interaction.splice(y,1),i.eventCount&&g.interaction.push(n)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(t=n.__r3f)!=null&&t.parent&&r1(n),n}function nh(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 r1(n){n.onUpdate==null||n.onUpdate(n)}function vH(n,e){n.manual||(s2(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 q0(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function _H(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return dh.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return dh.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return dh.ContinuousEventPriority;default:return dh.DefaultEventPriority}}function u2(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function xH(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)=>{u2(t.capturedMap,e,i,r)})}function yH(n){function e(d){const{internal:p}=n.getState(),m=d.offsetX-p.initialClick[0],v=d.offsetY-p.initialClick[1];return Math.round(Math.sqrt(m*m+v*v))}function t(d){return d.filter(p=>["Move","Over","Enter","Out","Leave"].some(m=>{var v;return(v=p.__r3f)==null?void 0:v.handlers["onPointer"+m]}))}function i(d,p){const m=n.getState(),v=new Set,g=[],y=p?p(m.internal.interaction):m.internal.interaction;for(let M=0;M{const I=im(M.object),D=im(P.object);return!I||!D?M.distance-P.distance:D.events.priority-I.events.priority||M.distance-P.distance}).filter(M=>{const P=q0(M);return v.has(P)?!1:(v.add(P),!0)});m.events.filter&&(C=m.events.filter(C,m));for(const M of C){let P=M.object;for(;P;){var w;(w=P.__r3f)!=null&&w.eventCount&&g.push({...M,eventObject:P}),P=P.parent}}if("pointerId"in d&&m.internal.capturedMap.has(d.pointerId))for(let M of m.internal.capturedMap.get(d.pointerId).values())v.has(q0(M.intersection))||g.push(M.intersection);return g}function r(d,p,m,v){const g=n.getState();if(d.length){const y={stopped:!1};for(const E of d){const C=im(E.object)||g,{raycaster:w,pointer:M,camera:P,internal:I}=C,D=new xe(M.x,M.y,0).unproject(P),L=H=>{var W,Y;return(W=(Y=I.capturedMap.get(H))==null?void 0:Y.has(E.eventObject))!=null?W:!1},O=H=>{const W={intersection:E,target:p.target};I.capturedMap.has(H)?I.capturedMap.get(H).set(E.eventObject,W):I.capturedMap.set(H,new Map([[E.eventObject,W]])),p.target.setPointerCapture(H)},U=H=>{const W=I.capturedMap.get(H);W&&u2(I.capturedMap,E.eventObject,W,H)};let b={};for(let H in p){let W=p[H];typeof W!="function"&&(b[H]=W)}let F={...E,...b,pointer:M,intersections:d,stopped:y.stopped,delta:m,unprojectedPoint:D,ray:w.ray,camera:P,stopPropagation(){const H="pointerId"in p&&I.capturedMap.get(p.pointerId);if((!H||H.has(E.eventObject))&&(F.stopped=y.stopped=!0,I.hovered.size&&Array.from(I.hovered.values()).find(W=>W.eventObject===E.eventObject))){const W=d.slice(0,d.indexOf(E));o([...W,E])}},target:{hasPointerCapture:L,setPointerCapture:O,releasePointerCapture:U},currentTarget:{hasPointerCapture:L,setPointerCapture:O,releasePointerCapture:U},nativeEvent:p};if(v(F),y.stopped===!0)break}}return d}function o(d){const{internal:p}=n.getState();for(const m of p.hovered.values())if(!d.length||!d.find(v=>v.object===m.object&&v.index===m.index&&v.instanceId===m.instanceId)){const g=m.eventObject.__r3f,y=g==null?void 0:g.handlers;if(p.hovered.delete(q0(m)),g!=null&&g.eventCount){const E={...m,intersections:d};y.onPointerOut==null||y.onPointerOut(E),y.onPointerLeave==null||y.onPointerLeave(E)}}}function l(d,p){for(let m=0;mo([]);case"onLostPointerCapture":return p=>{const{internal:m}=n.getState();"pointerId"in p&&m.capturedMap.has(p.pointerId)&&requestAnimationFrame(()=>{m.capturedMap.has(p.pointerId)&&(m.capturedMap.delete(p.pointerId),o([]))})}}return function(m){const{onPointerMissed:v,internal:g}=n.getState();g.lastEvent.current=m;const y=d==="onPointerMove",E=d==="onClick"||d==="onContextMenu"||d==="onDoubleClick",w=i(m,y?t:void 0),M=E?e(m):0;d==="onPointerDown"&&(g.initialClick=[m.offsetX,m.offsetY],g.initialHits=w.map(I=>I.eventObject)),E&&!w.length&&M<=2&&(l(m,g.interaction),v&&v(m)),y&&o(w);function P(I){const D=I.eventObject,L=D.__r3f,O=L==null?void 0:L.handlers;if(L!=null&&L.eventCount)if(y){if(O.onPointerOver||O.onPointerEnter||O.onPointerOut||O.onPointerLeave){const U=q0(I),b=g.hovered.get(U);b?b.stopped&&I.stopPropagation():(g.hovered.set(U,I),O.onPointerOver==null||O.onPointerOver(I),O.onPointerEnter==null||O.onPointerEnter(I))}O.onPointerMove==null||O.onPointerMove(I)}else{const U=O[d];U?(!E||g.initialHits.includes(D))&&(l(m,g.interaction.filter(b=>!g.initialHits.includes(b))),U(I)):E&&g.initialHits.includes(D)&&l(m,g.interaction.filter(b=>!g.initialHits.includes(b)))}}r(w,m,M,P)}}return{handlePointer:c}}const c2=n=>!!(n!=null&&n.render),f2=De.createContext(null),SH=(n,e)=>{const t=sH((c,d)=>{const p=new xe,m=new xe,v=new xe;function g(M=d().camera,P=m,I=d().size){const{width:D,height:L,top:O,left:U}=I,b=D/L;P.isVector3?v.copy(P):v.set(...P);const F=M.getWorldPosition(p).distanceTo(v);if(s2(M))return{width:D/M.zoom,height:L/M.zoom,top:O,left:U,factor:1,distance:F,aspect:b};{const H=M.fov*Math.PI/180,W=2*Math.tan(H/2)*F,Y=W*(D/L);return{width:Y,height:W,top:O,left:U,factor:D/Y,distance:F,aspect:b}}}let y;const E=M=>c(P=>({performance:{...P.performance,current:M}})),C=new Dn;return{set:c,get:d,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(M=1)=>n(d(),M),advance:(M,P)=>e(M,P,d()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new rz,pointer:C,mouse:C,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const M=d();y&&clearTimeout(y),M.performance.current!==M.performance.min&&E(M.performance.min),y=setTimeout(()=>E(d().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:g},setEvents:M=>c(P=>({...P,events:{...P.events,...M}})),setSize:(M,P,I,D,L)=>{const O=d().camera,U={width:M,height:P,top:D||0,left:L||0,updateStyle:I};c(b=>({size:U,viewport:{...b.viewport,...g(O,m,U)}}))},setDpr:M=>c(P=>{const I=a2(M);return{viewport:{...P.viewport,dpr:I,initialDpr:P.viewport.initialDpr||I}}}),setFrameloop:(M="always")=>{const P=d().clock;P.stop(),P.elapsedTime=0,M!=="never"&&(P.start(),P.elapsedTime=0),c(()=>({frameloop:M}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:De.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(M,P,I)=>{const D=d().internal;return D.priority=D.priority+(P>0?1:0),D.subscribers.push({ref:M,priority:P,store:I}),D.subscribers=D.subscribers.sort((L,O)=>L.priority-O.priority),()=>{const L=d().internal;L!=null&&L.subscribers&&(L.priority=L.priority-(P>0?1:0),L.subscribers=L.subscribers.filter(O=>O.ref!==M))}}}}}),i=t.getState();let r=i.size,o=i.viewport.dpr,l=i.camera;return t.subscribe(()=>{const{camera:c,size:d,viewport:p,gl:m,set:v}=t.getState();if(d.width!==r.width||d.height!==r.height||p.dpr!==o){var g;r=d,o=p.dpr,vH(c,d),m.setPixelRatio(p.dpr);const y=(g=d.updateStyle)!=null?g:typeof HTMLCanvasElement<"u"&&m.domElement instanceof HTMLCanvasElement;m.setSize(d.width,d.height,y)}c!==l&&(l=c,v(y=>({viewport:{...y.viewport,...y.viewport.getCurrentViewport(c)}})))}),t.subscribe(c=>n(c)),t};let Z0,MH=new Set,EH=new Set,wH=new Set;function hy(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function rm(n,e){switch(n){case"before":return hy(MH,e);case"after":return hy(EH,e);case"tail":return hy(wH,e)}}let py,my;function gy(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),py=e.internal.subscribers,Z0=0;Z00)&&!((m=o.gl.xr)!=null&&m.isPresenting)&&(i+=gy(p,o))}if(t=!1,rm("after",p),i===0)return rm("tail",p),e=!1,cancelAnimationFrame(r)}function c(p,m=1){var v;if(!p)return n.forEach(g=>c(g.store.getState(),m));(v=p.gl.xr)!=null&&v.isPresenting||!p.internal.active||p.frameloop==="never"||(m>1?p.internal.frames=Math.min(60,p.internal.frames+m):t?p.internal.frames=2:p.internal.frames=1,e||(e=!0,requestAnimationFrame(l)))}function d(p,m=!0,v,g){if(m&&rm("before",p),v)gy(p,v,g);else for(const y of n.values())gy(p,y.store.getState());m&&rm("after",p)}return{loop:l,invalidate:c,advance:d}}function CH(){const n=De.useContext(f2);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function AH(n,e=0){const t=CH(),i=t.getState().internal.subscribe,r=hH(n);return AM(()=>i(r,e,t),[e,i,t]),null}const Wh=new Map,{invalidate:hA,advance:pA}=TH(Wh),{reconciler:jv,applyProps:Zd}=dH(Wh,_H),Kd={objects:"shallow",strict:!1},RH=(n,e)=>{const t=typeof n=="function"?n(e):n;return c2(t)?t:new eH({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function PH(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:o,left:l,updateStyle:c=t}=e;return{width:i,height:r,top:o,left:l,updateStyle:c}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:o,left:l}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:o,left:l,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&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 bH(n){const e=Wh.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,o=i||SH(hA,pA),l=t||jv.createContainer(o,dh.ConcurrentRoot,null,!1,null,"",r,null);e||Wh.set(n,{fiber:l,store:o});let c,d=!1,p;return{configure(m={}){let{gl:v,size:g,scene:y,events:E,onCreated:C,shadows:w=!1,linear:M=!1,flat:P=!1,legacy:I=!1,orthographic:D=!1,frameloop:L="always",dpr:O=[1,2],performance:U,raycaster:b,camera:F,onPointerMissed:H}=m,W=o.getState(),Y=W.gl;W.gl||W.set({gl:Y=RH(v,n)});let le=W.raycaster;le||W.set({raycaster:le=new iz});const{params:pe,...ee}=b||{};if(hi.equ(ee,le,Kd)||Zd(le,{...ee}),hi.equ(pe,le.params,Kd)||Zd(le,{params:{...le.params,...pe}}),!W.camera||W.camera===p&&!hi.equ(p,F,Kd)){p=F;const B=F instanceof wM,G=B?F:D?new TM(0,0,0,0,.1,1e3):new Uo(75,0,.1,1e3);B||(G.position.z=5,F&&(Zd(G,F),("aspect"in F||"left"in F||"right"in F||"bottom"in F||"top"in F)&&(G.manual=!0,G.updateProjectionMatrix())),!W.camera&&!(F!=null&&F.rotation)&&G.lookAt(0,0,0)),W.set({camera:G}),le.camera=G}if(!W.scene){let B;y!=null&&y.isScene?B=y:(B=new IF,y&&Zd(B,y)),W.set({scene:th(B)})}if(!W.xr){var ce;const B=(Oe,We)=>{const qe=o.getState();qe.frameloop!=="never"&&pA(Oe,!0,qe,We)},G=()=>{const Oe=o.getState();Oe.gl.xr.enabled=Oe.gl.xr.isPresenting,Oe.gl.xr.setAnimationLoop(Oe.gl.xr.isPresenting?B:null),Oe.gl.xr.isPresenting||hA(Oe)},te={connect(){const Oe=o.getState().gl;Oe.xr.addEventListener("sessionstart",G),Oe.xr.addEventListener("sessionend",G)},disconnect(){const Oe=o.getState().gl;Oe.xr.removeEventListener("sessionstart",G),Oe.xr.removeEventListener("sessionend",G)}};typeof((ce=Y.xr)==null?void 0:ce.addEventListener)=="function"&&te.connect(),W.set({xr:te})}if(Y.shadowMap){const B=Y.shadowMap.enabled,G=Y.shadowMap.type;if(Y.shadowMap.enabled=!!w,hi.boo(w))Y.shadowMap.type=cv;else if(hi.str(w)){var $;const te={basic:BU,percentage:km,soft:cv,variance:fh};Y.shadowMap.type=($=te[w])!=null?$:cv}else hi.obj(w)&&Object.assign(Y.shadowMap,w);(B!==Y.shadowMap.enabled||G!==Y.shadowMap.type)&&(Y.shadowMap.needsUpdate=!0)}const X=r2();X&&("enabled"in X?X.enabled=!I:"legacyMode"in X&&(X.legacyMode=I)),d||Zd(Y,{outputEncoding:M?3e3:3001,toneMapping:P?Sa:cM}),W.legacy!==I&&W.set(()=>({legacy:I})),W.linear!==M&&W.set(()=>({linear:M})),W.flat!==P&&W.set(()=>({flat:P})),v&&!hi.fun(v)&&!c2(v)&&!hi.equ(v,Y,Kd)&&Zd(Y,v),E&&!W.events.handlers&&W.set({events:E(o)});const Q=PH(n,g);return hi.equ(Q,W.size,Kd)||W.setSize(Q.width,Q.height,Q.updateStyle,Q.top,Q.left),O&&W.viewport.dpr!==a2(O)&&W.setDpr(O),W.frameloop!==L&&W.setFrameloop(L),W.onPointerMissed||W.set({onPointerMissed:H}),U&&!hi.equ(U,W.performance,Kd)&&W.set(B=>({performance:{...B.performance,...U}})),c=C,d=!0,this},render(m){return d||this.configure(),jv.updateContainer(Z.jsx(DH,{store:o,children:m,onCreated:c,rootElement:n}),l,null,()=>{}),o},unmount(){NH(n)}}}function DH({store:n,children:e,onCreated:t,rootElement:i}){return AM(()=>{const r=n.getState();r.set(o=>({internal:{...o.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),Z.jsx(f2.Provider,{value:n,children:e})}function NH(n,e){const t=Wh.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),jv.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var o,l,c,d;r.events.disconnect==null||r.events.disconnect(),(o=r.gl)==null||(l=o.renderLists)==null||l.dispose==null||l.dispose(),(c=r.gl)==null||c.forceContextLoss==null||c.forceContextLoss(),(d=r.gl)!=null&&d.xr&&r.xr.disconnect(),gH(r),Wh.delete(n)}catch{}},500)})}}jv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:De.version});const vy={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 LH(n){const{handlePointer:e}=yH(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(vy).reduce((t,i)=>({...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:o}=n.getState();o.disconnect==null||o.disconnect(),r(l=>({events:{...l.events,connected:t}})),Object.entries((i=o.handlers)!=null?i:[]).forEach(([l,c])=>{const[d,p]=vy[l];t.addEventListener(d,c,{passive:p})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([o,l])=>{if(i&&i.connected instanceof HTMLElement){const[c]=vy[o];i.connected.removeEventListener(c,l)}}),t(o=>({events:{...o.events,connected:void 0}}))}}}}fH({Group:gm,InstancedMesh:VF,Mesh:Ho,SphereGeometry:EM,RingGeometry:MM,MeshBasicMaterial:SM,MeshMatcapMaterial:ez});const mA=4,Yv=2.1,d2=-2.1,IH=1.2,kH=new bn("#415FA8"),OH=new bn("#FBC774");function UH(){const e=document.createElement("canvas");e.width=128,e.height=128;const t=e.getContext("2d"),i=128/2,r=128/2,o=128/2,l=t.createRadialGradient(i,r,0,i,r,o);l.addColorStop(0,"#eef1f9"),l.addColorStop(.45,"#a3adc9"),l.addColorStop(.75,"#454a63"),l.addColorStop(1,"#101219"),t.fillStyle=l,t.fillRect(0,0,128,128);const c=t.createRadialGradient(i-o*.32,r-o*.38,0,i-o*.32,r-o*.38,o*.4);c.addColorStop(0,"rgba(255,255,255,0.95)"),c.addColorStop(.5,"rgba(255,255,255,0.35)"),c.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=c,t.fillRect(0,0,128,128),t.beginPath(),t.arc(i,r,o*.93,0,Math.PI*2),t.lineWidth=128*.055,t.strokeStyle="rgba(255,255,255,0.6)",t.stroke();const d=new XF(e);return d.needsUpdate=!0,d}function h2(n){return 1.5*(1-n*.82)}function FH({count:n,animate:e}){const t=De.useRef(null),i=De.useRef(null),r=De.useMemo(()=>new Gs,[]),o=De.useMemo(()=>new bn,[]),l=De.useMemo(()=>UH(),[]),c=De.useMemo(()=>Array.from({length:n},()=>({progress:Math.random(),angle:Math.random()*Math.PI*2,speed:(.06+Math.random()*.05)*IH})),[n]);return AH((d,p)=>{const m=t.current;if(!m)return;const v=i.current;if(v){const g=d.pointer.x*.22,y=-d.pointer.y*.12;v.rotation.y+=(g-v.rotation.y)*.04,v.rotation.x+=(y-v.rotation.x)*.04}c.forEach((g,y)=>{e&&(g.progress=(g.progress+g.speed*p*.15)%1);const E=Yv+(d2-Yv)*g.progress,C=h2(g.progress),w=g.angle+g.progress*2.4,M=Math.cos(w)*C,P=Math.sin(w)*C;r.position.set(M,E,P),r.scale.setScalar(.05+.03*(1-g.progress)),r.updateMatrix(),m.setMatrixAt(y,r.matrix),o.copy(kH).lerp(OH,g.progress),m.setColorAt(y,o)}),m.instanceMatrix.needsUpdate=!0,m.instanceColor&&(m.instanceColor.needsUpdate=!0)}),Z.jsxs("group",{ref:i,children:[Z.jsxs("instancedMesh",{ref:t,args:[void 0,void 0,n],children:[Z.jsx("sphereGeometry",{args:[1,16,16]}),Z.jsx("meshMatcapMaterial",{matcap:l,toneMapped:!1})]}),Z.jsx(zH,{})]})}function zH(){const n=Array.from({length:mA},(e,t)=>{const i=t/(mA-1);return{y:Yv+(d2-Yv)*i,radius:h2(i)}});return Z.jsx(Z.Fragment,{children:n.map((e,t)=>Z.jsxs("mesh",{position:[0,e.y,0],rotation:[Math.PI/2,0,0],children:[Z.jsx("ringGeometry",{args:[e.radius*.94,e.radius,48]}),Z.jsx("meshBasicMaterial",{color:"#FBC774",transparent:!0,opacity:.28,side:Xa})]},t))})}function BH({particleCount:n,animate:e}){return Z.jsx(FH,{count:n,animate:e})}function VH({particleCount:n,animate:e,dpr:t,onReady:i}){const r=De.useRef(null),o=De.useRef(null);return De.useEffect(()=>{const l=r.current,c=o.current;if(!l||!c)return;const d=bH(c);let p=!1;const m=()=>{const{width:g,height:y}=l.getBoundingClientRect();if(!(g===0||y===0))try{d.configure({size:{width:g,height:y,top:0,left:0},camera:{position:[0,.3,6.4],fov:34},dpr:t,frameloop:e?"always":"demand",gl:{antialias:!0,alpha:!0,powerPreference:"high-performance"},events:LH,onCreated:()=>i==null?void 0:i()}),d.render(Z.jsx(BH,{particleCount:n,animate:e}))}catch(E){console.error("[PipelineScene3D] failed to mount:",E)}};m();const v=new ResizeObserver(()=>{p||m()});return v.observe(l),()=>{p=!0,v.disconnect(),d.unmount()}},[n,e,t]),Z.jsx("div",{ref:r,className:"h-full w-full",children:Z.jsx("canvas",{ref:o,className:"block h-full w-full"})})}const HH=Object.freeze(Object.defineProperty({__proto__:null,default:VH},Symbol.toStringTag,{value:"Module"}));