From 2d2138ae738890cf1744e5ddde6cc76db850e322 Mon Sep 17 00:00:00 2001 From: CodeOlga <111949555+CodeOlga@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:53:51 +0200 Subject: [PATCH] Updates --- .../{index-DkNsVqaW.js => index-DWBN5_fb.js} | 384 +++++++++--------- index.html | 2 +- 2 files changed, 193 insertions(+), 193 deletions(-) rename assets/{index-DkNsVqaW.js => index-DWBN5_fb.js} (84%) diff --git a/assets/index-DkNsVqaW.js b/assets/index-DWBN5_fb.js similarity index 84% rename from assets/index-DkNsVqaW.js rename to assets/index-DWBN5_fb.js index 5d4a81c..2ebc99f 100644 --- a/assets/index-DkNsVqaW.js +++ b/assets/index-DWBN5_fb.js @@ -1,4 +1,4 @@ -(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 s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Gv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var oB={exports:{}},Hv={},aB={exports:{}},en={};/** +(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 s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Gv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lB={exports:{}},Hv={},uB={exports:{}},en={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Lp=Symbol.for("react.element"),LF=Symbol.for("react.portal"),DF=Symbol.for("react.fragment"),NF=Symbol.for("react.strict_mode"),FF=Symbol.for("react.profiler"),OF=Symbol.for("react.provider"),UF=Symbol.for("react.context"),kF=Symbol.for("react.forward_ref"),zF=Symbol.for("react.suspense"),GF=Symbol.for("react.memo"),HF=Symbol.for("react.lazy"),QT=Symbol.iterator;function VF(n){return n===null||typeof n!="object"?null:(n=QT&&n[QT]||n["@@iterator"],typeof n=="function"?n:null)}var lB={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uB=Object.assign,cB={};function ah(n,e,t){this.props=n,this.context=e,this.refs=cB,this.updater=t||lB}ah.prototype.isReactComponent={};ah.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};ah.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function fB(){}fB.prototype=ah.prototype;function $S(n,e,t){this.props=n,this.context=e,this.refs=cB,this.updater=t||lB}var eM=$S.prototype=new fB;eM.constructor=$S;uB(eM,ah.prototype);eM.isPureReactComponent=!0;var ZT=Array.isArray,hB=Object.prototype.hasOwnProperty,tM={current:null},dB={key:!0,ref:!0,__self:!0,__source:!0};function pB(n,e,t){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)hB.call(e,i)&&!dB.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1>>1,ce=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var ce=ee(d.expirationTime<=V);V=n.unstable_now(),typeof ce=="function"?d.callback=ce:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=ce,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}})(_B);vB.exports=_B;var eO=vB.exports;/** + */(function(n){function e(F,V){var N=F.length;F.push(V);e:for(;0>>1,fe=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var fe=ee(d.expirationTime<=V);V=n.unstable_now(),typeof fe=="function"?d.callback=fe:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=fe,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}})(xB);yB.exports=xB;var nO=yB.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yB=ne,ls=eO;function Ye(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),k1=Object.prototype.hasOwnProperty,tO=/^[: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]*$/,$T={},eC={};function nO(n){return k1.call(eC,n)?!0:k1.call($T,n)?!1:tO.test(n)?eC[n]=!0:($T[n]=!0,!1)}function iO(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function rO(n,e,t,i){if(e===null||typeof e>"u"||iO(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tr(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var zi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){zi[n]=new Tr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];zi[e]=new Tr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){zi[n]=new Tr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){zi[n]=new Tr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){zi[n]=new Tr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){zi[n]=new Tr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){zi[n]=new Tr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){zi[n]=new Tr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){zi[n]=new Tr(n,5,!1,n.toLowerCase(),null,!1,!1)});var iM=/[\-:]([a-z])/g;function rM(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){zi[n]=new Tr(n,1,!1,n.toLowerCase(),null,!1,!1)});zi.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){zi[n]=new Tr(n,1,!1,n.toLowerCase(),null,!0,!0)});function sM(n,e,t,i){var r=zi.hasOwnProperty(e)?zi[e]:null;(r!==null?r.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),k1=Object.prototype.hasOwnProperty,iO=/^[: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]*$/,$T={},eC={};function rO(n){return k1.call(eC,n)?!0:k1.call($T,n)?!1:iO.test(n)?eC[n]=!0:($T[n]=!0,!1)}function sO(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function oO(n,e,t,i){if(e===null||typeof e>"u"||sO(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tr(n,e,t,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var zi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){zi[n]=new Tr(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];zi[e]=new Tr(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){zi[n]=new Tr(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){zi[n]=new Tr(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){zi[n]=new Tr(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){zi[n]=new Tr(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){zi[n]=new Tr(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){zi[n]=new Tr(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){zi[n]=new Tr(n,5,!1,n.toLowerCase(),null,!1,!1)});var iM=/[\-:]([a-z])/g;function rM(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(iM,rM);zi[e]=new Tr(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){zi[n]=new Tr(n,1,!1,n.toLowerCase(),null,!1,!1)});zi.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){zi[n]=new Tr(n,1,!1,n.toLowerCase(),null,!0,!0)});function sM(n,e,t,i){var r=zi.hasOwnProperty(e)?zi[e]:null;(r!==null?r.type!==0:i||!(2a||r[o]!==s[a]){var l=` -`+r[o].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Wy=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?ad(n):""}function sO(n){switch(n.tag){case 5:return ad(n.type);case 16:return ad("Lazy");case 13:return ad("Suspense");case 19:return ad("SuspenseList");case 0:case 2:case 15:return n=Xy(n.type,!1),n;case 11:return n=Xy(n.type.render,!1),n;case 1:return n=Xy(n.type,!0),n;default:return""}}function V1(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ef:return"Fragment";case $c:return"Portal";case z1:return"Profiler";case oM:return"StrictMode";case G1:return"Suspense";case H1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case SB:return(n.displayName||"Context")+".Consumer";case AB:return(n._context.displayName||"Context")+".Provider";case aM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case lM:return e=n.displayName||null,e!==null?e:V1(n.type)||"Memo";case ja:e=n._payload,n=n._init;try{return V1(n(e))}catch{}}return null}function oO(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V1(e);case 8:return e===oM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Sl(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function EB(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function aO(n){var e=EB(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Zm(n){n._valueTracker||(n._valueTracker=aO(n))}function wB(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=EB(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function $0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function W1(n,e){var t=e.checked;return Jn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function nC(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Sl(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function TB(n,e){e=e.checked,e!=null&&sM(n,"checked",e,!1)}function X1(n,e){TB(n,e);var t=Sl(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?J1(n,e.type,t):e.hasOwnProperty("defaultValue")&&J1(n,e.type,Sl(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function iC(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function J1(n,e,t){(e!=="number"||$0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ld=Array.isArray;function xf(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=qm.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Jd(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var yd={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},lO=["Webkit","ms","Moz","O"];Object.keys(yd).forEach(function(n){lO.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),yd[e]=yd[n]})});function PB(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||yd.hasOwnProperty(n)&&yd[n]?(""+e).trim():e+"px"}function BB(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=PB(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var uO=Jn({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 K1(n,e){if(e){if(uO[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ye(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ye(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ye(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ye(62))}}function Q1(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Z1=null;function uM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var q1=null,Af=null,Sf=null;function oC(n){if(n=Fp(n)){if(typeof q1!="function")throw Error(Ye(280));var e=n.stateNode;e&&(e=jv(e),q1(n.stateNode,n.type,e))}}function IB(n){Af?Sf?Sf.push(n):Sf=[n]:Af=n}function LB(){if(Af){var n=Af,e=Sf;if(Sf=Af=null,oC(n),e)for(n=0;n>>=0,n===0?32:31-(xO(n)/AO|0)|0}var $m=64,eg=4194304;function ud(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function iv(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=ud(a):(s&=o,s!==0&&(i=ud(s)))}else o=t&~r,o!==0?i=ud(o):s!==0&&(i=ud(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Dp(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-oo(e),n[e]=t}function wO(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Ad),mC=" ",gC=!1;function $B(n,e){switch(n){case"keyup":return $O.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eI(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var tf=!1;function tU(n,e){switch(n){case"compositionend":return eI(e);case"keypress":return e.which!==32?null:(gC=!0,mC);case"textInput":return n=e.data,n===mC&&gC?null:n;default:return null}}function nU(n,e){if(tf)return n==="compositionend"||!vM&&$B(n,e)?(n=ZB(),T0=pM=el=null,tf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=xC(t)}}function rI(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?rI(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function sI(){for(var n=window,e=$0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=$0(n.document)}return e}function _M(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function fU(n){var e=sI(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&rI(t.ownerDocument.documentElement,t)){if(i!==null&&_M(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=AC(t,s);var o=AC(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,nf=null,rA=null,Md=null,sA=!1;function SC(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;sA||nf==null||nf!==$0(i)||(i=nf,"selectionStart"in i&&_M(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Md&&qd(Md,i)||(Md=i,i=ov(rA,"onSelect"),0of||(n.current=fA[of],fA[of]=null,of--)}function wn(n,e){of++,fA[of]=n.current,n.current=e}var Ml={},sr=Il(Ml),Nr=Il(!1),Vu=Ml;function Of(n,e){var t=n.type.contextTypes;if(!t)return Ml;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Fr(n){return n=n.childContextTypes,n!=null}function lv(){In(Nr),In(sr)}function bC(n,e,t){if(sr.current!==Ml)throw Error(Ye(168));wn(sr,e),wn(Nr,t)}function pI(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Ye(108,oO(n)||"Unknown",r));return Jn({},t,i)}function uv(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Ml,Vu=sr.current,wn(sr,n),wn(Nr,Nr.current),!0}function PC(n,e,t){var i=n.stateNode;if(!i)throw Error(Ye(169));t?(n=pI(n,e,Vu),i.__reactInternalMemoizedMergedChildContext=n,In(Nr),In(sr),wn(sr,n)):In(Nr),wn(Nr,t)}var ia=null,Yv=!1,sx=!1;function mI(n){ia===null?ia=[n]:ia.push(n)}function MU(n){Yv=!0,mI(n)}function Ll(){if(!sx&&ia!==null){sx=!0;var n=0,e=yn;try{var t=ia;for(yn=1;n>=o,r-=o,ua=1<<32-oo(e)+r|t<I?(O=R,R=null):O=R.sibling;var T=p(g,R,A[I],E);if(T===null){R===null&&(R=O);break}n&&R&&T.alternate===null&&e(g,R),S=s(T,S,I),C===null?b=T:C.sibling=T,C=T,R=O}if(I===A.length)return t(g,R),Fn&&lu(g,I),b;if(R===null){for(;II?(O=R,R=null):O=R.sibling;var L=p(g,R,T.value,E);if(L===null){R===null&&(R=O);break}n&&R&&L.alternate===null&&e(g,R),S=s(L,S,I),C===null?b=L:C.sibling=L,C=L,R=O}if(T.done)return t(g,R),Fn&&lu(g,I),b;if(R===null){for(;!T.done;I++,T=A.next())T=d(g,T.value,E),T!==null&&(S=s(T,S,I),C===null?b=T:C.sibling=T,C=T);return Fn&&lu(g,I),b}for(R=i(g,R);!T.done;I++,T=A.next())T=m(R,g,I,T.value,E),T!==null&&(n&&T.alternate!==null&&R.delete(T.key===null?I:T.key),S=s(T,S,I),C===null?b=T:C.sibling=T,C=T);return n&&R.forEach(function(K){return e(g,K)}),Fn&&lu(g,I),b}function y(g,S,A,E){if(typeof A=="object"&&A!==null&&A.type===ef&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case Qm:e:{for(var b=A.key,C=S;C!==null;){if(C.key===b){if(b=A.type,b===ef){if(C.tag===7){t(g,C.sibling),S=r(C,A.props.children),S.return=g,g=S;break e}}else if(C.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===ja&&OC(b)===C.type){t(g,C.sibling),S=r(C,A.props),S.ref=zh(g,C,A),S.return=g,g=S;break e}t(g,C);break}else e(g,C);C=C.sibling}A.type===ef?(S=Bu(A.props.children,g.mode,E,A.key),S.return=g,g=S):(E=D0(A.type,A.key,A.props,null,g.mode,E),E.ref=zh(g,S,A),E.return=g,g=E)}return o(g);case $c:e:{for(C=A.key;S!==null;){if(S.key===C)if(S.tag===4&&S.stateNode.containerInfo===A.containerInfo&&S.stateNode.implementation===A.implementation){t(g,S.sibling),S=r(S,A.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=dx(A,g.mode,E),S.return=g,g=S}return o(g);case ja:return C=A._init,y(g,S,C(A._payload),E)}if(ld(A))return v(g,S,A,E);if(Nh(A))return x(g,S,A,E);ag(g,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,S!==null&&S.tag===6?(t(g,S.sibling),S=r(S,A),S.return=g,g=S):(t(g,S),S=hx(A,g.mode,E),S.return=g,g=S),o(g)):t(g,S)}return y}var kf=MI(!0),EI=MI(!1),Op={},Bo=Il(Op),np=Il(Op),ip=Il(Op);function Au(n){if(n===Op)throw Error(Ye(174));return n}function CM(n,e){switch(wn(ip,e),wn(np,n),wn(Bo,Op),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Y1(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Y1(e,n)}In(Bo),wn(Bo,e)}function zf(){In(Bo),In(np),In(ip)}function wI(n){Au(ip.current);var e=Au(Bo.current),t=Y1(e,n.type);e!==t&&(wn(np,n),wn(Bo,t))}function RM(n){np.current===n&&(In(Bo),In(np))}var Gn=Il(0);function mv(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ox=[];function bM(){for(var n=0;nt?t:4,n(!0);var i=ax.transition;ax.transition={};try{n(!1),e()}finally{yn=t,ax.transition=i}}function GI(){return Gs().memoizedState}function CU(n,e,t){var i=pl(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},HI(n))VI(e,t);else if(t=yI(n,e,t,i),t!==null){var r=Mr();ao(t,n,i,r),WI(t,e,i)}}function RU(n,e,t){var i=pl(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(HI(n))VI(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,lo(a,o)){var l=e.interleaved;l===null?(r.next=r,wM(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=yI(n,e,r,i),t!==null&&(r=Mr(),ao(t,n,i,r),WI(t,e,i))}}function HI(n){var e=n.alternate;return n===Xn||e!==null&&e===Xn}function VI(n,e){Ed=gv=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function WI(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,fM(n,t)}}var vv={readContext:zs,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useInsertionEffect:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useSyncExternalStore:Xi,useId:Xi,unstable_isNewReconciler:!1},bU={readContext:zs,useCallback:function(n,e){return So().memoizedState=[n,e===void 0?null:e],n},useContext:zs,useEffect:kC,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,P0(4194308,4,FI.bind(null,e,n),t)},useLayoutEffect:function(n,e){return P0(4194308,4,n,e)},useInsertionEffect:function(n,e){return P0(4,2,n,e)},useMemo:function(n,e){var t=So();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=So();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=CU.bind(null,Xn,n),[i.memoizedState,n]},useRef:function(n){var e=So();return n={current:n},e.memoizedState=n},useState:UC,useDebugValue:DM,useDeferredValue:function(n){return So().memoizedState=n},useTransition:function(){var n=UC(!1),e=n[0];return n=TU.bind(null,n[1]),So().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Xn,r=So();if(Fn){if(t===void 0)throw Error(Ye(407));t=t()}else{if(t=e(),Bi===null)throw Error(Ye(349));Xu&30||RI(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,kC(PI.bind(null,i,s,n),[n]),i.flags|=2048,op(9,bI.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=So(),e=Bi.identifierPrefix;if(Fn){var t=ca,i=ua;t=(i&~(1<<32-oo(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=rp++,0")&&(l=l.replace("",n.displayName)),l}while(1<=o&&0<=a);break}}}finally{Wy=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?ad(n):""}function aO(n){switch(n.tag){case 5:return ad(n.type);case 16:return ad("Lazy");case 13:return ad("Suspense");case 19:return ad("SuspenseList");case 0:case 2:case 15:return n=Xy(n.type,!1),n;case 11:return n=Xy(n.type.render,!1),n;case 1:return n=Xy(n.type,!0),n;default:return""}}function V1(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case ef:return"Fragment";case $c:return"Portal";case z1:return"Profiler";case oM:return"StrictMode";case G1:return"Suspense";case H1:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case EB:return(n.displayName||"Context")+".Consumer";case MB:return(n._context.displayName||"Context")+".Provider";case aM:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case lM:return e=n.displayName||null,e!==null?e:V1(n.type)||"Memo";case ja:e=n._payload,n=n._init;try{return V1(n(e))}catch{}}return null}function lO(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return V1(e);case 8:return e===oM?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Sl(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function TB(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function uO(n){var e=TB(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,s=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function Zm(n){n._valueTracker||(n._valueTracker=uO(n))}function CB(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=TB(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function $0(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function W1(n,e){var t=e.checked;return Jn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function nC(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Sl(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function RB(n,e){e=e.checked,e!=null&&sM(n,"checked",e,!1)}function X1(n,e){RB(n,e);var t=Sl(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?J1(n,e.type,t):e.hasOwnProperty("defaultValue")&&J1(n,e.type,Sl(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function iC(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function J1(n,e,t){(e!=="number"||$0(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var ld=Array.isArray;function xf(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r"+e.valueOf().toString()+"",e=qm.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function Jd(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var yd={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},cO=["Webkit","ms","Moz","O"];Object.keys(yd).forEach(function(n){cO.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),yd[e]=yd[n]})});function IB(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||yd.hasOwnProperty(n)&&yd[n]?(""+e).trim():e+"px"}function LB(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=IB(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var fO=Jn({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 K1(n,e){if(e){if(fO[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Ye(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Ye(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Ye(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Ye(62))}}function Q1(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Z1=null;function uM(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var q1=null,Af=null,Sf=null;function oC(n){if(n=Fp(n)){if(typeof q1!="function")throw Error(Ye(280));var e=n.stateNode;e&&(e=jv(e),q1(n.stateNode,n.type,e))}}function DB(n){Af?Sf?Sf.push(n):Sf=[n]:Af=n}function NB(){if(Af){var n=Af,e=Sf;if(Sf=Af=null,oC(n),e)for(n=0;n>>=0,n===0?32:31-(SO(n)/MO|0)|0}var $m=64,eg=4194304;function ud(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function iv(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,s=n.pingedLanes,o=t&268435455;if(o!==0){var a=o&~r;a!==0?i=ud(a):(s&=o,s!==0&&(i=ud(s)))}else o=t&~r,o!==0?i=ud(o):s!==0&&(i=ud(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function Dp(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-oo(e),n[e]=t}function CO(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=Ad),mC=" ",gC=!1;function tI(n,e){switch(n){case"keyup":return tU.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nI(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var tf=!1;function iU(n,e){switch(n){case"compositionend":return nI(e);case"keypress":return e.which!==32?null:(gC=!0,mC);case"textInput":return n=e.data,n===mC&&gC?null:n;default:return null}}function rU(n,e){if(tf)return n==="compositionend"||!vM&&tI(n,e)?(n=$B(),T0=pM=el=null,tf=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=xC(t)}}function oI(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?oI(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function aI(){for(var n=window,e=$0();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=$0(n.document)}return e}function _M(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function dU(n){var e=aI(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&oI(t.ownerDocument.documentElement,t)){if(i!==null&&_M(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!n.extend&&s>i&&(r=i,i=s,s=r),r=AC(t,s);var o=AC(t,i);r&&o&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==o.node||n.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),s>i?(n.addRange(e),n.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,nf=null,rA=null,Md=null,sA=!1;function SC(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;sA||nf==null||nf!==$0(i)||(i=nf,"selectionStart"in i&&_M(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Md&&qd(Md,i)||(Md=i,i=ov(rA,"onSelect"),0of||(n.current=fA[of],fA[of]=null,of--)}function wn(n,e){of++,fA[of]=n.current,n.current=e}var Ml={},sr=Il(Ml),Nr=Il(!1),Wu=Ml;function Of(n,e){var t=n.type.contextTypes;if(!t)return Ml;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in t)r[s]=e[s];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Fr(n){return n=n.childContextTypes,n!=null}function lv(){In(Nr),In(sr)}function bC(n,e,t){if(sr.current!==Ml)throw Error(Ye(168));wn(sr,e),wn(Nr,t)}function gI(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(Ye(108,lO(n)||"Unknown",r));return Jn({},t,i)}function uv(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Ml,Wu=sr.current,wn(sr,n),wn(Nr,Nr.current),!0}function PC(n,e,t){var i=n.stateNode;if(!i)throw Error(Ye(169));t?(n=gI(n,e,Wu),i.__reactInternalMemoizedMergedChildContext=n,In(Nr),In(sr),wn(sr,n)):In(Nr),wn(Nr,t)}var ia=null,Yv=!1,sx=!1;function vI(n){ia===null?ia=[n]:ia.push(n)}function wU(n){Yv=!0,vI(n)}function Ll(){if(!sx&&ia!==null){sx=!0;var n=0,e=yn;try{var t=ia;for(yn=1;n>=o,r-=o,ua=1<<32-oo(e)+r|t<I?(O=R,R=null):O=R.sibling;var T=p(g,R,A[I],E);if(T===null){R===null&&(R=O);break}n&&R&&T.alternate===null&&e(g,R),S=s(T,S,I),C===null?b=T:C.sibling=T,C=T,R=O}if(I===A.length)return t(g,R),Fn&&uu(g,I),b;if(R===null){for(;II?(O=R,R=null):O=R.sibling;var L=p(g,R,T.value,E);if(L===null){R===null&&(R=O);break}n&&R&&L.alternate===null&&e(g,R),S=s(L,S,I),C===null?b=L:C.sibling=L,C=L,R=O}if(T.done)return t(g,R),Fn&&uu(g,I),b;if(R===null){for(;!T.done;I++,T=A.next())T=d(g,T.value,E),T!==null&&(S=s(T,S,I),C===null?b=T:C.sibling=T,C=T);return Fn&&uu(g,I),b}for(R=i(g,R);!T.done;I++,T=A.next())T=m(R,g,I,T.value,E),T!==null&&(n&&T.alternate!==null&&R.delete(T.key===null?I:T.key),S=s(T,S,I),C===null?b=T:C.sibling=T,C=T);return n&&R.forEach(function(K){return e(g,K)}),Fn&&uu(g,I),b}function y(g,S,A,E){if(typeof A=="object"&&A!==null&&A.type===ef&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case Qm:e:{for(var b=A.key,C=S;C!==null;){if(C.key===b){if(b=A.type,b===ef){if(C.tag===7){t(g,C.sibling),S=r(C,A.props.children),S.return=g,g=S;break e}}else if(C.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===ja&&OC(b)===C.type){t(g,C.sibling),S=r(C,A.props),S.ref=zh(g,C,A),S.return=g,g=S;break e}t(g,C);break}else e(g,C);C=C.sibling}A.type===ef?(S=Iu(A.props.children,g.mode,E,A.key),S.return=g,g=S):(E=D0(A.type,A.key,A.props,null,g.mode,E),E.ref=zh(g,S,A),E.return=g,g=E)}return o(g);case $c:e:{for(C=A.key;S!==null;){if(S.key===C)if(S.tag===4&&S.stateNode.containerInfo===A.containerInfo&&S.stateNode.implementation===A.implementation){t(g,S.sibling),S=r(S,A.children||[]),S.return=g,g=S;break e}else{t(g,S);break}else e(g,S);S=S.sibling}S=dx(A,g.mode,E),S.return=g,g=S}return o(g);case ja:return C=A._init,y(g,S,C(A._payload),E)}if(ld(A))return v(g,S,A,E);if(Nh(A))return x(g,S,A,E);ag(g,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,S!==null&&S.tag===6?(t(g,S.sibling),S=r(S,A),S.return=g,g=S):(t(g,S),S=hx(A,g.mode,E),S.return=g,g=S),o(g)):t(g,S)}return y}var kf=wI(!0),TI=wI(!1),Op={},Bo=Il(Op),np=Il(Op),ip=Il(Op);function Su(n){if(n===Op)throw Error(Ye(174));return n}function CM(n,e){switch(wn(ip,e),wn(np,n),wn(Bo,Op),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Y1(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=Y1(e,n)}In(Bo),wn(Bo,e)}function zf(){In(Bo),In(np),In(ip)}function CI(n){Su(ip.current);var e=Su(Bo.current),t=Y1(e,n.type);e!==t&&(wn(np,n),wn(Bo,t))}function RM(n){np.current===n&&(In(Bo),In(np))}var Gn=Il(0);function mv(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ox=[];function bM(){for(var n=0;nt?t:4,n(!0);var i=ax.transition;ax.transition={};try{n(!1),e()}finally{yn=t,ax.transition=i}}function VI(){return Gs().memoizedState}function bU(n,e,t){var i=pl(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},WI(n))XI(e,t);else if(t=AI(n,e,t,i),t!==null){var r=Mr();ao(t,n,i,r),JI(t,e,i)}}function PU(n,e,t){var i=pl(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(WI(n))XI(e,r);else{var s=n.alternate;if(n.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,t);if(r.hasEagerState=!0,r.eagerState=a,lo(a,o)){var l=e.interleaved;l===null?(r.next=r,wM(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=AI(n,e,r,i),t!==null&&(r=Mr(),ao(t,n,i,r),JI(t,e,i))}}function WI(n){var e=n.alternate;return n===Xn||e!==null&&e===Xn}function XI(n,e){Ed=gv=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function JI(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,fM(n,t)}}var vv={readContext:zs,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useInsertionEffect:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useSyncExternalStore:Xi,useId:Xi,unstable_isNewReconciler:!1},BU={readContext:zs,useCallback:function(n,e){return So().memoizedState=[n,e===void 0?null:e],n},useContext:zs,useEffect:kC,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,P0(4194308,4,UI.bind(null,e,n),t)},useLayoutEffect:function(n,e){return P0(4194308,4,n,e)},useInsertionEffect:function(n,e){return P0(4,2,n,e)},useMemo:function(n,e){var t=So();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=So();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=bU.bind(null,Xn,n),[i.memoizedState,n]},useRef:function(n){var e=So();return n={current:n},e.memoizedState=n},useState:UC,useDebugValue:DM,useDeferredValue:function(n){return So().memoizedState=n},useTransition:function(){var n=UC(!1),e=n[0];return n=RU.bind(null,n[1]),So().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=Xn,r=So();if(Fn){if(t===void 0)throw Error(Ye(407));t=t()}else{if(t=e(),Bi===null)throw Error(Ye(349));Ju&30||PI(i,e,t)}r.memoizedState=t;var s={value:t,getSnapshot:e};return r.queue=s,kC(II.bind(null,i,s,n),[n]),i.flags|=2048,op(9,BI.bind(null,i,s,t,e),void 0,null),t},useId:function(){var n=So(),e=Bi.identifierPrefix;if(Fn){var t=ca,i=ua;t=(i&~(1<<32-oo(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=rp++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[wo]=e,n[tp]=i,$I(n,e,!1,!1),e.stateNode=n;e:{switch(o=Q1(t,i),t){case"dialog":Cn("cancel",n),Cn("close",n),r=i;break;case"iframe":case"object":case"embed":Cn("load",n),r=i;break;case"video":case"audio":for(r=0;rHf&&(e.flags|=128,i=!0,Gh(s,!1),e.lanes=4194304)}else{if(!i)if(n=mv(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Gh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fn)return Ji(e),null}else 2*si()-s.renderingStartTime>Hf&&t!==1073741824&&(e.flags|=128,i=!0,Gh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=si(),e.sibling=null,t=Gn.current,wn(Gn,i?t&1|2:t&1),e):(Ji(e),null);case 22:case 23:return zM(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Qr&1073741824&&(Ji(e),e.subtreeFlags&6&&(e.flags|=8192)):Ji(e),null;case 24:return null;case 25:return null}throw Error(Ye(156,e.tag))}function OU(n,e){switch(xM(e),e.tag){case 1:return Fr(e.type)&&lv(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return zf(),In(Nr),In(sr),bM(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return RM(e),null;case 13:if(In(Gn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ye(340));Uf()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return In(Gn),null;case 4:return zf(),null;case 10:return EM(e.type._context),null;case 22:case 23:return zM(),null;case 24:return null;default:return null}}var ug=!1,qi=!1,UU=typeof WeakSet=="function"?WeakSet:Set,mt=null;function cf(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Qn(n,e,i)}else t.current=null}function MA(n,e,t){try{t()}catch(i){Qn(n,e,i)}}var YC=!1;function kU(n,e){if(oA=rv,n=sI(),_M(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++u===r&&(a=o),p===s&&++h===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(aA={focusedElem:n,selectionRange:t},rv=!1,mt=e;mt!==null;)if(e=mt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,mt=n;else for(;mt!==null;){e=mt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,y=v.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:$s(e.type,x),y);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ye(163))}}catch(E){Qn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,mt=n;break}mt=e.return}return v=YC,YC=!1,v}function wd(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&MA(e,t,s)}r=r.next}while(r!==i)}}function Zv(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function EA(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function n2(n){var e=n.alternate;e!==null&&(n.alternate=null,n2(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[wo],delete e[tp],delete e[cA],delete e[AU],delete e[SU])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function i2(n){return n.tag===5||n.tag===3||n.tag===4}function KC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||i2(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function wA(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=av));else if(i!==4&&(n=n.child,n!==null))for(wA(n,e,t),n=n.sibling;n!==null;)wA(n,e,t),n=n.sibling}function TA(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(TA(n,e,t),n=n.sibling;n!==null;)TA(n,e,t),n=n.sibling}var Ni=null,to=!1;function Na(n,e,t){for(t=t.child;t!==null;)r2(n,e,t),t=t.sibling}function r2(n,e,t){if(Po&&typeof Po.onCommitFiberUnmount=="function")try{Po.onCommitFiberUnmount(Vv,t)}catch{}switch(t.tag){case 5:qi||cf(t,e);case 6:var i=Ni,r=to;Ni=null,Na(n,e,t),Ni=i,to=r,Ni!==null&&(to?(n=Ni,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ni.removeChild(t.stateNode));break;case 18:Ni!==null&&(to?(n=Ni,t=t.stateNode,n.nodeType===8?rx(n.parentNode,t):n.nodeType===1&&rx(n,t),Qd(n)):rx(Ni,t.stateNode));break;case 4:i=Ni,r=to,Ni=t.stateNode.containerInfo,to=!0,Na(n,e,t),Ni=i,to=r;break;case 0:case 11:case 14:case 15:if(!qi&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&MA(t,e,o),r=r.next}while(r!==i)}Na(n,e,t);break;case 1:if(!qi&&(cf(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Qn(t,e,a)}Na(n,e,t);break;case 21:Na(n,e,t);break;case 22:t.mode&1?(qi=(i=qi)||t.memoizedState!==null,Na(n,e,t),qi=i):Na(n,e,t);break;default:Na(n,e,t)}}function QC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new UU),e.forEach(function(i){var r=YU.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function js(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=si()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*GU(i/1960))-i,10n?16:n,tl===null)var i=!1;else{if(n=tl,tl=null,xv=0,ln&6)throw Error(Ye(331));var r=ln;for(ln|=4,mt=n.current;mt!==null;){var s=mt,o=s.child;if(mt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lsi()-UM?Pu(n,0):OM|=t),Or(n,e)}function h2(n,e){e===0&&(n.mode&1?(e=eg,eg<<=1,!(eg&130023424)&&(eg=4194304)):e=1);var t=Mr();n=ya(n,e),n!==null&&(Dp(n,e,t),Or(n,t))}function jU(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),h2(n,t)}function YU(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ye(314))}i!==null&&i.delete(e),h2(n,t)}var d2;d2=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Nr.current)Dr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Dr=!1,NU(n,e,t);Dr=!!(n.flags&131072)}else Dr=!1,Fn&&e.flags&1048576&&gI(e,fv,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;B0(n,e),n=e.pendingProps;var r=Of(e,sr.current);Ef(e,t),r=BM(null,e,i,n,r,t);var s=IM();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Fr(i)?(s=!0,uv(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,TM(e),r.updater=Kv,e.stateNode=r,r._reactInternals=e,gA(e,i,n,t),e=yA(null,e,i,!0,s,t)):(e.tag=0,Fn&&s&&yM(e),gr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(B0(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=QU(i),n=$s(i,n),r){case 0:e=_A(null,e,i,n,t);break e;case 1:e=XC(null,e,i,n,t);break e;case 11:e=VC(null,e,i,n,t);break e;case 14:e=WC(null,e,i,$s(i.type,n),t);break e}throw Error(Ye(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),_A(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),XC(n,e,i,r,t);case 3:e:{if(QI(e),n===null)throw Error(Ye(387));i=e.pendingProps,s=e.memoizedState,r=s.element,xI(n,e),pv(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Gf(Error(Ye(423)),e),e=JC(n,e,i,t,r);break e}else if(i!==r){r=Gf(Error(Ye(424)),e),e=JC(n,e,i,t,r);break e}else for(ns=fl(e.stateNode.containerInfo.firstChild),ss=e,Fn=!0,no=null,t=EI(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Uf(),i===r){e=xa(n,e,t);break e}gr(n,e,i,t)}e=e.child}return e;case 5:return wI(e),n===null&&dA(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,lA(i,r)?o=null:s!==null&&lA(i,s)&&(e.flags|=32),KI(n,e),gr(n,e,o,t),e.child;case 6:return n===null&&dA(e),null;case 13:return ZI(n,e,t);case 4:return CM(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=kf(e,null,i,t):gr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),VC(n,e,i,r,t);case 7:return gr(n,e,e.pendingProps,t),e.child;case 8:return gr(n,e,e.pendingProps.children,t),e.child;case 12:return gr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,wn(hv,i._currentValue),i._currentValue=o,s!==null)if(lo(s.value,o)){if(s.children===r.children&&!Nr.current){e=xa(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=pa(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),pA(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ye(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),pA(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Ef(e,t),r=zs(r),i=i(r),e.flags|=1,gr(n,e,i,t),e.child;case 14:return i=e.type,r=$s(i,e.pendingProps),r=$s(i.type,r),WC(n,e,i,r,t);case 15:return jI(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),B0(n,e),e.tag=1,Fr(i)?(n=!0,uv(e)):n=!1,Ef(e,t),SI(e,i,r),gA(e,i,r,t),yA(null,e,i,!0,n,t);case 19:return qI(n,e,t);case 22:return YI(n,e,t)}throw Error(Ye(156,e.tag))};function p2(n,e){return zB(n,e)}function KU(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ls(n,e,t,i){return new KU(n,e,t,i)}function HM(n){return n=n.prototype,!(!n||!n.isReactComponent)}function QU(n){if(typeof n=="function")return HM(n)?1:0;if(n!=null){if(n=n.$$typeof,n===aM)return 11;if(n===lM)return 14}return 2}function ml(n,e){var t=n.alternate;return t===null?(t=Ls(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function D0(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")HM(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case ef:return Bu(t.children,r,s,e);case oM:o=8,r|=8;break;case z1:return n=Ls(12,t,e,r|2),n.elementType=z1,n.lanes=s,n;case G1:return n=Ls(13,t,e,r),n.elementType=G1,n.lanes=s,n;case H1:return n=Ls(19,t,e,r),n.elementType=H1,n.lanes=s,n;case MB:return $v(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case AB:o=10;break e;case SB:o=9;break e;case aM:o=11;break e;case lM:o=14;break e;case ja:o=16,i=null;break e}throw Error(Ye(130,n==null?n:typeof n,""))}return e=Ls(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Bu(n,e,t,i){return n=Ls(7,n,i,e),n.lanes=t,n}function $v(n,e,t,i){return n=Ls(22,n,i,e),n.elementType=MB,n.lanes=t,n.stateNode={isHidden:!1},n}function hx(n,e,t){return n=Ls(6,n,null,e),n.lanes=t,n}function dx(n,e,t){return e=Ls(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function ZU(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jy(0),this.expirationTimes=jy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jy(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function VM(n,e,t,i,r,s,o,a,l){return n=new ZU(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ls(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},TM(s),n}function qU(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_2)}catch(n){console.error(n)}}_2(),gB.exports=ds;var ik=gB.exports,y2,rR=ik;y2=U1.createRoot=rR.createRoot,U1.hydrateRoot=rR.hydrateRoot;function na(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function x2(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! +`+s.stack}return{value:n,source:e,stack:r,digest:null}}function cx(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function vA(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var DU=typeof WeakMap=="function"?WeakMap:Map;function jI(n,e,t){t=pa(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){yv||(yv=!0,CA=i),vA(n,e)},t}function YI(n,e,t){t=pa(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){vA(n,e)}}var s=n.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(t.callback=function(){vA(n,e),typeof i!="function"&&(dl===null?dl=new Set([this]):dl.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),t}function zC(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new DU;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=YU.bind(null,n,e,t),e.then(n,n))}function GC(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function HC(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=pa(-1,1),e.tag=2,hl(t,e,1))),t.lanes|=1),n)}var NU=Ea.ReactCurrentOwner,Dr=!1;function gr(n,e,t,i){e.child=n===null?TI(e,null,t,i):kf(e,n.child,t,i)}function VC(n,e,t,i,r){t=t.render;var s=e.ref;return Ef(e,r),i=BM(n,e,t,i,s,r),t=IM(),n!==null&&!Dr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,xa(n,e,r)):(Fn&&t&&yM(e),e.flags|=1,gr(n,e,i,r),e.child)}function WC(n,e,t,i,r){if(n===null){var s=t.type;return typeof s=="function"&&!HM(s)&&s.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=s,KI(n,e,s,i,r)):(n=D0(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(s=n.child,!(n.lanes&r)){var o=s.memoizedProps;if(t=t.compare,t=t!==null?t:qd,t(o,i)&&n.ref===e.ref)return xa(n,e,r)}return e.flags|=1,n=ml(s,i),n.ref=e.ref,n.return=e,e.child=n}function KI(n,e,t,i,r){if(n!==null){var s=n.memoizedProps;if(qd(s,i)&&n.ref===e.ref)if(Dr=!1,e.pendingProps=i=s,(n.lanes&r)!==0)n.flags&131072&&(Dr=!0);else return e.lanes=n.lanes,xa(n,e,r)}return _A(n,e,t,i,r)}function QI(n,e,t){var i=e.pendingProps,r=i.children,s=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wn(ff,Qr),Qr|=t;else{if(!(t&1073741824))return n=s!==null?s.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,wn(ff,Qr),Qr|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:t,wn(ff,Qr),Qr|=i}else s!==null?(i=s.baseLanes|t,e.memoizedState=null):i=t,wn(ff,Qr),Qr|=i;return gr(n,e,r,t),e.child}function ZI(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function _A(n,e,t,i,r){var s=Fr(t)?Wu:sr.current;return s=Of(e,s),Ef(e,r),t=BM(n,e,t,i,s,r),i=IM(),n!==null&&!Dr?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,xa(n,e,r)):(Fn&&i&&yM(e),e.flags|=1,gr(n,e,t,r),e.child)}function XC(n,e,t,i,r){if(Fr(t)){var s=!0;uv(e)}else s=!1;if(Ef(e,r),e.stateNode===null)B0(n,e),EI(e,t,i),gA(e,t,i,r),i=!0;else if(n===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=t.contextType;typeof u=="object"&&u!==null?u=zs(u):(u=Fr(t)?Wu:sr.current,u=Of(e,u));var h=t.getDerivedStateFromProps,d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==u)&&FC(e,o,i,u),Ya=!1;var p=e.memoizedState;o.state=p,pv(e,i,o,r),l=e.memoizedState,a!==i||p!==l||Nr.current||Ya?(typeof h=="function"&&(mA(e,t,h,i),l=e.memoizedState),(a=Ya||NC(e,t,a,i,p,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=u,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,SI(n,e),a=e.memoizedProps,u=e.type===e.elementType?a:$s(e.type,a),o.props=u,d=e.pendingProps,p=o.context,l=t.contextType,typeof l=="object"&&l!==null?l=zs(l):(l=Fr(t)?Wu:sr.current,l=Of(e,l));var m=t.getDerivedStateFromProps;(h=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||p!==l)&&FC(e,o,i,l),Ya=!1,p=e.memoizedState,o.state=p,pv(e,i,o,r);var v=e.memoizedState;a!==d||p!==v||Nr.current||Ya?(typeof m=="function"&&(mA(e,t,m,i),v=e.memoizedState),(u=Ya||NC(e,t,u,i,p,v,l)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,v,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=v),o.props=i,o.state=v,o.context=l,i=u):(typeof o.componentDidUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&p===n.memoizedState||(e.flags|=1024),i=!1)}return yA(n,e,t,i,s,r)}function yA(n,e,t,i,r,s){ZI(n,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&PC(e,t,!1),xa(n,e,s);i=e.stateNode,NU.current=e;var a=o&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&o?(e.child=kf(e,n.child,null,s),e.child=kf(e,null,a,s)):gr(n,e,a,s),e.memoizedState=i.state,r&&PC(e,t,!0),e.child}function qI(n){var e=n.stateNode;e.pendingContext?bC(n,e.pendingContext,e.pendingContext!==e.context):e.context&&bC(n,e.context,!1),CM(n,e.containerInfo)}function JC(n,e,t,i,r){return Uf(),AM(r),e.flags|=256,gr(n,e,t,i),e.child}var xA={dehydrated:null,treeContext:null,retryLane:0};function AA(n){return{baseLanes:n,cachePool:null,transitions:null}}function $I(n,e,t){var i=e.pendingProps,r=Gn.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),wn(Gn,r&1),n===null)return dA(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,n=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=$v(o,i,0,null),n=Iu(n,i,t,null),s.return=e,n.return=e,s.sibling=n,e.child=s,e.child.memoizedState=AA(t),e.memoizedState=xA,n):NM(e,o));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return FU(n,e,o,i,a,r,t);if(s){s=i.fallback,o=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=ml(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=ml(a,s):(s=Iu(s,o,t,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=n.child.memoizedState,o=o===null?AA(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=n.childLanes&~t,e.memoizedState=xA,i}return s=n.child,n=s.sibling,i=ml(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function NM(n,e){return e=$v({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function lg(n,e,t,i){return i!==null&&AM(i),kf(e,n.child,null,t),n=NM(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function FU(n,e,t,i,r,s,o){if(t)return e.flags&256?(e.flags&=-257,i=cx(Error(Ye(422))),lg(n,e,o,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=$v({mode:"visible",children:i.children},r,0,null),s=Iu(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&kf(e,n.child,null,o),e.child.memoizedState=AA(o),e.memoizedState=xA,s);if(!(e.mode&1))return lg(n,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(Ye(419)),i=cx(s,i,void 0),lg(n,e,o,i)}if(a=(o&n.childLanes)!==0,Dr||a){if(i=Bi,i!==null){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,ya(n,r),ao(i,n,r,-1))}return GM(),i=cx(Error(Ye(421))),lg(n,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=KU.bind(null,n),r._reactRetry=e,null):(n=s.treeContext,ns=fl(r.nextSibling),ss=e,Fn=!0,no=null,n!==null&&(Rs[bs++]=ua,Rs[bs++]=ca,Rs[bs++]=Xu,ua=n.id,ca=n.overflow,Xu=e),e=NM(e,i.children),e.flags|=4096,e)}function jC(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),pA(n.return,e,t)}function fx(n,e,t,i,r){var s=n.memoizedState;s===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=t,s.tailMode=r)}function e2(n,e,t){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(gr(n,e,i.children,t),i=Gn.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&jC(n,t,e);else if(n.tag===19)jC(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(wn(Gn,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&mv(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),fx(e,!1,r,t,s);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&mv(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}fx(e,!0,t,null,s);break;case"together":fx(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function B0(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function xa(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),ju|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(Ye(153));if(e.child!==null){for(n=e.child,t=ml(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=ml(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function OU(n,e,t){switch(e.tag){case 3:qI(e),Uf();break;case 5:CI(e);break;case 1:Fr(e.type)&&uv(e);break;case 4:CM(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;wn(hv,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(wn(Gn,Gn.current&1),e.flags|=128,null):t&e.child.childLanes?$I(n,e,t):(wn(Gn,Gn.current&1),n=xa(n,e,t),n!==null?n.sibling:null);wn(Gn,Gn.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return e2(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),wn(Gn,Gn.current),i)break;return null;case 22:case 23:return e.lanes=0,QI(n,e,t)}return xa(n,e,t)}var t2,SA,n2,i2;t2=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};SA=function(){};n2=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,Su(Bo.current);var s=null;switch(t){case"input":r=W1(n,r),i=W1(n,i),s=[];break;case"select":r=Jn({},r,{value:void 0}),i=Jn({},i,{value:void 0}),s=[];break;case"textarea":r=j1(n,r),i=j1(n,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=av)}K1(t,i);var o;t=null;for(u in r)if(!i.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(o in a)a.hasOwnProperty(o)&&(t||(t={}),t[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Xd.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in i){var l=i[u];if(a=r!=null?r[u]:void 0,i.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(t||(t={}),t[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(t||(t={}),t[o]=l[o])}else t||(s||(s=[]),s.push(u,t)),t=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Xd.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Cn("scroll",n),s||a===l||(s=[])):(s=s||[]).push(u,l))}t&&(s=s||[]).push("style",t);var u=s;(e.updateQueue=u)&&(e.flags|=4)}};i2=function(n,e,t,i){t!==i&&(e.flags|=4)};function Gh(n,e){if(!Fn)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function Ji(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function UU(n,e,t){var i=e.pendingProps;switch(xM(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ji(e),null;case 1:return Fr(e.type)&&lv(),Ji(e),null;case 3:return i=e.stateNode,zf(),In(Nr),In(sr),bM(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(og(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,no!==null&&(PA(no),no=null))),SA(n,e),Ji(e),null;case 5:RM(e);var r=Su(ip.current);if(t=e.type,n!==null&&e.stateNode!=null)n2(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(Ye(166));return Ji(e),null}if(n=Su(Bo.current),og(e)){i=e.stateNode,t=e.type;var s=e.memoizedProps;switch(i[wo]=e,i[tp]=s,n=(e.mode&1)!==0,t){case"dialog":Cn("cancel",i),Cn("close",i);break;case"iframe":case"object":case"embed":Cn("load",i);break;case"video":case"audio":for(r=0;r<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=o.createElement(t,{is:i.is}):(n=o.createElement(t),t==="select"&&(o=n,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):n=o.createElementNS(n,t),n[wo]=e,n[tp]=i,t2(n,e,!1,!1),e.stateNode=n;e:{switch(o=Q1(t,i),t){case"dialog":Cn("cancel",n),Cn("close",n),r=i;break;case"iframe":case"object":case"embed":Cn("load",n),r=i;break;case"video":case"audio":for(r=0;rHf&&(e.flags|=128,i=!0,Gh(s,!1),e.lanes=4194304)}else{if(!i)if(n=mv(o),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Gh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Fn)return Ji(e),null}else 2*oi()-s.renderingStartTime>Hf&&t!==1073741824&&(e.flags|=128,i=!0,Gh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=oi(),e.sibling=null,t=Gn.current,wn(Gn,i?t&1|2:t&1),e):(Ji(e),null);case 22:case 23:return zM(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Qr&1073741824&&(Ji(e),e.subtreeFlags&6&&(e.flags|=8192)):Ji(e),null;case 24:return null;case 25:return null}throw Error(Ye(156,e.tag))}function kU(n,e){switch(xM(e),e.tag){case 1:return Fr(e.type)&&lv(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return zf(),In(Nr),In(sr),bM(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return RM(e),null;case 13:if(In(Gn),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(Ye(340));Uf()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return In(Gn),null;case 4:return zf(),null;case 10:return EM(e.type._context),null;case 22:case 23:return zM(),null;case 24:return null;default:return null}}var ug=!1,qi=!1,zU=typeof WeakSet=="function"?WeakSet:Set,mt=null;function cf(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Qn(n,e,i)}else t.current=null}function MA(n,e,t){try{t()}catch(i){Qn(n,e,i)}}var YC=!1;function GU(n,e){if(oA=rv,n=aI(),_M(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,a=-1,l=-1,u=0,h=0,d=n,p=null;t:for(;;){for(var m;d!==t||r!==0&&d.nodeType!==3||(a=o+r),d!==s||i!==0&&d.nodeType!==3||(l=o+i),d.nodeType===3&&(o+=d.nodeValue.length),(m=d.firstChild)!==null;)p=d,d=m;for(;;){if(d===n)break t;if(p===t&&++u===r&&(a=o),p===s&&++h===i&&(l=o),(m=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=m}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(aA={focusedElem:n,selectionRange:t},rv=!1,mt=e;mt!==null;)if(e=mt,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,mt=n;else for(;mt!==null;){e=mt;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,y=v.memoizedState,g=e.stateNode,S=g.getSnapshotBeforeUpdate(e.elementType===e.type?x:$s(e.type,x),y);g.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ye(163))}}catch(E){Qn(e,e.return,E)}if(n=e.sibling,n!==null){n.return=e.return,mt=n;break}mt=e.return}return v=YC,YC=!1,v}function wd(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var s=r.destroy;r.destroy=void 0,s!==void 0&&MA(e,t,s)}r=r.next}while(r!==i)}}function Zv(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function EA(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function r2(n){var e=n.alternate;e!==null&&(n.alternate=null,r2(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[wo],delete e[tp],delete e[cA],delete e[MU],delete e[EU])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function s2(n){return n.tag===5||n.tag===3||n.tag===4}function KC(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||s2(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function wA(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=av));else if(i!==4&&(n=n.child,n!==null))for(wA(n,e,t),n=n.sibling;n!==null;)wA(n,e,t),n=n.sibling}function TA(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(TA(n,e,t),n=n.sibling;n!==null;)TA(n,e,t),n=n.sibling}var Ni=null,to=!1;function Na(n,e,t){for(t=t.child;t!==null;)o2(n,e,t),t=t.sibling}function o2(n,e,t){if(Po&&typeof Po.onCommitFiberUnmount=="function")try{Po.onCommitFiberUnmount(Vv,t)}catch{}switch(t.tag){case 5:qi||cf(t,e);case 6:var i=Ni,r=to;Ni=null,Na(n,e,t),Ni=i,to=r,Ni!==null&&(to?(n=Ni,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Ni.removeChild(t.stateNode));break;case 18:Ni!==null&&(to?(n=Ni,t=t.stateNode,n.nodeType===8?rx(n.parentNode,t):n.nodeType===1&&rx(n,t),Qd(n)):rx(Ni,t.stateNode));break;case 4:i=Ni,r=to,Ni=t.stateNode.containerInfo,to=!0,Na(n,e,t),Ni=i,to=r;break;case 0:case 11:case 14:case 15:if(!qi&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&MA(t,e,o),r=r.next}while(r!==i)}Na(n,e,t);break;case 1:if(!qi&&(cf(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Qn(t,e,a)}Na(n,e,t);break;case 21:Na(n,e,t);break;case 22:t.mode&1?(qi=(i=qi)||t.memoizedState!==null,Na(n,e,t),qi=i):Na(n,e,t);break;default:Na(n,e,t)}}function QC(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new zU),e.forEach(function(i){var r=QU.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function js(n,e){var t=e.deletions;if(t!==null)for(var i=0;ir&&(r=o),i&=~s}if(i=r,i=oi()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*VU(i/1960))-i,10n?16:n,tl===null)var i=!1;else{if(n=tl,tl=null,xv=0,ln&6)throw Error(Ye(331));var r=ln;for(ln|=4,mt=n.current;mt!==null;){var s=mt,o=s.child;if(mt.flags&16){var a=s.deletions;if(a!==null){for(var l=0;loi()-UM?Bu(n,0):OM|=t),Or(n,e)}function p2(n,e){e===0&&(n.mode&1?(e=eg,eg<<=1,!(eg&130023424)&&(eg=4194304)):e=1);var t=Mr();n=ya(n,e),n!==null&&(Dp(n,e,t),Or(n,t))}function KU(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),p2(n,t)}function QU(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(Ye(314))}i!==null&&i.delete(e),p2(n,t)}var m2;m2=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Nr.current)Dr=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Dr=!1,OU(n,e,t);Dr=!!(n.flags&131072)}else Dr=!1,Fn&&e.flags&1048576&&_I(e,fv,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;B0(n,e),n=e.pendingProps;var r=Of(e,sr.current);Ef(e,t),r=BM(null,e,i,n,r,t);var s=IM();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Fr(i)?(s=!0,uv(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,TM(e),r.updater=Kv,e.stateNode=r,r._reactInternals=e,gA(e,i,n,t),e=yA(null,e,i,!0,s,t)):(e.tag=0,Fn&&s&&yM(e),gr(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(B0(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=qU(i),n=$s(i,n),r){case 0:e=_A(null,e,i,n,t);break e;case 1:e=XC(null,e,i,n,t);break e;case 11:e=VC(null,e,i,n,t);break e;case 14:e=WC(null,e,i,$s(i.type,n),t);break e}throw Error(Ye(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),_A(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),XC(n,e,i,r,t);case 3:e:{if(qI(e),n===null)throw Error(Ye(387));i=e.pendingProps,s=e.memoizedState,r=s.element,SI(n,e),pv(e,i,null,t);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=Gf(Error(Ye(423)),e),e=JC(n,e,i,t,r);break e}else if(i!==r){r=Gf(Error(Ye(424)),e),e=JC(n,e,i,t,r);break e}else for(ns=fl(e.stateNode.containerInfo.firstChild),ss=e,Fn=!0,no=null,t=TI(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(Uf(),i===r){e=xa(n,e,t);break e}gr(n,e,i,t)}e=e.child}return e;case 5:return CI(e),n===null&&dA(e),i=e.type,r=e.pendingProps,s=n!==null?n.memoizedProps:null,o=r.children,lA(i,r)?o=null:s!==null&&lA(i,s)&&(e.flags|=32),ZI(n,e),gr(n,e,o,t),e.child;case 6:return n===null&&dA(e),null;case 13:return $I(n,e,t);case 4:return CM(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=kf(e,null,i,t):gr(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),VC(n,e,i,r,t);case 7:return gr(n,e,e.pendingProps,t),e.child;case 8:return gr(n,e,e.pendingProps.children,t),e.child;case 12:return gr(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,wn(hv,i._currentValue),i._currentValue=o,s!==null)if(lo(s.value,o)){if(s.children===r.children&&!Nr.current){e=xa(n,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=pa(-1,t&-t),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}s.lanes|=t,l=s.alternate,l!==null&&(l.lanes|=t),pA(s.return,t,e),a.lanes|=t;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Ye(341));o.lanes|=t,a=o.alternate,a!==null&&(a.lanes|=t),pA(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gr(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Ef(e,t),r=zs(r),i=i(r),e.flags|=1,gr(n,e,i,t),e.child;case 14:return i=e.type,r=$s(i,e.pendingProps),r=$s(i.type,r),WC(n,e,i,r,t);case 15:return KI(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:$s(i,r),B0(n,e),e.tag=1,Fr(i)?(n=!0,uv(e)):n=!1,Ef(e,t),EI(e,i,r),gA(e,i,r,t),yA(null,e,i,!0,n,t);case 19:return e2(n,e,t);case 22:return QI(n,e,t)}throw Error(Ye(156,e.tag))};function g2(n,e){return HB(n,e)}function ZU(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ls(n,e,t,i){return new ZU(n,e,t,i)}function HM(n){return n=n.prototype,!(!n||!n.isReactComponent)}function qU(n){if(typeof n=="function")return HM(n)?1:0;if(n!=null){if(n=n.$$typeof,n===aM)return 11;if(n===lM)return 14}return 2}function ml(n,e){var t=n.alternate;return t===null?(t=Ls(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function D0(n,e,t,i,r,s){var o=2;if(i=n,typeof n=="function")HM(n)&&(o=1);else if(typeof n=="string")o=5;else e:switch(n){case ef:return Iu(t.children,r,s,e);case oM:o=8,r|=8;break;case z1:return n=Ls(12,t,e,r|2),n.elementType=z1,n.lanes=s,n;case G1:return n=Ls(13,t,e,r),n.elementType=G1,n.lanes=s,n;case H1:return n=Ls(19,t,e,r),n.elementType=H1,n.lanes=s,n;case wB:return $v(t,r,s,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case MB:o=10;break e;case EB:o=9;break e;case aM:o=11;break e;case lM:o=14;break e;case ja:o=16,i=null;break e}throw Error(Ye(130,n==null?n:typeof n,""))}return e=Ls(o,t,e,r),e.elementType=n,e.type=i,e.lanes=s,e}function Iu(n,e,t,i){return n=Ls(7,n,i,e),n.lanes=t,n}function $v(n,e,t,i){return n=Ls(22,n,i,e),n.elementType=wB,n.lanes=t,n.stateNode={isHidden:!1},n}function hx(n,e,t){return n=Ls(6,n,null,e),n.lanes=t,n}function dx(n,e,t){return e=Ls(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function $U(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jy(0),this.expirationTimes=jy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jy(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function VM(n,e,t,i,r,s,o,a,l){return n=new $U(n,e,t,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ls(3,null,null,e),n.current=s,s.stateNode=n,s.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},TM(s),n}function ek(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(x2)}catch(n){console.error(n)}}x2(),_B.exports=ds;var sk=_B.exports,A2,rR=sk;A2=U1.createRoot=rR.createRoot,U1.hydrateRoot=rR.hydrateRoot;function na(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function S2(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}/*! * GSAP 3.12.5 * https://gsap.com * @@ -45,7 +45,7 @@ Error generating stack: `+s.message+` * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var os={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Vf={duration:.5,overwrite:!1,delay:0},jM,nr,On,Ds=1e8,En=1/Ds,BA=Math.PI*2,rk=BA/4,sk=0,A2=Math.sqrt,ok=Math.cos,ak=Math.sin,Li=function(e){return typeof e=="string"},$n=function(e){return typeof e=="function"},Aa=function(e){return typeof e=="number"},YM=function(e){return typeof e>"u"},Uo=function(e){return typeof e=="object"},Ur=function(e){return e!==!1},KM=function(){return typeof window<"u"},hg=function(e){return $n(e)||Li(e)},S2=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ir=Array.isArray,IA=/(?:-?\.?\d|\.)+/gi,M2=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,hf=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,px=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,E2=/[+-]=-?[.\d]+/,w2=/[^,'"\[\]\s]+/gi,lk=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Hn,Mo,LA,QM,us={},Mv={},T2,C2=function(e){return(Mv=Yu(e,us))&&Hr},ZM=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},lp=function(e,t){return!t&&console.warn(e)},R2=function(e,t){return e&&(us[e]=t)&&Mv&&(Mv[e]=t)||us},up=function(){return 0},uk={suppressEvents:!0,isStart:!0,kill:!1},N0={suppressEvents:!0,kill:!1},ck={suppressEvents:!0},qM={},gl=[],DA={},b2,qr={},mx={},sR=30,F0=[],$M="",eE=function(e){var t=e[0],i,r;if(Uo(t)||$n(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(r=F0.length;r--&&!F0[r].targetTest(t););i=F0[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new $2(e[r],i)))||e.splice(r,1);return e},Iu=function(e){return e._gsap||eE(Ns(e))[0]._gsap},P2=function(e,t,i){return(i=e[t])&&$n(i)?e[t]():YM(i)&&e.getAttribute&&e.getAttribute(t)||i},kr=function(e,t){return(e=e.split(",")).forEach(t)||e},ii=function(e){return Math.round(e*1e5)/1e5||0},Pi=function(e){return Math.round(e*1e7)/1e7||0},Tf=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},fk=function(e,t){for(var i=t.length,r=0;e.indexOf(t[r])<0&&++ra;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[r]=t,t._prev=o,t.parent=t._dp=e,t},r_=function(e,t,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var s=t._prev,o=t._next;s?s._next=o:e[i]===t&&(e[i]=o),o?o._prev=s:e[r]===t&&(e[r]=s),t._next=t._prev=t.parent=null},El=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Lu=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},pk=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},NA=function(e,t,i,r){return e._startAt&&(nr?e._startAt.revert(N0):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},mk=function n(e){return!e||e._ts&&n(e.parent)},aR=function(e){return e._repeat?Wf(e._tTime,e=e.duration()+e._rDelay)*e:0},Wf=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},Tv=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},s_=function(e){return e._end=Pi(e._start+(e._tDur/Math.abs(e._ts||e._rts||En)||0))},o_=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Pi(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),s_(e),i._dirty||Lu(i,e)),e},N2=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._startEn)&&t.render(i,!0)),Lu(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-En}},To=function(e,t,i,r){return t.parent&&El(t),t._start=Pi((Aa(i)?i:i||e!==Hn?ws(e,i,t):e._time)+t._delay),t._end=Pi(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),D2(e,t,"_first","_last",e._sort?"_start":0),FA(t)||(e._recent=t),r||N2(e,t),e._ts<0&&o_(e,e._tTime),e},F2=function(e,t){return(us.ScrollTrigger||ZM("scrollTrigger",t))&&us.ScrollTrigger.create(t,e)},O2=function(e,t,i,r,s){if(nE(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!nr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&b2!==$r.frame)return gl.push(e),e._lazy=[s,r],1},gk=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},FA=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},vk=function(e,t,i,r){var s=e.ratio,o=t<0||!t&&(!e._start&&gk(e)&&!(!e._initted&&FA(e))||(e._ts<0||e._dp._ts<0)&&!FA(e))?0:1,a=e._rDelay,l=0,u,h,d;if(a&&e._repeat&&(l=Up(0,e._tDur,t),h=Wf(l,a),e._yoyo&&h&1&&(o=1-o),h!==Wf(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||nr||r||e._zTime===En||!t&&e._zTime){if(!e._initted&&O2(e,t,r,i,l))return;for(d=e._zTime,e._zTime=t||(i?En:0),i||(i=t&&!d),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=l,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&NA(e,t,i,!0),e._onUpdate&&!i&&is(e,"onUpdate"),l&&e._repeat&&!i&&e.parent&&is(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&El(e,1),!i&&!nr&&(is(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},_k=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&&o_(e,e._tTime=e._tDur*a),e.parent&&s_(e),i||Lu(e.parent,e),e},lR=function(e){return e instanceof yr?Lu(e):Xf(e,e._dur)},yk={_start:0,endTime:up,totalDuration:up},ws=function n(e,t,i){var r=e.labels,s=e._recent||yk,o=e.duration()>=Ds?s.endTime(!1):e._dur,a,l,u;return Li(t)&&(isNaN(t)||t in r)?(l=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),l==="<"||l===">"?(a>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?s:i).totalDuration()/100:1)):a<0?(t in r||(r[t]=o),r[t]):(l=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&i&&(l=l/100*(ir(i)?i[0]:i).totalDuration()),a>1?n(e,t.substr(0,a-1),i)+l:o+l)):t==null?o:+t},bd=function(e,t,i){var r=Aa(t[1]),s=(r?2:1)+(e<2?0:1),o=t[s],a,l;if(r&&(o.duration=t[1]),o.parent=i,e){for(a=o,l=i;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Ur(l.vars.inherit)&&l.parent;o.immediateRender=Ur(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new hi(t[0],o,t[s+1])},Dl=function(e,t){return e||e===0?t(e):t},Up=function(e,t,i){return it?t:i},$i=function(e,t){return!Li(e)||!(t=lk.exec(e))?"":t[1]},xk=function(e,t,i){return Dl(i,function(r){return Up(e,t,r)})},OA=[].slice,U2=function(e,t){return e&&Uo(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Uo(e[0]))&&!e.nodeType&&e!==Mo},Ak=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(r){var s;return Li(r)&&!t||U2(r,1)?(s=i).push.apply(s,Ns(r)):i.push(r)})||i},Ns=function(e,t,i){return On&&!t&&On.selector?On.selector(e):Li(e)&&!i&&(LA||!Jf())?OA.call((t||QM).querySelectorAll(e),0):ir(e)?Ak(e,i):U2(e)?OA.call(e,0):e?[e]:[]},UA=function(e){return e=Ns(e)[0]||lp("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return Ns(t,i.querySelectorAll?i:i===e?lp("Invalid scope")||QM.createElement("div"):e)}},k2=function(e){return e.sort(function(){return .5-Math.random()})},z2=function(e){if($n(e))return e;var t=Uo(e)?e:{each:e},i=Du(t.ease),r=t.from||0,s=parseFloat(t.base)||0,o={},a=r>0&&r<1,l=isNaN(r)||a,u=t.axis,h=r,d=r;return Li(r)?h=d={center:.5,edges:.5,end:1}[r]||0:!a&&l&&(h=r[0],d=r[1]),function(p,m,v){var x=(v||t).length,y=o[x],g,S,A,E,b,C,R,I,O;if(!y){if(O=t.grid==="auto"?0:(t.grid||[1,Ds])[1],!O){for(R=-Ds;R<(R=v[O++].getBoundingClientRect().left)&&OR&&(R=b),bx?x-1:u?u==="y"?x/O:O:Math.max(O,x/O))||0)*(r==="edges"?-1:1),y.b=x<0?s-x:s,y.u=$i(t.amount||t.each)||0,i=i&&x<0?Q2(i):i}return x=(y[p]-y.min)/y.max||0,Pi(y.b+(i?i(x):x)*y.v)+y.u}},kA=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var r=Pi(Math.round(parseFloat(i)/e)*e*t);return(r-r%1)/t+(Aa(i)?0:$i(i))}},G2=function(e,t){var i=ir(e),r,s;return!i&&Uo(e)&&(r=i=e.radius||Ds,e.values?(e=Ns(e.values),(s=!Aa(e[0]))&&(r*=r)):e=kA(e.increment)),Dl(t,i?$n(e)?function(o){return s=e(o),Math.abs(s-o)<=r?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),u=Ds,h=0,d=e.length,p,m;d--;)s?(p=e[d].x-a,m=e[d].y-l,p=p*p+m*m):p=Math.abs(e[d]-a),pr?s-o:o)})},cp=function(e){for(var t=0,i="",r,s,o,a;~(r=e.indexOf("random(",t));)o=e.indexOf(")",r),a=e.charAt(r+7)==="[",s=e.substr(r+7,o-r-7).match(a?w2:IA),i+=e.substr(t,r-t)+H2(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},W2=function(e,t,i,r,s){var o=t-e,a=r-i;return Dl(s,function(l){return i+((l-e)/o*a||0)})},Ck=function n(e,t,i,r){var s=isNaN(e+t)?0:function(m){return(1-m)*e+m*t};if(!s){var o=Li(e),a={},l,u,h,d,p;if(i===!0&&(r=1)&&(i=null),o)e={p:e},t={p:t};else if(ir(e)&&!ir(t)){for(h=[],d=e.length,p=d-2,u=1;u(a=Math.abs(a))&&(l=o,s=a);return l},is=function(e,t,i){var r=e.vars,s=r[t],o=On,a=e._ctx,l,u,h;if(s)return l=r[t+"Params"],u=r.callbackScope||e,i&&gl.length&&Ev(),a&&(On=a),h=l?s.apply(u,l):s.call(u),On=o,h},fd=function(e){return El(e),e.scrollTrigger&&e.scrollTrigger.kill(!!nr),e.progress()<1&&is(e,"onInterrupt"),e},df,X2=[],J2=function(e){if(e)if(e=!e.name&&e.default||e,KM()||e.headless){var t=e.name,i=$n(e),r=t&&!i&&e.init?function(){this._props=[]}:e,s={init:up,render:sE,add:tE,kill:Vk,modifier:Hk,rawVars:0},o={targetTest:0,get:0,getSetter:rE,aliases:{},register:0};if(Jf(),e!==r){if(qr[t])return;Hs(r,Hs(wv(e,s),o)),Yu(r.prototype,Yu(s,wv(e,o))),qr[r.prop=t]=r,e.targetTest&&(F0.push(r),qM[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}R2(t,r),e.register&&e.register(Hr,r,zr)}else X2.push(e)},An=255,hd={aqua:[0,An,An],lime:[0,An,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,An],navy:[0,0,128],white:[An,An,An],olive:[128,128,0],yellow:[An,An,0],orange:[An,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[An,0,0],pink:[An,192,203],cyan:[0,An,An],transparent:[An,An,An,0]},gx=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)*An+.5|0},j2=function(e,t,i){var r=e?Aa(e)?[e>>16,e>>8&An,e&An]:0:hd.black,s,o,a,l,u,h,d,p,m,v;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),hd[e])r=hd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+s+s+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&An,r&An,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&An,e&An]}else if(e.substr(0,3)==="hsl"){if(r=v=e.match(IA),!t)l=+r[0]%360/360,u=+r[1]/100,h=+r[2]/100,o=h<=.5?h*(u+1):h+u-h*u,s=h*2-o,r.length>3&&(r[3]*=1),r[0]=gx(l+1/3,s,o),r[1]=gx(l,s,o),r[2]=gx(l-1/3,s,o);else if(~e.indexOf("="))return r=e.match(M2),i&&r.length<4&&(r[3]=1),r}else r=e.match(IA)||hd.transparent;r=r.map(Number)}return t&&!v&&(s=r[0]/An,o=r[1]/An,a=r[2]/An,d=Math.max(s,o,a),p=Math.min(s,o,a),h=(d+p)/2,d===p?l=u=0:(m=d-p,u=h>.5?m/(2-d-p):m/(d+p),l=d===s?(o-a)/m+(oe||g<0)&&(i+=g-t),r+=g,b=r-i,A=b-o,(A>0||S)&&(C=++d.frame,p=b-d.time*1e3,d.time=b=b/1e3,o+=A+(A>=s?4:s-A),E=1),S||(l=u(x)),E)for(m=0;m=g&&m--},_listeners:a},d}(),Jf=function(){return!fp&&$r.wake()},rn={},bk=/^[\d.\-M][\d.\-,\s]/,Pk=/["']/g,Bk=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),r=i[0],s=1,o=i.length,a,l,u;s1&&i.config?i.config.apply(null,~e.indexOf("{")?[Bk(t[1])]:Ik(e).split(",").map(I2)):rn._CE&&bk.test(e)?rn._CE("",e):i},Q2=function(e){return function(t){return 1-e(1-t)}},Z2=function n(e,t){for(var i=e._first,r;i;)i instanceof yr?n(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?n(i.timeline,t):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=t)),i=i._next},Du=function(e,t){return e&&($n(e)?e:rn[e]||Lk(e))||t},rc=function(e,t,i,r){i===void 0&&(i=function(l){return 1-t(1-l)}),r===void 0&&(r=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:i,easeInOut:r},o;return kr(e,function(a){rn[a]=us[a]=s,rn[o=a.toLowerCase()]=i;for(var l in s)rn[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=rn[a+"."+l]=s[l]}),s},q2=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},vx=function n(e,t,i){var r=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/BA*(Math.asin(1/r)||0),a=function(h){return h===1?1:r*Math.pow(2,-10*h)*ak((h-o)*s)+1},l=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:q2(a);return s=BA/s,l.config=function(u,h){return n(e,u,h)},l},_x=function n(e,t){t===void 0&&(t=1.70158);var i=function(o){return o?--o*o*((t+1)*o+t)+1:0},r=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:q2(i);return r.config=function(s){return n(e,s)},r};kr("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;rc(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})});rn.Linear.easeNone=rn.none=rn.Linear.easeIn;rc("Elastic",vx("in"),vx("out"),vx());(function(n,e){var t=1/e,i=2*t,r=2.5*t,s=function(a){return a0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,Xf(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,r){if(Jf(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(o_(this,i),!s._dp||s.parent||N2(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i0||!this._tDur&&!i)&&To(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===En||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),B2(this,i,r)),this},e.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+aR(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?1:0},e.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+aR(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,r){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,r):this._repeat?Wf(this._tTime,s)+1:1},e.timeScale=function(i,r){if(!arguments.length)return this._rts===-En?0:this._rts;if(this._rts===i)return this;var s=this.parent&&this._ts?Tv(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-En?0:this._rts,this.totalTime(Up(-Math.abs(this._delay),this._tDur,s),r!==!1),s_(this),pk(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):(Jf(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==En&&(this._tTime-=En)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&To(r,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Ur(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?Tv(r.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=ck);var r=nr;return nr=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),nr=r,this},e.globalTime=function(i){for(var r=this,s=arguments.length?i:r.rawTime();r;)s=r._start+s/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):s},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,lR(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,lR(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(ws(this,i),Ur(r))},e.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,Ur(r))},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?-En:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-En,this},e.isActive=function(){var i=this.parent||this._dp,r=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=r&&s1?(r?(o[i]=r,s&&(o[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=r)):delete o[i],this):o[i]},e.then=function(i){var r=this;return new Promise(function(s){var o=$n(i)?i:L2,a=function(){var u=r.then;r.then=null,$n(o)&&(o=o(r))&&(o.then||o===r)&&(r.then=u),s(o),r.then=u};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?a():r._prom=a})},e.kill=function(){fd(this)},n}();Hs(hp.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:-En,_prom:0,_ps:!1,_rts:1});var yr=function(n){x2(e,n);function e(i,r){var s;return i===void 0&&(i={}),s=n.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=Ur(i.sortChildren),Hn&&To(i.parent||Hn,na(s),r),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&F2(na(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(r,s,o){return bd(0,arguments,this),this},t.from=function(r,s,o){return bd(1,arguments,this),this},t.fromTo=function(r,s,o,a){return bd(2,arguments,this),this},t.set=function(r,s,o){return s.duration=0,s.parent=this,Rd(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new hi(r,s,ws(this,o),1),this},t.call=function(r,s,o){return To(this,hi.delayedCall(0,r,s),o)},t.staggerTo=function(r,s,o,a,l,u,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=h,o.parent=this,new hi(r,o,ws(this,l)),this},t.staggerFrom=function(r,s,o,a,l,u,h){return o.runBackwards=1,Rd(o).immediateRender=Ur(o.immediateRender),this.staggerTo(r,s,o,a,l,u,h)},t.staggerFromTo=function(r,s,o,a,l,u,h,d){return a.startAt=o,Rd(a).immediateRender=Ur(a.immediateRender),this.staggerTo(r,s,a,l,u,h,d)},t.render=function(r,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,h=r<=0?0:Pi(r),d=this._zTime<0!=r<0&&(this._initted||!u),p,m,v,x,y,g,S,A,E,b,C,R;if(this!==Hn&&h>l&&r>=0&&(h=l),h!==this._tTime||o||d){if(a!==this._time&&u&&(h+=this._time-a,r+=this._time-a),p=h,E=this._start,A=this._ts,g=!A,d&&(u||(a=this._zTime),(r||!s)&&(this._zTime=r)),this._repeat){if(C=this._yoyo,y=u+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(y*100+r,s,o);if(p=Pi(h%y),h===l?(x=this._repeat,p=u):(x=~~(h/y),x&&x===h/y&&(p=u,x--),p>u&&(p=u)),b=Wf(this._tTime,y),!a&&this._tTime&&b!==x&&this._tTime-b*y-this._dur<=0&&(b=x),C&&x&1&&(p=u-p,R=1),x!==b&&!this._lock){var I=C&&b&1,O=I===(C&&x&1);if(x=a&&r>=0)for(m=this._first;m;){if(v=m._next,(m._act||p>=m._start)&&m._ts&&S!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(p-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(p-m._start)*m._ts,s,o),p!==this._time||!this._ts&&!g){S=0,v&&(h+=this._zTime=-En);break}}m=v}else{m=this._last;for(var T=r<0?r:p;m;){if(v=m._prev,(m._act||T<=m._end)&&m._ts&&S!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(T-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(T-m._start)*m._ts,s,o||nr&&(m._initted||m._startAt)),p!==this._time||!this._ts&&!g){S=0,v&&(h+=this._zTime=T?-En:En);break}}m=v}}if(S&&!s&&(this.pause(),S.render(p>=a?0:-En)._zTime=p>=a?1:-1,this._ts))return this._start=E,s_(this),this.render(r,s,o);this._onUpdate&&!s&&is(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(E===this._start||Math.abs(A)!==Math.abs(this._ts))&&(this._lock||((r||!u)&&(h===l&&this._ts>0||!h&&this._ts<0)&&El(this,1),!s&&!(r<0&&!a)&&(h||a||!l)&&(is(this,h===l&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom())))}return this},t.add=function(r,s){var o=this;if(Aa(s)||(s=ws(this,s,r)),!(r instanceof hp)){if(ir(r))return r.forEach(function(a){return o.add(a,s)}),this;if(Li(r))return this.addLabel(r,s);if($n(r))r=hi.delayedCall(0,r);else return this}return this!==r?To(this,r,s):this},t.getChildren=function(r,s,o,a){r===void 0&&(r=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ds);for(var l=[],u=this._first;u;)u._start>=a&&(u instanceof hi?s&&l.push(u):(o&&l.push(u),r&&l.push.apply(l,u.getChildren(!0,s,o)))),u=u._next;return l},t.getById=function(r){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===r)return s[o]},t.remove=function(r){return Li(r)?this.removeLabel(r):$n(r)?this.killTweensOf(r):(r_(this,r),r===this._recent&&(this._recent=this._last),Lu(this))},t.totalTime=function(r,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Pi($r.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,s),this._forcing=0,this):this._tTime},t.addLabel=function(r,s){return this.labels[r]=ws(this,s),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,s,o){var a=hi.delayedCall(0,s||up,o);return a.data="isPause",this._hasPause=1,To(this,a,ws(this,r))},t.removePause=function(r){var s=this._first;for(r=ws(this,r);s;)s._start===r&&s.data==="isPause"&&El(s),s=s._next},t.killTweensOf=function(r,s,o){for(var a=this.getTweensOf(r,o),l=a.length;l--;)nl!==a[l]&&a[l].kill(r,s);return this},t.getTweensOf=function(r,s){for(var o=[],a=Ns(r),l=this._first,u=Aa(s),h;l;)l instanceof hi?fk(l._targets,a)&&(u?(!nl||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},t.tweenTo=function(r,s){s=s||{};var o=this,a=ws(o,r),l=s,u=l.startAt,h=l.onStart,d=l.onStartParams,p=l.immediateRender,m,v=hi.to(o,Hs({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||En,onStart:function(){if(o.pause(),!m){var y=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==y&&Xf(v,y,0,1).render(v._time,!0,!0),m=1}h&&h.apply(v,d||[])}},s));return p?v.render(0):v},t.tweenFromTo=function(r,s,o){return this.tweenTo(s,Hs({startAt:{time:ws(this,r)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),uR(this,ws(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),uR(this,ws(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+En)},t.shiftChildren=function(r,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,u;a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(s)for(u in l)l[u]>=o&&(l[u]+=r);return Lu(this)},t.invalidate=function(r){var s=this._first;for(this._lock=0;s;)s.invalidate(r),s=s._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Lu(this)},t.totalDuration=function(r){var s=0,o=this,a=o._last,l=Ds,u,h,d;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(d=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,To(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=u;Xf(o,o===Hn&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(r){if(Hn._ts&&(B2(Hn,Tv(r,Hn)),b2=$r.frame),$r.frame>=sR){sR+=os.autoSleep||120;var s=Hn._first;if((!s||!s._ts)&&os.autoSleep&&$r._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||$r.sleep()}}},e}(hp);Hs(yr.prototype,{_lock:0,_hasPause:0,_forcing:0});var Dk=function(e,t,i,r,s,o,a){var l=new zr(this._pt,e,t,0,1,sL,null,s),u=0,h=0,d,p,m,v,x,y,g,S;for(l.b=i,l.e=r,i+="",r+="",(g=~r.indexOf("random("))&&(r=cp(r)),o&&(S=[i,r],o(S,e,t),i=S[0],r=S[1]),p=i.match(px)||[];d=px.exec(r);)v=d[0],x=r.substring(u,d.index),m?m=(m+1)%5:x.substr(-5)==="rgba("&&(m=1),v!==p[h++]&&(y=parseFloat(p[h-1])||0,l._pt={_next:l._pt,p:x||h===1?x:",",s:y,c:v.charAt(1)==="="?Tf(y,v)-y:parseFloat(v)-y,m:m&&m<4?Math.round:0},u=px.lastIndex);return l.c=u")}),E.duration();else{C={};for(I in v)I==="ease"||I==="easeEach"||Uk(I,v[I],C,v.easeEach);for(I in C)for(se=C[I].sort(function($,oe){return $.t-oe.t}),K=0,b=0;bl-En&&!h?l:ru&&(p=u)),g=this._yoyo&&v&1,g&&(E=this._yEase,p=u-p),y=Wf(this._tTime,x),p===a&&!o&&this._initted&&v===y)return this._tTime=d,this;v!==y&&(A&&this._yEase&&Z2(A,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==x&&this._initted&&(this._lock=o=1,this.render(Pi(x*v),!0).invalidate()._lock=0))}if(!this._initted){if(O2(this,h?r:p,o,s,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&v!==y))return this;if(u!==this._dur)return this.render(r,s,o)}if(this._tTime=d,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=S=(E||this._ease)(p/u),this._from&&(this.ratio=S=1-S),p&&!a&&!s&&!v&&(is(this,"onStart"),this._tTime!==d))return this;for(m=this._pt;m;)m.r(S,m.d),m=m._next;A&&A.render(r<0?r:A._dur*A._ease(p/this._dur),s,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!s&&(h&&NA(this,r,s,o),is(this,"onUpdate")),this._repeat&&v!==y&&this.vars.onRepeat&&!s&&this.parent&&is(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(h&&!this._onUpdate&&NA(this,r,!0,!0),(r||!u)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&El(this,1),!s&&!(h&&!a)&&(d||a||g)&&(is(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d0)&&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,s,o,a,l){fp||$r.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||nE(this,u),h=this._ease(u/this._dur),Fk(this,r,s,o,a,h,u,l)?this.resetTo(r,s,o,a,1):(o_(this,0),this.parent||D2(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,s){if(s===void 0&&(s="all"),!r&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?fd(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(r,s,nl&&nl.vars.overwrite!==!0)._first||fd(this),this.parent&&o!==this.timeline.totalDuration()&&Xf(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=r?Ns(r):a,u=this._ptLookup,h=this._pt,d,p,m,v,x,y,g;if((!s||s==="all")&&dk(a,l))return s==="all"&&(this._pt=0),fd(this);for(d=this._op=this._op||[],s!=="all"&&(Li(s)&&(x={},kr(s,function(S){return x[S]=1}),s=x),s=Ok(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){p=u[g],s==="all"?(d[g]=s,v=p,m={}):(m=d[g]=d[g]||{},v=s);for(x in v)y=p&&p[x],y&&((!("kill"in y.d)||y.d.kill(x)===!0)&&r_(this,y,"_pt"),delete p[x]),m!=="all"&&(m[x]=1)}return this._initted&&!this._pt&&h&&fd(this),this},e.to=function(r,s){return new e(r,s,arguments[2])},e.from=function(r,s){return bd(1,arguments)},e.delayedCall=function(r,s,o,a){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(r,s,o){return bd(2,arguments)},e.set=function(r,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(r,s)},e.killTweensOf=function(r,s,o){return Hn.killTweensOf(r,s,o)},e}(hp);Hs(hi.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});kr("staggerTo,staggerFrom,staggerFromTo",function(n){hi[n]=function(){var e=new yr,t=OA.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var iE=function(e,t,i){return e[t]=i},iL=function(e,t,i){return e[t](i)},kk=function(e,t,i,r){return e[t](r.fp,i)},zk=function(e,t,i){return e.setAttribute(t,i)},rE=function(e,t){return $n(e[t])?iL:YM(e[t])&&e.setAttribute?zk:iE},rL=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Gk=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},sL=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)},sE=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},Hk=function(e,t,i,r){for(var s=this._pt,o;s;)o=s._next,s.p===r&&s.modifier(e,t,i),s=o},Vk=function(e){for(var t=this._pt,i,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?r_(this,t,"_pt"):t.dep||(i=1),t=r;return!i},Wk=function(e,t,i,r){r.mSet(e,t,r.m.call(r.tween,i,r.mt),r)},oL=function(e){for(var t=e._pt,i,r,s,o;t;){for(i=t._next,r=s;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:o)?t._prev._next=t:s=t,(t._next=r)?r._prev=t:o=t,t=i}e._pt=s},zr=function(){function n(t,i,r,s,o,a,l,u,h){this.t=i,this.s=s,this.c=o,this.p=r,this.r=a||rL,this.d=l||this,this.set=u||iE,this.pr=h||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(i,r,s){this.mSet=this.mSet||this.set,this.set=Wk,this.m=i,this.mt=s,this.tween=r},n}();kr($M+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return qM[n]=1});us.TweenMax=us.TweenLite=hi;us.TimelineLite=us.TimelineMax=yr;Hn=new yr({sortChildren:!1,defaults:Vf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});os.stringFilter=K2;var Nu=[],O0={},Xk=[],fR=0,Jk=0,yx=function(e){return(O0[e]||Xk).map(function(t){return t()})},GA=function(){var e=Date.now(),t=[];e-fR>2&&(yx("matchMediaInit"),Nu.forEach(function(i){var r=i.queries,s=i.conditions,o,a,l,u;for(a in r)o=Mo.matchMedia(r[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),l&&t.push(i))}),yx("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),fR=e,yx("matchMedia"))},aL=function(){function n(t,i){this.selector=i&&UA(i),this.data=[],this._r=[],this.isReverted=!1,this.id=Jk++,t&&this.add(t)}var e=n.prototype;return e.add=function(i,r,s){$n(i)&&(s=r,r=i,i=$n);var o=this,a=function(){var u=On,h=o.selector,d;return u&&u!==o&&u.data.push(o),s&&(o.selector=UA(s)),On=o,d=r.apply(o,arguments),$n(d)&&o._r.push(d),On=u,o.selector=h,o.isReverted=!1,d};return o.last=a,i===$n?a(o,function(l){return o.add(null,l)}):i?o[i]=a:a},e.ignore=function(i){var r=On;On=null,i(this),On=r},e.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof n?i.push.apply(i,r.getTweens()):r instanceof hi&&!(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 s=this;if(i?function(){for(var a=s.getTweens(),l=s.data.length,u;l--;)u=s.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,d){return d.g-h.g||-1/0}).forEach(function(h){return h.t.revert(i)}),l=s.data.length;l--;)u=s.data[l],u instanceof yr?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof hi)&&u.revert&&u.revert(i);s._r.forEach(function(h){return h(i,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),r)for(var o=Nu.length;o--;)Nu[o].id===this.id&&Nu.splice(o,1)},e.revert=function(i){this.kill(i||{})},n}(),jk=function(){function n(t){this.contexts=[],this.scope=t,On&&On.data.push(this)}var e=n.prototype;return e.add=function(i,r,s){Uo(i)||(i={matches:i});var o=new aL(0,s||this.scope),a=o.conditions={},l,u,h;On&&!o.selector&&(o.selector=On.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=i;for(u in i)u==="all"?h=1:(l=Mo.matchMedia(i[u]),l&&(Nu.indexOf(o)<0&&Nu.push(o),(a[u]=l.matches)&&(h=1),l.addListener?l.addListener(GA):l.addEventListener("change",GA)));return h&&r(o,function(d){return o.add(null,d)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},n}(),Cv={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i1){var r=e.map(function(h){return Hr.quickSetter(h,t,i)}),s=r.length;return function(h){for(var d=s;d--;)r[d](h)}}e=e[0]||{};var o=qr[t],a=Iu(e),l=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(h){var d=new o;df._pt=0,d.init(e,i?h+i:h,df,0,[e]),d.render(1,d),df._pt&&sE(1,df)}:a.set(e,l);return o?u:function(h){return u(e,l,i?h+i:h,a,1)}},quickTo:function(e,t,i){var r,s=Hr.to(e,Yu((r={},r[t]="+=0.1",r.paused=!0,r),i||{})),o=function(l,u,h){return s.resetTo(t,l,u,h)};return o.tween=s,o},isTweening:function(e){return Hn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Du(e.ease,Vf.ease)),oR(Vf,e||{})},config:function(e){return oR(os,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,r=e.plugins,s=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!qr[a]&&!us[a]&&lp(t+" effect requires "+a+" plugin.")}),mx[t]=function(a,l,u){return i(Ns(a),Hs(l||{},s),u)},o&&(yr.prototype[t]=function(a,l,u){return this.add(mx[t](a,Uo(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){rn[e]=Du(t)},parseEase:function(e,t){return arguments.length?Du(e,t):rn},getById:function(e){return Hn.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new yr(e),r,s;for(i.smoothChildTiming=Ur(e.smoothChildTiming),Hn.remove(i),i._dp=0,i._time=i._tTime=Hn._time,r=Hn._first;r;)s=r._next,(t||!(!r._dur&&r instanceof hi&&r.vars.onComplete===r._targets[0]))&&To(i,r,r._start-r._delay),r=s;return To(Hn,i,0),i},context:function(e,t){return e?new aL(e,t):On},matchMedia:function(e){return new jk(e)},matchMediaRefresh:function(){return Nu.forEach(function(e){var t=e.conditions,i,r;for(r in t)t[r]&&(t[r]=!1,i=1);i&&e.revert()})||GA()},addEventListener:function(e,t){var i=O0[e]||(O0[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=O0[e],r=i&&i.indexOf(t);r>=0&&i.splice(r,1)},utils:{wrap:wk,wrapYoyo:Tk,distribute:z2,random:H2,snap:G2,normalize:Ek,getUnit:$i,clamp:xk,splitColor:j2,toArray:Ns,selector:UA,mapRange:W2,pipe:Sk,unitize:Mk,interpolate:Ck,shuffle:k2},install:C2,effects:mx,ticker:$r,updateRoot:yr.updateRoot,plugins:qr,globalTimeline:Hn,core:{PropTween:zr,globals:R2,Tween:hi,Timeline:yr,Animation:hp,getCache:Iu,_removeLinkedListItem:r_,reverting:function(){return nr},context:function(e){return e&&On&&(On.data.push(e),e._ctx=On),On},suppressOverwrites:function(e){return jM=e}}};kr("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return Cv[n]=hi[n]});$r.add(yr.updateRoot);df=Cv.to({},{duration:0});var Yk=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},Kk=function(e,t){var i=e._targets,r,s,o;for(r in t)for(s=i.length;s--;)o=e._ptLookup[s][r],o&&(o=o.d)&&(o._pt&&(o=Yk(o,r)),o&&o.modifier&&o.modifier(t[r],e,i[s],r))},xx=function(e,t){return{name:e,rawVars:1,init:function(r,s,o){o._onInit=function(a){var l,u;if(Li(s)&&(l={},kr(s,function(h){return l[h]=1}),s=l),t){l={};for(u in s)l[u]=t(s[u]);s=l}Kk(a,s)}}}},Hr=Cv.registerPlugin({name:"attr",init:function(e,t,i,r,s){var o,a,l;this.tween=i;for(o in t)l=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(l||0)+"",t[o],r,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(e,t){for(var i=t._pt;i;)nr?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",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)}},xx("roundProps",kA),xx("modifiers"),xx("snap",G2))||Cv;hi.version=yr.version=Hr.version="3.12.5";T2=1;KM()&&Jf();rn.Power0;rn.Power1;rn.Power2;rn.Power3;rn.Power4;rn.Linear;rn.Quad;rn.Cubic;rn.Quart;rn.Quint;rn.Strong;rn.Elastic;rn.Back;rn.SteppedEase;rn.Bounce;rn.Sine;rn.Expo;rn.Circ;/*! +*/var os={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Vf={duration:.5,overwrite:!1,delay:0},jM,nr,On,Ds=1e8,En=1/Ds,BA=Math.PI*2,ok=BA/4,ak=0,M2=Math.sqrt,lk=Math.cos,uk=Math.sin,Li=function(e){return typeof e=="string"},ei=function(e){return typeof e=="function"},Aa=function(e){return typeof e=="number"},YM=function(e){return typeof e>"u"},Uo=function(e){return typeof e=="object"},Ur=function(e){return e!==!1},KM=function(){return typeof window<"u"},hg=function(e){return ei(e)||Li(e)},E2=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ir=Array.isArray,IA=/(?:-?\.?\d|\.)+/gi,w2=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,hf=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,px=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,T2=/[+-]=-?[.\d]+/,C2=/[^,'"\[\]\s]+/gi,ck=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Hn,Mo,LA,QM,us={},Mv={},R2,b2=function(e){return(Mv=Ku(e,us))&&Hr},ZM=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},lp=function(e,t){return!t&&console.warn(e)},P2=function(e,t){return e&&(us[e]=t)&&Mv&&(Mv[e]=t)||us},up=function(){return 0},fk={suppressEvents:!0,isStart:!0,kill:!1},N0={suppressEvents:!0,kill:!1},hk={suppressEvents:!0},qM={},gl=[],DA={},B2,qr={},mx={},sR=30,F0=[],$M="",eE=function(e){var t=e[0],i,r;if(Uo(t)||ei(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(r=F0.length;r--&&!F0[r].targetTest(t););i=F0[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new tL(e[r],i)))||e.splice(r,1);return e},Lu=function(e){return e._gsap||eE(Ns(e))[0]._gsap},I2=function(e,t,i){return(i=e[t])&&ei(i)?e[t]():YM(i)&&e.getAttribute&&e.getAttribute(t)||i},kr=function(e,t){return(e=e.split(",")).forEach(t)||e},ri=function(e){return Math.round(e*1e5)/1e5||0},Pi=function(e){return Math.round(e*1e7)/1e7||0},Tf=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},dk=function(e,t){for(var i=t.length,r=0;e.indexOf(t[r])<0&&++ra;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[r]=t,t._prev=o,t.parent=t._dp=e,t},r_=function(e,t,i,r){i===void 0&&(i="_first"),r===void 0&&(r="_last");var s=t._prev,o=t._next;s?s._next=o:e[i]===t&&(e[i]=o),o?o._prev=s:e[r]===t&&(e[r]=s),t._next=t._prev=t.parent=null},El=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Du=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},gk=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},NA=function(e,t,i,r){return e._startAt&&(nr?e._startAt.revert(N0):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},vk=function n(e){return!e||e._ts&&n(e.parent)},aR=function(e){return e._repeat?Wf(e._tTime,e=e.duration()+e._rDelay)*e:0},Wf=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},Tv=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},s_=function(e){return e._end=Pi(e._start+(e._tDur/Math.abs(e._ts||e._rts||En)||0))},o_=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Pi(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),s_(e),i._dirty||Du(i,e)),e},O2=function(e,t){var i;if((t._time||!t._dur&&t._initted||t._startEn)&&t.render(i,!0)),Du(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-En}},To=function(e,t,i,r){return t.parent&&El(t),t._start=Pi((Aa(i)?i:i||e!==Hn?ws(e,i,t):e._time)+t._delay),t._end=Pi(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),F2(e,t,"_first","_last",e._sort?"_start":0),FA(t)||(e._recent=t),r||O2(e,t),e._ts<0&&o_(e,e._tTime),e},U2=function(e,t){return(us.ScrollTrigger||ZM("scrollTrigger",t))&&us.ScrollTrigger.create(t,e)},k2=function(e,t,i,r,s){if(nE(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!nr&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&B2!==$r.frame)return gl.push(e),e._lazy=[s,r],1},_k=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},FA=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},yk=function(e,t,i,r){var s=e.ratio,o=t<0||!t&&(!e._start&&_k(e)&&!(!e._initted&&FA(e))||(e._ts<0||e._dp._ts<0)&&!FA(e))?0:1,a=e._rDelay,l=0,u,h,d;if(a&&e._repeat&&(l=Up(0,e._tDur,t),h=Wf(l,a),e._yoyo&&h&1&&(o=1-o),h!==Wf(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||nr||r||e._zTime===En||!t&&e._zTime){if(!e._initted&&k2(e,t,r,i,l))return;for(d=e._zTime,e._zTime=t||(i?En:0),i||(i=t&&!d),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=l,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&NA(e,t,i,!0),e._onUpdate&&!i&&is(e,"onUpdate"),l&&e._repeat&&!i&&e.parent&&is(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&El(e,1),!i&&!nr&&(is(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},xk=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&&o_(e,e._tTime=e._tDur*a),e.parent&&s_(e),i||Du(e.parent,e),e},lR=function(e){return e instanceof yr?Du(e):Xf(e,e._dur)},Ak={_start:0,endTime:up,totalDuration:up},ws=function n(e,t,i){var r=e.labels,s=e._recent||Ak,o=e.duration()>=Ds?s.endTime(!1):e._dur,a,l,u;return Li(t)&&(isNaN(t)||t in r)?(l=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),l==="<"||l===">"?(a>=0&&(t=t.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?s:i).totalDuration()/100:1)):a<0?(t in r||(r[t]=o),r[t]):(l=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&i&&(l=l/100*(ir(i)?i[0]:i).totalDuration()),a>1?n(e,t.substr(0,a-1),i)+l:o+l)):t==null?o:+t},bd=function(e,t,i){var r=Aa(t[1]),s=(r?2:1)+(e<2?0:1),o=t[s],a,l;if(r&&(o.duration=t[1]),o.parent=i,e){for(a=o,l=i;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Ur(l.vars.inherit)&&l.parent;o.immediateRender=Ur(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new hi(t[0],o,t[s+1])},Dl=function(e,t){return e||e===0?t(e):t},Up=function(e,t,i){return it?t:i},$i=function(e,t){return!Li(e)||!(t=ck.exec(e))?"":t[1]},Sk=function(e,t,i){return Dl(i,function(r){return Up(e,t,r)})},OA=[].slice,z2=function(e,t){return e&&Uo(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Uo(e[0]))&&!e.nodeType&&e!==Mo},Mk=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(r){var s;return Li(r)&&!t||z2(r,1)?(s=i).push.apply(s,Ns(r)):i.push(r)})||i},Ns=function(e,t,i){return On&&!t&&On.selector?On.selector(e):Li(e)&&!i&&(LA||!Jf())?OA.call((t||QM).querySelectorAll(e),0):ir(e)?Mk(e,i):z2(e)?OA.call(e,0):e?[e]:[]},UA=function(e){return e=Ns(e)[0]||lp("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return Ns(t,i.querySelectorAll?i:i===e?lp("Invalid scope")||QM.createElement("div"):e)}},G2=function(e){return e.sort(function(){return .5-Math.random()})},H2=function(e){if(ei(e))return e;var t=Uo(e)?e:{each:e},i=Nu(t.ease),r=t.from||0,s=parseFloat(t.base)||0,o={},a=r>0&&r<1,l=isNaN(r)||a,u=t.axis,h=r,d=r;return Li(r)?h=d={center:.5,edges:.5,end:1}[r]||0:!a&&l&&(h=r[0],d=r[1]),function(p,m,v){var x=(v||t).length,y=o[x],g,S,A,E,b,C,R,I,O;if(!y){if(O=t.grid==="auto"?0:(t.grid||[1,Ds])[1],!O){for(R=-Ds;R<(R=v[O++].getBoundingClientRect().left)&&OR&&(R=b),bx?x-1:u?u==="y"?x/O:O:Math.max(O,x/O))||0)*(r==="edges"?-1:1),y.b=x<0?s-x:s,y.u=$i(t.amount||t.each)||0,i=i&&x<0?q2(i):i}return x=(y[p]-y.min)/y.max||0,Pi(y.b+(i?i(x):x)*y.v)+y.u}},kA=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var r=Pi(Math.round(parseFloat(i)/e)*e*t);return(r-r%1)/t+(Aa(i)?0:$i(i))}},V2=function(e,t){var i=ir(e),r,s;return!i&&Uo(e)&&(r=i=e.radius||Ds,e.values?(e=Ns(e.values),(s=!Aa(e[0]))&&(r*=r)):e=kA(e.increment)),Dl(t,i?ei(e)?function(o){return s=e(o),Math.abs(s-o)<=r?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),u=Ds,h=0,d=e.length,p,m;d--;)s?(p=e[d].x-a,m=e[d].y-l,p=p*p+m*m):p=Math.abs(e[d]-a),pr?s-o:o)})},cp=function(e){for(var t=0,i="",r,s,o,a;~(r=e.indexOf("random(",t));)o=e.indexOf(")",r),a=e.charAt(r+7)==="[",s=e.substr(r+7,o-r-7).match(a?C2:IA),i+=e.substr(t,r-t)+W2(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},J2=function(e,t,i,r,s){var o=t-e,a=r-i;return Dl(s,function(l){return i+((l-e)/o*a||0)})},bk=function n(e,t,i,r){var s=isNaN(e+t)?0:function(m){return(1-m)*e+m*t};if(!s){var o=Li(e),a={},l,u,h,d,p;if(i===!0&&(r=1)&&(i=null),o)e={p:e},t={p:t};else if(ir(e)&&!ir(t)){for(h=[],d=e.length,p=d-2,u=1;u(a=Math.abs(a))&&(l=o,s=a);return l},is=function(e,t,i){var r=e.vars,s=r[t],o=On,a=e._ctx,l,u,h;if(s)return l=r[t+"Params"],u=r.callbackScope||e,i&&gl.length&&Ev(),a&&(On=a),h=l?s.apply(u,l):s.call(u),On=o,h},fd=function(e){return El(e),e.scrollTrigger&&e.scrollTrigger.kill(!!nr),e.progress()<1&&is(e,"onInterrupt"),e},df,j2=[],Y2=function(e){if(e)if(e=!e.name&&e.default||e,KM()||e.headless){var t=e.name,i=ei(e),r=t&&!i&&e.init?function(){this._props=[]}:e,s={init:up,render:sE,add:tE,kill:Xk,modifier:Wk,rawVars:0},o={targetTest:0,get:0,getSetter:rE,aliases:{},register:0};if(Jf(),e!==r){if(qr[t])return;Hs(r,Hs(wv(e,s),o)),Ku(r.prototype,Ku(s,wv(e,o))),qr[r.prop=t]=r,e.targetTest&&(F0.push(r),qM[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}P2(t,r),e.register&&e.register(Hr,r,zr)}else j2.push(e)},An=255,hd={aqua:[0,An,An],lime:[0,An,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,An],navy:[0,0,128],white:[An,An,An],olive:[128,128,0],yellow:[An,An,0],orange:[An,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[An,0,0],pink:[An,192,203],cyan:[0,An,An],transparent:[An,An,An,0]},gx=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)*An+.5|0},K2=function(e,t,i){var r=e?Aa(e)?[e>>16,e>>8&An,e&An]:0:hd.black,s,o,a,l,u,h,d,p,m,v;if(!r){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),hd[e])r=hd[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+s+s+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&An,r&An,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&An,e&An]}else if(e.substr(0,3)==="hsl"){if(r=v=e.match(IA),!t)l=+r[0]%360/360,u=+r[1]/100,h=+r[2]/100,o=h<=.5?h*(u+1):h+u-h*u,s=h*2-o,r.length>3&&(r[3]*=1),r[0]=gx(l+1/3,s,o),r[1]=gx(l,s,o),r[2]=gx(l-1/3,s,o);else if(~e.indexOf("="))return r=e.match(w2),i&&r.length<4&&(r[3]=1),r}else r=e.match(IA)||hd.transparent;r=r.map(Number)}return t&&!v&&(s=r[0]/An,o=r[1]/An,a=r[2]/An,d=Math.max(s,o,a),p=Math.min(s,o,a),h=(d+p)/2,d===p?l=u=0:(m=d-p,u=h>.5?m/(2-d-p):m/(d+p),l=d===s?(o-a)/m+(oe||g<0)&&(i+=g-t),r+=g,b=r-i,A=b-o,(A>0||S)&&(C=++d.frame,p=b-d.time*1e3,d.time=b=b/1e3,o+=A+(A>=s?4:s-A),E=1),S||(l=u(x)),E)for(m=0;m=g&&m--},_listeners:a},d}(),Jf=function(){return!fp&&$r.wake()},rn={},Bk=/^[\d.\-M][\d.\-,\s]/,Ik=/["']/g,Lk=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),r=i[0],s=1,o=i.length,a,l,u;s1&&i.config?i.config.apply(null,~e.indexOf("{")?[Lk(t[1])]:Dk(e).split(",").map(D2)):rn._CE&&Bk.test(e)?rn._CE("",e):i},q2=function(e){return function(t){return 1-e(1-t)}},$2=function n(e,t){for(var i=e._first,r;i;)i instanceof yr?n(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?n(i.timeline,t):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=t)),i=i._next},Nu=function(e,t){return e&&(ei(e)?e:rn[e]||Nk(e))||t},sc=function(e,t,i,r){i===void 0&&(i=function(l){return 1-t(1-l)}),r===void 0&&(r=function(l){return l<.5?t(l*2)/2:1-t((1-l)*2)/2});var s={easeIn:t,easeOut:i,easeInOut:r},o;return kr(e,function(a){rn[a]=us[a]=s,rn[o=a.toLowerCase()]=i;for(var l in s)rn[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=rn[a+"."+l]=s[l]}),s},eL=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},vx=function n(e,t,i){var r=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/BA*(Math.asin(1/r)||0),a=function(h){return h===1?1:r*Math.pow(2,-10*h)*uk((h-o)*s)+1},l=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:eL(a);return s=BA/s,l.config=function(u,h){return n(e,u,h)},l},_x=function n(e,t){t===void 0&&(t=1.70158);var i=function(o){return o?--o*o*((t+1)*o+t)+1:0},r=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:eL(i);return r.config=function(s){return n(e,s)},r};kr("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;sc(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})});rn.Linear.easeNone=rn.none=rn.Linear.easeIn;sc("Elastic",vx("in"),vx("out"),vx());(function(n,e){var t=1/e,i=2*t,r=2.5*t,s=function(a){return a0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,Xf(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,r){if(Jf(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(o_(this,i),!s._dp||s.parent||O2(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i0||!this._tDur&&!i)&&To(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!r||this._initted&&Math.abs(this._zTime)===En||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),L2(this,i,r)),this},e.time=function(i,r){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+aR(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?1:0},e.progress=function(i,r){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+aR(this),r):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(i,r){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,r):this._repeat?Wf(this._tTime,s)+1:1},e.timeScale=function(i,r){if(!arguments.length)return this._rts===-En?0:this._rts;if(this._rts===i)return this;var s=this.parent&&this._ts?Tv(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-En?0:this._rts,this.totalTime(Up(-Math.abs(this._delay),this._tDur,s),r!==!1),s_(this),gk(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):(Jf(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==En&&(this._tTime-=En)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var r=this.parent||this._dp;return r&&(r._sort||!this.parent)&&To(r,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Ur(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?Tv(r.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=hk);var r=nr;return nr=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),nr=r,this},e.globalTime=function(i){for(var r=this,s=arguments.length?i:r.rawTime();r;)s=r._start+s/(Math.abs(r._ts)||1),r=r._dp;return!this.parent&&this._sat?this._sat.globalTime(i):s},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,lR(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var r=this._time;return this._rDelay=i,lR(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(ws(this,i),Ur(r))},e.restart=function(i,r){return this.play().totalTime(i?-this._delay:0,Ur(r))},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?-En:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-En,this},e.isActive=function(){var i=this.parent||this._dp,r=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=r&&s1?(r?(o[i]=r,s&&(o[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=r)):delete o[i],this):o[i]},e.then=function(i){var r=this;return new Promise(function(s){var o=ei(i)?i:N2,a=function(){var u=r.then;r.then=null,ei(o)&&(o=o(r))&&(o.then||o===r)&&(r.then=u),s(o),r.then=u};r._initted&&r.totalProgress()===1&&r._ts>=0||!r._tTime&&r._ts<0?a():r._prom=a})},e.kill=function(){fd(this)},n}();Hs(hp.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:-En,_prom:0,_ps:!1,_rts:1});var yr=function(n){S2(e,n);function e(i,r){var s;return i===void 0&&(i={}),s=n.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=Ur(i.sortChildren),Hn&&To(i.parent||Hn,na(s),r),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&U2(na(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(r,s,o){return bd(0,arguments,this),this},t.from=function(r,s,o){return bd(1,arguments,this),this},t.fromTo=function(r,s,o,a){return bd(2,arguments,this),this},t.set=function(r,s,o){return s.duration=0,s.parent=this,Rd(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new hi(r,s,ws(this,o),1),this},t.call=function(r,s,o){return To(this,hi.delayedCall(0,r,s),o)},t.staggerTo=function(r,s,o,a,l,u,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=h,o.parent=this,new hi(r,o,ws(this,l)),this},t.staggerFrom=function(r,s,o,a,l,u,h){return o.runBackwards=1,Rd(o).immediateRender=Ur(o.immediateRender),this.staggerTo(r,s,o,a,l,u,h)},t.staggerFromTo=function(r,s,o,a,l,u,h,d){return a.startAt=o,Rd(a).immediateRender=Ur(a.immediateRender),this.staggerTo(r,s,a,l,u,h,d)},t.render=function(r,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,h=r<=0?0:Pi(r),d=this._zTime<0!=r<0&&(this._initted||!u),p,m,v,x,y,g,S,A,E,b,C,R;if(this!==Hn&&h>l&&r>=0&&(h=l),h!==this._tTime||o||d){if(a!==this._time&&u&&(h+=this._time-a,r+=this._time-a),p=h,E=this._start,A=this._ts,g=!A,d&&(u||(a=this._zTime),(r||!s)&&(this._zTime=r)),this._repeat){if(C=this._yoyo,y=u+this._rDelay,this._repeat<-1&&r<0)return this.totalTime(y*100+r,s,o);if(p=Pi(h%y),h===l?(x=this._repeat,p=u):(x=~~(h/y),x&&x===h/y&&(p=u,x--),p>u&&(p=u)),b=Wf(this._tTime,y),!a&&this._tTime&&b!==x&&this._tTime-b*y-this._dur<=0&&(b=x),C&&x&1&&(p=u-p,R=1),x!==b&&!this._lock){var I=C&&b&1,O=I===(C&&x&1);if(x=a&&r>=0)for(m=this._first;m;){if(v=m._next,(m._act||p>=m._start)&&m._ts&&S!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(p-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(p-m._start)*m._ts,s,o),p!==this._time||!this._ts&&!g){S=0,v&&(h+=this._zTime=-En);break}}m=v}else{m=this._last;for(var T=r<0?r:p;m;){if(v=m._prev,(m._act||T<=m._end)&&m._ts&&S!==m){if(m.parent!==this)return this.render(r,s,o);if(m.render(m._ts>0?(T-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(T-m._start)*m._ts,s,o||nr&&(m._initted||m._startAt)),p!==this._time||!this._ts&&!g){S=0,v&&(h+=this._zTime=T?-En:En);break}}m=v}}if(S&&!s&&(this.pause(),S.render(p>=a?0:-En)._zTime=p>=a?1:-1,this._ts))return this._start=E,s_(this),this.render(r,s,o);this._onUpdate&&!s&&is(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(E===this._start||Math.abs(A)!==Math.abs(this._ts))&&(this._lock||((r||!u)&&(h===l&&this._ts>0||!h&&this._ts<0)&&El(this,1),!s&&!(r<0&&!a)&&(h||a||!l)&&(is(this,h===l&&r>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom())))}return this},t.add=function(r,s){var o=this;if(Aa(s)||(s=ws(this,s,r)),!(r instanceof hp)){if(ir(r))return r.forEach(function(a){return o.add(a,s)}),this;if(Li(r))return this.addLabel(r,s);if(ei(r))r=hi.delayedCall(0,r);else return this}return this!==r?To(this,r,s):this},t.getChildren=function(r,s,o,a){r===void 0&&(r=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ds);for(var l=[],u=this._first;u;)u._start>=a&&(u instanceof hi?s&&l.push(u):(o&&l.push(u),r&&l.push.apply(l,u.getChildren(!0,s,o)))),u=u._next;return l},t.getById=function(r){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===r)return s[o]},t.remove=function(r){return Li(r)?this.removeLabel(r):ei(r)?this.killTweensOf(r):(r_(this,r),r===this._recent&&(this._recent=this._last),Du(this))},t.totalTime=function(r,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Pi($r.time-(this._ts>0?r/this._ts:(this.totalDuration()-r)/-this._ts))),n.prototype.totalTime.call(this,r,s),this._forcing=0,this):this._tTime},t.addLabel=function(r,s){return this.labels[r]=ws(this,s),this},t.removeLabel=function(r){return delete this.labels[r],this},t.addPause=function(r,s,o){var a=hi.delayedCall(0,s||up,o);return a.data="isPause",this._hasPause=1,To(this,a,ws(this,r))},t.removePause=function(r){var s=this._first;for(r=ws(this,r);s;)s._start===r&&s.data==="isPause"&&El(s),s=s._next},t.killTweensOf=function(r,s,o){for(var a=this.getTweensOf(r,o),l=a.length;l--;)nl!==a[l]&&a[l].kill(r,s);return this},t.getTweensOf=function(r,s){for(var o=[],a=Ns(r),l=this._first,u=Aa(s),h;l;)l instanceof hi?dk(l._targets,a)&&(u?(!nl||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},t.tweenTo=function(r,s){s=s||{};var o=this,a=ws(o,r),l=s,u=l.startAt,h=l.onStart,d=l.onStartParams,p=l.immediateRender,m,v=hi.to(o,Hs({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||En,onStart:function(){if(o.pause(),!m){var y=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==y&&Xf(v,y,0,1).render(v._time,!0,!0),m=1}h&&h.apply(v,d||[])}},s));return p?v.render(0):v},t.tweenFromTo=function(r,s,o){return this.tweenTo(s,Hs({startAt:{time:ws(this,r)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(r){return r===void 0&&(r=this._time),uR(this,ws(this,r))},t.previousLabel=function(r){return r===void 0&&(r=this._time),uR(this,ws(this,r),1)},t.currentLabel=function(r){return arguments.length?this.seek(r,!0):this.previousLabel(this._time+En)},t.shiftChildren=function(r,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,u;a;)a._start>=o&&(a._start+=r,a._end+=r),a=a._next;if(s)for(u in l)l[u]>=o&&(l[u]+=r);return Du(this)},t.invalidate=function(r){var s=this._first;for(this._lock=0;s;)s.invalidate(r),s=s._next;return n.prototype.invalidate.call(this,r)},t.clear=function(r){r===void 0&&(r=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),r&&(this.labels={}),Du(this)},t.totalDuration=function(r){var s=0,o=this,a=o._last,l=Ds,u,h,d;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-r:r));if(o._dirty){for(d=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,To(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=u;Xf(o,o===Hn&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(r){if(Hn._ts&&(L2(Hn,Tv(r,Hn)),B2=$r.frame),$r.frame>=sR){sR+=os.autoSleep||120;var s=Hn._first;if((!s||!s._ts)&&os.autoSleep&&$r._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||$r.sleep()}}},e}(hp);Hs(yr.prototype,{_lock:0,_hasPause:0,_forcing:0});var Fk=function(e,t,i,r,s,o,a){var l=new zr(this._pt,e,t,0,1,aL,null,s),u=0,h=0,d,p,m,v,x,y,g,S;for(l.b=i,l.e=r,i+="",r+="",(g=~r.indexOf("random("))&&(r=cp(r)),o&&(S=[i,r],o(S,e,t),i=S[0],r=S[1]),p=i.match(px)||[];d=px.exec(r);)v=d[0],x=r.substring(u,d.index),m?m=(m+1)%5:x.substr(-5)==="rgba("&&(m=1),v!==p[h++]&&(y=parseFloat(p[h-1])||0,l._pt={_next:l._pt,p:x||h===1?x:",",s:y,c:v.charAt(1)==="="?Tf(y,v)-y:parseFloat(v)-y,m:m&&m<4?Math.round:0},u=px.lastIndex);return l.c=u")}),E.duration();else{C={};for(I in v)I==="ease"||I==="easeEach"||zk(I,v[I],C,v.easeEach);for(I in C)for(se=C[I].sort(function($,oe){return $.t-oe.t}),K=0,b=0;bl-En&&!h?l:ru&&(p=u)),g=this._yoyo&&v&1,g&&(E=this._yEase,p=u-p),y=Wf(this._tTime,x),p===a&&!o&&this._initted&&v===y)return this._tTime=d,this;v!==y&&(A&&this._yEase&&$2(A,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==x&&this._initted&&(this._lock=o=1,this.render(Pi(x*v),!0).invalidate()._lock=0))}if(!this._initted){if(k2(this,h?r:p,o,s,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&v!==y))return this;if(u!==this._dur)return this.render(r,s,o)}if(this._tTime=d,this._time=p,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=S=(E||this._ease)(p/u),this._from&&(this.ratio=S=1-S),p&&!a&&!s&&!v&&(is(this,"onStart"),this._tTime!==d))return this;for(m=this._pt;m;)m.r(S,m.d),m=m._next;A&&A.render(r<0?r:A._dur*A._ease(p/this._dur),s,o)||this._startAt&&(this._zTime=r),this._onUpdate&&!s&&(h&&NA(this,r,s,o),is(this,"onUpdate")),this._repeat&&v!==y&&this.vars.onRepeat&&!s&&this.parent&&is(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(h&&!this._onUpdate&&NA(this,r,!0,!0),(r||!u)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&El(this,1),!s&&!(h&&!a)&&(d||a||g)&&(is(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d0)&&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,s,o,a,l){fp||$r.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||nE(this,u),h=this._ease(u/this._dur),Uk(this,r,s,o,a,h,u,l)?this.resetTo(r,s,o,a,1):(o_(this,0),this.parent||F2(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(r,s){if(s===void 0&&(s="all"),!r&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?fd(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(r,s,nl&&nl.vars.overwrite!==!0)._first||fd(this),this.parent&&o!==this.timeline.totalDuration()&&Xf(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=r?Ns(r):a,u=this._ptLookup,h=this._pt,d,p,m,v,x,y,g;if((!s||s==="all")&&mk(a,l))return s==="all"&&(this._pt=0),fd(this);for(d=this._op=this._op||[],s!=="all"&&(Li(s)&&(x={},kr(s,function(S){return x[S]=1}),s=x),s=kk(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){p=u[g],s==="all"?(d[g]=s,v=p,m={}):(m=d[g]=d[g]||{},v=s);for(x in v)y=p&&p[x],y&&((!("kill"in y.d)||y.d.kill(x)===!0)&&r_(this,y,"_pt"),delete p[x]),m!=="all"&&(m[x]=1)}return this._initted&&!this._pt&&h&&fd(this),this},e.to=function(r,s){return new e(r,s,arguments[2])},e.from=function(r,s){return bd(1,arguments)},e.delayedCall=function(r,s,o,a){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:r,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(r,s,o){return bd(2,arguments)},e.set=function(r,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(r,s)},e.killTweensOf=function(r,s,o){return Hn.killTweensOf(r,s,o)},e}(hp);Hs(hi.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});kr("staggerTo,staggerFrom,staggerFromTo",function(n){hi[n]=function(){var e=new yr,t=OA.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var iE=function(e,t,i){return e[t]=i},sL=function(e,t,i){return e[t](i)},Gk=function(e,t,i,r){return e[t](r.fp,i)},Hk=function(e,t,i){return e.setAttribute(t,i)},rE=function(e,t){return ei(e[t])?sL:YM(e[t])&&e.setAttribute?Hk:iE},oL=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Vk=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},aL=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)},sE=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},Wk=function(e,t,i,r){for(var s=this._pt,o;s;)o=s._next,s.p===r&&s.modifier(e,t,i),s=o},Xk=function(e){for(var t=this._pt,i,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?r_(this,t,"_pt"):t.dep||(i=1),t=r;return!i},Jk=function(e,t,i,r){r.mSet(e,t,r.m.call(r.tween,i,r.mt),r)},lL=function(e){for(var t=e._pt,i,r,s,o;t;){for(i=t._next,r=s;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:o)?t._prev._next=t:s=t,(t._next=r)?r._prev=t:o=t,t=i}e._pt=s},zr=function(){function n(t,i,r,s,o,a,l,u,h){this.t=i,this.s=s,this.c=o,this.p=r,this.r=a||oL,this.d=l||this,this.set=u||iE,this.pr=h||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(i,r,s){this.mSet=this.mSet||this.set,this.set=Jk,this.m=i,this.mt=s,this.tween=r},n}();kr($M+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return qM[n]=1});us.TweenMax=us.TweenLite=hi;us.TimelineLite=us.TimelineMax=yr;Hn=new yr({sortChildren:!1,defaults:Vf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});os.stringFilter=Z2;var Fu=[],O0={},jk=[],fR=0,Yk=0,yx=function(e){return(O0[e]||jk).map(function(t){return t()})},GA=function(){var e=Date.now(),t=[];e-fR>2&&(yx("matchMediaInit"),Fu.forEach(function(i){var r=i.queries,s=i.conditions,o,a,l,u;for(a in r)o=Mo.matchMedia(r[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),l&&t.push(i))}),yx("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i,function(r){return i.add(null,r)})}),fR=e,yx("matchMedia"))},uL=function(){function n(t,i){this.selector=i&&UA(i),this.data=[],this._r=[],this.isReverted=!1,this.id=Yk++,t&&this.add(t)}var e=n.prototype;return e.add=function(i,r,s){ei(i)&&(s=r,r=i,i=ei);var o=this,a=function(){var u=On,h=o.selector,d;return u&&u!==o&&u.data.push(o),s&&(o.selector=UA(s)),On=o,d=r.apply(o,arguments),ei(d)&&o._r.push(d),On=u,o.selector=h,o.isReverted=!1,d};return o.last=a,i===ei?a(o,function(l){return o.add(null,l)}):i?o[i]=a:a},e.ignore=function(i){var r=On;On=null,i(this),On=r},e.getTweens=function(){var i=[];return this.data.forEach(function(r){return r instanceof n?i.push.apply(i,r.getTweens()):r instanceof hi&&!(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 s=this;if(i?function(){for(var a=s.getTweens(),l=s.data.length,u;l--;)u=s.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,d){return d.g-h.g||-1/0}).forEach(function(h){return h.t.revert(i)}),l=s.data.length;l--;)u=s.data[l],u instanceof yr?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof hi)&&u.revert&&u.revert(i);s._r.forEach(function(h){return h(i,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),r)for(var o=Fu.length;o--;)Fu[o].id===this.id&&Fu.splice(o,1)},e.revert=function(i){this.kill(i||{})},n}(),Kk=function(){function n(t){this.contexts=[],this.scope=t,On&&On.data.push(this)}var e=n.prototype;return e.add=function(i,r,s){Uo(i)||(i={matches:i});var o=new uL(0,s||this.scope),a=o.conditions={},l,u,h;On&&!o.selector&&(o.selector=On.selector),this.contexts.push(o),r=o.add("onMatch",r),o.queries=i;for(u in i)u==="all"?h=1:(l=Mo.matchMedia(i[u]),l&&(Fu.indexOf(o)<0&&Fu.push(o),(a[u]=l.matches)&&(h=1),l.addListener?l.addListener(GA):l.addEventListener("change",GA)));return h&&r(o,function(d){return o.add(null,d)}),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(r){return r.kill(i,!0)})},n}(),Cv={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i1){var r=e.map(function(h){return Hr.quickSetter(h,t,i)}),s=r.length;return function(h){for(var d=s;d--;)r[d](h)}}e=e[0]||{};var o=qr[t],a=Lu(e),l=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(h){var d=new o;df._pt=0,d.init(e,i?h+i:h,df,0,[e]),d.render(1,d),df._pt&&sE(1,df)}:a.set(e,l);return o?u:function(h){return u(e,l,i?h+i:h,a,1)}},quickTo:function(e,t,i){var r,s=Hr.to(e,Ku((r={},r[t]="+=0.1",r.paused=!0,r),i||{})),o=function(l,u,h){return s.resetTo(t,l,u,h)};return o.tween=s,o},isTweening:function(e){return Hn.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Nu(e.ease,Vf.ease)),oR(Vf,e||{})},config:function(e){return oR(os,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,r=e.plugins,s=e.defaults,o=e.extendTimeline;(r||"").split(",").forEach(function(a){return a&&!qr[a]&&!us[a]&&lp(t+" effect requires "+a+" plugin.")}),mx[t]=function(a,l,u){return i(Ns(a),Hs(l||{},s),u)},o&&(yr.prototype[t]=function(a,l,u){return this.add(mx[t](a,Uo(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,t){rn[e]=Nu(t)},parseEase:function(e,t){return arguments.length?Nu(e,t):rn},getById:function(e){return Hn.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new yr(e),r,s;for(i.smoothChildTiming=Ur(e.smoothChildTiming),Hn.remove(i),i._dp=0,i._time=i._tTime=Hn._time,r=Hn._first;r;)s=r._next,(t||!(!r._dur&&r instanceof hi&&r.vars.onComplete===r._targets[0]))&&To(i,r,r._start-r._delay),r=s;return To(Hn,i,0),i},context:function(e,t){return e?new uL(e,t):On},matchMedia:function(e){return new Kk(e)},matchMediaRefresh:function(){return Fu.forEach(function(e){var t=e.conditions,i,r;for(r in t)t[r]&&(t[r]=!1,i=1);i&&e.revert()})||GA()},addEventListener:function(e,t){var i=O0[e]||(O0[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=O0[e],r=i&&i.indexOf(t);r>=0&&i.splice(r,1)},utils:{wrap:Ck,wrapYoyo:Rk,distribute:H2,random:W2,snap:V2,normalize:Tk,getUnit:$i,clamp:Sk,splitColor:K2,toArray:Ns,selector:UA,mapRange:J2,pipe:Ek,unitize:wk,interpolate:bk,shuffle:G2},install:b2,effects:mx,ticker:$r,updateRoot:yr.updateRoot,plugins:qr,globalTimeline:Hn,core:{PropTween:zr,globals:P2,Tween:hi,Timeline:yr,Animation:hp,getCache:Lu,_removeLinkedListItem:r_,reverting:function(){return nr},context:function(e){return e&&On&&(On.data.push(e),e._ctx=On),On},suppressOverwrites:function(e){return jM=e}}};kr("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return Cv[n]=hi[n]});$r.add(yr.updateRoot);df=Cv.to({},{duration:0});var Qk=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},Zk=function(e,t){var i=e._targets,r,s,o;for(r in t)for(s=i.length;s--;)o=e._ptLookup[s][r],o&&(o=o.d)&&(o._pt&&(o=Qk(o,r)),o&&o.modifier&&o.modifier(t[r],e,i[s],r))},xx=function(e,t){return{name:e,rawVars:1,init:function(r,s,o){o._onInit=function(a){var l,u;if(Li(s)&&(l={},kr(s,function(h){return l[h]=1}),s=l),t){l={};for(u in s)l[u]=t(s[u]);s=l}Zk(a,s)}}}},Hr=Cv.registerPlugin({name:"attr",init:function(e,t,i,r,s){var o,a,l;this.tween=i;for(o in t)l=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(l||0)+"",t[o],r,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(e,t){for(var i=t._pt;i;)nr?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",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)}},xx("roundProps",kA),xx("modifiers"),xx("snap",V2))||Cv;hi.version=yr.version=Hr.version="3.12.5";R2=1;KM()&&Jf();rn.Power0;rn.Power1;rn.Power2;rn.Power3;rn.Power4;rn.Linear;rn.Quad;rn.Cubic;rn.Quart;rn.Quint;rn.Strong;rn.Elastic;rn.Back;rn.SteppedEase;rn.Bounce;rn.Sine;rn.Expo;rn.Circ;/*! * CSSPlugin 3.12.5 * https://gsap.com * @@ -53,7 +53,7 @@ Error generating stack: `+s.message+` * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var hR,il,Cf,oE,Su,dR,aE,Qk=function(){return typeof window<"u"},Sa={},cu=180/Math.PI,Rf=Math.PI/180,Ec=Math.atan2,pR=1e8,lE=/([A-Z])/g,Zk=/(left|right|width|margin|padding|x)/i,qk=/[\s,\(]\S/,Co={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},HA=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},$k=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)},ez=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)},tz=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},lL=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},uL=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},nz=function(e,t,i){return e.style[t]=i},iz=function(e,t,i){return e.style.setProperty(t,i)},rz=function(e,t,i){return e._gsap[t]=i},sz=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},oz=function(e,t,i,r,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},az=function(e,t,i,r,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},Vn="transform",Gr=Vn+"Origin",lz=function n(e,t){var i=this,r=this.target,s=r.style,o=r._gsap;if(e in Sa&&s){if(this.tfm=this.tfm||{},e!=="transform")e=Co[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return i.tfm[a]=ra(r,a)}):this.tfm[e]=o.x?o[e]:ra(r,e),e===Gr&&(this.tfm.zOrigin=o.zOrigin);else return Co.transform.split(",").forEach(function(a){return n.call(i,a,t)});if(this.props.indexOf(Vn)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Gr,t,"")),e=Vn}(s||t)&&this.props.push(e,t,s[e])},cL=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},uz=function(){var e=this.props,t=this.target,i=t.style,r=t._gsap,s,o;for(s=0;s=0?mR[o]:"")+e},WA=function(){Qk()&&window.document&&(hR=window,il=hR.document,Cf=il.documentElement,Su=VA("div")||{style:{}},VA("div"),Vn=jf(Vn),Gr=Vn+"Origin",Su.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",hL=!!jf("perspective"),aE=Hr.core.reverting,oE=1)},Ax=function n(e){var t=VA("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,r=this.nextSibling,s=this.style.cssText,o;if(Cf.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(r?i.insertBefore(this,r):i.appendChild(this)),Cf.removeChild(t),this.style.cssText=s,o},gR=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},dL=function(e){var t;try{t=e.getBBox()}catch{t=Ax.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Ax||(t=Ax.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+gR(e,["x","cx","x1"])||0,y:+gR(e,["y","cy","y1"])||0,width:0,height:0}:t},pL=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&dL(e))},Ku=function(e,t){if(t){var i=e.style,r;t in Sa&&t!==Gr&&(t=Vn),i.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(r==="--"?t:t.replace(lE,"-$1").toLowerCase())):i.removeAttribute(t)}},rl=function(e,t,i,r,s,o){var a=new zr(e._pt,t,i,0,1,o?uL:lL);return e._pt=a,a.b=r,a.e=s,e._props.push(i),a},vR={deg:1,rad:1,turn:1},cz={grid:1,flex:1},wl=function n(e,t,i,r){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Su.style,l=Zk.test(t),u=e.tagName.toLowerCase()==="svg",h=(u?"client":"offset")+(l?"Width":"Height"),d=100,p=r==="px",m=r==="%",v,x,y,g;if(r===o||!s||vR[r]||vR[o])return s;if(o!=="px"&&!p&&(s=n(e,t,i,"px")),g=e.getCTM&&pL(e),(m||o==="%")&&(Sa[t]||~t.indexOf("adius")))return v=g?e.getBBox()[l?"width":"height"]:e[h],ii(m?s/v*d:s/100*v);if(a[l?"width":"height"]=d+(p?o:r),x=~t.indexOf("adius")||r==="em"&&e.appendChild&&!u?e:e.parentNode,g&&(x=(e.ownerSVGElement||{}).parentNode),(!x||x===il||!x.appendChild)&&(x=il.body),y=x._gsap,y&&m&&y.width&&l&&y.time===$r.time&&!y.uncache)return ii(s/y.width*d);if(m&&(t==="height"||t==="width")){var S=e.style[t];e.style[t]=d+r,v=e[h],S?e.style[t]=S:Ku(e,t)}else(m||o==="%")&&!cz[Io(x,"display")]&&(a.position=Io(e,"position")),x===e&&(a.position="static"),x.appendChild(Su),v=Su[h],x.removeChild(Su),a.position="absolute";return l&&m&&(y=Iu(x),y.time=$r.time,y.width=x[h]),ii(p?v*s/d:v&&s?d/v*s:0)},ra=function(e,t,i,r){var s;return oE||WA(),t in Co&&t!=="transform"&&(t=Co[t],~t.indexOf(",")&&(t=t.split(",")[0])),Sa[t]&&t!=="transform"?(s=pp(e,r),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:bv(Io(e,Gr))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||r||~(s+"").indexOf("calc("))&&(s=Rv[t]&&Rv[t](e,t,i)||Io(e,t)||P2(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?wl(e,t,s,i)+i:s},fz=function(e,t,i,r){if(!i||i==="none"){var s=jf(t,e,1),o=s&&Io(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=Io(e,"borderTopColor"))}var a=new zr(this._pt,e.style,t,0,1,sL),l=0,u=0,h,d,p,m,v,x,y,g,S,A,E,b;if(a.b=i,a.e=r,i+="",r+="",r==="auto"&&(x=e.style[t],e.style[t]=r,r=Io(e,t)||r,x?e.style[t]=x:Ku(e,t)),h=[i,r],K2(h),i=h[0],r=h[1],p=i.match(hf)||[],b=r.match(hf)||[],b.length){for(;d=hf.exec(r);)y=d[0],S=r.substring(l,d.index),v?v=(v+1)%5:(S.substr(-5)==="rgba("||S.substr(-5)==="hsla(")&&(v=1),y!==(x=p[u++]||"")&&(m=parseFloat(x)||0,E=x.substr((m+"").length),y.charAt(1)==="="&&(y=Tf(m,y)+E),g=parseFloat(y),A=y.substr((g+"").length),l=hf.lastIndex-A.length,A||(A=A||os.units[t]||E,l===r.length&&(r+=A,a.e+=A)),E!==A&&(m=wl(e,t,x,A)||0),a._pt={_next:a._pt,p:S||u===1?S:",",s:m,c:g-m,m:v&&v<4||t==="zIndex"?Math.round:0});a.c=l-1;)a=s[u],Sa[a]&&(l=1,a=a==="transformOrigin"?Gr:Vn),Ku(i,a);l&&(Ku(i,Vn),o&&(o.svg&&i.removeAttribute("transform"),pp(i,1),o.uncache=1,cL(r)))}},Rv={clearProps:function(e,t,i,r,s){if(s.data!=="isFromStart"){var o=e._pt=new zr(e._pt,t,i,0,0,dz);return o.u=r,o.pr=-10,o.tween=s,e._props.push(i),1}}},dp=[1,0,0,1,0,0],mL={},gL=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},yR=function(e){var t=Io(e,Vn);return gL(t)?dp:t.substr(7).match(M2).map(ii)},uE=function(e,t){var i=e._gsap||Iu(e),r=e.style,s=yR(e),o,a,l,u;return i.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?dp:s):(s===dp&&!e.offsetParent&&e!==Cf&&!i.svg&&(l=r.display,r.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,Cf.appendChild(e)),s=yR(e),l?r.display=l:Ku(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):Cf.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},XA=function(e,t,i,r,s,o){var a=e._gsap,l=s||uE(e,!0),u=a.xOrigin||0,h=a.yOrigin||0,d=a.xOffset||0,p=a.yOffset||0,m=l[0],v=l[1],x=l[2],y=l[3],g=l[4],S=l[5],A=t.split(" "),E=parseFloat(A[0])||0,b=parseFloat(A[1])||0,C,R,I,O;i?l!==dp&&(R=m*y-v*x)&&(I=E*(y/R)+b*(-x/R)+(x*S-y*g)/R,O=E*(-v/R)+b*(m/R)-(m*S-v*g)/R,E=I,b=O):(C=dL(e),E=C.x+(~A[0].indexOf("%")?E/100*C.width:E),b=C.y+(~(A[1]||A[0]).indexOf("%")?b/100*C.height:b)),r||r!==!1&&a.smooth?(g=E-u,S=b-h,a.xOffset=d+(g*m+S*x)-g,a.yOffset=p+(g*v+S*y)-S):a.xOffset=a.yOffset=0,a.xOrigin=E,a.yOrigin=b,a.smooth=!!r,a.origin=t,a.originIsAbsolute=!!i,e.style[Gr]="0px 0px",o&&(rl(o,a,"xOrigin",u,E),rl(o,a,"yOrigin",h,b),rl(o,a,"xOffset",d,a.xOffset),rl(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",E+" "+b)},pp=function(e,t){var i=e._gsap||new $2(e);if("x"in i&&!t&&!i.uncache)return i;var r=e.style,s=i.scaleX<0,o="px",a="deg",l=getComputedStyle(e),u=Io(e,Gr)||"0",h,d,p,m,v,x,y,g,S,A,E,b,C,R,I,O,T,L,K,se,W,te,$,oe,F,V,N,ee,ce,Be,ae,xe;return h=d=p=x=y=g=S=A=E=0,m=v=1,i.svg=!!(e.getCTM&&pL(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(r[Vn]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Vn]!=="none"?l[Vn]:"")),r.scale=r.rotate=r.translate="none"),R=uE(e,i.svg),i.svg&&(i.uncache?(F=e.getBBox(),u=i.xOrigin-F.x+"px "+(i.yOrigin-F.y)+"px",oe=""):oe=!t&&e.getAttribute("data-svg-origin"),XA(e,oe||u,!!oe||i.originIsAbsolute,i.smooth!==!1,R)),b=i.xOrigin||0,C=i.yOrigin||0,R!==dp&&(L=R[0],K=R[1],se=R[2],W=R[3],h=te=R[4],d=$=R[5],R.length===6?(m=Math.sqrt(L*L+K*K),v=Math.sqrt(W*W+se*se),x=L||K?Ec(K,L)*cu:0,S=se||W?Ec(se,W)*cu+x:0,S&&(v*=Math.abs(Math.cos(S*Rf))),i.svg&&(h-=b-(b*L+C*se),d-=C-(b*K+C*W))):(xe=R[6],Be=R[7],N=R[8],ee=R[9],ce=R[10],ae=R[11],h=R[12],d=R[13],p=R[14],I=Ec(xe,ce),y=I*cu,I&&(O=Math.cos(-I),T=Math.sin(-I),oe=te*O+N*T,F=$*O+ee*T,V=xe*O+ce*T,N=te*-T+N*O,ee=$*-T+ee*O,ce=xe*-T+ce*O,ae=Be*-T+ae*O,te=oe,$=F,xe=V),I=Ec(-se,ce),g=I*cu,I&&(O=Math.cos(-I),T=Math.sin(-I),oe=L*O-N*T,F=K*O-ee*T,V=se*O-ce*T,ae=W*T+ae*O,L=oe,K=F,se=V),I=Ec(K,L),x=I*cu,I&&(O=Math.cos(I),T=Math.sin(I),oe=L*O+K*T,F=te*O+$*T,K=K*O-L*T,$=$*O-te*T,L=oe,te=F),y&&Math.abs(y)+Math.abs(x)>359.9&&(y=x=0,g=180-g),m=ii(Math.sqrt(L*L+K*K+se*se)),v=ii(Math.sqrt($*$+xe*xe)),I=Ec(te,$),S=Math.abs(I)>2e-4?I*cu:0,E=ae?1/(ae<0?-ae:ae):0),i.svg&&(oe=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!gL(Io(e,Vn)),oe&&e.setAttribute("transform",oe))),Math.abs(S)>90&&Math.abs(S)<270&&(s?(m*=-1,S+=x<=0?180:-180,x+=x<=0?180:-180):(v*=-1,S+=S<=0?180:-180)),t=t||i.uncache,i.x=h-((i.xPercent=h&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+o,i.y=d-((i.yPercent=d&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+o,i.z=p+o,i.scaleX=ii(m),i.scaleY=ii(v),i.rotation=ii(x)+a,i.rotationX=ii(y)+a,i.rotationY=ii(g)+a,i.skewX=S+a,i.skewY=A+a,i.transformPerspective=E+o,(i.zOrigin=parseFloat(u.split(" ")[2])||!t&&i.zOrigin||0)&&(r[Gr]=bv(u)),i.xOffset=i.yOffset=0,i.force3D=os.force3D,i.renderTransform=i.svg?mz:hL?vL:pz,i.uncache=0,i},bv=function(e){return(e=e.split(" "))[0]+" "+e[1]},Sx=function(e,t,i){var r=$i(t);return ii(parseFloat(t)+parseFloat(wl(e,"x",i+"px",r)))+r},pz=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,vL(e,t)},jl="0deg",Vh="0px",Yl=") ",vL=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.z,u=i.rotation,h=i.rotationY,d=i.rotationX,p=i.skewX,m=i.skewY,v=i.scaleX,x=i.scaleY,y=i.transformPerspective,g=i.force3D,S=i.target,A=i.zOrigin,E="",b=g==="auto"&&e&&e!==1||g===!0;if(A&&(d!==jl||h!==jl)){var C=parseFloat(h)*Rf,R=Math.sin(C),I=Math.cos(C),O;C=parseFloat(d)*Rf,O=Math.cos(C),o=Sx(S,o,R*O*-A),a=Sx(S,a,-Math.sin(C)*-A),l=Sx(S,l,I*O*-A+A)}y!==Vh&&(E+="perspective("+y+Yl),(r||s)&&(E+="translate("+r+"%, "+s+"%) "),(b||o!==Vh||a!==Vh||l!==Vh)&&(E+=l!==Vh||b?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Yl),u!==jl&&(E+="rotate("+u+Yl),h!==jl&&(E+="rotateY("+h+Yl),d!==jl&&(E+="rotateX("+d+Yl),(p!==jl||m!==jl)&&(E+="skew("+p+", "+m+Yl),(v!==1||x!==1)&&(E+="scale("+v+", "+x+Yl),S.style[Vn]=E||"translate(0, 0)"},mz=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.rotation,u=i.skewX,h=i.skewY,d=i.scaleX,p=i.scaleY,m=i.target,v=i.xOrigin,x=i.yOrigin,y=i.xOffset,g=i.yOffset,S=i.forceCSS,A=parseFloat(o),E=parseFloat(a),b,C,R,I,O;l=parseFloat(l),u=parseFloat(u),h=parseFloat(h),h&&(h=parseFloat(h),u+=h,l+=h),l||u?(l*=Rf,u*=Rf,b=Math.cos(l)*d,C=Math.sin(l)*d,R=Math.sin(l-u)*-p,I=Math.cos(l-u)*p,u&&(h*=Rf,O=Math.tan(u-h),O=Math.sqrt(1+O*O),R*=O,I*=O,h&&(O=Math.tan(h),O=Math.sqrt(1+O*O),b*=O,C*=O)),b=ii(b),C=ii(C),R=ii(R),I=ii(I)):(b=d,I=p,C=R=0),(A&&!~(o+"").indexOf("px")||E&&!~(a+"").indexOf("px"))&&(A=wl(m,"x",o,"px"),E=wl(m,"y",a,"px")),(v||x||y||g)&&(A=ii(A+v-(v*b+x*R)+y),E=ii(E+x-(v*C+x*I)+g)),(r||s)&&(O=m.getBBox(),A=ii(A+r/100*O.width),E=ii(E+s/100*O.height)),O="matrix("+b+","+C+","+R+","+I+","+A+","+E+")",m.setAttribute("transform",O),S&&(m.style[Vn]=O)},gz=function(e,t,i,r,s){var o=360,a=Li(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?cu:1),u=l-r,h=r+u+"deg",d,p;return a&&(d=s.split("_")[1],d==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),d==="cw"&&u<0?u=(u+o*pR)%o-~~(u/o)*o:d==="ccw"&&u>0&&(u=(u-o*pR)%o-~~(u/o)*o)),e._pt=p=new zr(e._pt,t,i,r,u,$k),p.e=h,p.u="deg",e._props.push(i),p},xR=function(e,t){for(var i in t)e[i]=t[i];return e},vz=function(e,t,i){var r=xR({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,l,u,h,d,p,m,v;r.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),o[Vn]=t,a=pp(i,1),Ku(i,Vn),i.setAttribute("transform",u)):(u=getComputedStyle(i)[Vn],o[Vn]=t,a=pp(i,1),o[Vn]=u);for(l in Sa)u=r[l],h=a[l],u!==h&&s.indexOf(l)<0&&(m=$i(u),v=$i(h),d=m!==v?wl(i,l,u,v):parseFloat(u),p=parseFloat(h),e._pt=new zr(e._pt,a,l,d,p-d,HA),e._pt.u=v||0,e._props.push(l));xR(a,r)};kr("padding,margin,Width,Radius",function(n,e){var t="Top",i="Right",r="Bottom",s="Left",o=(e<3?[t,i,r,s]:[t+s,t+i,r+i,r+s]).map(function(a){return e<2?n+a:"border"+a+n});Rv[e>1?"border"+n:n]=function(a,l,u,h,d){var p,m;if(arguments.length<4)return p=o.map(function(v){return ra(a,v,u)}),m=p.join(" "),m.split(p[0]).length===5?p[0]:m;p=(h+"").split(" "),m={},o.forEach(function(v,x){return m[v]=p[x]=p[x]||p[(x-1)/2|0]}),a.init(l,m,d)}});var _L={name:"css",register:WA,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,r,s){var o=this._props,a=e.style,l=i.vars.startAt,u,h,d,p,m,v,x,y,g,S,A,E,b,C,R,I;oE||WA(),this.styles=this.styles||fL(e),I=this.styles.props,this.tween=i;for(x in t)if(x!=="autoRound"&&(h=t[x],!(qr[x]&&eL(x,t,i,r,e,s)))){if(m=typeof h,v=Rv[x],m==="function"&&(h=h.call(i,r,e,s),m=typeof h),m==="string"&&~h.indexOf("random(")&&(h=cp(h)),v)v(this,e,x,h,i)&&(R=1);else if(x.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(x)+"").trim(),h+="",vl.lastIndex=0,vl.test(u)||(y=$i(u),g=$i(h)),g?y!==g&&(u=wl(e,x,u,g)+g):y&&(h+=y),this.add(a,"setProperty",u,h,r,s,0,0,x),o.push(x),I.push(x,0,a[x]);else if(m!=="undefined"){if(l&&x in l?(u=typeof l[x]=="function"?l[x].call(i,r,e,s):l[x],Li(u)&&~u.indexOf("random(")&&(u=cp(u)),$i(u+"")||u==="auto"||(u+=os.units[x]||$i(ra(e,x))||""),(u+"").charAt(1)==="="&&(u=ra(e,x))):u=ra(e,x),p=parseFloat(u),S=m==="string"&&h.charAt(1)==="="&&h.substr(0,2),S&&(h=h.substr(2)),d=parseFloat(h),x in Co&&(x==="autoAlpha"&&(p===1&&ra(e,"visibility")==="hidden"&&d&&(p=0),I.push("visibility",0,a.visibility),rl(this,a,"visibility",p?"inherit":"hidden",d?"inherit":"hidden",!d)),x!=="scale"&&x!=="transform"&&(x=Co[x],~x.indexOf(",")&&(x=x.split(",")[0]))),A=x in Sa,A){if(this.styles.save(x),E||(b=e._gsap,b.renderTransform&&!t.parseTransform||pp(e,t.parseTransform),C=t.smoothOrigin!==!1&&b.smooth,E=this._pt=new zr(this._pt,a,Vn,0,1,b.renderTransform,b,0,-1),E.dep=1),x==="scale")this._pt=new zr(this._pt,b,"scaleY",b.scaleY,(S?Tf(b.scaleY,S+d):d)-b.scaleY||0,HA),this._pt.u=0,o.push("scaleY",x),x+="X";else if(x==="transformOrigin"){I.push(Gr,0,a[Gr]),h=hz(h),b.svg?XA(e,h,0,C,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==b.zOrigin&&rl(this,b,"zOrigin",b.zOrigin,g),rl(this,a,x,bv(u),bv(h)));continue}else if(x==="svgOrigin"){XA(e,h,1,C,0,this);continue}else if(x in mL){gz(this,b,x,p,S?Tf(p,S+h):h);continue}else if(x==="smoothOrigin"){rl(this,b,"smooth",b.smooth,h);continue}else if(x==="force3D"){b[x]=h;continue}else if(x==="transform"){vz(this,h,e);continue}}else x in a||(x=jf(x)||x);if(A||(d||d===0)&&(p||p===0)&&!qk.test(h)&&x in a)y=(u+"").substr((p+"").length),d||(d=0),g=$i(h)||(x in os.units?os.units[x]:y),y!==g&&(p=wl(e,x,u,g)),this._pt=new zr(this._pt,A?b:a,x,p,(S?Tf(p,S+d):d)-p,!A&&(g==="px"||x==="zIndex")&&t.autoRound!==!1?tz:HA),this._pt.u=g||0,y!==g&&g!=="%"&&(this._pt.b=u,this._pt.r=ez);else if(x in a)fz.call(this,e,x,u,S?S+h:h);else if(x in e)this.add(e,x,u||e[x],S?S+h:h,r,s);else if(x!=="parseTransform"){ZM(x,h);continue}A||(x in a?I.push(x,0,a[x]):I.push(x,1,u||e[x])),o.push(x)}}R&&oL(this)},render:function(e,t){if(t.tween._time||!aE())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ra,aliases:Co,getSetter:function(e,t,i){var r=Co[t];return r&&r.indexOf(",")<0&&(t=r),t in Sa&&t!==Gr&&(e._gsap.x||ra(e,"x"))?i&&dR===i?t==="scale"?sz:rz:(dR=i||{})&&(t==="scale"?oz:az):e.style&&!YM(e.style[t])?nz:~t.indexOf("-")?iz:rE(e,t)},core:{_removeProperty:Ku,_getMatrix:uE}};Hr.utils.checkPrefix=jf;Hr.core.getStyleSaver=fL;(function(n,e,t,i){var r=kr(n+","+e+","+t,function(s){Sa[s]=1});kr(e,function(s){os.units[s]="deg",mL[s]=1}),Co[r[13]]=n+","+e,kr(i,function(s){var o=s.split(":");Co[o[1]]=r[o[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");kr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){os.units[n]="px"});Hr.registerPlugin(_L);var fi=Hr.registerPlugin(_L)||Hr;fi.core.Tween;/*! +*/var hR,il,Cf,oE,Mu,dR,aE,qk=function(){return typeof window<"u"},Sa={},fu=180/Math.PI,Rf=Math.PI/180,Ec=Math.atan2,pR=1e8,lE=/([A-Z])/g,$k=/(left|right|width|margin|padding|x)/i,ez=/[\s,\(]\S/,Co={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},HA=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},tz=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)},nz=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)},iz=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},cL=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},fL=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},rz=function(e,t,i){return e.style[t]=i},sz=function(e,t,i){return e.style.setProperty(t,i)},oz=function(e,t,i){return e._gsap[t]=i},az=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},lz=function(e,t,i,r,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},uz=function(e,t,i,r,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},Vn="transform",Gr=Vn+"Origin",cz=function n(e,t){var i=this,r=this.target,s=r.style,o=r._gsap;if(e in Sa&&s){if(this.tfm=this.tfm||{},e!=="transform")e=Co[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return i.tfm[a]=ra(r,a)}):this.tfm[e]=o.x?o[e]:ra(r,e),e===Gr&&(this.tfm.zOrigin=o.zOrigin);else return Co.transform.split(",").forEach(function(a){return n.call(i,a,t)});if(this.props.indexOf(Vn)>=0)return;o.svg&&(this.svgo=r.getAttribute("data-svg-origin"),this.props.push(Gr,t,"")),e=Vn}(s||t)&&this.props.push(e,t,s[e])},hL=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},fz=function(){var e=this.props,t=this.target,i=t.style,r=t._gsap,s,o;for(s=0;s=0?mR[o]:"")+e},WA=function(){qk()&&window.document&&(hR=window,il=hR.document,Cf=il.documentElement,Mu=VA("div")||{style:{}},VA("div"),Vn=jf(Vn),Gr=Vn+"Origin",Mu.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",pL=!!jf("perspective"),aE=Hr.core.reverting,oE=1)},Ax=function n(e){var t=VA("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,r=this.nextSibling,s=this.style.cssText,o;if(Cf.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(r?i.insertBefore(this,r):i.appendChild(this)),Cf.removeChild(t),this.style.cssText=s,o},gR=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},mL=function(e){var t;try{t=e.getBBox()}catch{t=Ax.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Ax||(t=Ax.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+gR(e,["x","cx","x1"])||0,y:+gR(e,["y","cy","y1"])||0,width:0,height:0}:t},gL=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&mL(e))},Qu=function(e,t){if(t){var i=e.style,r;t in Sa&&t!==Gr&&(t=Vn),i.removeProperty?(r=t.substr(0,2),(r==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(r==="--"?t:t.replace(lE,"-$1").toLowerCase())):i.removeAttribute(t)}},rl=function(e,t,i,r,s,o){var a=new zr(e._pt,t,i,0,1,o?fL:cL);return e._pt=a,a.b=r,a.e=s,e._props.push(i),a},vR={deg:1,rad:1,turn:1},hz={grid:1,flex:1},wl=function n(e,t,i,r){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Mu.style,l=$k.test(t),u=e.tagName.toLowerCase()==="svg",h=(u?"client":"offset")+(l?"Width":"Height"),d=100,p=r==="px",m=r==="%",v,x,y,g;if(r===o||!s||vR[r]||vR[o])return s;if(o!=="px"&&!p&&(s=n(e,t,i,"px")),g=e.getCTM&&gL(e),(m||o==="%")&&(Sa[t]||~t.indexOf("adius")))return v=g?e.getBBox()[l?"width":"height"]:e[h],ri(m?s/v*d:s/100*v);if(a[l?"width":"height"]=d+(p?o:r),x=~t.indexOf("adius")||r==="em"&&e.appendChild&&!u?e:e.parentNode,g&&(x=(e.ownerSVGElement||{}).parentNode),(!x||x===il||!x.appendChild)&&(x=il.body),y=x._gsap,y&&m&&y.width&&l&&y.time===$r.time&&!y.uncache)return ri(s/y.width*d);if(m&&(t==="height"||t==="width")){var S=e.style[t];e.style[t]=d+r,v=e[h],S?e.style[t]=S:Qu(e,t)}else(m||o==="%")&&!hz[Io(x,"display")]&&(a.position=Io(e,"position")),x===e&&(a.position="static"),x.appendChild(Mu),v=Mu[h],x.removeChild(Mu),a.position="absolute";return l&&m&&(y=Lu(x),y.time=$r.time,y.width=x[h]),ri(p?v*s/d:v&&s?d/v*s:0)},ra=function(e,t,i,r){var s;return oE||WA(),t in Co&&t!=="transform"&&(t=Co[t],~t.indexOf(",")&&(t=t.split(",")[0])),Sa[t]&&t!=="transform"?(s=pp(e,r),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:bv(Io(e,Gr))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||r||~(s+"").indexOf("calc("))&&(s=Rv[t]&&Rv[t](e,t,i)||Io(e,t)||I2(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?wl(e,t,s,i)+i:s},dz=function(e,t,i,r){if(!i||i==="none"){var s=jf(t,e,1),o=s&&Io(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=Io(e,"borderTopColor"))}var a=new zr(this._pt,e.style,t,0,1,aL),l=0,u=0,h,d,p,m,v,x,y,g,S,A,E,b;if(a.b=i,a.e=r,i+="",r+="",r==="auto"&&(x=e.style[t],e.style[t]=r,r=Io(e,t)||r,x?e.style[t]=x:Qu(e,t)),h=[i,r],Z2(h),i=h[0],r=h[1],p=i.match(hf)||[],b=r.match(hf)||[],b.length){for(;d=hf.exec(r);)y=d[0],S=r.substring(l,d.index),v?v=(v+1)%5:(S.substr(-5)==="rgba("||S.substr(-5)==="hsla(")&&(v=1),y!==(x=p[u++]||"")&&(m=parseFloat(x)||0,E=x.substr((m+"").length),y.charAt(1)==="="&&(y=Tf(m,y)+E),g=parseFloat(y),A=y.substr((g+"").length),l=hf.lastIndex-A.length,A||(A=A||os.units[t]||E,l===r.length&&(r+=A,a.e+=A)),E!==A&&(m=wl(e,t,x,A)||0),a._pt={_next:a._pt,p:S||u===1?S:",",s:m,c:g-m,m:v&&v<4||t==="zIndex"?Math.round:0});a.c=l-1;)a=s[u],Sa[a]&&(l=1,a=a==="transformOrigin"?Gr:Vn),Qu(i,a);l&&(Qu(i,Vn),o&&(o.svg&&i.removeAttribute("transform"),pp(i,1),o.uncache=1,hL(r)))}},Rv={clearProps:function(e,t,i,r,s){if(s.data!=="isFromStart"){var o=e._pt=new zr(e._pt,t,i,0,0,mz);return o.u=r,o.pr=-10,o.tween=s,e._props.push(i),1}}},dp=[1,0,0,1,0,0],vL={},_L=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},yR=function(e){var t=Io(e,Vn);return _L(t)?dp:t.substr(7).match(w2).map(ri)},uE=function(e,t){var i=e._gsap||Lu(e),r=e.style,s=yR(e),o,a,l,u;return i.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?dp:s):(s===dp&&!e.offsetParent&&e!==Cf&&!i.svg&&(l=r.display,r.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,Cf.appendChild(e)),s=yR(e),l?r.display=l:Qu(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):Cf.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},XA=function(e,t,i,r,s,o){var a=e._gsap,l=s||uE(e,!0),u=a.xOrigin||0,h=a.yOrigin||0,d=a.xOffset||0,p=a.yOffset||0,m=l[0],v=l[1],x=l[2],y=l[3],g=l[4],S=l[5],A=t.split(" "),E=parseFloat(A[0])||0,b=parseFloat(A[1])||0,C,R,I,O;i?l!==dp&&(R=m*y-v*x)&&(I=E*(y/R)+b*(-x/R)+(x*S-y*g)/R,O=E*(-v/R)+b*(m/R)-(m*S-v*g)/R,E=I,b=O):(C=mL(e),E=C.x+(~A[0].indexOf("%")?E/100*C.width:E),b=C.y+(~(A[1]||A[0]).indexOf("%")?b/100*C.height:b)),r||r!==!1&&a.smooth?(g=E-u,S=b-h,a.xOffset=d+(g*m+S*x)-g,a.yOffset=p+(g*v+S*y)-S):a.xOffset=a.yOffset=0,a.xOrigin=E,a.yOrigin=b,a.smooth=!!r,a.origin=t,a.originIsAbsolute=!!i,e.style[Gr]="0px 0px",o&&(rl(o,a,"xOrigin",u,E),rl(o,a,"yOrigin",h,b),rl(o,a,"xOffset",d,a.xOffset),rl(o,a,"yOffset",p,a.yOffset)),e.setAttribute("data-svg-origin",E+" "+b)},pp=function(e,t){var i=e._gsap||new tL(e);if("x"in i&&!t&&!i.uncache)return i;var r=e.style,s=i.scaleX<0,o="px",a="deg",l=getComputedStyle(e),u=Io(e,Gr)||"0",h,d,p,m,v,x,y,g,S,A,E,b,C,R,I,O,T,L,K,se,W,te,$,oe,F,V,N,ee,fe,Be,ae,xe;return h=d=p=x=y=g=S=A=E=0,m=v=1,i.svg=!!(e.getCTM&&gL(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(r[Vn]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Vn]!=="none"?l[Vn]:"")),r.scale=r.rotate=r.translate="none"),R=uE(e,i.svg),i.svg&&(i.uncache?(F=e.getBBox(),u=i.xOrigin-F.x+"px "+(i.yOrigin-F.y)+"px",oe=""):oe=!t&&e.getAttribute("data-svg-origin"),XA(e,oe||u,!!oe||i.originIsAbsolute,i.smooth!==!1,R)),b=i.xOrigin||0,C=i.yOrigin||0,R!==dp&&(L=R[0],K=R[1],se=R[2],W=R[3],h=te=R[4],d=$=R[5],R.length===6?(m=Math.sqrt(L*L+K*K),v=Math.sqrt(W*W+se*se),x=L||K?Ec(K,L)*fu:0,S=se||W?Ec(se,W)*fu+x:0,S&&(v*=Math.abs(Math.cos(S*Rf))),i.svg&&(h-=b-(b*L+C*se),d-=C-(b*K+C*W))):(xe=R[6],Be=R[7],N=R[8],ee=R[9],fe=R[10],ae=R[11],h=R[12],d=R[13],p=R[14],I=Ec(xe,fe),y=I*fu,I&&(O=Math.cos(-I),T=Math.sin(-I),oe=te*O+N*T,F=$*O+ee*T,V=xe*O+fe*T,N=te*-T+N*O,ee=$*-T+ee*O,fe=xe*-T+fe*O,ae=Be*-T+ae*O,te=oe,$=F,xe=V),I=Ec(-se,fe),g=I*fu,I&&(O=Math.cos(-I),T=Math.sin(-I),oe=L*O-N*T,F=K*O-ee*T,V=se*O-fe*T,ae=W*T+ae*O,L=oe,K=F,se=V),I=Ec(K,L),x=I*fu,I&&(O=Math.cos(I),T=Math.sin(I),oe=L*O+K*T,F=te*O+$*T,K=K*O-L*T,$=$*O-te*T,L=oe,te=F),y&&Math.abs(y)+Math.abs(x)>359.9&&(y=x=0,g=180-g),m=ri(Math.sqrt(L*L+K*K+se*se)),v=ri(Math.sqrt($*$+xe*xe)),I=Ec(te,$),S=Math.abs(I)>2e-4?I*fu:0,E=ae?1/(ae<0?-ae:ae):0),i.svg&&(oe=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!_L(Io(e,Vn)),oe&&e.setAttribute("transform",oe))),Math.abs(S)>90&&Math.abs(S)<270&&(s?(m*=-1,S+=x<=0?180:-180,x+=x<=0?180:-180):(v*=-1,S+=S<=0?180:-180)),t=t||i.uncache,i.x=h-((i.xPercent=h&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+o,i.y=d-((i.yPercent=d&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+o,i.z=p+o,i.scaleX=ri(m),i.scaleY=ri(v),i.rotation=ri(x)+a,i.rotationX=ri(y)+a,i.rotationY=ri(g)+a,i.skewX=S+a,i.skewY=A+a,i.transformPerspective=E+o,(i.zOrigin=parseFloat(u.split(" ")[2])||!t&&i.zOrigin||0)&&(r[Gr]=bv(u)),i.xOffset=i.yOffset=0,i.force3D=os.force3D,i.renderTransform=i.svg?vz:pL?yL:gz,i.uncache=0,i},bv=function(e){return(e=e.split(" "))[0]+" "+e[1]},Sx=function(e,t,i){var r=$i(t);return ri(parseFloat(t)+parseFloat(wl(e,"x",i+"px",r)))+r},gz=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,yL(e,t)},Yl="0deg",Vh="0px",Kl=") ",yL=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.z,u=i.rotation,h=i.rotationY,d=i.rotationX,p=i.skewX,m=i.skewY,v=i.scaleX,x=i.scaleY,y=i.transformPerspective,g=i.force3D,S=i.target,A=i.zOrigin,E="",b=g==="auto"&&e&&e!==1||g===!0;if(A&&(d!==Yl||h!==Yl)){var C=parseFloat(h)*Rf,R=Math.sin(C),I=Math.cos(C),O;C=parseFloat(d)*Rf,O=Math.cos(C),o=Sx(S,o,R*O*-A),a=Sx(S,a,-Math.sin(C)*-A),l=Sx(S,l,I*O*-A+A)}y!==Vh&&(E+="perspective("+y+Kl),(r||s)&&(E+="translate("+r+"%, "+s+"%) "),(b||o!==Vh||a!==Vh||l!==Vh)&&(E+=l!==Vh||b?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+Kl),u!==Yl&&(E+="rotate("+u+Kl),h!==Yl&&(E+="rotateY("+h+Kl),d!==Yl&&(E+="rotateX("+d+Kl),(p!==Yl||m!==Yl)&&(E+="skew("+p+", "+m+Kl),(v!==1||x!==1)&&(E+="scale("+v+", "+x+Kl),S.style[Vn]=E||"translate(0, 0)"},vz=function(e,t){var i=t||this,r=i.xPercent,s=i.yPercent,o=i.x,a=i.y,l=i.rotation,u=i.skewX,h=i.skewY,d=i.scaleX,p=i.scaleY,m=i.target,v=i.xOrigin,x=i.yOrigin,y=i.xOffset,g=i.yOffset,S=i.forceCSS,A=parseFloat(o),E=parseFloat(a),b,C,R,I,O;l=parseFloat(l),u=parseFloat(u),h=parseFloat(h),h&&(h=parseFloat(h),u+=h,l+=h),l||u?(l*=Rf,u*=Rf,b=Math.cos(l)*d,C=Math.sin(l)*d,R=Math.sin(l-u)*-p,I=Math.cos(l-u)*p,u&&(h*=Rf,O=Math.tan(u-h),O=Math.sqrt(1+O*O),R*=O,I*=O,h&&(O=Math.tan(h),O=Math.sqrt(1+O*O),b*=O,C*=O)),b=ri(b),C=ri(C),R=ri(R),I=ri(I)):(b=d,I=p,C=R=0),(A&&!~(o+"").indexOf("px")||E&&!~(a+"").indexOf("px"))&&(A=wl(m,"x",o,"px"),E=wl(m,"y",a,"px")),(v||x||y||g)&&(A=ri(A+v-(v*b+x*R)+y),E=ri(E+x-(v*C+x*I)+g)),(r||s)&&(O=m.getBBox(),A=ri(A+r/100*O.width),E=ri(E+s/100*O.height)),O="matrix("+b+","+C+","+R+","+I+","+A+","+E+")",m.setAttribute("transform",O),S&&(m.style[Vn]=O)},_z=function(e,t,i,r,s){var o=360,a=Li(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?fu:1),u=l-r,h=r+u+"deg",d,p;return a&&(d=s.split("_")[1],d==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),d==="cw"&&u<0?u=(u+o*pR)%o-~~(u/o)*o:d==="ccw"&&u>0&&(u=(u-o*pR)%o-~~(u/o)*o)),e._pt=p=new zr(e._pt,t,i,r,u,tz),p.e=h,p.u="deg",e._props.push(i),p},xR=function(e,t){for(var i in t)e[i]=t[i];return e},yz=function(e,t,i){var r=xR({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,l,u,h,d,p,m,v;r.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),o[Vn]=t,a=pp(i,1),Qu(i,Vn),i.setAttribute("transform",u)):(u=getComputedStyle(i)[Vn],o[Vn]=t,a=pp(i,1),o[Vn]=u);for(l in Sa)u=r[l],h=a[l],u!==h&&s.indexOf(l)<0&&(m=$i(u),v=$i(h),d=m!==v?wl(i,l,u,v):parseFloat(u),p=parseFloat(h),e._pt=new zr(e._pt,a,l,d,p-d,HA),e._pt.u=v||0,e._props.push(l));xR(a,r)};kr("padding,margin,Width,Radius",function(n,e){var t="Top",i="Right",r="Bottom",s="Left",o=(e<3?[t,i,r,s]:[t+s,t+i,r+i,r+s]).map(function(a){return e<2?n+a:"border"+a+n});Rv[e>1?"border"+n:n]=function(a,l,u,h,d){var p,m;if(arguments.length<4)return p=o.map(function(v){return ra(a,v,u)}),m=p.join(" "),m.split(p[0]).length===5?p[0]:m;p=(h+"").split(" "),m={},o.forEach(function(v,x){return m[v]=p[x]=p[x]||p[(x-1)/2|0]}),a.init(l,m,d)}});var xL={name:"css",register:WA,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,r,s){var o=this._props,a=e.style,l=i.vars.startAt,u,h,d,p,m,v,x,y,g,S,A,E,b,C,R,I;oE||WA(),this.styles=this.styles||dL(e),I=this.styles.props,this.tween=i;for(x in t)if(x!=="autoRound"&&(h=t[x],!(qr[x]&&nL(x,t,i,r,e,s)))){if(m=typeof h,v=Rv[x],m==="function"&&(h=h.call(i,r,e,s),m=typeof h),m==="string"&&~h.indexOf("random(")&&(h=cp(h)),v)v(this,e,x,h,i)&&(R=1);else if(x.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(x)+"").trim(),h+="",vl.lastIndex=0,vl.test(u)||(y=$i(u),g=$i(h)),g?y!==g&&(u=wl(e,x,u,g)+g):y&&(h+=y),this.add(a,"setProperty",u,h,r,s,0,0,x),o.push(x),I.push(x,0,a[x]);else if(m!=="undefined"){if(l&&x in l?(u=typeof l[x]=="function"?l[x].call(i,r,e,s):l[x],Li(u)&&~u.indexOf("random(")&&(u=cp(u)),$i(u+"")||u==="auto"||(u+=os.units[x]||$i(ra(e,x))||""),(u+"").charAt(1)==="="&&(u=ra(e,x))):u=ra(e,x),p=parseFloat(u),S=m==="string"&&h.charAt(1)==="="&&h.substr(0,2),S&&(h=h.substr(2)),d=parseFloat(h),x in Co&&(x==="autoAlpha"&&(p===1&&ra(e,"visibility")==="hidden"&&d&&(p=0),I.push("visibility",0,a.visibility),rl(this,a,"visibility",p?"inherit":"hidden",d?"inherit":"hidden",!d)),x!=="scale"&&x!=="transform"&&(x=Co[x],~x.indexOf(",")&&(x=x.split(",")[0]))),A=x in Sa,A){if(this.styles.save(x),E||(b=e._gsap,b.renderTransform&&!t.parseTransform||pp(e,t.parseTransform),C=t.smoothOrigin!==!1&&b.smooth,E=this._pt=new zr(this._pt,a,Vn,0,1,b.renderTransform,b,0,-1),E.dep=1),x==="scale")this._pt=new zr(this._pt,b,"scaleY",b.scaleY,(S?Tf(b.scaleY,S+d):d)-b.scaleY||0,HA),this._pt.u=0,o.push("scaleY",x),x+="X";else if(x==="transformOrigin"){I.push(Gr,0,a[Gr]),h=pz(h),b.svg?XA(e,h,0,C,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==b.zOrigin&&rl(this,b,"zOrigin",b.zOrigin,g),rl(this,a,x,bv(u),bv(h)));continue}else if(x==="svgOrigin"){XA(e,h,1,C,0,this);continue}else if(x in vL){_z(this,b,x,p,S?Tf(p,S+h):h);continue}else if(x==="smoothOrigin"){rl(this,b,"smooth",b.smooth,h);continue}else if(x==="force3D"){b[x]=h;continue}else if(x==="transform"){yz(this,h,e);continue}}else x in a||(x=jf(x)||x);if(A||(d||d===0)&&(p||p===0)&&!ez.test(h)&&x in a)y=(u+"").substr((p+"").length),d||(d=0),g=$i(h)||(x in os.units?os.units[x]:y),y!==g&&(p=wl(e,x,u,g)),this._pt=new zr(this._pt,A?b:a,x,p,(S?Tf(p,S+d):d)-p,!A&&(g==="px"||x==="zIndex")&&t.autoRound!==!1?iz:HA),this._pt.u=g||0,y!==g&&g!=="%"&&(this._pt.b=u,this._pt.r=nz);else if(x in a)dz.call(this,e,x,u,S?S+h:h);else if(x in e)this.add(e,x,u||e[x],S?S+h:h,r,s);else if(x!=="parseTransform"){ZM(x,h);continue}A||(x in a?I.push(x,0,a[x]):I.push(x,1,u||e[x])),o.push(x)}}R&&lL(this)},render:function(e,t){if(t.tween._time||!aE())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ra,aliases:Co,getSetter:function(e,t,i){var r=Co[t];return r&&r.indexOf(",")<0&&(t=r),t in Sa&&t!==Gr&&(e._gsap.x||ra(e,"x"))?i&&dR===i?t==="scale"?az:oz:(dR=i||{})&&(t==="scale"?lz:uz):e.style&&!YM(e.style[t])?rz:~t.indexOf("-")?sz:rE(e,t)},core:{_removeProperty:Qu,_getMatrix:uE}};Hr.utils.checkPrefix=jf;Hr.core.getStyleSaver=dL;(function(n,e,t,i){var r=kr(n+","+e+","+t,function(s){Sa[s]=1});kr(e,function(s){os.units[s]="deg",vL[s]=1}),Co[r[13]]=n+","+e,kr(i,function(s){var o=s.split(":");Co[o[1]]=r[o[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");kr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){os.units[n]="px"});Hr.registerPlugin(xL);var Zn=Hr.registerPlugin(xL)||Hr;Zn.core.Tween;/*! * @gsap/react 2.1.0 * https://gsap.com * @@ -61,7 +61,7 @@ Error generating stack: `+s.message+` * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/let AR=typeof window<"u"?ne.useLayoutEffect:ne.useEffect,SR=n=>n&&!Array.isArray(n)&&typeof n=="object",dg=[],_z={},yL=fi;const sc=(n,e=dg)=>{let t=_z;SR(n)?(t=n,n=null,e="dependencies"in t?t.dependencies:dg):SR(e)&&(t=e,e="dependencies"in t?t.dependencies:dg);let{scope:i,revertOnUpdate:r}=t,[s,o]=ne.useState(!1);n&&typeof n!="function"&&console.warn("First parameter must be a function or config object");const a=yL.context(()=>{},i),l=d=>a.add(null,d),u=()=>a.revert(),h=e&&e.length&&!r;return AR(()=>{if(n&&a.add(n,i),!h||!s)return u},e),h&&AR(()=>(o(!0),u),dg),{context:a,contextSafe:l}};sc.register=n=>{yL=n};sc.headless=!0;const yz="/assets/videos/highlight-first.mp4",xz="/assets/videos/hightlight-third.mp4",Az="/assets/videos/hightlight-sec.mp4",Sz="/assets/videos/hightlight-fourth.mp4",Mz="/assets/videos/explore.mp4",Ez="/assets/videos/frame.mp4",wz="/assets/images/apple.svg",Tz="/assets/images/search.svg",Cz="/assets/images/bag.svg",Rz="/assets/images/watch.svg",bz="/assets/images/right.svg",Pz="/assets/images/replay.svg",Bz="/assets/images/play.svg",Iz="/assets/images/pause.svg",Lz="/assets/images/yellow.jpg",Dz="/assets/images/blue.jpg",Nz="/assets/images/white.jpg",Fz="/assets/images/black.jpg",Oz="/assets/images/explore1.jpg",Uz="/assets/images/explore2.jpg",kz="/assets/images/chip.jpeg",zz="/assets/images/frame.png",Gz=yz,Hz=xz,Vz=Az,Wz=Sz,Xz=Mz,Jz=Ez,jz=wz,Yz=Tz,Kz=Cz,Qz=Rz,Zz=bz,qz=Pz,$z=Bz,eG=Iz,xL=Lz,tG=Dz,nG=Nz,iG=Fz,rG=Oz,sG=Uz,oG=kz,aG=zz;function MR(n,e){for(var t=0;tn&&!Array.isArray(n)&&typeof n=="object",dg=[],xz={},AL=Zn;const Nl=(n,e=dg)=>{let t=xz;SR(n)?(t=n,n=null,e="dependencies"in t?t.dependencies:dg):SR(e)&&(t=e,e="dependencies"in t?t.dependencies:dg);let{scope:i,revertOnUpdate:r}=t,[s,o]=ne.useState(!1);n&&typeof n!="function"&&console.warn("First parameter must be a function or config object");const a=AL.context(()=>{},i),l=d=>a.add(null,d),u=()=>a.revert(),h=e&&e.length&&!r;return AR(()=>{if(n&&a.add(n,i),!h||!s)return u},e),h&&AR(()=>(o(!0),u),dg),{context:a,contextSafe:l}};Nl.register=n=>{AL=n};Nl.headless=!0;const Az="/assets/videos/hero.mp4",Sz="/assets/videos/smallHero.mp4",Mz="/assets/videos/highlight-first.mp4",Ez="/assets/videos/hightlight-third.mp4",wz="/assets/videos/hightlight-sec.mp4",Tz="/assets/videos/hightlight-fourth.mp4",Cz="/assets/videos/explore.mp4",Rz="/assets/videos/frame.mp4",bz="/assets/images/apple.svg",Pz="/assets/images/search.svg",Bz="/assets/images/bag.svg",Iz="/assets/images/watch.svg",Lz="/assets/images/right.svg",Dz="/assets/images/replay.svg",Nz="/assets/images/play.svg",Fz="/assets/images/pause.svg",Oz="/assets/images/yellow.jpg",Uz="/assets/images/blue.jpg",kz="/assets/images/white.jpg",zz="/assets/images/black.jpg",Gz="/assets/images/explore1.jpg",Hz="/assets/images/explore2.jpg",Vz="/assets/images/chip.jpeg",Wz="/assets/images/frame.png",MR=Az,ER=Sz,Xz=Mz,Jz=Ez,jz=wz,Yz=Tz,Kz=Cz,Qz=Rz,Zz=bz,qz=Pz,$z=Bz,eG=Iz,tG=Lz,nG=Dz,iG=Nz,rG=Fz,SL=Oz,sG=Uz,oG=kz,aG=zz,lG=Gz,uG=Hz,cG=Vz,fG=Wz,hG=()=>{const[n,e]=ne.useState(window.innerWidth<760?ER:MR),t=()=>{window.innerWidth<760?e(ER):e(MR)};return ne.useEffect(()=>(window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)})),Nl(()=>{Zn.to("#hero",{opacity:1,delay:2}),Zn.to("#cta",{opacity:1,y:-50,delay:2})},[]),ue.jsxs("section",{className:"w-full nav-height bg-black relative",children:[ue.jsxs("div",{className:"h-5/6 w-full flex-center flex-col ",children:[ue.jsx("p",{id:"hero",className:"hero-title",children:"iPhone 15 Pro"}),ue.jsx("div",{className:"md:w-10/12 w-9/12",children:ue.jsx("video",{className:"pointer-events-auto",autoPlay:!0,muted:!0,playsInline:!0,children:ue.jsx("source",{src:n,type:"video/mp4"})},n)})]}),ue.jsxs("div",{id:"cta",className:"flex flex-col items-center opacity-0 translate-y-20",children:[ue.jsx("a",{href:"#highlights",className:"btn",children:"Buy"}),ue.jsx("p",{className:"font-normal text-xl",children:"From $199/month or $999"})]})]})};function wR(n,e){for(var t=0;tl?(s=r,r=v,a=o,o=y):i?r+=v:r=s+(v-s)/(y-a)*(o-a)},d=function(){s=r=i?0:r,a=o=0},p=function(v){var x=a,y=s,g=Id();return(v||v===0)&&v!==r&&h(v),o===a||g-a>u?0:(r+(i?y:-y))/((i?g:o)-x)*1e3};return{update:h,reset:d,getVelocity:p}},Wh=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},ER=function(e){var t=Math.max.apply(Math,e),i=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(i)?t:i},TL=function(){Bd=Oi.core.globals().ScrollTrigger,Bd&&Bd.core&&uG()},CL=function(e){return Oi=e||EL(),!U0&&Oi&&typeof document<"u"&&document.body&&(es=window,sl=document,ol=sl.documentElement,bf=sl.body,SL=[es,sl,ol,bf],Oi.utils.clamp,ML=Oi.core.context||function(){},fu="onpointerenter"in bf?"pointer":"mouse",AL=oi.isTouch=es.matchMedia&&es.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in es||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,qs=oi.eventTypes=("ontouchstart"in ol?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in ol?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return wL=0},500),TL(),U0=1),U0};xr.op=yi;Qt.cache=0;var oi=function(){function n(t){this.init(t)}var e=n.prototype;return e.init=function(i){U0||CL(Oi)||console.warn("Please gsap.registerPlugin(Observer)"),Bd||TL();var r=i.tolerance,s=i.dragMinimum,o=i.type,a=i.target,l=i.lineHeight,u=i.debounce,h=i.preventDefault,d=i.onStop,p=i.onStopDelay,m=i.ignore,v=i.wheelSpeed,x=i.event,y=i.onDragStart,g=i.onDragEnd,S=i.onDrag,A=i.onPress,E=i.onRelease,b=i.onRight,C=i.onLeft,R=i.onUp,I=i.onDown,O=i.onChangeX,T=i.onChangeY,L=i.onChange,K=i.onToggleX,se=i.onToggleY,W=i.onHover,te=i.onHoverEnd,$=i.onMove,oe=i.ignoreCheck,F=i.isNormalizer,V=i.onGestureStart,N=i.onGestureEnd,ee=i.onWheel,ce=i.onEnable,Be=i.onDisable,ae=i.onClick,xe=i.scrollSpeed,Se=i.capture,ke=i.allowClicks,We=i.lockAxis,Qe=i.onLockAxis;this.target=a=Br(a)||ol,this.vars=i,m&&(m=Oi.utils.toArray(m)),r=r||1e-9,s=s||0,v=v||1,xe=xe||1,o=o||"wheel,touch,pointer",u=u!==!1,l||(l=parseFloat(es.getComputedStyle(bf).lineHeight)||22);var lt,Ne,Y,Ae,ge,Fe,Ce,re=this,Xe=0,et=0,Et=i.passive||!h,H=Tl(a,xr),U=Tl(a,yi),ve=H(),Me=U(),be=~o.indexOf("touch")&&!~o.indexOf("pointer")&&qs[0]==="pointerdown",Ie=Ld(a),tt=a.ownerDocument||sl,ct=[0,0,0],Ge=[0,0,0],Ke=0,Rt=function(){return Ke=Id()},Oe=function(ot,dt){return(re.event=ot)&&m&&~m.indexOf(ot.target)||dt&&be&&ot.pointerType!=="touch"||oe&&oe(ot,dt)},qt=function(){re._vx.reset(),re._vy.reset(),Ne.pause(),d&&d(re)},pt=function(){var ot=re.deltaX=ER(ct),dt=re.deltaY=ER(Ge),je=Math.abs(ot)>=r,Tt=Math.abs(dt)>=r;L&&(je||Tt)&&L(re,ot,dt,ct,Ge),je&&(b&&re.deltaX>0&&b(re),C&&re.deltaX<0&&C(re),O&&O(re),K&&re.deltaX<0!=Xe<0&&K(re),Xe=re.deltaX,ct[0]=ct[1]=ct[2]=0),Tt&&(I&&re.deltaY>0&&I(re),R&&re.deltaY<0&&R(re),T&&T(re),se&&re.deltaY<0!=et<0&&se(re),et=re.deltaY,Ge[0]=Ge[1]=Ge[2]=0),(Ae||Y)&&($&&$(re),Y&&(S(re),Y=!1),Ae=!1),Fe&&!(Fe=!1)&&Qe&&Qe(re),ge&&(ee(re),ge=!1),lt=0},ht=function(ot,dt,je){ct[je]+=ot,Ge[je]+=dt,re._vx.update(ot),re._vy.update(dt),u?lt||(lt=requestAnimationFrame(pt)):pt()},Z=function(ot,dt){We&&!Ce&&(re.axis=Ce=Math.abs(ot)>Math.abs(dt)?"x":"y",Fe=!0),Ce!=="y"&&(ct[2]+=ot,re._vx.update(ot,!0)),Ce!=="x"&&(Ge[2]+=dt,re._vy.update(dt,!0)),u?lt||(lt=requestAnimationFrame(pt)):pt()},de=function(ot){if(!Oe(ot,1)){ot=Wh(ot,h);var dt=ot.clientX,je=ot.clientY,Tt=dt-re.x,xt=je-re.y,It=re.isDragging;re.x=dt,re.y=je,(It||Math.abs(re.startX-dt)>=s||Math.abs(re.startY-je)>=s)&&(S&&(Y=!0),It||(re.isDragging=!0),Z(Tt,xt),It||y&&y(re))}},Ue=re.onPress=function(ut){Oe(ut,1)||ut&&ut.button||(re.axis=Ce=null,Ne.pause(),re.isPressed=!0,ut=Wh(ut),Xe=et=0,re.startX=re.x=ut.clientX,re.startY=re.y=ut.clientY,re._vx.reset(),re._vy.reset(),dr(F?a:tt,qs[1],de,Et,!0),re.deltaX=re.deltaY=0,A&&A(re))},Le=re.onRelease=function(ut){if(!Oe(ut,1)){fr(F?a:tt,qs[1],de,!0);var ot=!isNaN(re.y-re.startY),dt=re.isDragging,je=dt&&(Math.abs(re.x-re.startX)>3||Math.abs(re.y-re.startY)>3),Tt=Wh(ut);!je&&ot&&(re._vx.reset(),re._vy.reset(),h&&ke&&Oi.delayedCall(.08,function(){if(Id()-Ke>300&&!ut.defaultPrevented){if(ut.target.click)ut.target.click();else if(tt.createEvent){var xt=tt.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!0,es,1,Tt.screenX,Tt.screenY,Tt.clientX,Tt.clientY,!1,!1,!1,!1,0,null),ut.target.dispatchEvent(xt)}}})),re.isDragging=re.isGesturing=re.isPressed=!1,d&&dt&&!F&&Ne.restart(!0),g&&dt&&g(re),E&&E(re,je)}},Pe=function(ot){return ot.touches&&ot.touches.length>1&&(re.isGesturing=!0)&&V(ot,re.isDragging)},ie=function(){return(re.isGesturing=!1)||N(re)},He=function(ot){if(!Oe(ot)){var dt=H(),je=U();ht((dt-ve)*xe,(je-Me)*xe,1),ve=dt,Me=je,d&&Ne.restart(!0)}},pe=function(ot){if(!Oe(ot)){ot=Wh(ot,h),ee&&(ge=!0);var dt=(ot.deltaMode===1?l:ot.deltaMode===2?es.innerHeight:1)*v;ht(ot.deltaX*dt,ot.deltaY*dt,0),d&&!F&&Ne.restart(!0)}},Ve=function(ot){if(!Oe(ot)){var dt=ot.clientX,je=ot.clientY,Tt=dt-re.x,xt=je-re.y;re.x=dt,re.y=je,Ae=!0,d&&Ne.restart(!0),(Tt||xt)&&Z(Tt,xt)}},Je=function(ot){re.event=ot,W(re)},Mt=function(ot){re.event=ot,te(re)},Ot=function(ot){return Oe(ot)||Wh(ot,h)&&ae(re)};Ne=re._dc=Oi.delayedCall(p||.25,qt).pause(),re.deltaX=re.deltaY=0,re._vx=YA(0,50,!0),re._vy=YA(0,50,!0),re.scrollX=H,re.scrollY=U,re.isDragging=re.isGesturing=re.isPressed=!1,ML(this),re.enable=function(ut){return re.isEnabled||(dr(Ie?tt:a,"scroll",jA),o.indexOf("scroll")>=0&&dr(Ie?tt:a,"scroll",He,Et,Se),o.indexOf("wheel")>=0&&dr(a,"wheel",pe,Et,Se),(o.indexOf("touch")>=0&&AL||o.indexOf("pointer")>=0)&&(dr(a,qs[0],Ue,Et,Se),dr(tt,qs[2],Le),dr(tt,qs[3],Le),ke&&dr(a,"click",Rt,!0,!0),ae&&dr(a,"click",Ot),V&&dr(tt,"gesturestart",Pe),N&&dr(tt,"gestureend",ie),W&&dr(a,fu+"enter",Je),te&&dr(a,fu+"leave",Mt),$&&dr(a,fu+"move",Ve)),re.isEnabled=!0,ut&&ut.type&&Ue(ut),ce&&ce(re)),re},re.disable=function(){re.isEnabled&&(pf.filter(function(ut){return ut!==re&&Ld(ut.target)}).length||fr(Ie?tt:a,"scroll",jA),re.isPressed&&(re._vx.reset(),re._vy.reset(),fr(F?a:tt,qs[1],de,!0)),fr(Ie?tt:a,"scroll",He,Se),fr(a,"wheel",pe,Se),fr(a,qs[0],Ue,Se),fr(tt,qs[2],Le),fr(tt,qs[3],Le),fr(a,"click",Rt,!0),fr(a,"click",Ot),fr(tt,"gesturestart",Pe),fr(tt,"gestureend",ie),fr(a,fu+"enter",Je),fr(a,fu+"leave",Mt),fr(a,fu+"move",Ve),re.isEnabled=re.isPressed=re.isDragging=!1,Be&&Be(re))},re.kill=re.revert=function(){re.disable();var ut=pf.indexOf(re);ut>=0&&pf.splice(ut,1),fa===re&&(fa=0)},pf.push(re),F&&Ld(a)&&(fa=re),re.enable(x)},lG(n,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),n}();oi.version="3.12.5";oi.create=function(n){return new oi(n)};oi.register=CL;oi.getAll=function(){return pf.slice()};oi.getById=function(n){return pf.filter(function(e){return e.vars.id===n})[0]};EL()&&Oi.registerPlugin(oi);/*! +*/var Oi,U0,es,sl,ol,bf,ML,hu,Bd,EL,fa,qs,wL,TL=function(){return Oi||typeof window<"u"&&(Oi=window.gsap)&&Oi.registerPlugin&&Oi},CL=1,pf=[],Qt=[],Lo=[],Id=Date.now,JA=function(e,t){return t},pG=function(){var e=Bd.core,t=e.bridge||{},i=e._scrollers,r=e._proxies;i.push.apply(i,Qt),r.push.apply(r,Lo),Qt=i,Lo=r,JA=function(o,a){return t[o](a)}},_l=function(e,t){return~Lo.indexOf(e)&&Lo[Lo.indexOf(e)+1][t]},Ld=function(e){return!!~EL.indexOf(e)},dr=function(e,t,i,r,s){return e.addEventListener(t,i,{passive:r!==!1,capture:!!s})},fr=function(e,t,i,r){return e.removeEventListener(t,i,!!r)},pg="scrollLeft",mg="scrollTop",jA=function(){return fa&&fa.isPressed||Qt.cache++},Pv=function(e,t){var i=function r(s){if(s||s===0){CL&&(es.history.scrollRestoration="manual");var o=fa&&fa.isPressed;s=r.v=Math.round(s)||(fa&&fa.iOS?1:0),e(s),r.cacheID=Qt.cache,o&&JA("ss",s)}else(t||Qt.cache!==r.cacheID||JA("ref"))&&(r.cacheID=Qt.cache,r.v=e());return r.v+r.offset};return i.offset=0,e&&i},xr={s:pg,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Pv(function(n){return arguments.length?es.scrollTo(n,yi.sc()):es.pageXOffset||sl[pg]||ol[pg]||bf[pg]||0})},yi={s:mg,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:xr,sc:Pv(function(n){return arguments.length?es.scrollTo(xr.sc(),n):es.pageYOffset||sl[mg]||ol[mg]||bf[mg]||0})},Br=function(e,t){return(t&&t._ctx&&t._ctx.selector||Oi.utils.toArray)(e)[0]||(typeof e=="string"&&Oi.config().nullTargetWarn!==!1?console.warn("Element not found:",e):null)},Tl=function(e,t){var i=t.s,r=t.sc;Ld(e)&&(e=sl.scrollingElement||ol);var s=Qt.indexOf(e),o=r===yi.sc?1:2;!~s&&(s=Qt.push(e)-1),Qt[s+o]||dr(e,"scroll",jA);var a=Qt[s+o],l=a||(Qt[s+o]=Pv(_l(e,i),!0)||(Ld(e)?r:Pv(function(u){return arguments.length?e[i]=u:e[i]})));return l.target=e,a||(l.smooth=Oi.getProperty(e,"scrollBehavior")==="smooth"),l},YA=function(e,t,i){var r=e,s=e,o=Id(),a=o,l=t||50,u=Math.max(500,l*3),h=function(v,x){var y=Id();x||y-o>l?(s=r,r=v,a=o,o=y):i?r+=v:r=s+(v-s)/(y-a)*(o-a)},d=function(){s=r=i?0:r,a=o=0},p=function(v){var x=a,y=s,g=Id();return(v||v===0)&&v!==r&&h(v),o===a||g-a>u?0:(r+(i?y:-y))/((i?g:o)-x)*1e3};return{update:h,reset:d,getVelocity:p}},Wh=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},TR=function(e){var t=Math.max.apply(Math,e),i=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(i)?t:i},RL=function(){Bd=Oi.core.globals().ScrollTrigger,Bd&&Bd.core&&pG()},bL=function(e){return Oi=e||TL(),!U0&&Oi&&typeof document<"u"&&document.body&&(es=window,sl=document,ol=sl.documentElement,bf=sl.body,EL=[es,sl,ol,bf],Oi.utils.clamp,wL=Oi.core.context||function(){},hu="onpointerenter"in bf?"pointer":"mouse",ML=ai.isTouch=es.matchMedia&&es.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in es||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,qs=ai.eventTypes=("ontouchstart"in ol?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in ol?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return CL=0},500),RL(),U0=1),U0};xr.op=yi;Qt.cache=0;var ai=function(){function n(t){this.init(t)}var e=n.prototype;return e.init=function(i){U0||bL(Oi)||console.warn("Please gsap.registerPlugin(Observer)"),Bd||RL();var r=i.tolerance,s=i.dragMinimum,o=i.type,a=i.target,l=i.lineHeight,u=i.debounce,h=i.preventDefault,d=i.onStop,p=i.onStopDelay,m=i.ignore,v=i.wheelSpeed,x=i.event,y=i.onDragStart,g=i.onDragEnd,S=i.onDrag,A=i.onPress,E=i.onRelease,b=i.onRight,C=i.onLeft,R=i.onUp,I=i.onDown,O=i.onChangeX,T=i.onChangeY,L=i.onChange,K=i.onToggleX,se=i.onToggleY,W=i.onHover,te=i.onHoverEnd,$=i.onMove,oe=i.ignoreCheck,F=i.isNormalizer,V=i.onGestureStart,N=i.onGestureEnd,ee=i.onWheel,fe=i.onEnable,Be=i.onDisable,ae=i.onClick,xe=i.scrollSpeed,Se=i.capture,ke=i.allowClicks,We=i.lockAxis,Qe=i.onLockAxis;this.target=a=Br(a)||ol,this.vars=i,m&&(m=Oi.utils.toArray(m)),r=r||1e-9,s=s||0,v=v||1,xe=xe||1,o=o||"wheel,touch,pointer",u=u!==!1,l||(l=parseFloat(es.getComputedStyle(bf).lineHeight)||22);var lt,Ne,Y,Ae,ge,Fe,Ce,re=this,Xe=0,et=0,Et=i.passive||!h,H=Tl(a,xr),U=Tl(a,yi),ve=H(),Me=U(),be=~o.indexOf("touch")&&!~o.indexOf("pointer")&&qs[0]==="pointerdown",Ie=Ld(a),tt=a.ownerDocument||sl,ct=[0,0,0],Ge=[0,0,0],Ke=0,Rt=function(){return Ke=Id()},Oe=function(ot,dt){return(re.event=ot)&&m&&~m.indexOf(ot.target)||dt&&be&&ot.pointerType!=="touch"||oe&&oe(ot,dt)},qt=function(){re._vx.reset(),re._vy.reset(),Ne.pause(),d&&d(re)},pt=function(){var ot=re.deltaX=TR(ct),dt=re.deltaY=TR(Ge),je=Math.abs(ot)>=r,Tt=Math.abs(dt)>=r;L&&(je||Tt)&&L(re,ot,dt,ct,Ge),je&&(b&&re.deltaX>0&&b(re),C&&re.deltaX<0&&C(re),O&&O(re),K&&re.deltaX<0!=Xe<0&&K(re),Xe=re.deltaX,ct[0]=ct[1]=ct[2]=0),Tt&&(I&&re.deltaY>0&&I(re),R&&re.deltaY<0&&R(re),T&&T(re),se&&re.deltaY<0!=et<0&&se(re),et=re.deltaY,Ge[0]=Ge[1]=Ge[2]=0),(Ae||Y)&&($&&$(re),Y&&(S(re),Y=!1),Ae=!1),Fe&&!(Fe=!1)&&Qe&&Qe(re),ge&&(ee(re),ge=!1),lt=0},ht=function(ot,dt,je){ct[je]+=ot,Ge[je]+=dt,re._vx.update(ot),re._vy.update(dt),u?lt||(lt=requestAnimationFrame(pt)):pt()},Z=function(ot,dt){We&&!Ce&&(re.axis=Ce=Math.abs(ot)>Math.abs(dt)?"x":"y",Fe=!0),Ce!=="y"&&(ct[2]+=ot,re._vx.update(ot,!0)),Ce!=="x"&&(Ge[2]+=dt,re._vy.update(dt,!0)),u?lt||(lt=requestAnimationFrame(pt)):pt()},de=function(ot){if(!Oe(ot,1)){ot=Wh(ot,h);var dt=ot.clientX,je=ot.clientY,Tt=dt-re.x,xt=je-re.y,It=re.isDragging;re.x=dt,re.y=je,(It||Math.abs(re.startX-dt)>=s||Math.abs(re.startY-je)>=s)&&(S&&(Y=!0),It||(re.isDragging=!0),Z(Tt,xt),It||y&&y(re))}},Ue=re.onPress=function(ut){Oe(ut,1)||ut&&ut.button||(re.axis=Ce=null,Ne.pause(),re.isPressed=!0,ut=Wh(ut),Xe=et=0,re.startX=re.x=ut.clientX,re.startY=re.y=ut.clientY,re._vx.reset(),re._vy.reset(),dr(F?a:tt,qs[1],de,Et,!0),re.deltaX=re.deltaY=0,A&&A(re))},Le=re.onRelease=function(ut){if(!Oe(ut,1)){fr(F?a:tt,qs[1],de,!0);var ot=!isNaN(re.y-re.startY),dt=re.isDragging,je=dt&&(Math.abs(re.x-re.startX)>3||Math.abs(re.y-re.startY)>3),Tt=Wh(ut);!je&&ot&&(re._vx.reset(),re._vy.reset(),h&&ke&&Oi.delayedCall(.08,function(){if(Id()-Ke>300&&!ut.defaultPrevented){if(ut.target.click)ut.target.click();else if(tt.createEvent){var xt=tt.createEvent("MouseEvents");xt.initMouseEvent("click",!0,!0,es,1,Tt.screenX,Tt.screenY,Tt.clientX,Tt.clientY,!1,!1,!1,!1,0,null),ut.target.dispatchEvent(xt)}}})),re.isDragging=re.isGesturing=re.isPressed=!1,d&&dt&&!F&&Ne.restart(!0),g&&dt&&g(re),E&&E(re,je)}},Pe=function(ot){return ot.touches&&ot.touches.length>1&&(re.isGesturing=!0)&&V(ot,re.isDragging)},ie=function(){return(re.isGesturing=!1)||N(re)},He=function(ot){if(!Oe(ot)){var dt=H(),je=U();ht((dt-ve)*xe,(je-Me)*xe,1),ve=dt,Me=je,d&&Ne.restart(!0)}},pe=function(ot){if(!Oe(ot)){ot=Wh(ot,h),ee&&(ge=!0);var dt=(ot.deltaMode===1?l:ot.deltaMode===2?es.innerHeight:1)*v;ht(ot.deltaX*dt,ot.deltaY*dt,0),d&&!F&&Ne.restart(!0)}},Ve=function(ot){if(!Oe(ot)){var dt=ot.clientX,je=ot.clientY,Tt=dt-re.x,xt=je-re.y;re.x=dt,re.y=je,Ae=!0,d&&Ne.restart(!0),(Tt||xt)&&Z(Tt,xt)}},Je=function(ot){re.event=ot,W(re)},Mt=function(ot){re.event=ot,te(re)},Ot=function(ot){return Oe(ot)||Wh(ot,h)&&ae(re)};Ne=re._dc=Oi.delayedCall(p||.25,qt).pause(),re.deltaX=re.deltaY=0,re._vx=YA(0,50,!0),re._vy=YA(0,50,!0),re.scrollX=H,re.scrollY=U,re.isDragging=re.isGesturing=re.isPressed=!1,wL(this),re.enable=function(ut){return re.isEnabled||(dr(Ie?tt:a,"scroll",jA),o.indexOf("scroll")>=0&&dr(Ie?tt:a,"scroll",He,Et,Se),o.indexOf("wheel")>=0&&dr(a,"wheel",pe,Et,Se),(o.indexOf("touch")>=0&&ML||o.indexOf("pointer")>=0)&&(dr(a,qs[0],Ue,Et,Se),dr(tt,qs[2],Le),dr(tt,qs[3],Le),ke&&dr(a,"click",Rt,!0,!0),ae&&dr(a,"click",Ot),V&&dr(tt,"gesturestart",Pe),N&&dr(tt,"gestureend",ie),W&&dr(a,hu+"enter",Je),te&&dr(a,hu+"leave",Mt),$&&dr(a,hu+"move",Ve)),re.isEnabled=!0,ut&&ut.type&&Ue(ut),fe&&fe(re)),re},re.disable=function(){re.isEnabled&&(pf.filter(function(ut){return ut!==re&&Ld(ut.target)}).length||fr(Ie?tt:a,"scroll",jA),re.isPressed&&(re._vx.reset(),re._vy.reset(),fr(F?a:tt,qs[1],de,!0)),fr(Ie?tt:a,"scroll",He,Se),fr(a,"wheel",pe,Se),fr(a,qs[0],Ue,Se),fr(tt,qs[2],Le),fr(tt,qs[3],Le),fr(a,"click",Rt,!0),fr(a,"click",Ot),fr(tt,"gesturestart",Pe),fr(tt,"gestureend",ie),fr(a,hu+"enter",Je),fr(a,hu+"leave",Mt),fr(a,hu+"move",Ve),re.isEnabled=re.isPressed=re.isDragging=!1,Be&&Be(re))},re.kill=re.revert=function(){re.disable();var ut=pf.indexOf(re);ut>=0&&pf.splice(ut,1),fa===re&&(fa=0)},pf.push(re),F&&Ld(a)&&(fa=re),re.enable(x)},dG(n,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),n}();ai.version="3.12.5";ai.create=function(n){return new ai(n)};ai.register=bL;ai.getAll=function(){return pf.slice()};ai.getById=function(n){return pf.filter(function(e){return e.vars.id===n})[0]};TL()&&Oi.registerPlugin(ai);/*! * ScrollTrigger 3.12.5 * https://gsap.com * @@ -77,17 +77,17 @@ Error generating stack: `+s.message+` * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var vt,Kc,tn,zn,io,Rn,RL,Bv,mp,Dd,dd,gg,Qi,a_,KA,vr,wR,TR,Qc,bL,Mx,PL,mr,QA,BL,IL,Ja,ZA,cE,Pf,fE,Iv,qA,Ex,vg=1,Zi=Date.now,wx=Zi(),ks=0,pd=0,CR=function(e,t,i){var r=Zr(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return i["_"+t+"Clamp"]=r,r?e.substr(6,e.length-7):e},RR=function(e,t){return t&&(!Zr(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},cG=function n(){return pd&&requestAnimationFrame(n)},bR=function(){return a_=1},PR=function(){return a_=0},Eo=function(e){return e},md=function(e){return Math.round(e*1e5)/1e5||0},LL=function(){return typeof window<"u"},DL=function(){return vt||LL()&&(vt=window.gsap)&&vt.registerPlugin&&vt},Qu=function(e){return!!~RL.indexOf(e)},NL=function(e){return(e==="Height"?fE:tn["inner"+e])||io["client"+e]||Rn["client"+e]},FL=function(e){return _l(e,"getBoundingClientRect")||(Qu(e)?function(){return V0.width=tn.innerWidth,V0.height=fE,V0}:function(){return oa(e)})},fG=function(e,t,i){var r=i.d,s=i.d2,o=i.a;return(o=_l(e,"getBoundingClientRect"))?function(){return o()[r]}:function(){return(t?NL(s):e["client"+s])||0}},hG=function(e,t){return!t||~Lo.indexOf(e)?FL(e):function(){return V0}},Ro=function(e,t){var i=t.s,r=t.d2,s=t.d,o=t.a;return Math.max(0,(i="scroll"+r)&&(o=_l(e,i))?o()-FL(e)()[s]:Qu(e)?(io[i]||Rn[i])-NL(r):e[i]-e["offset"+r])},_g=function(e,t){for(var i=0;i0){for(r-=o,a=0;a=r)return i[a];return i[a-1]}else for(a=i.length,r+=o;a--;)if(i[a]<=r)return i[a];return i[0]}:function(r,s,o){o===void 0&&(o=.001);var a=t(r);return!s||Math.abs(a-r)i&&(r*=t/100),e=e.substr(0,i-1)),e=r+(e in Dv?Dv[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},Sg=function(e,t,i,r,s,o,a,l){var u=s.startColor,h=s.endColor,d=s.fontSize,p=s.indent,m=s.fontWeight,v=zn.createElement("div"),x=Qu(i)||_l(i,"pinType")==="fixed",y=e.indexOf("scroller")!==-1,g=x?Rn:i,S=e.indexOf("start")!==-1,A=S?u:h,E="border-color:"+A+";font-size:"+d+";color:"+A+";font-weight:"+m+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return E+="position:"+((y||l)&&x?"fixed;":"absolute;"),(y||l||!x)&&(E+=(r===yi?hE:dE)+":"+(o+parseFloat(p))+"px;"),a&&(E+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),v._isStart=S,v.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),v.style.cssText=E,v.innerText=t||t===0?e+"-"+t:e,g.children[0]?g.insertBefore(v,g.children[0]):g.appendChild(v),v._offset=v["offset"+r.op.d2],z0(v,0,r,S),v},z0=function(e,t,i,r){var s={display:"block"},o=i[r?"os2":"p2"],a=i[r?"p2":"os2"];e._isFlipped=r,s[i.a+"Percent"]=r?-100:0,s[i.a]=r?"1px":0,s["border"+o+Yf]=1,s["border"+a+Yf]=0,s[i.p]=t+"px",vt.set(e,s)},Kt=[],$A={},gp,LR=function(){return Zi()-ks>34&&(gp||(gp=requestAnimationFrame(ma)))},Tc=function(){(!mr||!mr.isPressed||mr.startX>Rn.clientWidth)&&(Qt.cache++,mr?gp||(gp=requestAnimationFrame(ma)):ma(),ks||qu("scrollStart"),ks=Zi())},Cx=function(){IL=tn.innerWidth,BL=tn.innerHeight},vd=function(){Qt.cache++,!Qi&&!PL&&!zn.fullscreenElement&&!zn.webkitFullscreenElement&&(!QA||IL!==tn.innerWidth||Math.abs(tn.innerHeight-BL)>tn.innerHeight*.25)&&Bv.restart(!0)},Zu={},gG=[],zL=function n(){return Ci(Zt,"scrollEnd",n)||Mu(!0)},qu=function(e){return Zu[e]&&Zu[e].map(function(t){return t()})||gG},Kr=[],GL=function(e){for(var t=0;ts,a=r._startClamp&&r.start>=s;(o||a)&&r.setPositions(a?s-1:r.start,o?Math.max(a?s:r.start+1,s):r.end,!0)}),NR(!1),qA=0,i.forEach(function(r){return r&&r.render&&r.render(-1)}),Qt.forEach(function(r){Ar(r)&&(r.smooth&&requestAnimationFrame(function(){return r.target.style.scrollBehavior="smooth"}),r.rec&&r(r.rec))}),HL(cE,1),Bv.pause(),Uu++,_r=2,ma(2),Kt.forEach(function(r){return Ar(r.vars.onRefresh)&&r.vars.onRefresh(r)}),_r=Zt.isRefreshing=!1,qu("refresh")},eS=0,G0=1,kd,ma=function(e){if(e===2||!_r&&!Iv){Zt.isUpdating=!0,kd&&kd.update(0);var t=Kt.length,i=Zi(),r=i-wx>=50,s=t&&Kt[0].scroll();if(G0=eS>s?-1:1,_r||(eS=s),r&&(ks&&!a_&&i-ks>200&&(ks=0,qu("scrollEnd")),dd=wx,wx=i),G0<0){for(vr=t;vr-- >0;)Kt[vr]&&Kt[vr].update(0,r);G0=1}else for(vr=0;vr20),i-=i-C}if(v&&(l[v]=e||-.001,e<0&&(e=0)),o){var I=e+i,O=o._isStart;y="scroll"+r.d2,z0(o,I,r,O&&I>20||!O&&(d?Math.max(Rn[y],io[y]):o.parentNode[y])<=I+1),d&&(u=oa(a),d&&(o.style[r.op.p]=u[r.op.p]-r.op.m-o._offset+vi))}return m&&S&&(y=oa(S),m.seek(p),g=oa(S),m._caScrollDist=y[r.p]-g[r.p],e=e/m._caScrollDist*p),m&&m.seek(x),m?e:Math.round(e)},AG=/(webkit|moz|length|cssText|inset)/i,OR=function(e,t,i,r){if(e.parentNode!==t){var s=e.style,o,a;if(t===Rn){e._stOrig=s.cssText,a=Bs(e);for(o in a)!+o&&!AG.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=i,s.left=r}else s.cssText=e._stOrig;vt.core.getCache(e).uncache=1,t.appendChild(e)}},WL=function(e,t,i){var r=t,s=r;return function(o){var a=Math.round(e());return a!==r&&a!==s&&Math.abs(a-r)>3&&Math.abs(a-s)>3&&(o=a,i&&i()),s=r,r=o,o}},Eg=function(e,t,i){var r={};r[t.p]="+="+i,vt.set(e,r)},UR=function(e,t){var i=Tl(e,t),r="_scroll"+t.p2,s=function o(a,l,u,h,d){var p=o.tween,m=l.onComplete,v={};u=u||i();var x=WL(i,u,function(){p.kill(),o.tween=0});return d=h&&d||0,h=h||a-u,p&&p.kill(),l[r]=a,l.inherit=!1,l.modifiers=v,v[r]=function(){return x(u+h*p.ratio+d*p.ratio*p.ratio)},l.onUpdate=function(){Qt.cache++,o.tween&&ma()},l.onComplete=function(){o.tween=0,m&&m.call(p)},p=o.tween=vt.to(e,l),p};return e[r]=i,i.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ri(e,"wheel",i.wheelHandler),Zt.isTouch&&Ri(e,"touchmove",i.wheelHandler),s},Zt=function(){function n(t,i){Kc||n.register(vt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),ZA(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),!pd){this.update=this.refresh=this.kill=Eo;return}i=BR(Zr(i)||gd(i)||i.nodeType?{trigger:i}:i,Ag);var s=i,o=s.onUpdate,a=s.toggleClass,l=s.id,u=s.onToggle,h=s.onRefresh,d=s.scrub,p=s.trigger,m=s.pin,v=s.pinSpacing,x=s.invalidateOnRefresh,y=s.anticipatePin,g=s.onScrubComplete,S=s.onSnapComplete,A=s.once,E=s.snap,b=s.pinReparent,C=s.pinSpacer,R=s.containerAnimation,I=s.fastScrollEnd,O=s.preventOverlaps,T=i.horizontal||i.containerAnimation&&i.horizontal!==!1?xr:yi,L=!d&&d!==0,K=Br(i.scroller||tn),se=vt.core.getCache(K),W=Qu(K),te=("pinType"in i?i.pinType:_l(K,"pinType")||W&&"fixed")==="fixed",$=[i.onEnter,i.onLeave,i.onEnterBack,i.onLeaveBack],oe=L&&i.toggleActions.split(" "),F="markers"in i?i.markers:Ag.markers,V=W?0:parseFloat(Bs(K)["border"+T.p2+Yf])||0,N=this,ee=i.onRefreshInit&&function(){return i.onRefreshInit(N)},ce=fG(K,W,T),Be=hG(K,W),ae=0,xe=0,Se=0,ke=Tl(K,T),We,Qe,lt,Ne,Y,Ae,ge,Fe,Ce,re,Xe,et,Et,H,U,ve,Me,be,Ie,tt,ct,Ge,Ke,Rt,Oe,qt,pt,ht,Z,de,Ue,Le,Pe,ie,He,pe,Ve,Je,Mt;if(N._startClamp=N._endClamp=!1,N._dir=T,y*=45,N.scroller=K,N.scroll=R?R.time.bind(R):ke,Ne=ke(),N.vars=i,r=r||i.animation,"refreshPriority"in i&&(bL=1,i.refreshPriority===-9999&&(kd=N)),se.tweenScroll=se.tweenScroll||{top:UR(K,yi),left:UR(K,xr)},N.tweenTo=We=se.tweenScroll[T.p],N.scrubDuration=function(je){Pe=gd(je)&&je,Pe?Le?Le.duration(je):Le=vt.to(r,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:Pe,paused:!0,onComplete:function(){return g&&g(N)}}):(Le&&Le.progress(1).kill(),Le=0)},r&&(r.vars.lazy=!1,r._initted&&!N.isReverted||r.vars.immediateRender!==!1&&i.immediateRender!==!1&&r.duration()&&r.render(0,!0,!0),N.animation=r.pause(),r.scrollTrigger=N,N.scrubDuration(d),de=0,l||(l=r.vars.id)),E&&((!hu(E)||E.push)&&(E={snapTo:E}),"scrollBehavior"in Rn.style&&vt.set(W?[Rn,io]:K,{scrollBehavior:"auto"}),Qt.forEach(function(je){return Ar(je)&&je.target===(W?zn.scrollingElement||io:K)&&(je.smooth=!1)}),lt=Ar(E.snapTo)?E.snapTo:E.snapTo==="labels"?pG(r):E.snapTo==="labelsDirectional"?mG(r):E.directional!==!1?function(je,Tt){return mE(E.snapTo)(je,Zi()-xe<500?0:Tt.direction)}:vt.utils.snap(E.snapTo),ie=E.duration||{min:.1,max:2},ie=hu(ie)?Dd(ie.min,ie.max):Dd(ie,ie),He=vt.delayedCall(E.delay||Pe/2||.1,function(){var je=ke(),Tt=Zi()-xe<500,xt=We.tween;if((Tt||Math.abs(N.getVelocity())<10)&&!xt&&!a_&&ae!==je){var It=(je-Ae)/H,dn=r&&!L?r.totalProgress():It,Dt=Tt?0:(dn-Ue)/(Zi()-dd)*1e3||0,_t=vt.utils.clamp(-It,1-It,wc(Dt/2)*Dt/.185),Ln=It+(E.inertia===!1?0:_t),mn,D,k=E,q=k.onStart,B=k.onInterrupt,z=k.onComplete;if(mn=lt(Ln,N),gd(mn)||(mn=Ln),D=Math.round(Ae+mn*H),je<=ge&&je>=Ae&&D!==je){if(xt&&!xt._initted&&xt.data<=wc(D-je))return;E.inertia===!1&&(_t=mn-It),We(D,{duration:ie(wc(Math.max(wc(Ln-dn),wc(mn-dn))*.185/Dt/.05||0)),ease:E.ease||"power3",data:wc(D-je),onInterrupt:function(){return He.restart(!0)&&B&&B(N)},onComplete:function(){N.update(),ae=ke(),r&&(Le?Le.resetTo("totalProgress",mn,r._tTime/r._tDur):r.progress(mn)),de=Ue=r&&!L?r.totalProgress():N.progress,S&&S(N),z&&z(N)}},je,_t*H,D-je-_t*H),q&&q(N,We.tween)}}else N.isActive&&ae!==je&&He.restart(!0)}).pause()),l&&($A[l]=N),p=N.trigger=Br(p||m!==!0&&m),Mt=p&&p._gsap&&p._gsap.stRevert,Mt&&(Mt=Mt(N)),m=m===!0?p:Br(m),Zr(a)&&(a={targets:p,className:a}),m&&(v===!1||v===Ps||(v=!v&&m.parentNode&&m.parentNode.style&&Bs(m.parentNode).display==="flex"?!1:ci),N.pin=m,Qe=vt.core.getCache(m),Qe.spacer?U=Qe.pinState:(C&&(C=Br(C),C&&!C.nodeType&&(C=C.current||C.nativeElement),Qe.spacerIsNative=!!C,C&&(Qe.spacerState=Mg(C))),Qe.spacer=be=C||zn.createElement("div"),be.classList.add("pin-spacer"),l&&be.classList.add("pin-spacer-"+l),Qe.pinState=U=Mg(m)),i.force3D!==!1&&vt.set(m,{force3D:!0}),N.spacer=be=Qe.spacer,Z=Bs(m),Rt=Z[v+T.os2],tt=vt.getProperty(m),ct=vt.quickSetter(m,T.a,vi),Rx(m,be,Z),Me=Mg(m)),F){et=hu(F)?BR(F,IR):IR,re=Sg("scroller-start",l,K,T,et,0),Xe=Sg("scroller-end",l,K,T,et,0,re),Ie=re["offset"+T.op.d2];var Ot=Br(_l(K,"content")||K);Fe=this.markerStart=Sg("start",l,Ot,T,et,Ie,0,R),Ce=this.markerEnd=Sg("end",l,Ot,T,et,Ie,0,R),R&&(Je=vt.quickSetter([Fe,Ce],T.a,vi)),!te&&!(Lo.length&&_l(K,"fixedMarkers")===!0)&&(dG(W?Rn:K),vt.set([re,Xe],{force3D:!0}),qt=vt.quickSetter(re,T.a,vi),ht=vt.quickSetter(Xe,T.a,vi))}if(R){var ut=R.vars.onUpdate,ot=R.vars.onUpdateParams;R.eventCallback("onUpdate",function(){N.update(0,0,1),ut&&ut.apply(R,ot||[])})}if(N.previous=function(){return Kt[Kt.indexOf(N)-1]},N.next=function(){return Kt[Kt.indexOf(N)+1]},N.revert=function(je,Tt){if(!Tt)return N.kill(!0);var xt=je!==!1||!N.enabled,It=Qi;xt!==N.isReverted&&(xt&&(pe=Math.max(ke(),N.scroll.rec||0),Se=N.progress,Ve=r&&r.progress()),Fe&&[Fe,Ce,re,Xe].forEach(function(dn){return dn.style.display=xt?"none":"block"}),xt&&(Qi=N,N.update(xt)),m&&(!b||!N.isActive)&&(xt?_G(m,be,U):Rx(m,be,Bs(m),Oe)),xt||N.update(xt),Qi=It,N.isReverted=xt)},N.refresh=function(je,Tt,xt,It){if(!((Qi||!N.enabled)&&!Tt)){if(m&&je&&ks){Ri(n,"scrollEnd",zL);return}!_r&&ee&&ee(N),Qi=N,We.tween&&!xt&&(We.tween.kill(),We.tween=0),Le&&Le.pause(),x&&r&&r.revert({kill:!1}).invalidate(),N.isReverted||N.revert(!0,!0),N._subPinOffset=!1;var dn=ce(),Dt=Be(),_t=R?R.duration():Ro(K,T),Ln=H<=.01,mn=0,D=It||0,k=hu(xt)?xt.end:i.end,q=i.endTrigger||p,B=hu(xt)?xt.start:i.start||(i.start===0||!p?0:m?"0 0":"0 100%"),z=N.pinnedContainer=i.pinnedContainer&&Br(i.pinnedContainer,N),X=p&&Math.max(0,Kt.indexOf(N))||0,Q=X,j,he,ye,we,_e,Ze,De,ze,ft,At,yt,Lt,rt;for(F&&hu(xt)&&(Lt=vt.getProperty(re,T.p),rt=vt.getProperty(Xe,T.p));Q--;)Ze=Kt[Q],Ze.end||Ze.refresh(0,1)||(Qi=N),De=Ze.pin,De&&(De===p||De===m||De===z)&&!Ze.isReverted&&(At||(At=[]),At.unshift(Ze),Ze.revert(!0,!0)),Ze!==Kt[Q]&&(X--,Q--);for(Ar(B)&&(B=B(N)),B=CR(B,"start",N),Ae=FR(B,p,dn,T,ke(),Fe,re,N,Dt,V,te,_t,R,N._startClamp&&"_startClamp")||(m?-.001:0),Ar(k)&&(k=k(N)),Zr(k)&&!k.indexOf("+=")&&(~k.indexOf(" ")?k=(Zr(B)?B.split(" ")[0]:"")+k:(mn=k0(k.substr(2),dn),k=Zr(B)?B:(R?vt.utils.mapRange(0,R.duration(),R.scrollTrigger.start,R.scrollTrigger.end,Ae):Ae)+mn,q=p)),k=CR(k,"end",N),ge=Math.max(Ae,FR(k||(q?"100% 0":_t),q,dn,T,ke()+mn,Ce,Xe,N,Dt,V,te,_t,R,N._endClamp&&"_endClamp"))||-.001,mn=0,Q=X;Q--;)Ze=Kt[Q],De=Ze.pin,De&&Ze.start-Ze._pinPush<=Ae&&!R&&Ze.end>0&&(j=Ze.end-(N._startClamp?Math.max(0,Ze.start):Ze.start),(De===p&&Ze.start-Ze._pinPush=Ro(K,T)))j=Bs(m),we=T===yi,ye=ke(),Ge=parseFloat(tt(T.a))+D,!_t&&ge>1&&(yt=(W?zn.scrollingElement||io:K).style,yt={style:yt,value:yt["overflow"+T.a.toUpperCase()]},W&&Bs(Rn)["overflow"+T.a.toUpperCase()]!=="scroll"&&(yt.style["overflow"+T.a.toUpperCase()]="scroll")),Rx(m,be,j),Me=Mg(m),he=oa(m,!0),ze=te&&Tl(K,we?xr:yi)(),v?(Oe=[v+T.os2,H+D+vi],Oe.t=be,Q=v===ci?Lv(m,T)+H+D:0,Q&&(Oe.push(T.d,Q+vi),be.style.flexBasis!=="auto"&&(be.style.flexBasis=Q+vi)),Bf(Oe),z&&Kt.forEach(function(qe){qe.pin===z&&qe.vars.pinSpacing!==!1&&(qe._subPinOffset=!0)}),te&&ke(pe)):(Q=Lv(m,T),Q&&be.style.flexBasis!=="auto"&&(be.style.flexBasis=Q+vi)),te&&(_e={top:he.top+(we?ye-Ae:ze)+vi,left:he.left+(we?ze:ye-Ae)+vi,boxSizing:"border-box",position:"fixed"},_e[Fu]=_e["max"+Yf]=Math.ceil(he.width)+vi,_e[Ou]=_e["max"+pE]=Math.ceil(he.height)+vi,_e[Ps]=_e[Ps+Od]=_e[Ps+Nd]=_e[Ps+Ud]=_e[Ps+Fd]="0",_e[ci]=j[ci],_e[ci+Od]=j[ci+Od],_e[ci+Nd]=j[ci+Nd],_e[ci+Ud]=j[ci+Ud],_e[ci+Fd]=j[ci+Fd],ve=xG(U,_e,b),_r&&ke(0)),r?(ft=r._initted,Mx(1),r.render(r.duration(),!0,!0),Ke=tt(T.a)-Ge+H+D,pt=Math.abs(H-Ke)>1,te&&pt&&ve.splice(ve.length-2,2),r.render(0,!0,!0),ft||r.invalidate(!0),r.parent||r.totalTime(r.totalTime()),Mx(0)):Ke=H,yt&&(yt.value?yt.style["overflow"+T.a.toUpperCase()]=yt.value:yt.style.removeProperty("overflow-"+T.a));else if(p&&ke()&&!R)for(he=p.parentNode;he&&he!==Rn;)he._pinOffset&&(Ae-=he._pinOffset,ge-=he._pinOffset),he=he.parentNode;At&&At.forEach(function(qe){return qe.revert(!1,!0)}),N.start=Ae,N.end=ge,Ne=Y=_r?pe:ke(),!R&&!_r&&(Ne0?Kt.slice(0,Tt).reverse():Kt.slice(Tt+1);return(Zr(je)?xt.filter(function(It){return It.vars.preventOverlaps===je}):xt).filter(function(It){return N.direction>0?It.end<=Ae:It.start>=ge})},N.update=function(je,Tt,xt){if(!(R&&!xt&&!je)){var It=_r===!0?pe:N.scroll(),dn=je?0:(It-Ae)/H,Dt=dn<0?0:dn>1?1:dn||0,_t=N.progress,Ln,mn,D,k,q,B,z,X;if(Tt&&(Y=Ne,Ne=R?ke():It,E&&(Ue=de,de=r&&!L?r.totalProgress():Dt)),y&&m&&!Qi&&!vg&&ks&&(!Dt&&AeIt+(It-Y)/(Zi()-dd)*y&&(Dt=.9999)),Dt!==_t&&N.enabled){if(Ln=N.isActive=!!Dt&&Dt<1,mn=!!_t&&_t<1,B=Ln!==mn,q=B||!!Dt!=!!_t,N.direction=Dt>_t?1:-1,N.progress=Dt,q&&!Qi&&(D=Dt&&!_t?0:Dt===1?1:_t===1?2:3,L&&(k=!B&&oe[D+1]!=="none"&&oe[D+1]||oe[D],X=r&&(k==="complete"||k==="reset"||k in r))),O&&(B||X)&&(X||d||!r)&&(Ar(O)?O(N):N.getTrailing(O).forEach(function(ye){return ye.endAnimation()})),L||(Le&&!Qi&&!vg?(Le._dp._time-Le._start!==Le._time&&Le.render(Le._dp._time-Le._start),Le.resetTo?Le.resetTo("totalProgress",Dt,r._tTime/r._tDur):(Le.vars.totalProgress=Dt,Le.invalidate().restart())):r&&r.totalProgress(Dt,!!(Qi&&(xe||je)))),m){if(je&&v&&(be.style[v+T.os2]=Rt),!te)ct(md(Ge+Ke*Dt));else if(q){if(z=!je&&Dt>_t&&ge+1>It&&It+1>=Ro(K,T),b)if(!je&&(Ln||z)){var Q=oa(m,!0),j=It-Ae;OR(m,Rn,Q.top+(T===yi?j:0)+vi,Q.left+(T===yi?0:j)+vi)}else OR(m,be);Bf(Ln||z?ve:Me),pt&&Dt<1&&Ln||ct(Ge+(Dt===1&&!z?Ke:0))}}E&&!We.tween&&!Qi&&!vg&&He.restart(!0),a&&(B||A&&Dt&&(Dt<1||!Ex))&&mp(a.targets).forEach(function(ye){return ye.classList[Ln||A?"add":"remove"](a.className)}),o&&!L&&!je&&o(N),q&&!Qi?(L&&(X&&(k==="complete"?r.pause().totalProgress(1):k==="reset"?r.restart(!0).pause():k==="restart"?r.restart(!0):r[k]()),o&&o(N)),(B||!Ex)&&(u&&B&&Tx(N,u),$[D]&&Tx(N,$[D]),A&&(Dt===1?N.kill(!1,1):$[D]=0),B||(D=Dt===1?1:3,$[D]&&Tx(N,$[D]))),I&&!Ln&&Math.abs(N.getVelocity())>(gd(I)?I:2500)&&(Xh(N.callbackAnimation),Le?Le.progress(1):Xh(r,k==="reverse"?1:!Dt,1))):L&&o&&!Qi&&o(N)}if(ht){var he=R?It/R.duration()*(R._caScrollDist||0):It;qt(he+(re._isFlipped?1:0)),ht(he)}Je&&Je(-It/R.duration()*(R._caScrollDist||0))}},N.enable=function(je,Tt){N.enabled||(N.enabled=!0,Ri(K,"resize",vd),W||Ri(K,"scroll",Tc),ee&&Ri(n,"refreshInit",ee),je!==!1&&(N.progress=Se=0,Ne=Y=ae=ke()),Tt!==!1&&N.refresh())},N.getTween=function(je){return je&&We?We.tween:Le},N.setPositions=function(je,Tt,xt,It){if(R){var dn=R.scrollTrigger,Dt=R.duration(),_t=dn.end-dn.start;je=dn.start+_t*je/Dt,Tt=dn.start+_t*Tt/Dt}N.refresh(!1,!1,{start:RR(je,xt&&!!N._startClamp),end:RR(Tt,xt&&!!N._endClamp)},It),N.update()},N.adjustPinSpacing=function(je){if(Oe&&je){var Tt=Oe.indexOf(T.d)+1;Oe[Tt]=parseFloat(Oe[Tt])+je+vi,Oe[1]=parseFloat(Oe[1])+je+vi,Bf(Oe)}},N.disable=function(je,Tt){if(N.enabled&&(je!==!1&&N.revert(!0,!0),N.enabled=N.isActive=!1,Tt||Le&&Le.pause(),pe=0,Qe&&(Qe.uncache=1),ee&&Ci(n,"refreshInit",ee),He&&(He.pause(),We.tween&&We.tween.kill()&&(We.tween=0)),!W)){for(var xt=Kt.length;xt--;)if(Kt[xt].scroller===K&&Kt[xt]!==N)return;Ci(K,"resize",vd),W||Ci(K,"scroll",Tc)}},N.kill=function(je,Tt){N.disable(je,Tt),Le&&!Tt&&Le.kill(),l&&delete $A[l];var xt=Kt.indexOf(N);xt>=0&&Kt.splice(xt,1),xt===vr&&G0>0&&vr--,xt=0,Kt.forEach(function(It){return It.scroller===N.scroller&&(xt=1)}),xt||_r||(N.scroll.rec=0),r&&(r.scrollTrigger=null,je&&r.revert({kill:!1}),Tt||r.kill()),Fe&&[Fe,Ce,re,Xe].forEach(function(It){return It.parentNode&&It.parentNode.removeChild(It)}),kd===N&&(kd=0),m&&(Qe&&(Qe.uncache=1),xt=0,Kt.forEach(function(It){return It.pin===m&&xt++}),xt||(Qe.spacer=0)),i.onKill&&i.onKill(N)},Kt.push(N),N.enable(!1,!1),Mt&&Mt(N),r&&r.add&&!H){var dt=N.update;N.update=function(){N.update=dt,Ae||ge||N.refresh()},vt.delayedCall(.01,N.update),H=.01,Ae=ge=0}else N.refresh();m&&vG()},n.register=function(i){return Kc||(vt=i||DL(),LL()&&window.document&&n.enable(),Kc=pd),Kc},n.defaults=function(i){if(i)for(var r in i)Ag[r]=i[r];return Ag},n.disable=function(i,r){pd=0,Kt.forEach(function(o){return o[r?"kill":"disable"](i)}),Ci(tn,"wheel",Tc),Ci(zn,"scroll",Tc),clearInterval(gg),Ci(zn,"touchcancel",Eo),Ci(Rn,"touchstart",Eo),yg(Ci,zn,"pointerdown,touchstart,mousedown",bR),yg(Ci,zn,"pointerup,touchend,mouseup",PR),Bv.kill(),_g(Ci);for(var s=0;s0&&o.left+a0&&o.top+a=0&&Kr.splice(t,5),Kr.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),vt.core.getCache(e),ZA())}}):Kr};Zt.revert=function(n,e){return gE(!n,e)};Zt.create=function(n,e){return new Zt(n,e)};Zt.refresh=function(n){return n?vd():(Kc||Zt.register())&&Mu(!0)};Zt.update=function(n){return++Qt.cache&&ma(n===!0?2:0)};Zt.clearScrollMemory=HL;Zt.maxScroll=function(n,e){return Ro(n,e?xr:yi)};Zt.getScrollFunc=function(n,e){return Tl(Br(n),e?xr:yi)};Zt.getById=function(n){return $A[n]};Zt.getAll=function(){return Kt.filter(function(n){return n.vars.id!=="ScrollSmoother"})};Zt.isScrolling=function(){return!!ks};Zt.snapDirectional=mE;Zt.addEventListener=function(n,e){var t=Zu[n]||(Zu[n]=[]);~t.indexOf(e)||t.push(e)};Zt.removeEventListener=function(n,e){var t=Zu[n],i=t&&t.indexOf(e);i>=0&&t.splice(i,1)};Zt.batch=function(n,e){var t=[],i={},r=e.interval||.016,s=e.batchMax||1e9,o=function(u,h){var d=[],p=[],m=vt.delayedCall(r,function(){h(d,p),d=[],p=[]}).pause();return function(v){d.length||m.restart(!0),d.push(v.trigger),p.push(v),s<=d.length&&m.progress(1)}},a;for(a in e)i[a]=a.substr(0,2)==="on"&&Ar(e[a])&&a!=="onRefreshInit"?o(a,e[a]):e[a];return Ar(s)&&(s=s(),Ri(Zt,"refresh",function(){return s=e.batchMax()})),mp(n).forEach(function(l){var u={};for(a in i)u[a]=i[a];u.trigger=l,t.push(Zt.create(u))}),t};var kR=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},bx=function n(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(oi.isTouch?" pinch-zoom":""):"none",e===io&&n(Rn,t)},wg={auto:1,scroll:1},SG=function(e){var t=e.event,i=e.target,r=e.axis,s=(t.changedTouches?t.changedTouches[0]:t).target,o=s._gsap||vt.core.getCache(s),a=Zi(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Rn&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(wg[(l=Bs(s)).overflowY]||wg[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==i&&!Qu(s)&&(wg[(l=Bs(s)).overflowY]||wg[l.overflowX]),o._isScrollT=a}(o._isScroll||r==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},XL=function(e,t,i,r){return oi.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:r=r&&SG,onPress:r,onDrag:r,onScroll:r,onEnable:function(){return i&&Ri(zn,oi.eventTypes[0],GR,!1,!0)},onDisable:function(){return Ci(zn,oi.eventTypes[0],GR,!0)}})},MG=/(input|label|select|textarea)/i,zR,GR=function(e){var t=MG.test(e.target.tagName);(t||zR)&&(e._gsapAllow=!0,zR=t)},EG=function(e){hu(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,s=t.allowNestedScroll,o=t.onRelease,a,l,u=Br(e.target)||io,h=vt.core.globals().ScrollSmoother,d=h&&h.get(),p=Ja&&(e.content&&Br(e.content)||d&&e.content!==!1&&!d.smooth()&&d.content()),m=Tl(u,yi),v=Tl(u,xr),x=1,y=(oi.isTouch&&tn.visualViewport?tn.visualViewport.scale*tn.visualViewport.width:tn.outerWidth)/tn.innerWidth,g=0,S=Ar(r)?function(){return r(a)}:function(){return r||2.8},A,E,b=XL(u,e.type,!0,s),C=function(){return E=!1},R=Eo,I=Eo,O=function(){l=Ro(u,yi),I=Dd(Ja?1:0,l),i&&(R=Dd(0,Ro(u,xr))),A=Uu},T=function(){p._gsap.y=md(parseFloat(p._gsap.y)+m.offset)+"px",p.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(p._gsap.y)+", 0, 1)",m.offset=m.cacheID=0},L=function(){if(E){requestAnimationFrame(C);var F=md(a.deltaY/2),V=I(m.v-F);if(p&&V!==m.v+m.offset){m.offset=V-m.v;var N=md((parseFloat(p&&p._gsap.y)||0)-m.offset);p.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+N+", 0, 1)",p._gsap.y=N+"px",m.cacheID=Qt.cache,ma()}return!0}m.offset&&T(),E=!0},K,se,W,te,$=function(){O(),K.isActive()&&K.vars.scrollY>l&&(m()>l?K.progress(1)&&m(l):K.resetTo("scrollY",l))};return p&&vt.set(p,{y:"+=0"}),e.ignoreCheck=function(oe){return Ja&&oe.type==="touchmove"&&L()||x>1.05&&oe.type!=="touchstart"||a.isGesturing||oe.touches&&oe.touches.length>1},e.onPress=function(){E=!1;var oe=x;x=md((tn.visualViewport&&tn.visualViewport.scale||1)/y),K.pause(),oe!==x&&bx(u,x>1.01?!0:i?!1:"x"),se=v(),W=m(),O(),A=Uu},e.onRelease=e.onGestureStart=function(oe,F){if(m.offset&&T(),!F)te.restart(!0);else{Qt.cache++;var V=S(),N,ee;i&&(N=v(),ee=N+V*.05*-oe.velocityX/.227,V*=kR(v,N,ee,Ro(u,xr)),K.vars.scrollX=R(ee)),N=m(),ee=N+V*.05*-oe.velocityY/.227,V*=kR(m,N,ee,Ro(u,yi)),K.vars.scrollY=I(ee),K.invalidate().duration(V).play(.01),(Ja&&K.vars.scrollY>=l||N>=l-1)&&vt.to({},{onUpdate:$,duration:V})}o&&o(oe)},e.onWheel=function(){K._ts&&K.pause(),Zi()-g>1e3&&(A=0,g=Zi())},e.onChange=function(oe,F,V,N,ee){if(Uu!==A&&O(),F&&i&&v(R(N[2]===F?se+(oe.startX-oe.x):v()+F-N[1])),V){m.offset&&T();var ce=ee[2]===V,Be=ce?W+oe.startY-oe.y:m()+V-ee[1],ae=I(Be);ce&&Be!==ae&&(W+=ae-Be),m(ae)}(V||F)&&ma()},e.onEnable=function(){bx(u,i?!1:"x"),Zt.addEventListener("refresh",$),Ri(tn,"resize",$),m.smooth&&(m.target.style.scrollBehavior="auto",m.smooth=v.smooth=!1),b.enable()},e.onDisable=function(){bx(u,!0),Ci(tn,"resize",$),Zt.removeEventListener("refresh",$),b.kill()},e.lockAxis=e.lockAxis!==!1,a=new oi(e),a.iOS=Ja,Ja&&!m()&&m(1),Ja&&vt.ticker.add(Eo),te=a._dc,K=vt.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:i?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:WL(m,m(),function(){return K.pause()})},onUpdate:ma,onComplete:te.vars.onComplete}),a};Zt.sort=function(n){return Kt.sort(n||function(e,t){return(e.vars.refreshPriority||0)*-1e6+e.start-(t.start+(t.vars.refreshPriority||0)*-1e6)})};Zt.observe=function(n){return new oi(n)};Zt.normalizeScroll=function(n){if(typeof n>"u")return mr;if(n===!0&&mr)return mr.enable();if(n===!1){mr&&mr.kill(),mr=n;return}var e=n instanceof oi?n:EG(n);return mr&&mr.target===e.target&&mr.kill(),Qu(e.target)&&(mr=e),e};Zt.core={_getVelocityProp:YA,_inputObserver:XL,_scrollers:Qt,_proxies:Lo,bridge:{ss:function(){ks||qu("scrollStart"),ks=Zi()},ref:function(){return Qi}}};DL()&&vt.registerPlugin(Zt);const wG=["Store","Mac","iPhone","Support"],HR=[{id:1,textLists:["Enter A17 Pro.","Game‑changing chip.","Groundbreaking performance."],video:Gz,videoDuration:4},{id:2,textLists:["Titanium.","So strong. So light. So Pro."],video:Hz,videoDuration:5},{id:3,textLists:["iPhone 15 Pro Max has the","longest optical zoom in","iPhone ever. Far out."],video:Vz,videoDuration:2},{id:4,textLists:["All-new Action button.","What will yours do?."],video:Wz,videoDuration:3.63}],TG=[{id:1,title:"iPhone 15 Pro in Natural Titanium",color:["#8F8A81","#ffe7b9","#6f6c64"],img:xL},{id:2,title:"iPhone 15 Pro in Blue Titanium",color:["#53596E","#6395ff","#21242e"],img:tG},{id:3,title:"iPhone 15 Pro in White Titanium",color:["#C9C8C2","#ffffff","#C9C8C2"],img:nG},{id:4,title:"iPhone 15 Pro in Black Titanium",color:["#454749","#3b3b3b","#181819"],img:iG}],CG=[{label:'6.1"',value:"small"},{label:'6.7"',value:"large"}],VR=["Privacy Policy","Terms of Use","Sales Policy","Legal","Site Map"];fi.registerPlugin(Zt);const RG=()=>{const n=ne.useRef([]),e=ne.useRef([]),t=ne.useRef([]),[i,r]=ne.useState({isEnd:!1,startPlay:!1,videoId:0,isLastVideo:!1,isPlaying:!1}),[s,o]=ne.useState([]),{isEnd:a,isLastVideo:l,startPlay:u,videoId:h,isPlaying:d}=i;sc(()=>{fi.to("#slider",{transform:`translateX(${-100*h}%)`,duration:2,ease:"power2.inOut"}),fi.to("#video",{scrollTrigger:{trigger:"#video",toggleActions:"restart none none none"},onComplete:()=>{r(v=>({...v,startPlay:!0,isPlaying:!0}))}})},[a,h]),ne.useEffect(()=>{let v=0,x=e.current;if(x[h]){let y=fi.to(x[h],{onUpdate:()=>{const S=Math.ceil(y.progress()*100);S!=v&&(v=S,fi.to(t.current[h],{width:window.innerWidth<760||window.innerWidth<1200?"10vw":"4vw"}),fi.to(x[h],{width:`${v}%`,backgroundColor:"white"}))},onComplete:()=>{d&&(fi.to(t.current[h],{width:"12px"}),fi.to(x[h],{backgroundColor:"#afafaf"}))}});h===0&&y.restart();const g=()=>{y.progress(n.current[h].currentTime/HR[h].videoDuration)};d?fi.ticker.add(g):fi.ticker.remove(g)}},[h,u,d]),ne.useEffect(()=>{s.length>3&&(d?u&&n.current[h].play():n.current[h].pause())},[u,h,d,s]);const p=(v,x)=>{switch(v){case"video-end":r(y=>({...y,isEnd:!0,videoId:x+1}));break;case"video-last":r(y=>({...y,isLastVideo:!0}));break;case"video-reset":r(y=>({...y,isLastVideo:!1,videoId:0}));break;case"play":r(y=>({...y,isPlaying:!y.isPlaying}));break;case"pause":r(y=>({...y,isPlaying:!y.isPlaying}));break;default:return i}},m=(v,x)=>o(y=>[...y,x]);return fe.jsxs(fe.Fragment,{children:[fe.jsx("div",{className:"flex items-center",children:HR.map((v,x)=>fe.jsx("div",{id:"slider",className:"sm:pr-20 pr-10",children:fe.jsxs("div",{className:"video-carousel_container",children:[fe.jsx("div",{className:"w-full h-full flex-center rounded-3xl overflow-hidden bg-black",children:fe.jsx("video",{id:"video",playsInline:!0,className:`${v.id===2&&"translate-x-44"} +*/var vt,Kc,tn,zn,io,Rn,PL,Bv,mp,Dd,dd,gg,Qi,a_,KA,vr,CR,RR,Qc,BL,Mx,IL,mr,QA,LL,DL,Ja,ZA,cE,Pf,fE,Iv,qA,Ex,vg=1,Zi=Date.now,wx=Zi(),ks=0,pd=0,bR=function(e,t,i){var r=Zr(e)&&(e.substr(0,6)==="clamp("||e.indexOf("max")>-1);return i["_"+t+"Clamp"]=r,r?e.substr(6,e.length-7):e},PR=function(e,t){return t&&(!Zr(e)||e.substr(0,6)!=="clamp(")?"clamp("+e+")":e},mG=function n(){return pd&&requestAnimationFrame(n)},BR=function(){return a_=1},IR=function(){return a_=0},Eo=function(e){return e},md=function(e){return Math.round(e*1e5)/1e5||0},NL=function(){return typeof window<"u"},FL=function(){return vt||NL()&&(vt=window.gsap)&&vt.registerPlugin&&vt},Zu=function(e){return!!~PL.indexOf(e)},OL=function(e){return(e==="Height"?fE:tn["inner"+e])||io["client"+e]||Rn["client"+e]},UL=function(e){return _l(e,"getBoundingClientRect")||(Zu(e)?function(){return V0.width=tn.innerWidth,V0.height=fE,V0}:function(){return oa(e)})},gG=function(e,t,i){var r=i.d,s=i.d2,o=i.a;return(o=_l(e,"getBoundingClientRect"))?function(){return o()[r]}:function(){return(t?OL(s):e["client"+s])||0}},vG=function(e,t){return!t||~Lo.indexOf(e)?UL(e):function(){return V0}},Ro=function(e,t){var i=t.s,r=t.d2,s=t.d,o=t.a;return Math.max(0,(i="scroll"+r)&&(o=_l(e,i))?o()-UL(e)()[s]:Zu(e)?(io[i]||Rn[i])-OL(r):e[i]-e["offset"+r])},_g=function(e,t){for(var i=0;i0){for(r-=o,a=0;a=r)return i[a];return i[a-1]}else for(a=i.length,r+=o;a--;)if(i[a]<=r)return i[a];return i[0]}:function(r,s,o){o===void 0&&(o=.001);var a=t(r);return!s||Math.abs(a-r)i&&(r*=t/100),e=e.substr(0,i-1)),e=r+(e in Dv?Dv[e]*t:~e.indexOf("%")?parseFloat(e)*t/100:parseFloat(e)||0)}return e},Sg=function(e,t,i,r,s,o,a,l){var u=s.startColor,h=s.endColor,d=s.fontSize,p=s.indent,m=s.fontWeight,v=zn.createElement("div"),x=Zu(i)||_l(i,"pinType")==="fixed",y=e.indexOf("scroller")!==-1,g=x?Rn:i,S=e.indexOf("start")!==-1,A=S?u:h,E="border-color:"+A+";font-size:"+d+";color:"+A+";font-weight:"+m+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return E+="position:"+((y||l)&&x?"fixed;":"absolute;"),(y||l||!x)&&(E+=(r===yi?hE:dE)+":"+(o+parseFloat(p))+"px;"),a&&(E+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),v._isStart=S,v.setAttribute("class","gsap-marker-"+e+(t?" marker-"+t:"")),v.style.cssText=E,v.innerText=t||t===0?e+"-"+t:e,g.children[0]?g.insertBefore(v,g.children[0]):g.appendChild(v),v._offset=v["offset"+r.op.d2],z0(v,0,r,S),v},z0=function(e,t,i,r){var s={display:"block"},o=i[r?"os2":"p2"],a=i[r?"p2":"os2"];e._isFlipped=r,s[i.a+"Percent"]=r?-100:0,s[i.a]=r?"1px":0,s["border"+o+Yf]=1,s["border"+a+Yf]=0,s[i.p]=t+"px",vt.set(e,s)},Kt=[],$A={},gp,NR=function(){return Zi()-ks>34&&(gp||(gp=requestAnimationFrame(ma)))},Tc=function(){(!mr||!mr.isPressed||mr.startX>Rn.clientWidth)&&(Qt.cache++,mr?gp||(gp=requestAnimationFrame(ma)):ma(),ks||$u("scrollStart"),ks=Zi())},Cx=function(){DL=tn.innerWidth,LL=tn.innerHeight},vd=function(){Qt.cache++,!Qi&&!IL&&!zn.fullscreenElement&&!zn.webkitFullscreenElement&&(!QA||DL!==tn.innerWidth||Math.abs(tn.innerHeight-LL)>tn.innerHeight*.25)&&Bv.restart(!0)},qu={},AG=[],HL=function n(){return Ci(Zt,"scrollEnd",n)||Eu(!0)},$u=function(e){return qu[e]&&qu[e].map(function(t){return t()})||AG},Kr=[],VL=function(e){for(var t=0;ts,a=r._startClamp&&r.start>=s;(o||a)&&r.setPositions(a?s-1:r.start,o?Math.max(a?s:r.start+1,s):r.end,!0)}),OR(!1),qA=0,i.forEach(function(r){return r&&r.render&&r.render(-1)}),Qt.forEach(function(r){Ar(r)&&(r.smooth&&requestAnimationFrame(function(){return r.target.style.scrollBehavior="smooth"}),r.rec&&r(r.rec))}),WL(cE,1),Bv.pause(),ku++,_r=2,ma(2),Kt.forEach(function(r){return Ar(r.vars.onRefresh)&&r.vars.onRefresh(r)}),_r=Zt.isRefreshing=!1,$u("refresh")},eS=0,G0=1,kd,ma=function(e){if(e===2||!_r&&!Iv){Zt.isUpdating=!0,kd&&kd.update(0);var t=Kt.length,i=Zi(),r=i-wx>=50,s=t&&Kt[0].scroll();if(G0=eS>s?-1:1,_r||(eS=s),r&&(ks&&!a_&&i-ks>200&&(ks=0,$u("scrollEnd")),dd=wx,wx=i),G0<0){for(vr=t;vr-- >0;)Kt[vr]&&Kt[vr].update(0,r);G0=1}else for(vr=0;vr20),i-=i-C}if(v&&(l[v]=e||-.001,e<0&&(e=0)),o){var I=e+i,O=o._isStart;y="scroll"+r.d2,z0(o,I,r,O&&I>20||!O&&(d?Math.max(Rn[y],io[y]):o.parentNode[y])<=I+1),d&&(u=oa(a),d&&(o.style[r.op.p]=u[r.op.p]-r.op.m-o._offset+vi))}return m&&S&&(y=oa(S),m.seek(p),g=oa(S),m._caScrollDist=y[r.p]-g[r.p],e=e/m._caScrollDist*p),m&&m.seek(x),m?e:Math.round(e)},TG=/(webkit|moz|length|cssText|inset)/i,kR=function(e,t,i,r){if(e.parentNode!==t){var s=e.style,o,a;if(t===Rn){e._stOrig=s.cssText,a=Bs(e);for(o in a)!+o&&!TG.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=i,s.left=r}else s.cssText=e._stOrig;vt.core.getCache(e).uncache=1,t.appendChild(e)}},JL=function(e,t,i){var r=t,s=r;return function(o){var a=Math.round(e());return a!==r&&a!==s&&Math.abs(a-r)>3&&Math.abs(a-s)>3&&(o=a,i&&i()),s=r,r=o,o}},Eg=function(e,t,i){var r={};r[t.p]="+="+i,vt.set(e,r)},zR=function(e,t){var i=Tl(e,t),r="_scroll"+t.p2,s=function o(a,l,u,h,d){var p=o.tween,m=l.onComplete,v={};u=u||i();var x=JL(i,u,function(){p.kill(),o.tween=0});return d=h&&d||0,h=h||a-u,p&&p.kill(),l[r]=a,l.inherit=!1,l.modifiers=v,v[r]=function(){return x(u+h*p.ratio+d*p.ratio*p.ratio)},l.onUpdate=function(){Qt.cache++,o.tween&&ma()},l.onComplete=function(){o.tween=0,m&&m.call(p)},p=o.tween=vt.to(e,l),p};return e[r]=i,i.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ri(e,"wheel",i.wheelHandler),Zt.isTouch&&Ri(e,"touchmove",i.wheelHandler),s},Zt=function(){function n(t,i){Kc||n.register(vt)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),ZA(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),!pd){this.update=this.refresh=this.kill=Eo;return}i=LR(Zr(i)||gd(i)||i.nodeType?{trigger:i}:i,Ag);var s=i,o=s.onUpdate,a=s.toggleClass,l=s.id,u=s.onToggle,h=s.onRefresh,d=s.scrub,p=s.trigger,m=s.pin,v=s.pinSpacing,x=s.invalidateOnRefresh,y=s.anticipatePin,g=s.onScrubComplete,S=s.onSnapComplete,A=s.once,E=s.snap,b=s.pinReparent,C=s.pinSpacer,R=s.containerAnimation,I=s.fastScrollEnd,O=s.preventOverlaps,T=i.horizontal||i.containerAnimation&&i.horizontal!==!1?xr:yi,L=!d&&d!==0,K=Br(i.scroller||tn),se=vt.core.getCache(K),W=Zu(K),te=("pinType"in i?i.pinType:_l(K,"pinType")||W&&"fixed")==="fixed",$=[i.onEnter,i.onLeave,i.onEnterBack,i.onLeaveBack],oe=L&&i.toggleActions.split(" "),F="markers"in i?i.markers:Ag.markers,V=W?0:parseFloat(Bs(K)["border"+T.p2+Yf])||0,N=this,ee=i.onRefreshInit&&function(){return i.onRefreshInit(N)},fe=gG(K,W,T),Be=vG(K,W),ae=0,xe=0,Se=0,ke=Tl(K,T),We,Qe,lt,Ne,Y,Ae,ge,Fe,Ce,re,Xe,et,Et,H,U,ve,Me,be,Ie,tt,ct,Ge,Ke,Rt,Oe,qt,pt,ht,Z,de,Ue,Le,Pe,ie,He,pe,Ve,Je,Mt;if(N._startClamp=N._endClamp=!1,N._dir=T,y*=45,N.scroller=K,N.scroll=R?R.time.bind(R):ke,Ne=ke(),N.vars=i,r=r||i.animation,"refreshPriority"in i&&(BL=1,i.refreshPriority===-9999&&(kd=N)),se.tweenScroll=se.tweenScroll||{top:zR(K,yi),left:zR(K,xr)},N.tweenTo=We=se.tweenScroll[T.p],N.scrubDuration=function(je){Pe=gd(je)&&je,Pe?Le?Le.duration(je):Le=vt.to(r,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:Pe,paused:!0,onComplete:function(){return g&&g(N)}}):(Le&&Le.progress(1).kill(),Le=0)},r&&(r.vars.lazy=!1,r._initted&&!N.isReverted||r.vars.immediateRender!==!1&&i.immediateRender!==!1&&r.duration()&&r.render(0,!0,!0),N.animation=r.pause(),r.scrollTrigger=N,N.scrubDuration(d),de=0,l||(l=r.vars.id)),E&&((!du(E)||E.push)&&(E={snapTo:E}),"scrollBehavior"in Rn.style&&vt.set(W?[Rn,io]:K,{scrollBehavior:"auto"}),Qt.forEach(function(je){return Ar(je)&&je.target===(W?zn.scrollingElement||io:K)&&(je.smooth=!1)}),lt=Ar(E.snapTo)?E.snapTo:E.snapTo==="labels"?yG(r):E.snapTo==="labelsDirectional"?xG(r):E.directional!==!1?function(je,Tt){return mE(E.snapTo)(je,Zi()-xe<500?0:Tt.direction)}:vt.utils.snap(E.snapTo),ie=E.duration||{min:.1,max:2},ie=du(ie)?Dd(ie.min,ie.max):Dd(ie,ie),He=vt.delayedCall(E.delay||Pe/2||.1,function(){var je=ke(),Tt=Zi()-xe<500,xt=We.tween;if((Tt||Math.abs(N.getVelocity())<10)&&!xt&&!a_&&ae!==je){var It=(je-Ae)/H,dn=r&&!L?r.totalProgress():It,Dt=Tt?0:(dn-Ue)/(Zi()-dd)*1e3||0,_t=vt.utils.clamp(-It,1-It,wc(Dt/2)*Dt/.185),Ln=It+(E.inertia===!1?0:_t),mn,D,k=E,q=k.onStart,B=k.onInterrupt,z=k.onComplete;if(mn=lt(Ln,N),gd(mn)||(mn=Ln),D=Math.round(Ae+mn*H),je<=ge&&je>=Ae&&D!==je){if(xt&&!xt._initted&&xt.data<=wc(D-je))return;E.inertia===!1&&(_t=mn-It),We(D,{duration:ie(wc(Math.max(wc(Ln-dn),wc(mn-dn))*.185/Dt/.05||0)),ease:E.ease||"power3",data:wc(D-je),onInterrupt:function(){return He.restart(!0)&&B&&B(N)},onComplete:function(){N.update(),ae=ke(),r&&(Le?Le.resetTo("totalProgress",mn,r._tTime/r._tDur):r.progress(mn)),de=Ue=r&&!L?r.totalProgress():N.progress,S&&S(N),z&&z(N)}},je,_t*H,D-je-_t*H),q&&q(N,We.tween)}}else N.isActive&&ae!==je&&He.restart(!0)}).pause()),l&&($A[l]=N),p=N.trigger=Br(p||m!==!0&&m),Mt=p&&p._gsap&&p._gsap.stRevert,Mt&&(Mt=Mt(N)),m=m===!0?p:Br(m),Zr(a)&&(a={targets:p,className:a}),m&&(v===!1||v===Ps||(v=!v&&m.parentNode&&m.parentNode.style&&Bs(m.parentNode).display==="flex"?!1:fi),N.pin=m,Qe=vt.core.getCache(m),Qe.spacer?U=Qe.pinState:(C&&(C=Br(C),C&&!C.nodeType&&(C=C.current||C.nativeElement),Qe.spacerIsNative=!!C,C&&(Qe.spacerState=Mg(C))),Qe.spacer=be=C||zn.createElement("div"),be.classList.add("pin-spacer"),l&&be.classList.add("pin-spacer-"+l),Qe.pinState=U=Mg(m)),i.force3D!==!1&&vt.set(m,{force3D:!0}),N.spacer=be=Qe.spacer,Z=Bs(m),Rt=Z[v+T.os2],tt=vt.getProperty(m),ct=vt.quickSetter(m,T.a,vi),Rx(m,be,Z),Me=Mg(m)),F){et=du(F)?LR(F,DR):DR,re=Sg("scroller-start",l,K,T,et,0),Xe=Sg("scroller-end",l,K,T,et,0,re),Ie=re["offset"+T.op.d2];var Ot=Br(_l(K,"content")||K);Fe=this.markerStart=Sg("start",l,Ot,T,et,Ie,0,R),Ce=this.markerEnd=Sg("end",l,Ot,T,et,Ie,0,R),R&&(Je=vt.quickSetter([Fe,Ce],T.a,vi)),!te&&!(Lo.length&&_l(K,"fixedMarkers")===!0)&&(_G(W?Rn:K),vt.set([re,Xe],{force3D:!0}),qt=vt.quickSetter(re,T.a,vi),ht=vt.quickSetter(Xe,T.a,vi))}if(R){var ut=R.vars.onUpdate,ot=R.vars.onUpdateParams;R.eventCallback("onUpdate",function(){N.update(0,0,1),ut&&ut.apply(R,ot||[])})}if(N.previous=function(){return Kt[Kt.indexOf(N)-1]},N.next=function(){return Kt[Kt.indexOf(N)+1]},N.revert=function(je,Tt){if(!Tt)return N.kill(!0);var xt=je!==!1||!N.enabled,It=Qi;xt!==N.isReverted&&(xt&&(pe=Math.max(ke(),N.scroll.rec||0),Se=N.progress,Ve=r&&r.progress()),Fe&&[Fe,Ce,re,Xe].forEach(function(dn){return dn.style.display=xt?"none":"block"}),xt&&(Qi=N,N.update(xt)),m&&(!b||!N.isActive)&&(xt?MG(m,be,U):Rx(m,be,Bs(m),Oe)),xt||N.update(xt),Qi=It,N.isReverted=xt)},N.refresh=function(je,Tt,xt,It){if(!((Qi||!N.enabled)&&!Tt)){if(m&&je&&ks){Ri(n,"scrollEnd",HL);return}!_r&&ee&&ee(N),Qi=N,We.tween&&!xt&&(We.tween.kill(),We.tween=0),Le&&Le.pause(),x&&r&&r.revert({kill:!1}).invalidate(),N.isReverted||N.revert(!0,!0),N._subPinOffset=!1;var dn=fe(),Dt=Be(),_t=R?R.duration():Ro(K,T),Ln=H<=.01,mn=0,D=It||0,k=du(xt)?xt.end:i.end,q=i.endTrigger||p,B=du(xt)?xt.start:i.start||(i.start===0||!p?0:m?"0 0":"0 100%"),z=N.pinnedContainer=i.pinnedContainer&&Br(i.pinnedContainer,N),X=p&&Math.max(0,Kt.indexOf(N))||0,Q=X,j,he,ye,we,_e,Ze,De,ze,ft,At,yt,Lt,rt;for(F&&du(xt)&&(Lt=vt.getProperty(re,T.p),rt=vt.getProperty(Xe,T.p));Q--;)Ze=Kt[Q],Ze.end||Ze.refresh(0,1)||(Qi=N),De=Ze.pin,De&&(De===p||De===m||De===z)&&!Ze.isReverted&&(At||(At=[]),At.unshift(Ze),Ze.revert(!0,!0)),Ze!==Kt[Q]&&(X--,Q--);for(Ar(B)&&(B=B(N)),B=bR(B,"start",N),Ae=UR(B,p,dn,T,ke(),Fe,re,N,Dt,V,te,_t,R,N._startClamp&&"_startClamp")||(m?-.001:0),Ar(k)&&(k=k(N)),Zr(k)&&!k.indexOf("+=")&&(~k.indexOf(" ")?k=(Zr(B)?B.split(" ")[0]:"")+k:(mn=k0(k.substr(2),dn),k=Zr(B)?B:(R?vt.utils.mapRange(0,R.duration(),R.scrollTrigger.start,R.scrollTrigger.end,Ae):Ae)+mn,q=p)),k=bR(k,"end",N),ge=Math.max(Ae,UR(k||(q?"100% 0":_t),q,dn,T,ke()+mn,Ce,Xe,N,Dt,V,te,_t,R,N._endClamp&&"_endClamp"))||-.001,mn=0,Q=X;Q--;)Ze=Kt[Q],De=Ze.pin,De&&Ze.start-Ze._pinPush<=Ae&&!R&&Ze.end>0&&(j=Ze.end-(N._startClamp?Math.max(0,Ze.start):Ze.start),(De===p&&Ze.start-Ze._pinPush=Ro(K,T)))j=Bs(m),we=T===yi,ye=ke(),Ge=parseFloat(tt(T.a))+D,!_t&&ge>1&&(yt=(W?zn.scrollingElement||io:K).style,yt={style:yt,value:yt["overflow"+T.a.toUpperCase()]},W&&Bs(Rn)["overflow"+T.a.toUpperCase()]!=="scroll"&&(yt.style["overflow"+T.a.toUpperCase()]="scroll")),Rx(m,be,j),Me=Mg(m),he=oa(m,!0),ze=te&&Tl(K,we?xr:yi)(),v?(Oe=[v+T.os2,H+D+vi],Oe.t=be,Q=v===fi?Lv(m,T)+H+D:0,Q&&(Oe.push(T.d,Q+vi),be.style.flexBasis!=="auto"&&(be.style.flexBasis=Q+vi)),Bf(Oe),z&&Kt.forEach(function(qe){qe.pin===z&&qe.vars.pinSpacing!==!1&&(qe._subPinOffset=!0)}),te&&ke(pe)):(Q=Lv(m,T),Q&&be.style.flexBasis!=="auto"&&(be.style.flexBasis=Q+vi)),te&&(_e={top:he.top+(we?ye-Ae:ze)+vi,left:he.left+(we?ze:ye-Ae)+vi,boxSizing:"border-box",position:"fixed"},_e[Ou]=_e["max"+Yf]=Math.ceil(he.width)+vi,_e[Uu]=_e["max"+pE]=Math.ceil(he.height)+vi,_e[Ps]=_e[Ps+Od]=_e[Ps+Nd]=_e[Ps+Ud]=_e[Ps+Fd]="0",_e[fi]=j[fi],_e[fi+Od]=j[fi+Od],_e[fi+Nd]=j[fi+Nd],_e[fi+Ud]=j[fi+Ud],_e[fi+Fd]=j[fi+Fd],ve=wG(U,_e,b),_r&&ke(0)),r?(ft=r._initted,Mx(1),r.render(r.duration(),!0,!0),Ke=tt(T.a)-Ge+H+D,pt=Math.abs(H-Ke)>1,te&&pt&&ve.splice(ve.length-2,2),r.render(0,!0,!0),ft||r.invalidate(!0),r.parent||r.totalTime(r.totalTime()),Mx(0)):Ke=H,yt&&(yt.value?yt.style["overflow"+T.a.toUpperCase()]=yt.value:yt.style.removeProperty("overflow-"+T.a));else if(p&&ke()&&!R)for(he=p.parentNode;he&&he!==Rn;)he._pinOffset&&(Ae-=he._pinOffset,ge-=he._pinOffset),he=he.parentNode;At&&At.forEach(function(qe){return qe.revert(!1,!0)}),N.start=Ae,N.end=ge,Ne=Y=_r?pe:ke(),!R&&!_r&&(Ne0?Kt.slice(0,Tt).reverse():Kt.slice(Tt+1);return(Zr(je)?xt.filter(function(It){return It.vars.preventOverlaps===je}):xt).filter(function(It){return N.direction>0?It.end<=Ae:It.start>=ge})},N.update=function(je,Tt,xt){if(!(R&&!xt&&!je)){var It=_r===!0?pe:N.scroll(),dn=je?0:(It-Ae)/H,Dt=dn<0?0:dn>1?1:dn||0,_t=N.progress,Ln,mn,D,k,q,B,z,X;if(Tt&&(Y=Ne,Ne=R?ke():It,E&&(Ue=de,de=r&&!L?r.totalProgress():Dt)),y&&m&&!Qi&&!vg&&ks&&(!Dt&&AeIt+(It-Y)/(Zi()-dd)*y&&(Dt=.9999)),Dt!==_t&&N.enabled){if(Ln=N.isActive=!!Dt&&Dt<1,mn=!!_t&&_t<1,B=Ln!==mn,q=B||!!Dt!=!!_t,N.direction=Dt>_t?1:-1,N.progress=Dt,q&&!Qi&&(D=Dt&&!_t?0:Dt===1?1:_t===1?2:3,L&&(k=!B&&oe[D+1]!=="none"&&oe[D+1]||oe[D],X=r&&(k==="complete"||k==="reset"||k in r))),O&&(B||X)&&(X||d||!r)&&(Ar(O)?O(N):N.getTrailing(O).forEach(function(ye){return ye.endAnimation()})),L||(Le&&!Qi&&!vg?(Le._dp._time-Le._start!==Le._time&&Le.render(Le._dp._time-Le._start),Le.resetTo?Le.resetTo("totalProgress",Dt,r._tTime/r._tDur):(Le.vars.totalProgress=Dt,Le.invalidate().restart())):r&&r.totalProgress(Dt,!!(Qi&&(xe||je)))),m){if(je&&v&&(be.style[v+T.os2]=Rt),!te)ct(md(Ge+Ke*Dt));else if(q){if(z=!je&&Dt>_t&&ge+1>It&&It+1>=Ro(K,T),b)if(!je&&(Ln||z)){var Q=oa(m,!0),j=It-Ae;kR(m,Rn,Q.top+(T===yi?j:0)+vi,Q.left+(T===yi?0:j)+vi)}else kR(m,be);Bf(Ln||z?ve:Me),pt&&Dt<1&&Ln||ct(Ge+(Dt===1&&!z?Ke:0))}}E&&!We.tween&&!Qi&&!vg&&He.restart(!0),a&&(B||A&&Dt&&(Dt<1||!Ex))&&mp(a.targets).forEach(function(ye){return ye.classList[Ln||A?"add":"remove"](a.className)}),o&&!L&&!je&&o(N),q&&!Qi?(L&&(X&&(k==="complete"?r.pause().totalProgress(1):k==="reset"?r.restart(!0).pause():k==="restart"?r.restart(!0):r[k]()),o&&o(N)),(B||!Ex)&&(u&&B&&Tx(N,u),$[D]&&Tx(N,$[D]),A&&(Dt===1?N.kill(!1,1):$[D]=0),B||(D=Dt===1?1:3,$[D]&&Tx(N,$[D]))),I&&!Ln&&Math.abs(N.getVelocity())>(gd(I)?I:2500)&&(Xh(N.callbackAnimation),Le?Le.progress(1):Xh(r,k==="reverse"?1:!Dt,1))):L&&o&&!Qi&&o(N)}if(ht){var he=R?It/R.duration()*(R._caScrollDist||0):It;qt(he+(re._isFlipped?1:0)),ht(he)}Je&&Je(-It/R.duration()*(R._caScrollDist||0))}},N.enable=function(je,Tt){N.enabled||(N.enabled=!0,Ri(K,"resize",vd),W||Ri(K,"scroll",Tc),ee&&Ri(n,"refreshInit",ee),je!==!1&&(N.progress=Se=0,Ne=Y=ae=ke()),Tt!==!1&&N.refresh())},N.getTween=function(je){return je&&We?We.tween:Le},N.setPositions=function(je,Tt,xt,It){if(R){var dn=R.scrollTrigger,Dt=R.duration(),_t=dn.end-dn.start;je=dn.start+_t*je/Dt,Tt=dn.start+_t*Tt/Dt}N.refresh(!1,!1,{start:PR(je,xt&&!!N._startClamp),end:PR(Tt,xt&&!!N._endClamp)},It),N.update()},N.adjustPinSpacing=function(je){if(Oe&&je){var Tt=Oe.indexOf(T.d)+1;Oe[Tt]=parseFloat(Oe[Tt])+je+vi,Oe[1]=parseFloat(Oe[1])+je+vi,Bf(Oe)}},N.disable=function(je,Tt){if(N.enabled&&(je!==!1&&N.revert(!0,!0),N.enabled=N.isActive=!1,Tt||Le&&Le.pause(),pe=0,Qe&&(Qe.uncache=1),ee&&Ci(n,"refreshInit",ee),He&&(He.pause(),We.tween&&We.tween.kill()&&(We.tween=0)),!W)){for(var xt=Kt.length;xt--;)if(Kt[xt].scroller===K&&Kt[xt]!==N)return;Ci(K,"resize",vd),W||Ci(K,"scroll",Tc)}},N.kill=function(je,Tt){N.disable(je,Tt),Le&&!Tt&&Le.kill(),l&&delete $A[l];var xt=Kt.indexOf(N);xt>=0&&Kt.splice(xt,1),xt===vr&&G0>0&&vr--,xt=0,Kt.forEach(function(It){return It.scroller===N.scroller&&(xt=1)}),xt||_r||(N.scroll.rec=0),r&&(r.scrollTrigger=null,je&&r.revert({kill:!1}),Tt||r.kill()),Fe&&[Fe,Ce,re,Xe].forEach(function(It){return It.parentNode&&It.parentNode.removeChild(It)}),kd===N&&(kd=0),m&&(Qe&&(Qe.uncache=1),xt=0,Kt.forEach(function(It){return It.pin===m&&xt++}),xt||(Qe.spacer=0)),i.onKill&&i.onKill(N)},Kt.push(N),N.enable(!1,!1),Mt&&Mt(N),r&&r.add&&!H){var dt=N.update;N.update=function(){N.update=dt,Ae||ge||N.refresh()},vt.delayedCall(.01,N.update),H=.01,Ae=ge=0}else N.refresh();m&&SG()},n.register=function(i){return Kc||(vt=i||FL(),NL()&&window.document&&n.enable(),Kc=pd),Kc},n.defaults=function(i){if(i)for(var r in i)Ag[r]=i[r];return Ag},n.disable=function(i,r){pd=0,Kt.forEach(function(o){return o[r?"kill":"disable"](i)}),Ci(tn,"wheel",Tc),Ci(zn,"scroll",Tc),clearInterval(gg),Ci(zn,"touchcancel",Eo),Ci(Rn,"touchstart",Eo),yg(Ci,zn,"pointerdown,touchstart,mousedown",BR),yg(Ci,zn,"pointerup,touchend,mouseup",IR),Bv.kill(),_g(Ci);for(var s=0;s0&&o.left+a0&&o.top+a=0&&Kr.splice(t,5),Kr.push(e,e.style.cssText,e.getBBox&&e.getAttribute("transform"),vt.core.getCache(e),ZA())}}):Kr};Zt.revert=function(n,e){return gE(!n,e)};Zt.create=function(n,e){return new Zt(n,e)};Zt.refresh=function(n){return n?vd():(Kc||Zt.register())&&Eu(!0)};Zt.update=function(n){return++Qt.cache&&ma(n===!0?2:0)};Zt.clearScrollMemory=WL;Zt.maxScroll=function(n,e){return Ro(n,e?xr:yi)};Zt.getScrollFunc=function(n,e){return Tl(Br(n),e?xr:yi)};Zt.getById=function(n){return $A[n]};Zt.getAll=function(){return Kt.filter(function(n){return n.vars.id!=="ScrollSmoother"})};Zt.isScrolling=function(){return!!ks};Zt.snapDirectional=mE;Zt.addEventListener=function(n,e){var t=qu[n]||(qu[n]=[]);~t.indexOf(e)||t.push(e)};Zt.removeEventListener=function(n,e){var t=qu[n],i=t&&t.indexOf(e);i>=0&&t.splice(i,1)};Zt.batch=function(n,e){var t=[],i={},r=e.interval||.016,s=e.batchMax||1e9,o=function(u,h){var d=[],p=[],m=vt.delayedCall(r,function(){h(d,p),d=[],p=[]}).pause();return function(v){d.length||m.restart(!0),d.push(v.trigger),p.push(v),s<=d.length&&m.progress(1)}},a;for(a in e)i[a]=a.substr(0,2)==="on"&&Ar(e[a])&&a!=="onRefreshInit"?o(a,e[a]):e[a];return Ar(s)&&(s=s(),Ri(Zt,"refresh",function(){return s=e.batchMax()})),mp(n).forEach(function(l){var u={};for(a in i)u[a]=i[a];u.trigger=l,t.push(Zt.create(u))}),t};var GR=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},bx=function n(e,t){t===!0?e.style.removeProperty("touch-action"):e.style.touchAction=t===!0?"auto":t?"pan-"+t+(ai.isTouch?" pinch-zoom":""):"none",e===io&&n(Rn,t)},wg={auto:1,scroll:1},CG=function(e){var t=e.event,i=e.target,r=e.axis,s=(t.changedTouches?t.changedTouches[0]:t).target,o=s._gsap||vt.core.getCache(s),a=Zi(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Rn&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(wg[(l=Bs(s)).overflowY]||wg[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==i&&!Zu(s)&&(wg[(l=Bs(s)).overflowY]||wg[l.overflowX]),o._isScrollT=a}(o._isScroll||r==="x")&&(t.stopPropagation(),t._gsapAllow=!0)},jL=function(e,t,i,r){return ai.create({target:e,capture:!0,debounce:!1,lockAxis:!0,type:t,onWheel:r=r&&CG,onPress:r,onDrag:r,onScroll:r,onEnable:function(){return i&&Ri(zn,ai.eventTypes[0],VR,!1,!0)},onDisable:function(){return Ci(zn,ai.eventTypes[0],VR,!0)}})},RG=/(input|label|select|textarea)/i,HR,VR=function(e){var t=RG.test(e.target.tagName);(t||HR)&&(e._gsapAllow=!0,HR=t)},bG=function(e){du(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,s=t.allowNestedScroll,o=t.onRelease,a,l,u=Br(e.target)||io,h=vt.core.globals().ScrollSmoother,d=h&&h.get(),p=Ja&&(e.content&&Br(e.content)||d&&e.content!==!1&&!d.smooth()&&d.content()),m=Tl(u,yi),v=Tl(u,xr),x=1,y=(ai.isTouch&&tn.visualViewport?tn.visualViewport.scale*tn.visualViewport.width:tn.outerWidth)/tn.innerWidth,g=0,S=Ar(r)?function(){return r(a)}:function(){return r||2.8},A,E,b=jL(u,e.type,!0,s),C=function(){return E=!1},R=Eo,I=Eo,O=function(){l=Ro(u,yi),I=Dd(Ja?1:0,l),i&&(R=Dd(0,Ro(u,xr))),A=ku},T=function(){p._gsap.y=md(parseFloat(p._gsap.y)+m.offset)+"px",p.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(p._gsap.y)+", 0, 1)",m.offset=m.cacheID=0},L=function(){if(E){requestAnimationFrame(C);var F=md(a.deltaY/2),V=I(m.v-F);if(p&&V!==m.v+m.offset){m.offset=V-m.v;var N=md((parseFloat(p&&p._gsap.y)||0)-m.offset);p.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+N+", 0, 1)",p._gsap.y=N+"px",m.cacheID=Qt.cache,ma()}return!0}m.offset&&T(),E=!0},K,se,W,te,$=function(){O(),K.isActive()&&K.vars.scrollY>l&&(m()>l?K.progress(1)&&m(l):K.resetTo("scrollY",l))};return p&&vt.set(p,{y:"+=0"}),e.ignoreCheck=function(oe){return Ja&&oe.type==="touchmove"&&L()||x>1.05&&oe.type!=="touchstart"||a.isGesturing||oe.touches&&oe.touches.length>1},e.onPress=function(){E=!1;var oe=x;x=md((tn.visualViewport&&tn.visualViewport.scale||1)/y),K.pause(),oe!==x&&bx(u,x>1.01?!0:i?!1:"x"),se=v(),W=m(),O(),A=ku},e.onRelease=e.onGestureStart=function(oe,F){if(m.offset&&T(),!F)te.restart(!0);else{Qt.cache++;var V=S(),N,ee;i&&(N=v(),ee=N+V*.05*-oe.velocityX/.227,V*=GR(v,N,ee,Ro(u,xr)),K.vars.scrollX=R(ee)),N=m(),ee=N+V*.05*-oe.velocityY/.227,V*=GR(m,N,ee,Ro(u,yi)),K.vars.scrollY=I(ee),K.invalidate().duration(V).play(.01),(Ja&&K.vars.scrollY>=l||N>=l-1)&&vt.to({},{onUpdate:$,duration:V})}o&&o(oe)},e.onWheel=function(){K._ts&&K.pause(),Zi()-g>1e3&&(A=0,g=Zi())},e.onChange=function(oe,F,V,N,ee){if(ku!==A&&O(),F&&i&&v(R(N[2]===F?se+(oe.startX-oe.x):v()+F-N[1])),V){m.offset&&T();var fe=ee[2]===V,Be=fe?W+oe.startY-oe.y:m()+V-ee[1],ae=I(Be);fe&&Be!==ae&&(W+=ae-Be),m(ae)}(V||F)&&ma()},e.onEnable=function(){bx(u,i?!1:"x"),Zt.addEventListener("refresh",$),Ri(tn,"resize",$),m.smooth&&(m.target.style.scrollBehavior="auto",m.smooth=v.smooth=!1),b.enable()},e.onDisable=function(){bx(u,!0),Ci(tn,"resize",$),Zt.removeEventListener("refresh",$),b.kill()},e.lockAxis=e.lockAxis!==!1,a=new ai(e),a.iOS=Ja,Ja&&!m()&&m(1),Ja&&vt.ticker.add(Eo),te=a._dc,K=vt.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:i?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:JL(m,m(),function(){return K.pause()})},onUpdate:ma,onComplete:te.vars.onComplete}),a};Zt.sort=function(n){return Kt.sort(n||function(e,t){return(e.vars.refreshPriority||0)*-1e6+e.start-(t.start+(t.vars.refreshPriority||0)*-1e6)})};Zt.observe=function(n){return new ai(n)};Zt.normalizeScroll=function(n){if(typeof n>"u")return mr;if(n===!0&&mr)return mr.enable();if(n===!1){mr&&mr.kill(),mr=n;return}var e=n instanceof ai?n:bG(n);return mr&&mr.target===e.target&&mr.kill(),Zu(e.target)&&(mr=e),e};Zt.core={_getVelocityProp:YA,_inputObserver:jL,_scrollers:Qt,_proxies:Lo,bridge:{ss:function(){ks||$u("scrollStart"),ks=Zi()},ref:function(){return Qi}}};FL()&&vt.registerPlugin(Zt);const PG=["Store","Mac","iPhone","Support"],WR=[{id:1,textLists:["Enter A17 Pro.","Game‑changing chip.","Groundbreaking performance."],video:Xz,videoDuration:4},{id:2,textLists:["Titanium.","So strong. So light. So Pro."],video:Jz,videoDuration:5},{id:3,textLists:["iPhone 15 Pro Max has the","longest optical zoom in","iPhone ever. Far out."],video:jz,videoDuration:2},{id:4,textLists:["All-new Action button.","What will yours do?."],video:Yz,videoDuration:3.63}],BG=[{id:1,title:"iPhone 15 Pro in Natural Titanium",color:["#8F8A81","#ffe7b9","#6f6c64"],img:SL},{id:2,title:"iPhone 15 Pro in Blue Titanium",color:["#53596E","#6395ff","#21242e"],img:sG},{id:3,title:"iPhone 15 Pro in White Titanium",color:["#C9C8C2","#ffffff","#C9C8C2"],img:oG},{id:4,title:"iPhone 15 Pro in Black Titanium",color:["#454749","#3b3b3b","#181819"],img:aG}],IG=[{label:'6.1"',value:"small"},{label:'6.7"',value:"large"}],XR=["Privacy Policy","Terms of Use","Sales Policy","Legal","Site Map"];Zn.registerPlugin(Zt);const LG=()=>{const n=ne.useRef([]),e=ne.useRef([]),t=ne.useRef([]),[i,r]=ne.useState({isEnd:!1,startPlay:!1,videoId:0,isLastVideo:!1,isPlaying:!1}),[s,o]=ne.useState([]),{isEnd:a,isLastVideo:l,startPlay:u,videoId:h,isPlaying:d}=i;Nl(()=>{Zn.to("#slider",{transform:`translateX(${-100*h}%)`,duration:2,ease:"power2.inOut"}),Zn.to("#video",{scrollTrigger:{trigger:"#video",toggleActions:"restart none none none"},onComplete:()=>{r(v=>({...v,startPlay:!0,isPlaying:!0}))}})},[a,h]),ne.useEffect(()=>{let v=0,x=e.current;if(x[h]){let y=Zn.to(x[h],{onUpdate:()=>{const S=Math.ceil(y.progress()*100);S!=v&&(v=S,Zn.to(t.current[h],{width:window.innerWidth<760||window.innerWidth<1200?"10vw":"4vw"}),Zn.to(x[h],{width:`${v}%`,backgroundColor:"white"}))},onComplete:()=>{d&&(Zn.to(t.current[h],{width:"12px"}),Zn.to(x[h],{backgroundColor:"#afafaf"}))}});h===0&&y.restart();const g=()=>{y.progress(n.current[h].currentTime/WR[h].videoDuration)};d?Zn.ticker.add(g):Zn.ticker.remove(g)}},[h,u,d]),ne.useEffect(()=>{s.length>3&&(d?u&&n.current[h].play():n.current[h].pause())},[u,h,d,s]);const p=(v,x)=>{switch(v){case"video-end":r(y=>({...y,isEnd:!0,videoId:x+1}));break;case"video-last":r(y=>({...y,isLastVideo:!0}));break;case"video-reset":r(y=>({...y,isLastVideo:!1,videoId:0}));break;case"play":r(y=>({...y,isPlaying:!y.isPlaying}));break;case"pause":r(y=>({...y,isPlaying:!y.isPlaying}));break;default:return i}},m=(v,x)=>o(y=>[...y,x]);return ue.jsxs(ue.Fragment,{children:[ue.jsx("div",{className:"flex items-center",children:WR.map((v,x)=>ue.jsx("div",{id:"slider",className:"sm:pr-20 pr-10",children:ue.jsxs("div",{className:"video-carousel_container",children:[ue.jsx("div",{className:"w-full h-full flex-center rounded-3xl overflow-hidden bg-black",children:ue.jsx("video",{id:"video",playsInline:!0,className:`${v.id===2&&"translate-x-44"} pointer-events-none - `,preload:"auto",muted:!0,ref:y=>n.current[x]=y,onEnded:()=>x!==3?p("video-end",x):p("video-last"),onPlay:()=>{r(y=>({...y,isPlaying:!0}))},onLoadedMetadata:y=>m(x,y),children:fe.jsx("source",{src:v.video,type:"video/mp4"})})}),fe.jsx("div",{className:"absolute top-12 left-[5%] z-10",children:v.textLists.map((y,g)=>fe.jsx("p",{className:"md:text-2xl text-lg font-medium",children:y},g))})]})},v.id))}),fe.jsxs("div",{className:"relative flex-center mt-10",children:[fe.jsx("div",{className:"flex-center py-5 px-7 bg-gray-300 backdrop-blur rounded-full",children:n.current.map((v,x)=>fe.jsx("span",{ref:y=>t.current[x]=y,className:"mx-2 w-3 h-3 bg-gray-200 rounded-full relative cursor-pointer",children:fe.jsx("span",{ref:y=>e.current[x]=y,className:"absolute h-full w-full rounded-full"})},x))}),fe.jsx("button",{className:"control-btn",children:fe.jsx("img",{src:l?qz:d?eG:$z,alt:l?"replay":d?"pause":"play",onClick:l?()=>p("video-reset"):d?()=>p("pause"):()=>p("play")})})]})]})},bG=()=>(sc(()=>{fi.to("#title",{opacity:1,y:0}),fi.to(".link",{opacity:1,y:0,duration:1,stagger:.25})},[]),fe.jsx("section",{id:"highlights",className:"w-screen overflow-hidden h-full common-padding bg-zinc",children:fe.jsxs("div",{className:"screen-max-width",children:[fe.jsxs("div",{className:"mb-12 w-full md:flex items-end justify-between",children:[fe.jsx("h1",{id:"title",className:"section-heading",children:"Get the highlights."}),fe.jsxs("div",{className:"flex flex-wrap items-end gap-5",children:[fe.jsxs("p",{className:"link",children:["Watch the film",fe.jsx("img",{src:Qz,alt:"watch",className:"ml-2"})]}),fe.jsxs("p",{className:"link",children:["Watch the event",fe.jsx("img",{src:Zz,alt:"right",className:"ml-2"})]})]})]}),fe.jsx(RG,{})]})})),PG=()=>fe.jsx("header",{className:"w-full py-5 sm:px-10 px-5 flex justify-between items-center",children:fe.jsxs("nav",{className:"flex w-full screen-max-width",children:[fe.jsx("img",{src:jz,alt:"Apple",width:14,height:18}),fe.jsx("div",{className:"flex flex-1 justify-center max-sm:hidden",children:wG.map(n=>fe.jsx("div",{className:"px-5 text-sm cursor-pointer text-gray hover:text-white transition-all",children:n},n))}),fe.jsxs("div",{className:"flex items-baseline gap-7 max-sm:justify-end max-sm:flex-1",children:[fe.jsx("img",{src:Yz,alt:"search",width:18,height:18}),fe.jsx("img",{src:Kz,alt:"bag",width:18,height:18})]})]})});/** + `,preload:"auto",muted:!0,ref:y=>n.current[x]=y,onEnded:()=>x!==3?p("video-end",x):p("video-last"),onPlay:()=>{r(y=>({...y,isPlaying:!0}))},onLoadedMetadata:y=>m(x,y),children:ue.jsx("source",{src:v.video,type:"video/mp4"})})}),ue.jsx("div",{className:"absolute top-12 left-[5%] z-10",children:v.textLists.map((y,g)=>ue.jsx("p",{className:"md:text-2xl text-lg font-medium",children:y},g))})]})},v.id))}),ue.jsxs("div",{className:"relative flex-center mt-10",children:[ue.jsx("div",{className:"flex-center py-5 px-7 bg-gray-300 backdrop-blur rounded-full",children:n.current.map((v,x)=>ue.jsx("span",{ref:y=>t.current[x]=y,className:"mx-2 w-3 h-3 bg-gray-200 rounded-full relative cursor-pointer",children:ue.jsx("span",{ref:y=>e.current[x]=y,className:"absolute h-full w-full rounded-full"})},x))}),ue.jsx("button",{className:"control-btn",children:ue.jsx("img",{src:l?nG:d?rG:iG,alt:l?"replay":d?"pause":"play",onClick:l?()=>p("video-reset"):d?()=>p("pause"):()=>p("play")})})]})]})},DG=()=>(Nl(()=>{Zn.to("#title",{opacity:1,y:0}),Zn.to(".link",{opacity:1,y:0,duration:1,stagger:.25})},[]),ue.jsx("section",{id:"highlights",className:"w-screen overflow-hidden h-full common-padding bg-zinc",children:ue.jsxs("div",{className:"screen-max-width",children:[ue.jsxs("div",{className:"mb-12 w-full md:flex items-end justify-between",children:[ue.jsx("h1",{id:"title",className:"section-heading",children:"Get the highlights."}),ue.jsxs("div",{className:"flex flex-wrap items-end gap-5",children:[ue.jsxs("p",{className:"link",children:["Watch the film",ue.jsx("img",{src:eG,alt:"watch",className:"ml-2"})]}),ue.jsxs("p",{className:"link",children:["Watch the event",ue.jsx("img",{src:tG,alt:"right",className:"ml-2"})]})]})]}),ue.jsx(LG,{})]})})),NG=()=>ue.jsx("header",{className:"w-full py-5 sm:px-10 px-5 flex justify-between items-center",children:ue.jsxs("nav",{className:"flex w-full screen-max-width",children:[ue.jsx("img",{src:Zz,alt:"Apple",width:14,height:18}),ue.jsx("div",{className:"flex flex-1 justify-center max-sm:hidden",children:PG.map(n=>ue.jsx("div",{className:"px-5 text-sm cursor-pointer text-gray hover:text-white transition-all",children:n},n))}),ue.jsxs("div",{className:"flex items-baseline gap-7 max-sm:justify-end max-sm:flex-1",children:[ue.jsx("img",{src:qz,alt:"search",width:18,height:18}),ue.jsx("img",{src:$z,alt:"bag",width:18,height:18})]})]})});/** * @license * Copyright 2010-2023 Three.js Authors * SPDX-License-Identifier: MIT - */const ch="162",du={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},pu={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},JL=0,nS=1,jL=2,BG=3,YL=0,l_=1,zd=2,eo=3,ko=0,Er=1,Lr=2,ga=0,ku=1,iS=2,rS=3,sS=4,KL=5,qa=100,QL=101,ZL=102,oS=103,aS=104,qL=200,$L=201,eD=202,tD=203,Nv=204,Fv=205,nD=206,iD=207,rD=208,sD=209,oD=210,aD=211,lD=212,uD=213,cD=214,fD=0,hD=1,dD=2,vp=3,pD=4,mD=5,gD=6,vD=7,kp=0,_D=1,yD=2,Do=0,xD=1,AD=2,SD=3,vE=4,MD=5,ED=6,wD=7,lS="attached",TD="detached",u_=300,zo=301,Cl=302,Kf=303,_p=304,fh=306,Rl=1e3,Fi=1001,Qf=1002,Zn=1003,yp=1004,IG=1004,$a=1005,LG=1005,pn=1006,If=1007,DG=1007,Fs=1008,NG=1008,No=1009,CD=1010,RD=1011,c_=1012,_E=1013,ha=1014,pi=1015,tr=1016,yE=1017,xE=1018,yl=1020,bD=1021,er=1023,PD=1024,BD=1025,xl=1026,$u=1027,f_=1028,AE=1029,ID=1030,SE=1031,ME=1033,W0=33776,X0=33777,J0=33778,j0=33779,uS=35840,cS=35841,fS=35842,hS=35843,EE=36196,dS=37492,pS=37496,mS=37808,gS=37809,vS=37810,_S=37811,yS=37812,xS=37813,AS=37814,SS=37815,MS=37816,ES=37817,wS=37818,TS=37819,CS=37820,RS=37821,Y0=36492,bS=36494,PS=36495,LD=36283,BS=36284,IS=36285,LS=36286,DD=2200,ND=2201,FD=2202,Zf=2300,ec=2301,K0=2302,Eu=2400,wu=2401,xp=2402,h_=2500,wE=2501,OD=0,TE=1,Ov=2,UD=3200,kD=3201,Nl=0,zD=1,aa="",Cs="srgb",wa="srgb-linear",d_="display-p3",zp="display-p3-linear",Ap="linear",Mn="srgb",Sp="rec709",Mp="p3",FG=0,mu=7680,OG=7681,UG=7682,kG=7683,zG=34055,GG=34056,HG=5386,VG=512,WG=513,XG=514,JG=515,jG=516,YG=517,KG=518,DS=519,GD=512,HD=513,VD=514,CE=515,WD=516,XD=517,JD=518,jD=519,Ep=35044,QG=35048,ZG=35040,qG=35045,$G=35049,eH=35041,tH=35046,nH=35050,iH=35042,rH="100",NS="300 es",Uv=1035,bo=2e3,wp=2001;class Go{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const r=this._listeners[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const i=this._listeners[e.type];if(i!==void 0){e.target=this;const r=i.slice(0);for(let s=0,o=r.length;s>8&255]+ji[n>>16&255]+ji[n>>24&255]+"-"+ji[e&255]+ji[e>>8&255]+"-"+ji[e>>16&15|64]+ji[e>>24&255]+"-"+ji[t&63|128]+ji[t>>8&255]+"-"+ji[t>>16&255]+ji[t>>24&255]+ji[i&255]+ji[i>>8&255]+ji[i>>16&255]+ji[i>>24&255]).toLowerCase()}function qn(n,e,t){return Math.max(e,Math.min(t,n))}function RE(n,e){return(n%e+e)%e}function sH(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function oH(n,e,t){return n!==e?(t-n)/(e-n):0}function Gd(n,e,t){return(1-t)*n+t*e}function aH(n,e,t,i){return Gd(n,e,1-Math.exp(-t*i))}function lH(n,e=1){return e-Math.abs(RE(n,e*2)-e)}function uH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function cH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function fH(n,e){return n+Math.floor(Math.random()*(e-n+1))}function hH(n,e){return n+Math.random()*(e-n)}function dH(n){return n*(.5-Math.random())}function pH(n){n!==void 0&&(WR=n);let e=WR+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function mH(n){return n*zu}function gH(n){return n*qf}function FS(n){return(n&n-1)===0&&n!==0}function vH(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function kv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function _H(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*u);break;case"YZY":n.set(l*p,a*h,l*d,a*u);break;case"ZXZ":n.set(l*d,l*p,a*h,a*u);break;case"XZX":n.set(a*h,l*v,l*m,a*u);break;case"YXY":n.set(l*m,a*h,l*v,a*u);break;case"ZYZ":n.set(l*v,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Sr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Vt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const YD={DEG2RAD:zu,RAD2DEG:qf,generateUUID:as,clamp:qn,euclideanModulo:RE,mapLinear:sH,inverseLerp:oH,lerp:Gd,damp:aH,pingpong:lH,smoothstep:uH,smootherstep:cH,randInt:fH,randFloat:hH,randFloatSpread:dH,seededRandom:pH,degToRad:mH,radToDeg:gH,isPowerOfTwo:FS,ceilPowerOfTwo:vH,floorPowerOfTwo:kv,setQuaternionFromProperEuler:_H,normalize:Vt,denormalize:Sr};class Re{constructor(e=0,t=0){Re.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(qn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ht{constructor(e,t,i,r,s,o,a,l,u){Ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u)}set(e,t,i,r,s,o,a,l,u){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=i,h[7]=o,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],h=i[4],d=i[7],p=i[2],m=i[5],v=i[8],x=r[0],y=r[3],g=r[6],S=r[1],A=r[4],E=r[7],b=r[2],C=r[5],R=r[8];return s[0]=o*x+a*S+l*b,s[3]=o*y+a*A+l*C,s[6]=o*g+a*E+l*R,s[1]=u*x+h*S+d*b,s[4]=u*y+h*A+d*C,s[7]=u*g+h*E+d*R,s[2]=p*x+m*S+v*b,s[5]=p*y+m*A+v*C,s[8]=p*g+m*E+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8];return t*o*h-t*a*u-i*s*h+i*a*l+r*s*u-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=h*o-a*u,p=a*l-h*s,m=u*s-o*l,v=t*d+i*p+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=d*x,e[1]=(r*u-h*i)*x,e[2]=(a*i-r*o)*x,e[3]=p*x,e[4]=(h*t-r*l)*x,e[5]=(r*s-a*t)*x,e[6]=m*x,e[7]=(i*l-u*t)*x,e[8]=(o*t-i*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-r*u,r*l,-r*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Px.makeScale(e,t)),this}rotate(e){return this.premultiply(Px.makeRotation(-e)),this}translate(e,t){return this.premultiply(Px.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Px=new Ht;function KD(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const yH={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function mf(n,e){return new yH[n](e)}function Tp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function QD(){const n=Tp("canvas");return n.style.display="block",n}const XR={};function ZD(n){n in XR||(XR[n]=!0,console.warn(n))}const JR=new Ht().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),jR=new Ht().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Tg={[wa]:{transfer:Ap,primaries:Sp,toReference:n=>n,fromReference:n=>n},[Cs]:{transfer:Mn,primaries:Sp,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[zp]:{transfer:Ap,primaries:Mp,toReference:n=>n.applyMatrix3(jR),fromReference:n=>n.applyMatrix3(JR)},[d_]:{transfer:Mn,primaries:Mp,toReference:n=>n.convertSRGBToLinear().applyMatrix3(jR),fromReference:n=>n.applyMatrix3(JR).convertLinearToSRGB()}},xH=new Set([wa,zp]),vn={enabled:!0,_workingColorSpace:wa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!xH.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Tg[e].toReference,r=Tg[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Tg[n].primaries},getTransfer:function(n){return n===aa?Ap:Tg[n].transfer}};function Lf(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Bx(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Cc;class bE{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Cc===void 0&&(Cc=Tp("canvas")),Cc.width=e.width,Cc.height=e.height;const i=Cc.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Cc}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Tp("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==u_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Rl:e.x=e.x-Math.floor(e.x);break;case Fi:e.x=e.x<0?0:1;break;case Qf: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 Rl:e.y=e.y-Math.floor(e.y);break;case Fi:e.y=e.y<0?0:1;break;case Qf: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)}}Tn.DEFAULT_IMAGE=null;Tn.DEFAULT_MAPPING=u_;Tn.DEFAULT_ANISOTROPY=1;class _n{constructor(e=0,t=0,i=0,r=1){_n.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,u=l[0],h=l[4],d=l[8],p=l[1],m=l[5],v=l[9],x=l[2],y=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-x)<.01&&Math.abs(v-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+x)<.1&&Math.abs(v+y)<.1&&Math.abs(u+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const A=(u+1)/2,E=(m+1)/2,b=(g+1)/2,C=(h+p)/4,R=(d+x)/4,I=(v+y)/4;return A>E&&A>b?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=C/i,s=R/i):E>b?E<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(E),i=C/r,s=I/r):b<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),i=R/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(d-x)*(d-x)+(p-h)*(p-h));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(d-x)/S,this.z=(p-h)/S,this.w=Math.acos((u+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class qD extends Go{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new _n(0,0,e,t),this.scissorTest=!1,this.viewport=new _n(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);const s=new Tn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,A=1-g*g;if(A>Number.EPSILON){const b=Math.sqrt(A),C=Math.atan2(b,g*S);y=Math.sin(y*C)/b,a=Math.sin(a*C)/b}const E=a*S;if(l=l*y+p*E,u=u*y+m*E,h=h*y+v*E,d=d*y+x*E,y===1-a){const b=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=b,u*=b,h*=b,d*=b}}e[t]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],u=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+h*d+l*m-u*p,e[t+1]=l*v+h*p+u*d-a*m,e[t+2]=u*v+h*m+a*p-l*d,e[t+3]=h*v-a*d-l*p-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=p*h*d+u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d-p*m*v;break;case"YXZ":this._x=p*h*d+u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d+p*m*v;break;case"ZXY":this._x=p*h*d-u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d-p*m*v;break;case"ZYX":this._x=p*h*d-u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d+p*m*v;break;case"YZX":this._x=p*h*d+u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d-p*m*v;break;case"XZY":this._x=p*h*d-u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-u)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-u)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+u)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(qn(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,h=t._w;return this._x=i*h+o*a+r*u-s*l,this._y=r*h+o*l+s*a-i*u,this._z=s*h+o*u+i*l-r*a,this._w=o*h-i*a-r*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-t)*h)/u,p=Math.sin(t*h)/u;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(YR.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(YR.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*r-a*i),h=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+l*u+o*d-a*h,this.y=i+l*h+a*u-s*d,this.z=r+l*d+s*h-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Lx.copy(this).projectOnVector(e),this.sub(Lx)}reflect(e){return this.sub(Lx.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(qn(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Lx=new G,YR=new Ii;class rr{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ys),Ys.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(Jh),Rg.subVectors(this.max,Jh),Rc.subVectors(e.a,Jh),bc.subVectors(e.b,Jh),Pc.subVectors(e.c,Jh),Fa.subVectors(bc,Rc),Oa.subVectors(Pc,bc),Kl.subVectors(Rc,Pc);let t=[0,-Fa.z,Fa.y,0,-Oa.z,Oa.y,0,-Kl.z,Kl.y,Fa.z,0,-Fa.x,Oa.z,0,-Oa.x,Kl.z,0,-Kl.x,-Fa.y,Fa.x,0,-Oa.y,Oa.x,0,-Kl.y,Kl.x,0];return!Dx(t,Rc,bc,Pc,Rg)||(t=[1,0,0,0,1,0,0,0,1],!Dx(t,Rc,bc,Pc,Rg))?!1:(bg.crossVectors(Fa,Oa),t=[bg.x,bg.y,bg.z],Dx(t,Rc,bc,Pc,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ys).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ys).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:(Ko[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ko[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ko[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ko[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ko[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ko[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ko[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ko[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ko),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ko=[new G,new G,new G,new G,new G,new G,new G,new G],Ys=new G,Cg=new rr,Rc=new G,bc=new G,Pc=new G,Fa=new G,Oa=new G,Kl=new G,Jh=new G,Rg=new G,bg=new G,Ql=new G;function Dx(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Ql.fromArray(n,s);const a=r.x*Math.abs(Ql.x)+r.y*Math.abs(Ql.y)+r.z*Math.abs(Ql.z),l=e.dot(Ql),u=t.dot(Ql),h=i.dot(Ql);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const wH=new rr,jh=new G,Nx=new G;class ki{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):wH.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;jh.subVectors(e,this.center);const t=jh.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(jh,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):(Nx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(jh.copy(e.center).add(Nx)),this.expandByPoint(jh.copy(e.center).sub(Nx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Qo=new G,Fx=new G,Pg=new G,Ua=new G,Ox=new G,Bg=new G,Ux=new G;class oc{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Qo)),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=Qo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Qo.copy(this.origin).addScaledVector(this.direction,t),Qo.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Fx.copy(e).add(t).multiplyScalar(.5),Pg.copy(t).sub(e).normalize(),Ua.copy(this.origin).sub(Fx);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Pg),a=Ua.dot(this.direction),l=-Ua.dot(Pg),u=Ua.lengthSq(),h=Math.abs(1-o*o);let d,p,m,v;if(h>0)if(d=o*l-a,p=o*a-l,v=s*h,d>=0)if(p>=-v)if(p<=v){const x=1/h;d*=x,p*=x,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+u}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-v?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u):p<=v?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Fx).addScaledVector(Pg,p),m}intersectSphere(e,t){Qo.subVectors(e.center,this.origin);const i=Qo.dot(this.direction),r=Qo.dot(Qo)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(i=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Qo)!==null}intersectTriangle(e,t,i,r,s){Ox.subVectors(t,e),Bg.subVectors(i,e),Ux.crossVectors(Ox,Bg);let o=this.direction.dot(Ux),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ua.subVectors(this.origin,e);const l=a*this.direction.dot(Bg.crossVectors(Ua,Bg));if(l<0)return null;const u=a*this.direction.dot(Ox.cross(Ua));if(u<0||l+u>o)return null;const h=-a*Ua.dot(Ux);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class bt{constructor(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y){bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y)}set(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=v,g[11]=x,g[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new bt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Bc.setFromMatrixColumn(e,0).length(),s=1/Bc.setFromMatrixColumn(e,1).length(),o=1/Bc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,v=a*h,x=a*d;t[0]=l*h,t[4]=-l*d,t[8]=u,t[1]=m+v*u,t[5]=p-x*u,t[9]=-a*l,t[2]=x-p*u,t[6]=v+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,v=u*h,x=u*d;t[0]=p+x*a,t[4]=v*a-m,t[8]=o*u,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-v,t[6]=x+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,v=u*h,x=u*d;t[0]=p-x*a,t[4]=-o*d,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*h,t[9]=x-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,m=o*d,v=a*h,x=a*d;t[0]=l*h,t[4]=v*u-m,t[8]=p*u+x,t[1]=l*d,t[5]=x*u+p,t[9]=m*u-v,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,v=a*l,x=a*u;t[0]=l*h,t[4]=x-p*d,t[8]=v*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-u*h,t[6]=m*d+v,t[10]=p-x*d}else if(e.order==="XZY"){const p=o*l,m=o*u,v=a*l,x=a*u;t[0]=l*h,t[4]=-d,t[8]=u*h,t[1]=p*d+x,t[5]=o*h,t[9]=m*d-v,t[2]=v*d-m,t[6]=a*h,t[10]=x*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(TH,e,CH)}lookAt(e,t,i){const r=this.elements;return jr.subVectors(e,t),jr.lengthSq()===0&&(jr.z=1),jr.normalize(),ka.crossVectors(i,jr),ka.lengthSq()===0&&(Math.abs(i.z)===1?jr.x+=1e-4:jr.z+=1e-4,jr.normalize(),ka.crossVectors(i,jr)),ka.normalize(),Ig.crossVectors(jr,ka),r[0]=ka.x,r[4]=Ig.x,r[8]=jr.x,r[1]=ka.y,r[5]=Ig.y,r[9]=jr.y,r[2]=ka.z,r[6]=Ig.z,r[10]=jr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],h=i[1],d=i[5],p=i[9],m=i[13],v=i[2],x=i[6],y=i[10],g=i[14],S=i[3],A=i[7],E=i[11],b=i[15],C=r[0],R=r[4],I=r[8],O=r[12],T=r[1],L=r[5],K=r[9],se=r[13],W=r[2],te=r[6],$=r[10],oe=r[14],F=r[3],V=r[7],N=r[11],ee=r[15];return s[0]=o*C+a*T+l*W+u*F,s[4]=o*R+a*L+l*te+u*V,s[8]=o*I+a*K+l*$+u*N,s[12]=o*O+a*se+l*oe+u*ee,s[1]=h*C+d*T+p*W+m*F,s[5]=h*R+d*L+p*te+m*V,s[9]=h*I+d*K+p*$+m*N,s[13]=h*O+d*se+p*oe+m*ee,s[2]=v*C+x*T+y*W+g*F,s[6]=v*R+x*L+y*te+g*V,s[10]=v*I+x*K+y*$+g*N,s[14]=v*O+x*se+y*oe+g*ee,s[3]=S*C+A*T+E*W+b*F,s[7]=S*R+A*L+E*te+b*V,s[11]=S*I+A*K+E*$+b*N,s[15]=S*O+A*se+E*oe+b*ee,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],h=e[2],d=e[6],p=e[10],m=e[14],v=e[3],x=e[7],y=e[11],g=e[15];return v*(+s*l*d-r*u*d-s*a*p+i*u*p+r*a*m-i*l*m)+x*(+t*l*m-t*u*p+s*o*p-r*o*m+r*u*h-s*l*h)+y*(+t*u*d-t*a*m-s*o*d+i*o*m+s*a*h-i*u*h)+g*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=e[9],p=e[10],m=e[11],v=e[12],x=e[13],y=e[14],g=e[15],S=d*y*u-x*p*u+x*l*m-a*y*m-d*l*g+a*p*g,A=v*p*u-h*y*u-v*l*m+o*y*m+h*l*g-o*p*g,E=h*x*u-v*d*u+v*a*m-o*x*m-h*a*g+o*d*g,b=v*d*l-h*x*l-v*a*p+o*x*p+h*a*y-o*d*y,C=t*S+i*A+r*E+s*b;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/C;return e[0]=S*R,e[1]=(x*p*s-d*y*s-x*r*m+i*y*m+d*r*g-i*p*g)*R,e[2]=(a*y*s-x*l*s+x*r*u-i*y*u-a*r*g+i*l*g)*R,e[3]=(d*l*s-a*p*s-d*r*u+i*p*u+a*r*m-i*l*m)*R,e[4]=A*R,e[5]=(h*y*s-v*p*s+v*r*m-t*y*m-h*r*g+t*p*g)*R,e[6]=(v*l*s-o*y*s-v*r*u+t*y*u+o*r*g-t*l*g)*R,e[7]=(o*p*s-h*l*s+h*r*u-t*p*u-o*r*m+t*l*m)*R,e[8]=E*R,e[9]=(v*d*s-h*x*s-v*i*m+t*x*m+h*i*g-t*d*g)*R,e[10]=(o*x*s-v*a*s+v*i*u-t*x*u-o*i*g+t*a*g)*R,e[11]=(h*a*s-o*d*s-h*i*u+t*d*u+o*i*m-t*a*m)*R,e[12]=b*R,e[13]=(h*x*r-v*d*r+v*i*p-t*x*p-h*i*y+t*d*y)*R,e[14]=(v*a*r-o*x*r-v*i*l+t*x*l+o*i*y-t*a*y)*R,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-o*i*p+t*a*p)*R,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,u=s*o,h=s*a;return this.set(u*o+i,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+i,h*l-r*o,0,u*l-r*a,h*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,h=o+o,d=a+a,p=s*u,m=s*h,v=s*d,x=o*h,y=o*d,g=a*d,S=l*u,A=l*h,E=l*d,b=i.x,C=i.y,R=i.z;return r[0]=(1-(x+g))*b,r[1]=(m+E)*b,r[2]=(v-A)*b,r[3]=0,r[4]=(m-E)*C,r[5]=(1-(p+g))*C,r[6]=(y+S)*C,r[7]=0,r[8]=(v+A)*R,r[9]=(y-S)*R,r[10]=(1-(p+x))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Bc.set(r[0],r[1],r[2]).length();const o=Bc.set(r[4],r[5],r[6]).length(),a=Bc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ks.copy(this);const u=1/s,h=1/o,d=1/a;return Ks.elements[0]*=u,Ks.elements[1]*=u,Ks.elements[2]*=u,Ks.elements[4]*=h,Ks.elements[5]*=h,Ks.elements[6]*=h,Ks.elements[8]*=d,Ks.elements[9]*=d,Ks.elements[10]*=d,t.setFromRotationMatrix(Ks),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=bo){const l=this.elements,u=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,v;if(a===bo)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===wp)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=bo){const l=this.elements,u=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*u,m=(i+r)*h;let v,x;if(a===bo)v=(o+s)*d,x=-2*d;else if(a===wp)v=s*d,x=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Bc=new G,Ks=new bt,TH=new G(0,0,0),CH=new G(1,1,1),ka=new G,Ig=new G,jr=new G,KR=new bt,QR=new Ii;class cs{constructor(e=0,t=0,i=0,r=cs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin(qn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-qn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(qn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-qn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(qn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-qn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return KR.makeRotationFromQuaternion(e),this.setFromRotationMatrix(KR,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return QR.setFromEuler(this),this.setFromQuaternion(QR,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cs.DEFAULT_ORDER="XYZ";class Gu{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,h=l.length;u0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Qs.subVectors(r,t),qo.subVectors(i,t),Gx.subVectors(e,t);const o=Qs.dot(Qs),a=Qs.dot(qo),l=Qs.dot(Gx),u=qo.dot(qo),h=qo.dot(Gx),d=o*u-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(u*l-a*h)*p,v=(o*h-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,$o)===null?!1:$o.x>=0&&$o.y>=0&&$o.x+$o.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,$o)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,$o.x),l.addScaledVector(o,$o.y),l.addScaledVector(a,$o.z),l)}static isFrontFacing(e,t,i,r){return Qs.subVectors(i,t),qo.subVectors(e,t),Qs.cross(qo).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 Qs.subVectors(this.c,this.b),qo.subVectors(this.a,this.b),Qs.cross(qo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ts.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ts.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return ts.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return ts.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ts.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Lc.subVectors(r,i),Dc.subVectors(s,i),Hx.subVectors(e,i);const l=Lc.dot(Hx),u=Dc.dot(Hx);if(l<=0&&u<=0)return t.copy(i);Vx.subVectors(e,r);const h=Lc.dot(Vx),d=Dc.dot(Vx);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Lc,o);Wx.subVectors(e,s);const m=Lc.dot(Wx),v=Dc.dot(Wx);if(v>=0&&m<=v)return t.copy(s);const x=m*u-l*v;if(x<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(i).addScaledVector(Dc,a);const y=h*v-m*d;if(y<=0&&d-h>=0&&m-v>=0)return tb.subVectors(s,r),a=(d-h)/(d-h+(m-v)),t.copy(r).addScaledVector(tb,a);const g=1/(y+x+p);return o=x*g,a=p*g,t.copy(i).addScaledVector(Lc,o).addScaledVector(Dc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const $D={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},za={h:0,s:0,l:0},Dg={h:0,s:0,l:0};function Xx(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 it{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=Cs){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,vn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=vn.workingColorSpace){return this.r=e,this.g=t,this.b=i,vn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=vn.workingColorSpace){if(e=RE(e,1),t=qn(t,0,1),i=qn(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Xx(o,s,e+1/3),this.g=Xx(o,s,e),this.b=Xx(o,s,e-1/3)}return vn.toWorkingColorSpace(this,r),this}setStyle(e,t=Cs){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cs){const i=$D[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Lf(e.r),this.g=Lf(e.g),this.b=Lf(e.b),this}copyLinearToSRGB(e){return this.r=Bx(e.r),this.g=Bx(e.g),this.b=Bx(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cs){return vn.fromWorkingColorSpace(Yi.copy(this),e),Math.round(qn(Yi.r*255,0,255))*65536+Math.round(qn(Yi.g*255,0,255))*256+Math.round(qn(Yi.b*255,0,255))}getHexString(e=Cs){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=vn.workingColorSpace){vn.fromWorkingColorSpace(Yi.copy(this),t);const i=Yi.r,r=Yi.g,s=Yi.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,u;const h=(a+o)/2;if(a===o)l=0,u=0;else{const d=o-a;switch(u=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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!==ku&&(i.blending=this.blending),this.side!==ko&&(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!==Nv&&(i.blendSrc=this.blendSrc),this.blendDst!==Fv&&(i.blendDst=this.blendDst),this.blendEquation!==qa&&(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!==vp&&(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!==DS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==mu&&(i.stencilFail=this.stencilFail),this.stencilZFail!==mu&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==mu&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class rs extends mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new it(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 cs,this.combine=kp,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 la=DH();function DH(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):u<-14?(i[l]=1024>>-u-14,i[l|256]=1024>>-u-14|32768,r[l]=-u-1,r[l|256]=-u-1):u<=15?(i[l]=u+15<<10,i[l|256]=u+15<<10|32768,r[l]=13,r[l|256]=13):u<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,h=0;for(;!(u&8388608);)u<<=1,h-=8388608;u&=-8388609,h+=947912704,s[l]=u|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Pr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=qn(n,-65504,65504),la.floatView[0]=n;const e=la.uint32View[0],t=e>>23&511;return la.baseTable[t]+((e&8388607)>>la.shiftTable[t])}function _d(n){const e=n>>10;return la.uint32View[0]=la.mantissaTable[la.offsetTable[e]+(n&1023)]+la.exponentTable[e],la.floatView[0]}const Cu={toHalfFloat:Pr,fromHalfFloat:_d},ui=new G,Ng=new Re;class un{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Ep,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=pi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ZD("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(t))}const s=e.morphAttributes;for(const u in s){const h=[],d=s[u];for(let p=0,m=d.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(nb.copy(s).invert(),Zl.copy(e.ray).applyMatrix4(nb),!(i.boundingBox!==null&&Zl.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,Zl)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,x=p.length;vt.far?null:{distance:u,point:Hg.clone(),object:n}}function Vg(n,e,t,i,r,s,o,a,l,u){n.getVertexPosition(a,Fc),n.getVertexPosition(l,Oc),n.getVertexPosition(u,Uc);const h=HH(n,e,t,i,Fc,Oc,Uc,Gg);if(h){r&&(Ug.fromBufferAttribute(r,a),kg.fromBufferAttribute(r,l),zg.fromBufferAttribute(r,u),h.uv=ts.getInterpolation(Gg,Fc,Oc,Uc,Ug,kg,zg,new Re)),s&&(Ug.fromBufferAttribute(s,a),kg.fromBufferAttribute(s,l),zg.fromBufferAttribute(s,u),h.uv1=ts.getInterpolation(Gg,Fc,Oc,Uc,Ug,kg,zg,new Re)),o&&(rb.fromBufferAttribute(o,a),sb.fromBufferAttribute(o,l),ob.fromBufferAttribute(o,u),h.normal=ts.getInterpolation(Gg,Fc,Oc,Uc,rb,sb,ob,new G),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new G,materialIndex:0};ts.getNormal(Fc,Oc,Uc,d.normal),h.face=d}return h}class ac extends zt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],h=[],d=[];let p=0,m=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new St(u,3)),this.setAttribute("normal",new St(h,3)),this.setAttribute("uv",new St(d,2));function v(x,y,g,S,A,E,b,C,R,I,O){const T=E/R,L=b/I,K=E/2,se=b/2,W=C/2,te=R+1,$=I+1;let oe=0,F=0;const V=new G;for(let N=0;N<$;N++){const ee=N*L-se;for(let ce=0;ce0?1:-1,h.push(V.x,V.y,V.z),d.push(ce/R),d.push(1-N/I),oe+=1}}for(let N=0;N>8&255]+ji[n>>16&255]+ji[n>>24&255]+"-"+ji[e&255]+ji[e>>8&255]+"-"+ji[e>>16&15|64]+ji[e>>24&255]+"-"+ji[t&63|128]+ji[t>>8&255]+"-"+ji[t>>16&255]+ji[t>>24&255]+ji[i&255]+ji[i>>8&255]+ji[i>>16&255]+ji[i>>24&255]).toLowerCase()}function $n(n,e,t){return Math.max(e,Math.min(t,n))}function RE(n,e){return(n%e+e)%e}function cH(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function fH(n,e,t){return n!==e?(t-n)/(e-n):0}function Gd(n,e,t){return(1-t)*n+t*e}function hH(n,e,t,i){return Gd(n,e,1-Math.exp(-t*i))}function dH(n,e=1){return e-Math.abs(RE(n,e*2)-e)}function pH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function mH(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function gH(n,e){return n+Math.floor(Math.random()*(e-n+1))}function vH(n,e){return n+Math.random()*(e-n)}function _H(n){return n*(.5-Math.random())}function yH(n){n!==void 0&&(JR=n);let e=JR+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function xH(n){return n*Gu}function AH(n){return n*qf}function FS(n){return(n&n-1)===0&&n!==0}function SH(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function kv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function MH(n,e,t,i,r){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+i)/2),h=o((e+i)/2),d=s((e-i)/2),p=o((e-i)/2),m=s((i-e)/2),v=o((i-e)/2);switch(r){case"XYX":n.set(a*h,l*d,l*p,a*u);break;case"YZY":n.set(l*p,a*h,l*d,a*u);break;case"ZXZ":n.set(l*d,l*p,a*h,a*u);break;case"XZX":n.set(a*h,l*v,l*m,a*u);break;case"YXY":n.set(l*m,a*h,l*v,a*u);break;case"ZYZ":n.set(l*v,l*m,a*h,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Sr(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Vt(n,e){switch(e.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const QD={DEG2RAD:Gu,RAD2DEG:qf,generateUUID:as,clamp:$n,euclideanModulo:RE,mapLinear:cH,inverseLerp:fH,lerp:Gd,damp:hH,pingpong:dH,smoothstep:pH,smootherstep:mH,randInt:gH,randFloat:vH,randFloatSpread:_H,seededRandom:yH,degToRad:xH,radToDeg:AH,isPowerOfTwo:FS,ceilPowerOfTwo:SH,floorPowerOfTwo:kv,setQuaternionFromProperEuler:MH,normalize:Vt,denormalize:Sr};class Re{constructor(e=0,t=0){Re.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6],this.y=r[1]*t+r[4]*i+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const i=this.dot(e)/t;return Math.acos($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),r=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*r+e.x,this.y=s*r+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ht{constructor(e,t,i,r,s,o,a,l,u){Ht.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u)}set(e,t,i,r,s,o,a,l,u){const h=this.elements;return h[0]=e,h[1]=r,h[2]=a,h[3]=t,h[4]=s,h[5]=l,h[6]=i,h[7]=o,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[3],l=i[6],u=i[1],h=i[4],d=i[7],p=i[2],m=i[5],v=i[8],x=r[0],y=r[3],g=r[6],S=r[1],A=r[4],E=r[7],b=r[2],C=r[5],R=r[8];return s[0]=o*x+a*S+l*b,s[3]=o*y+a*A+l*C,s[6]=o*g+a*E+l*R,s[1]=u*x+h*S+d*b,s[4]=u*y+h*A+d*C,s[7]=u*g+h*E+d*R,s[2]=p*x+m*S+v*b,s[5]=p*y+m*A+v*C,s[8]=p*g+m*E+v*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8];return t*o*h-t*a*u-i*s*h+i*a*l+r*s*u-r*o*l}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=h*o-a*u,p=a*l-h*s,m=u*s-o*l,v=t*d+i*p+r*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const x=1/v;return e[0]=d*x,e[1]=(r*u-h*i)*x,e[2]=(a*i-r*o)*x,e[3]=p*x,e[4]=(h*t-r*l)*x,e[5]=(r*s-a*t)*x,e[6]=m*x,e[7]=(i*l-u*t)*x,e[8]=(o*t-i*s)*x,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,i,r,s,o,a){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*o+u*a)+o+e,-r*u,r*l,-r*(-u*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Px.makeScale(e,t)),this}rotate(e){return this.premultiply(Px.makeRotation(-e)),this}translate(e,t){return this.premultiply(Px.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<9;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Px=new Ht;function ZD(n){for(let e=n.length-1;e>=0;--e)if(n[e]>=65535)return!0;return!1}const EH={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function mf(n,e){return new EH[n](e)}function Tp(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function qD(){const n=Tp("canvas");return n.style.display="block",n}const jR={};function $D(n){n in jR||(jR[n]=!0,console.warn(n))}const YR=new Ht().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),KR=new Ht().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Tg={[wa]:{transfer:Ap,primaries:Sp,toReference:n=>n,fromReference:n=>n},[Cs]:{transfer:Mn,primaries:Sp,toReference:n=>n.convertSRGBToLinear(),fromReference:n=>n.convertLinearToSRGB()},[zp]:{transfer:Ap,primaries:Mp,toReference:n=>n.applyMatrix3(KR),fromReference:n=>n.applyMatrix3(YR)},[d_]:{transfer:Mn,primaries:Mp,toReference:n=>n.convertSRGBToLinear().applyMatrix3(KR),fromReference:n=>n.applyMatrix3(YR).convertLinearToSRGB()}},wH=new Set([wa,zp]),vn={enabled:!0,_workingColorSpace:wa,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(n){if(!wH.has(n))throw new Error(`Unsupported working color space, "${n}".`);this._workingColorSpace=n},convert:function(n,e,t){if(this.enabled===!1||e===t||!e||!t)return n;const i=Tg[e].toReference,r=Tg[t].fromReference;return r(i(n))},fromWorkingColorSpace:function(n,e){return this.convert(n,this._workingColorSpace,e)},toWorkingColorSpace:function(n,e){return this.convert(n,e,this._workingColorSpace)},getPrimaries:function(n){return Tg[n].primaries},getTransfer:function(n){return n===aa?Ap:Tg[n].transfer}};function Lf(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Bx(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Cc;class bE{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Cc===void 0&&(Cc=Tp("canvas")),Cc.width=e.width,Cc.height=e.height;const i=Cc.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Cc}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Tp("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const r=i.getImageData(0,0,e.width,e.height),s=r.data;for(let o=0;o0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==u_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Rl:e.x=e.x-Math.floor(e.x);break;case Fi:e.x=e.x<0?0:1;break;case Qf: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 Rl:e.y=e.y-Math.floor(e.y);break;case Fi:e.y=e.y<0?0:1;break;case Qf: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)}}Tn.DEFAULT_IMAGE=null;Tn.DEFAULT_MAPPING=u_;Tn.DEFAULT_ANISOTROPY=1;class _n{constructor(e=0,t=0,i=0,r=1){_n.prototype.isVector4=!0,this.x=e,this.y=t,this.z=i,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*s,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*s,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*s,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,r,s;const l=e.elements,u=l[0],h=l[4],d=l[8],p=l[1],m=l[5],v=l[9],x=l[2],y=l[6],g=l[10];if(Math.abs(h-p)<.01&&Math.abs(d-x)<.01&&Math.abs(v-y)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+x)<.1&&Math.abs(v+y)<.1&&Math.abs(u+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const A=(u+1)/2,E=(m+1)/2,b=(g+1)/2,C=(h+p)/4,R=(d+x)/4,I=(v+y)/4;return A>E&&A>b?A<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(A),r=C/i,s=R/i):E>b?E<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(E),i=C/r,s=I/r):b<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(b),i=R/s,r=I/s),this.set(i,r,s,t),this}let S=Math.sqrt((y-v)*(y-v)+(d-x)*(d-x)+(p-h)*(p-h));return Math.abs(S)<.001&&(S=1),this.x=(y-v)/S,this.y=(d-x)/S,this.z=(p-h)/S,this.w=Math.acos((u+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class eN extends Go{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new _n(0,0,e,t),this.scissorTest=!1,this.viewport=new _n(0,0,e,t);const r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);const s=new Tn(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);s.flipY=!1,s.generateMipmaps=i.generateMipmaps,s.internalFormat=i.internalFormat,this.textures=[];const o=i.count;for(let a=0;a=0?1:-1,A=1-g*g;if(A>Number.EPSILON){const b=Math.sqrt(A),C=Math.atan2(b,g*S);y=Math.sin(y*C)/b,a=Math.sin(a*C)/b}const E=a*S;if(l=l*y+p*E,u=u*y+m*E,h=h*y+v*E,d=d*y+x*E,y===1-a){const b=1/Math.sqrt(l*l+u*u+h*h+d*d);l*=b,u*=b,h*=b,d*=b}}e[t]=l,e[t+1]=u,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const a=i[r],l=i[r+1],u=i[r+2],h=i[r+3],d=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+h*d+l*m-u*p,e[t+1]=l*v+h*p+u*d-a*m,e[t+2]=u*v+h*m+a*p-l*d,e[t+3]=h*v-a*d-l*p-u*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,r=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,u=a(i/2),h=a(r/2),d=a(s/2),p=l(i/2),m=l(r/2),v=l(s/2);switch(o){case"XYZ":this._x=p*h*d+u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d-p*m*v;break;case"YXZ":this._x=p*h*d+u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d+p*m*v;break;case"ZXY":this._x=p*h*d-u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d-p*m*v;break;case"ZYX":this._x=p*h*d-u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d+p*m*v;break;case"YZX":this._x=p*h*d+u*m*v,this._y=u*m*d+p*h*v,this._z=u*h*v-p*m*d,this._w=u*h*d-p*m*v;break;case"XZY":this._x=p*h*d-u*m*v,this._y=u*m*d-p*h*v,this._z=u*h*v+p*m*d,this._w=u*h*d+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],r=t[4],s=t[8],o=t[1],a=t[5],l=t[9],u=t[2],h=t[6],d=t[10],p=i+a+d;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(h-l)*m,this._y=(s-u)*m,this._z=(o-r)*m}else if(i>a&&i>d){const m=2*Math.sqrt(1+i-a-d);this._w=(h-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(s+u)/m}else if(a>d){const m=2*Math.sqrt(1+a-i-d);this._w=(s-u)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+h)/m}else{const m=2*Math.sqrt(1+d-i-a);this._w=(o-r)/m,this._x=(s+u)/m,this._y=(l+h)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($n(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(i===0)return this;const r=Math.min(1,t/i);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,r=e._y,s=e._z,o=e._w,a=t._x,l=t._y,u=t._z,h=t._w;return this._x=i*h+o*a+r*u-s*l,this._y=r*h+o*l+s*a-i*u,this._z=s*h+o*u+i*l-r*a,this._w=o*h-i*a-r*l-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const i=this._x,r=this._y,s=this._z,o=this._w;let a=o*e._w+i*e._x+r*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*s+t*this._z,this.normalize(),this}const u=Math.sqrt(l),h=Math.atan2(u,a),d=Math.sin((1-t)*h)/u,p=Math.sin(t*h)/u;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,i=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=i}set(e,t,i){return i===void 0&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(QR.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(QR.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*i+s[6]*r,this.y=s[1]*t+s[4]*i+s[7]*r,this.z=s[2]*t+s[5]*i+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,r=this.z,s=e.elements,o=1/(s[3]*t+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*i+s[8]*r+s[12])*o,this.y=(s[1]*t+s[5]*i+s[9]*r+s[13])*o,this.z=(s[2]*t+s[6]*i+s[10]*r+s[14])*o,this}applyQuaternion(e){const t=this.x,i=this.y,r=this.z,s=e.x,o=e.y,a=e.z,l=e.w,u=2*(o*r-a*i),h=2*(a*t-s*r),d=2*(s*i-o*t);return this.x=t+l*u+o*d-a*h,this.y=i+l*h+a*u-s*d,this.z=r+l*d+s*h-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*r,this.y=s[1]*t+s[5]*i+s[9]*r,this.z=s[2]*t+s[6]*i+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,r=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=r*l-s*a,this.y=s*o-i*l,this.z=i*a-r*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Lx.copy(this).projectOnVector(e),this.sub(Lx)}reflect(e){return this.sub(Lx.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($n(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const r=Math.sin(t)*e;return this.x=r*Math.sin(i),this.y=Math.cos(t)*e,this.z=r*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Lx=new G,QR=new Ii;class rr{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ys),Ys.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(Jh),Rg.subVectors(this.max,Jh),Rc.subVectors(e.a,Jh),bc.subVectors(e.b,Jh),Pc.subVectors(e.c,Jh),Fa.subVectors(bc,Rc),Oa.subVectors(Pc,bc),Ql.subVectors(Rc,Pc);let t=[0,-Fa.z,Fa.y,0,-Oa.z,Oa.y,0,-Ql.z,Ql.y,Fa.z,0,-Fa.x,Oa.z,0,-Oa.x,Ql.z,0,-Ql.x,-Fa.y,Fa.x,0,-Oa.y,Oa.x,0,-Ql.y,Ql.x,0];return!Dx(t,Rc,bc,Pc,Rg)||(t=[1,0,0,0,1,0,0,0,1],!Dx(t,Rc,bc,Pc,Rg))?!1:(bg.crossVectors(Fa,Oa),t=[bg.x,bg.y,bg.z],Dx(t,Rc,bc,Pc,Rg))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ys).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ys).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:(Ko[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ko[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ko[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ko[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ko[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ko[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ko[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ko[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ko),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ko=[new G,new G,new G,new G,new G,new G,new G,new G],Ys=new G,Cg=new rr,Rc=new G,bc=new G,Pc=new G,Fa=new G,Oa=new G,Ql=new G,Jh=new G,Rg=new G,bg=new G,Zl=new G;function Dx(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){Zl.fromArray(n,s);const a=r.x*Math.abs(Zl.x)+r.y*Math.abs(Zl.y)+r.z*Math.abs(Zl.z),l=e.dot(Zl),u=t.dot(Zl),h=i.dot(Zl);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>a)return!1}return!0}const PH=new rr,jh=new G,Nx=new G;class ki{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;t!==void 0?i.copy(t):PH.setFromPoints(e).getCenter(i);let r=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;jh.subVectors(e,this.center);const t=jh.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(jh,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):(Nx.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(jh.copy(e.center).add(Nx)),this.expandByPoint(jh.copy(e.center).sub(Nx))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Qo=new G,Fx=new G,Pg=new G,Ua=new G,Ox=new G,Bg=new G,Ux=new G;class oc{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Qo)),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=Qo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Qo.copy(this.origin).addScaledVector(this.direction,t),Qo.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Fx.copy(e).add(t).multiplyScalar(.5),Pg.copy(t).sub(e).normalize(),Ua.copy(this.origin).sub(Fx);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Pg),a=Ua.dot(this.direction),l=-Ua.dot(Pg),u=Ua.lengthSq(),h=Math.abs(1-o*o);let d,p,m,v;if(h>0)if(d=o*l-a,p=o*a-l,v=s*h,d>=0)if(p>=-v)if(p<=v){const x=1/h;d*=x,p*=x,m=d*(d+o*p+2*a)+p*(o*d+p+2*l)+u}else p=s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p=-s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;else p<=-v?(d=Math.max(0,-(-o*s+a)),p=d>0?-s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u):p<=v?(d=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+u):(d=Math.max(0,-(o*s+a)),p=d>0?s:Math.min(Math.max(-s,-l),s),m=-d*d+p*(p+2*l)+u);else p=o>0?-s:s,d=Math.max(0,-(o*p+a)),m=-d*d+p*(p+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),r&&r.copy(Fx).addScaledVector(Pg,p),m}intersectSphere(e,t){Qo.subVectors(e.center,this.origin);const i=Qo.dot(this.direction),r=Qo.dot(Qo)-i*i,s=e.radius*e.radius;if(r>s)return null;const o=Math.sqrt(s-r),a=i-o,l=i+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,s,o,a,l;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(e.min.x-p.x)*u,r=(e.max.x-p.x)*u):(i=(e.max.x-p.x)*u,r=(e.min.x-p.x)*u),h>=0?(s=(e.min.y-p.y)*h,o=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,o=(e.min.y-p.y)*h),i>o||s>r||((s>i||isNaN(i))&&(i=s),(o=0?(a=(e.min.z-p.z)*d,l=(e.max.z-p.z)*d):(a=(e.max.z-p.z)*d,l=(e.min.z-p.z)*d),i>l||a>r)||((a>i||i!==i)&&(i=a),(l=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Qo)!==null}intersectTriangle(e,t,i,r,s){Ox.subVectors(t,e),Bg.subVectors(i,e),Ux.crossVectors(Ox,Bg);let o=this.direction.dot(Ux),a;if(o>0){if(r)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ua.subVectors(this.origin,e);const l=a*this.direction.dot(Bg.crossVectors(Ua,Bg));if(l<0)return null;const u=a*this.direction.dot(Ox.cross(Ua));if(u<0||l+u>o)return null;const h=-a*Ua.dot(Ux);return h<0?null:this.at(h/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class bt{constructor(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y){bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y)}set(e,t,i,r,s,o,a,l,u,h,d,p,m,v,x,y){const g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=u,g[6]=h,g[10]=d,g[14]=p,g[3]=m,g[7]=v,g[11]=x,g[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new bt().fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,i=e.elements,r=1/Bc.setFromMatrixColumn(e,0).length(),s=1/Bc.setFromMatrixColumn(e,1).length(),o=1/Bc.setFromMatrixColumn(e,2).length();return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=0,t[4]=i[4]*s,t[5]=i[5]*s,t[6]=i[6]*s,t[7]=0,t[8]=i[8]*o,t[9]=i[9]*o,t[10]=i[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,r=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=o*h,m=o*d,v=a*h,x=a*d;t[0]=l*h,t[4]=-l*d,t[8]=u,t[1]=m+v*u,t[5]=p-x*u,t[9]=-a*l,t[2]=x-p*u,t[6]=v+m*u,t[10]=o*l}else if(e.order==="YXZ"){const p=l*h,m=l*d,v=u*h,x=u*d;t[0]=p+x*a,t[4]=v*a-m,t[8]=o*u,t[1]=o*d,t[5]=o*h,t[9]=-a,t[2]=m*a-v,t[6]=x+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*h,m=l*d,v=u*h,x=u*d;t[0]=p-x*a,t[4]=-o*d,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*h,t[9]=x-p*a,t[2]=-o*u,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*h,m=o*d,v=a*h,x=a*d;t[0]=l*h,t[4]=v*u-m,t[8]=p*u+x,t[1]=l*d,t[5]=x*u+p,t[9]=m*u-v,t[2]=-u,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*u,v=a*l,x=a*u;t[0]=l*h,t[4]=x-p*d,t[8]=v*d+m,t[1]=d,t[5]=o*h,t[9]=-a*h,t[2]=-u*h,t[6]=m*d+v,t[10]=p-x*d}else if(e.order==="XZY"){const p=o*l,m=o*u,v=a*l,x=a*u;t[0]=l*h,t[4]=-d,t[8]=u*h,t[1]=p*d+x,t[5]=o*h,t[9]=m*d-v,t[2]=v*d-m,t[6]=a*h,t[10]=x*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(BH,e,IH)}lookAt(e,t,i){const r=this.elements;return jr.subVectors(e,t),jr.lengthSq()===0&&(jr.z=1),jr.normalize(),ka.crossVectors(i,jr),ka.lengthSq()===0&&(Math.abs(i.z)===1?jr.x+=1e-4:jr.z+=1e-4,jr.normalize(),ka.crossVectors(i,jr)),ka.normalize(),Ig.crossVectors(jr,ka),r[0]=ka.x,r[4]=Ig.x,r[8]=jr.x,r[1]=ka.y,r[5]=Ig.y,r[9]=jr.y,r[2]=ka.z,r[6]=Ig.z,r[10]=jr.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,r=t.elements,s=this.elements,o=i[0],a=i[4],l=i[8],u=i[12],h=i[1],d=i[5],p=i[9],m=i[13],v=i[2],x=i[6],y=i[10],g=i[14],S=i[3],A=i[7],E=i[11],b=i[15],C=r[0],R=r[4],I=r[8],O=r[12],T=r[1],L=r[5],K=r[9],se=r[13],W=r[2],te=r[6],$=r[10],oe=r[14],F=r[3],V=r[7],N=r[11],ee=r[15];return s[0]=o*C+a*T+l*W+u*F,s[4]=o*R+a*L+l*te+u*V,s[8]=o*I+a*K+l*$+u*N,s[12]=o*O+a*se+l*oe+u*ee,s[1]=h*C+d*T+p*W+m*F,s[5]=h*R+d*L+p*te+m*V,s[9]=h*I+d*K+p*$+m*N,s[13]=h*O+d*se+p*oe+m*ee,s[2]=v*C+x*T+y*W+g*F,s[6]=v*R+x*L+y*te+g*V,s[10]=v*I+x*K+y*$+g*N,s[14]=v*O+x*se+y*oe+g*ee,s[3]=S*C+A*T+E*W+b*F,s[7]=S*R+A*L+E*te+b*V,s[11]=S*I+A*K+E*$+b*N,s[15]=S*O+A*se+E*oe+b*ee,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],r=e[8],s=e[12],o=e[1],a=e[5],l=e[9],u=e[13],h=e[2],d=e[6],p=e[10],m=e[14],v=e[3],x=e[7],y=e[11],g=e[15];return v*(+s*l*d-r*u*d-s*a*p+i*u*p+r*a*m-i*l*m)+x*(+t*l*m-t*u*p+s*o*p-r*o*m+r*u*h-s*l*h)+y*(+t*u*d-t*a*m-s*o*d+i*o*m+s*a*h-i*u*h)+g*(-r*a*h-t*l*d+t*a*p+r*o*d-i*o*p+i*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7],h=e[8],d=e[9],p=e[10],m=e[11],v=e[12],x=e[13],y=e[14],g=e[15],S=d*y*u-x*p*u+x*l*m-a*y*m-d*l*g+a*p*g,A=v*p*u-h*y*u-v*l*m+o*y*m+h*l*g-o*p*g,E=h*x*u-v*d*u+v*a*m-o*x*m-h*a*g+o*d*g,b=v*d*l-h*x*l-v*a*p+o*x*p+h*a*y-o*d*y,C=t*S+i*A+r*E+s*b;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const R=1/C;return e[0]=S*R,e[1]=(x*p*s-d*y*s-x*r*m+i*y*m+d*r*g-i*p*g)*R,e[2]=(a*y*s-x*l*s+x*r*u-i*y*u-a*r*g+i*l*g)*R,e[3]=(d*l*s-a*p*s-d*r*u+i*p*u+a*r*m-i*l*m)*R,e[4]=A*R,e[5]=(h*y*s-v*p*s+v*r*m-t*y*m-h*r*g+t*p*g)*R,e[6]=(v*l*s-o*y*s-v*r*u+t*y*u+o*r*g-t*l*g)*R,e[7]=(o*p*s-h*l*s+h*r*u-t*p*u-o*r*m+t*l*m)*R,e[8]=E*R,e[9]=(v*d*s-h*x*s-v*i*m+t*x*m+h*i*g-t*d*g)*R,e[10]=(o*x*s-v*a*s+v*i*u-t*x*u-o*i*g+t*a*g)*R,e[11]=(h*a*s-o*d*s-h*i*u+t*d*u+o*i*m-t*a*m)*R,e[12]=b*R,e[13]=(h*x*r-v*d*r+v*i*p-t*x*p-h*i*y+t*d*y)*R,e[14]=(v*a*r-o*x*r-v*i*l+t*x*l+o*i*y-t*a*y)*R,e[15]=(o*d*r-h*a*r+h*i*l-t*d*l-o*i*p+t*a*p)*R,this}scale(e){const t=this.elements,i=e.x,r=e.y,s=e.z;return t[0]*=i,t[4]*=r,t[8]*=s,t[1]*=i,t[5]*=r,t[9]*=s,t[2]*=i,t[6]*=r,t[10]*=s,t[3]*=i,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),r=Math.sin(t),s=1-i,o=e.x,a=e.y,l=e.z,u=s*o,h=s*a;return this.set(u*o+i,u*a-r*l,u*l+r*a,0,u*a+r*l,h*a+i,h*l-r*o,0,u*l-r*a,h*l+r*o,s*l*l+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,r,s,o){return this.set(1,i,s,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,i){const r=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,u=s+s,h=o+o,d=a+a,p=s*u,m=s*h,v=s*d,x=o*h,y=o*d,g=a*d,S=l*u,A=l*h,E=l*d,b=i.x,C=i.y,R=i.z;return r[0]=(1-(x+g))*b,r[1]=(m+E)*b,r[2]=(v-A)*b,r[3]=0,r[4]=(m-E)*C,r[5]=(1-(p+g))*C,r[6]=(y+S)*C,r[7]=0,r[8]=(v+A)*R,r[9]=(y-S)*R,r[10]=(1-(p+x))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,i){const r=this.elements;let s=Bc.set(r[0],r[1],r[2]).length();const o=Bc.set(r[4],r[5],r[6]).length(),a=Bc.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),e.x=r[12],e.y=r[13],e.z=r[14],Ks.copy(this);const u=1/s,h=1/o,d=1/a;return Ks.elements[0]*=u,Ks.elements[1]*=u,Ks.elements[2]*=u,Ks.elements[4]*=h,Ks.elements[5]*=h,Ks.elements[6]*=h,Ks.elements[8]*=d,Ks.elements[9]*=d,Ks.elements[10]*=d,t.setFromRotationMatrix(Ks),i.x=s,i.y=o,i.z=a,this}makePerspective(e,t,i,r,s,o,a=bo){const l=this.elements,u=2*s/(t-e),h=2*s/(i-r),d=(t+e)/(t-e),p=(i+r)/(i-r);let m,v;if(a===bo)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===wp)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,r,s,o,a=bo){const l=this.elements,u=1/(t-e),h=1/(i-r),d=1/(o-s),p=(t+e)*u,m=(i+r)*h;let v,x;if(a===bo)v=(o+s)*d,x=-2*d;else if(a===wp)v=s*d,x=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=x,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Bc=new G,Ks=new bt,BH=new G(0,0,0),IH=new G(1,1,1),ka=new G,Ig=new G,jr=new G,ZR=new bt,qR=new Ii;class cs{constructor(e=0,t=0,i=0,r=cs.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,r=this._order){return this._x=e,this._y=t,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const r=e.elements,s=r[0],o=r[4],a=r[8],l=r[1],u=r[5],h=r[9],d=r[2],p=r[6],m=r[10];switch(t){case"XYZ":this._y=Math.asin($n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-$n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin($n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,m),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-$n(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin($n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-$n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return ZR.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ZR,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return qR.setFromEuler(this),this.setFromQuaternion(qR,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}cs.DEFAULT_ORDER="XYZ";class Hu{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let i=0;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),this.boundingBox!==null&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,h=l.length;u0){r.children=[];for(let a=0;a0){r.animations=[];for(let a=0;a0&&(i.geometries=a),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),m.length>0&&(i.animations=m),v.length>0&&(i.nodes=v)}return i.object=r,i;function o(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,i,r,s){Qs.subVectors(r,t),qo.subVectors(i,t),Gx.subVectors(e,t);const o=Qs.dot(Qs),a=Qs.dot(qo),l=Qs.dot(Gx),u=qo.dot(qo),h=qo.dot(Gx),d=o*u-a*a;if(d===0)return s.set(0,0,0),null;const p=1/d,m=(u*l-a*h)*p,v=(o*h-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,$o)===null?!1:$o.x>=0&&$o.y>=0&&$o.x+$o.y<=1}static getInterpolation(e,t,i,r,s,o,a,l){return this.getBarycoord(e,t,i,r,$o)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,$o.x),l.addScaledVector(o,$o.y),l.addScaledVector(a,$o.z),l)}static isFrontFacing(e,t,i,r){return Qs.subVectors(i,t),qo.subVectors(e,t),Qs.cross(qo).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 Qs.subVectors(this.c,this.b),qo.subVectors(this.a,this.b),Qs.cross(qo).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ts.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return ts.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,r,s){return ts.getInterpolation(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return ts.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ts.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,r=this.b,s=this.c;let o,a;Lc.subVectors(r,i),Dc.subVectors(s,i),Hx.subVectors(e,i);const l=Lc.dot(Hx),u=Dc.dot(Hx);if(l<=0&&u<=0)return t.copy(i);Vx.subVectors(e,r);const h=Lc.dot(Vx),d=Dc.dot(Vx);if(h>=0&&d<=h)return t.copy(r);const p=l*d-h*u;if(p<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(i).addScaledVector(Lc,o);Wx.subVectors(e,s);const m=Lc.dot(Wx),v=Dc.dot(Wx);if(v>=0&&m<=v)return t.copy(s);const x=m*u-l*v;if(x<=0&&u>=0&&v<=0)return a=u/(u-v),t.copy(i).addScaledVector(Dc,a);const y=h*v-m*d;if(y<=0&&d-h>=0&&m-v>=0)return ib.subVectors(s,r),a=(d-h)/(d-h+(m-v)),t.copy(r).addScaledVector(ib,a);const g=1/(y+x+p);return o=x*g,a=p*g,t.copy(i).addScaledVector(Lc,o).addScaledVector(Dc,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const tN={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},za={h:0,s:0,l:0},Dg={h:0,s:0,l:0};function Xx(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 it{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=Cs){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,vn.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=vn.workingColorSpace){return this.r=e,this.g=t,this.b=i,vn.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=vn.workingColorSpace){if(e=RE(e,1),t=$n(t,0,1),i=$n(i,0,1),t===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+t):i+t-i*t,o=2*i-s;this.r=Xx(o,s,e+1/3),this.g=Xx(o,s,e),this.b=Xx(o,s,e-1/3)}return vn.toWorkingColorSpace(this,r),this}setStyle(e,t=Cs){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=r[1],a=r[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Cs){const i=tN[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Lf(e.r),this.g=Lf(e.g),this.b=Lf(e.b),this}copyLinearToSRGB(e){return this.r=Bx(e.r),this.g=Bx(e.g),this.b=Bx(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Cs){return vn.fromWorkingColorSpace(Yi.copy(this),e),Math.round($n(Yi.r*255,0,255))*65536+Math.round($n(Yi.g*255,0,255))*256+Math.round($n(Yi.b*255,0,255))}getHexString(e=Cs){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=vn.workingColorSpace){vn.fromWorkingColorSpace(Yi.copy(this),t);const i=Yi.r,r=Yi.g,s=Yi.b,o=Math.max(i,r,s),a=Math.min(i,r,s);let l,u;const h=(a+o)/2;if(a===o)l=0,u=0;else{const d=o-a;switch(u=h<=.5?d/(o+a):d/(2-o-a),o){case i:l=(r-s)/d+(r0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}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){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.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!==zu&&(i.blending=this.blending),this.side!==ko&&(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!==Nv&&(i.blendSrc=this.blendSrc),this.blendDst!==Fv&&(i.blendDst=this.blendDst),this.blendEquation!==qa&&(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!==vp&&(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!==DS&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==gu&&(i.stencilFail=this.stencilFail),this.stencilZFail!==gu&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==gu&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=r(e.textures),o=r(e.images);s.length>0&&(i.textures=s),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(t!==null){const r=t.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=t[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class rs extends mi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new it(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 cs,this.combine=kp,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 la=kH();function kH(){const n=new ArrayBuffer(4),e=new Float32Array(n),t=new Uint32Array(n),i=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(i[l]=0,i[l|256]=32768,r[l]=24,r[l|256]=24):u<-14?(i[l]=1024>>-u-14,i[l|256]=1024>>-u-14|32768,r[l]=-u-1,r[l|256]=-u-1):u<=15?(i[l]=u+15<<10,i[l|256]=u+15<<10|32768,r[l]=13,r[l|256]=13):u<128?(i[l]=31744,i[l|256]=64512,r[l]=24,r[l|256]=24):(i[l]=31744,i[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,h=0;for(;!(u&8388608);)u<<=1,h-=8388608;u&=-8388609,h+=947912704,s[l]=u|h}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:i,shiftTable:r,mantissaTable:s,exponentTable:o,offsetTable:a}}function Pr(n){Math.abs(n)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),n=$n(n,-65504,65504),la.floatView[0]=n;const e=la.uint32View[0],t=e>>23&511;return la.baseTable[t]+((e&8388607)>>la.shiftTable[t])}function _d(n){const e=n>>10;return la.uint32View[0]=la.mantissaTable[la.offsetTable[e]+(n&1023)]+la.exponentTable[e],la.floatView[0]}const Ru={toHalfFloat:Pr,fromHalfFloat:_d},ci=new G,Ng=new Re;class un{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=Ep,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=pi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return $D("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,s=this.itemSize;r0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const l in i){const u=i[l];e.data.attributes[l]=u.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let d=0,p=u.length;d0&&(r[l]=h,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone(t));const r=e.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(t))}const s=e.morphAttributes;for(const u in s){const h=[],d=s[u];for(let p=0,m=d.length;p0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s(e.far-e.near)**2))&&(rb.copy(s).invert(),ql.copy(e.ray).applyMatrix4(rb),!(i.boundingBox!==null&&ql.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,ql)))}_computeIntersections(e,t,i){let r;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,u=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,x=p.length;vt.far?null:{distance:u,point:Hg.clone(),object:n}}function Vg(n,e,t,i,r,s,o,a,l,u){n.getVertexPosition(a,Fc),n.getVertexPosition(l,Oc),n.getVertexPosition(u,Uc);const h=jH(n,e,t,i,Fc,Oc,Uc,Gg);if(h){r&&(Ug.fromBufferAttribute(r,a),kg.fromBufferAttribute(r,l),zg.fromBufferAttribute(r,u),h.uv=ts.getInterpolation(Gg,Fc,Oc,Uc,Ug,kg,zg,new Re)),s&&(Ug.fromBufferAttribute(s,a),kg.fromBufferAttribute(s,l),zg.fromBufferAttribute(s,u),h.uv1=ts.getInterpolation(Gg,Fc,Oc,Uc,Ug,kg,zg,new Re)),o&&(ob.fromBufferAttribute(o,a),ab.fromBufferAttribute(o,l),lb.fromBufferAttribute(o,u),h.normal=ts.getInterpolation(Gg,Fc,Oc,Uc,ob,ab,lb,new G),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new G,materialIndex:0};ts.getNormal(Fc,Oc,Uc,d.normal),h.face=d}return h}class ac extends zt{constructor(e=1,t=1,i=1,r=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:s,depthSegments:o};const a=this;r=Math.floor(r),s=Math.floor(s),o=Math.floor(o);const l=[],u=[],h=[],d=[];let p=0,m=0;v("z","y","x",-1,-1,i,t,e,o,s,0),v("z","y","x",1,-1,i,t,-e,o,s,1),v("x","z","y",1,1,e,i,t,r,o,2),v("x","z","y",1,-1,e,i,-t,r,o,3),v("x","y","z",1,-1,e,t,i,r,s,4),v("x","y","z",-1,-1,e,t,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new St(u,3)),this.setAttribute("normal",new St(h,3)),this.setAttribute("uv",new St(d,2));function v(x,y,g,S,A,E,b,C,R,I,O){const T=E/R,L=b/I,K=E/2,se=b/2,W=C/2,te=R+1,$=I+1;let oe=0,F=0;const V=new G;for(let N=0;N<$;N++){const ee=N*L-se;for(let fe=0;fe0?1:-1,h.push(V.x,V.y,V.z),d.push(fe/R),d.push(1-N/I),oe+=1}}for(let N=0;N0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Gp extends an{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new bt,this.projectionMatrix=new bt,this.projectionMatrixInverse=new bt,this.coordinateSystem=bo}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ga=new G,ab=new Re,lb=new Re;let Pn=class extends Gp{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=qf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(zu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return qf*2*Math.atan(Math.tan(zu*.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){Ga.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z),Ga.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z)}getViewSize(e,t){return this.getViewBounds(e,ab,lb),t.subVectors(lb,ab)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(zu*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/u,r*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const kc=-90,zc=1;class nN extends an{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Pn(kc,zc,e,t);r.layers=this.layers,this.add(r);const s=new Pn(kc,zc,e,t);s.layers=this.layers,this.add(s);const o=new Pn(kc,zc,e,t);o.layers=this.layers,this.add(o);const a=new Pn(kc,zc,e,t);a.layers=this.layers,this.add(a);const l=new Pn(kc,zc,e,t);l.layers=this.layers,this.add(l);const u=new Pn(kc,zc,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===bo)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===wp)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,u,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const x=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,u),i.texture.generateMipmaps=x,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,p,m),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class Hp extends Tn{constructor(e,t,i,r,s,o,a,l,u,h){e=e!==void 0?e:[],t=t!==void 0?t:zo,super(e,t,i,r,s,o,a,l,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class LE extends Vs{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 Hp(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:pn}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:` +}`;class Ws extends mi{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=KH,this.fragmentShader=QH,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=$f(e.uniforms),this.uniformsGroups=YH(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const o=this.uniforms[r].value;o&&o.isTexture?t.uniforms[r]={type:"t",value:o.toJSON(e).uuid}:o&&o.isColor?t.uniforms[r]={type:"c",value:o.getHex()}:o&&o.isVector2?t.uniforms[r]={type:"v2",value:o.toArray()}:o&&o.isVector3?t.uniforms[r]={type:"v3",value:o.toArray()}:o&&o.isVector4?t.uniforms[r]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?t.uniforms[r]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?t.uniforms[r]={type:"m4",value:o.toArray()}:t.uniforms[r]={value:o}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}}class Gp extends an{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new bt,this.projectionMatrix=new bt,this.projectionMatrixInverse=new bt,this.coordinateSystem=bo}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Ga=new G,ub=new Re,cb=new Re;let Pn=class extends Gp{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=qf*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Gu*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return qf*2*Math.atan(Math.tan(Gu*.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){Ga.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z),Ga.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(Ga.x,Ga.y).multiplyScalar(-e/Ga.z)}getViewSize(e,t){return this.getViewBounds(e,ub,cb),t.subVectors(cb,ub)}setViewOffset(e,t,i,r,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Gu*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,s=-.5*r;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,u=o.fullHeight;s+=o.offsetX*r/l,t-=o.offsetY*i/u,r*=o.width/l,i*=o.height/u}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}};const kc=-90,zc=1;class rN extends an{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Pn(kc,zc,e,t);r.layers=this.layers,this.add(r);const s=new Pn(kc,zc,e,t);s.layers=this.layers,this.add(s);const o=new Pn(kc,zc,e,t);o.layers=this.layers,this.add(o);const a=new Pn(kc,zc,e,t);a.layers=this.layers,this.add(a);const l=new Pn(kc,zc,e,t);l.layers=this.layers,this.add(l);const u=new Pn(kc,zc,e,t);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,r,s,o,a,l]=t;for(const u of t)this.remove(u);if(e===bo)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===wp)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of t)this.add(u),u.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,o,a,l,u,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),v=e.xr.enabled;e.xr.enabled=!1;const x=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,s),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,a),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,u),i.texture.generateMipmaps=x,e.setRenderTarget(i,5,r),e.render(t,h),e.setRenderTarget(d,p,m),e.xr.enabled=v,i.texture.needsPMREMUpdate=!0}}class Hp extends Tn{constructor(e,t,i,r,s,o,a,l,u,h){e=e!==void 0?e:[],t=t!==void 0?t:zo,super(e,t,i,r,s,o,a,l,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class LE extends Vs{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 Hp(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:pn}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; @@ -122,9 +122,9 @@ Error generating stack: `+s.message+` gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},r=new ac(5,5,5),s=new Ws({name:"CubemapFromEquirect",uniforms:$f(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Er,blending:ga});s.uniforms.tEquirect.value=t;const o=new ei(r,s),a=t.minFilter;return t.minFilter===Fs&&(t.minFilter=pn),new nN(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(s)}}const Yx=new G,JH=new G,jH=new Ht;class sa{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const r=Yx.subVectors(i,t).cross(JH.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const i=e.delta(Yx),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||jH.getNormalMatrix(e),r=this.coplanarPoint(Yx).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ql=new ki,Wg=new G;class Vp{constructor(e=new sa,t=new sa,i=new sa,r=new sa,s=new sa,o=new sa){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=bo){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],u=r[4],h=r[5],d=r[6],p=r[7],m=r[8],v=r[9],x=r[10],y=r[11],g=r[12],S=r[13],A=r[14],E=r[15];if(i[0].setComponents(l-s,p-u,y-m,E-g).normalize(),i[1].setComponents(l+s,p+u,y+m,E+g).normalize(),i[2].setComponents(l+o,p+h,y+v,E+S).normalize(),i[3].setComponents(l-o,p-h,y-v,E-S).normalize(),i[4].setComponents(l-a,p-d,y-x,E-A).normalize(),t===bo)i[5].setComponents(l+a,p+d,y+x,E+A).normalize();else if(t===wp)i[5].setComponents(a,d,x,A).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(),ql.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ql.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ql)}intersectsSprite(e){return ql.center.set(0,0,0),ql.radius=.7071067811865476,ql.applyMatrix4(e.matrixWorld),this.intersectsSphere(ql)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Wg.y=r.normal.y>0?e.max.y:e.min.y,Wg.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function iN(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function YH(n,e){const t=e.isWebGL2,i=new WeakMap;function r(u,h){const d=u.array,p=u.usage,m=d.byteLength,v=n.createBuffer();n.bindBuffer(h,v),n.bufferData(h,d,p),u.onUploadCallback();let x;if(d instanceof Float32Array)x=n.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)x=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)x=n.SHORT;else if(d instanceof Uint32Array)x=n.UNSIGNED_INT;else if(d instanceof Int32Array)x=n.INT;else if(d instanceof Int8Array)x=n.BYTE;else if(d instanceof Uint8Array)x=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)x=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:x,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version,size:m}}function s(u,h,d){const p=h.array,m=h._updateRange,v=h.updateRanges;if(n.bindBuffer(d,u),m.count===-1&&v.length===0&&n.bufferSubData(d,0,p),v.length!==0){for(let x=0,y=v.length;x1?null:t.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||qH.getNormalMatrix(e),r=this.coplanarPoint(Yx).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const $l=new ki,Wg=new G;class Vp{constructor(e=new sa,t=new sa,i=new sa,r=new sa,s=new sa,o=new sa){this.planes=[e,t,i,r,s,o]}set(e,t,i,r,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=bo){const i=this.planes,r=e.elements,s=r[0],o=r[1],a=r[2],l=r[3],u=r[4],h=r[5],d=r[6],p=r[7],m=r[8],v=r[9],x=r[10],y=r[11],g=r[12],S=r[13],A=r[14],E=r[15];if(i[0].setComponents(l-s,p-u,y-m,E-g).normalize(),i[1].setComponents(l+s,p+u,y+m,E+g).normalize(),i[2].setComponents(l+o,p+h,y+v,E+S).normalize(),i[3].setComponents(l-o,p-h,y-v,E-S).normalize(),i[4].setComponents(l-a,p-d,y-x,E-A).normalize(),t===bo)i[5].setComponents(l+a,p+d,y+x,E+A).normalize();else if(t===wp)i[5].setComponents(a,d,x,A).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(),$l.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),$l.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere($l)}intersectsSprite(e){return $l.center.set(0,0,0),$l.radius=.7071067811865476,$l.applyMatrix4(e.matrixWorld),this.intersectsSphere($l)}intersectsSphere(e){const t=this.planes,i=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(i)0?e.max.x:e.min.x,Wg.y=r.normal.y>0?e.max.y:e.min.y,Wg.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Wg)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function sN(){let n=null,e=!1,t=null,i=null;function r(s,o){t(s,o),i=n.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&(i=n.requestAnimationFrame(r),e=!0)},stop:function(){n.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){n=s}}}function $H(n,e){const t=e.isWebGL2,i=new WeakMap;function r(u,h){const d=u.array,p=u.usage,m=d.byteLength,v=n.createBuffer();n.bindBuffer(h,v),n.bufferData(h,d,p),u.onUploadCallback();let x;if(d instanceof Float32Array)x=n.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(t)x=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else x=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)x=n.SHORT;else if(d instanceof Uint32Array)x=n.UNSIGNED_INT;else if(d instanceof Int32Array)x=n.INT;else if(d instanceof Int8Array)x=n.BYTE;else if(d instanceof Uint8Array)x=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)x=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:v,type:x,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version,size:m}}function s(u,h,d){const p=h.array,m=h._updateRange,v=h.updateRanges;if(n.bindBuffer(d,u),m.count===-1&&v.length===0&&n.bufferSubData(d,0,p),v.length!==0){for(let x=0,y=v.length;x 0 +#endif`,m4=`#if NUM_CLIPPING_PLANES > 0 vec4 plane; #ifdef ALPHA_TO_COVERAGE float distanceToPlane, distanceGradient; @@ -354,26 +354,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve if ( clipped ) discard; #endif #endif -#endif`,f4=`#if NUM_CLIPPING_PLANES > 0 +#endif`,g4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,h4=`#if NUM_CLIPPING_PLANES > 0 +#endif`,v4=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; -#endif`,d4=`#if NUM_CLIPPING_PLANES > 0 +#endif`,_4=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; -#endif`,p4=`#if defined( USE_COLOR_ALPHA ) +#endif`,y4=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; -#endif`,m4=`#if defined( USE_COLOR_ALPHA ) +#endif`,x4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; -#endif`,g4=`#if defined( USE_COLOR_ALPHA ) +#endif`,A4=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; -#endif`,v4=`#if defined( USE_COLOR_ALPHA ) +#endif`,S4=`#if defined( USE_COLOR_ALPHA ) vColor = vec4( 1.0 ); #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) vColor = vec3( 1.0 ); @@ -383,7 +383,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve #endif #ifdef USE_INSTANCING_COLOR vColor.xyz *= instanceColor.xyz; -#endif`,_4=`#define PI 3.141592653589793 +#endif`,M4=`#define PI 3.141592653589793 #define PI2 6.283185307179586 #define PI_HALF 1.5707963267948966 #define RECIPROCAL_PI 0.3183098861837907 @@ -461,7 +461,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 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`,y4=`#ifdef ENVMAP_TYPE_CUBE_UV +} // validated`,E4=`#ifdef ENVMAP_TYPE_CUBE_UV #define cubeUV_minMipLevel 4.0 #define cubeUV_minTileSize 16.0 float getFace( vec3 direction ) { @@ -554,7 +554,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { return vec4( mix( color0, color1, mipF ), 1.0 ); } } -#endif`,x4=`vec3 transformedNormal = objectNormal; +#endif`,w4=`vec3 transformedNormal = objectNormal; #ifdef USE_TANGENT vec3 transformedTangent = objectTangent; #endif @@ -583,18 +583,18 @@ transformedNormal = normalMatrix * transformedNormal; #ifdef FLIP_SIDED transformedTangent = - transformedTangent; #endif -#endif`,A4=`#ifdef USE_DISPLACEMENTMAP +#endif`,T4=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; -#endif`,S4=`#ifdef USE_DISPLACEMENTMAP +#endif`,C4=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,M4=`#ifdef USE_EMISSIVEMAP +#endif`,R4=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,E4=`#ifdef USE_EMISSIVEMAP +#endif`,b4=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; -#endif`,w4="gl_FragColor = linearToOutputTexel( gl_FragColor );",T4=` +#endif`,P4="gl_FragColor = linearToOutputTexel( gl_FragColor );",B4=` const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( vec3( 0.8224621, 0.177538, 0.0 ), vec3( 0.0331941, 0.9668058, 0.0 ), @@ -622,7 +622,7 @@ vec4 LinearToLinear( in vec4 value ) { } vec4 LinearTosRGB( in vec4 value ) { return sRGBTransferOETF( value ); -}`,C4=`#ifdef USE_ENVMAP +}`,I4=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vec3 cameraToFrag; if ( isOrthographic ) { @@ -651,7 +651,7 @@ vec4 LinearTosRGB( in vec4 value ) { #elif defined( ENVMAP_BLENDING_ADD ) outgoingLight += envColor.xyz * specularStrength * reflectivity; #endif -#endif`,R4=`#ifdef USE_ENVMAP +#endif`,L4=`#ifdef USE_ENVMAP uniform float envMapIntensity; uniform float flipEnvMap; uniform mat3 envMapRotation; @@ -661,7 +661,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform sampler2D envMap; #endif -#endif`,b4=`#ifdef USE_ENVMAP +#endif`,D4=`#ifdef USE_ENVMAP uniform float reflectivity; #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS @@ -672,7 +672,7 @@ vec4 LinearTosRGB( in vec4 value ) { #else varying vec3 vReflect; #endif -#endif`,P4=`#ifdef USE_ENVMAP +#endif`,N4=`#ifdef USE_ENVMAP #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) #define ENV_WORLDPOS #endif @@ -683,7 +683,7 @@ vec4 LinearTosRGB( in vec4 value ) { varying vec3 vReflect; uniform float refractionRatio; #endif -#endif`,B4=`#ifdef USE_ENVMAP +#endif`,F4=`#ifdef USE_ENVMAP #ifdef ENV_WORLDPOS vWorldPosition = worldPosition.xyz; #else @@ -700,18 +700,18 @@ vec4 LinearTosRGB( in vec4 value ) { vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #endif -#endif`,I4=`#ifdef USE_FOG +#endif`,O4=`#ifdef USE_FOG vFogDepth = - mvPosition.z; -#endif`,L4=`#ifdef USE_FOG +#endif`,U4=`#ifdef USE_FOG varying float vFogDepth; -#endif`,D4=`#ifdef USE_FOG +#endif`,k4=`#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`,N4=`#ifdef USE_FOG +#endif`,z4=`#ifdef USE_FOG uniform vec3 fogColor; varying float vFogDepth; #ifdef FOG_EXP2 @@ -720,7 +720,7 @@ vec4 LinearTosRGB( in vec4 value ) { uniform float fogNear; uniform float fogFar; #endif -#endif`,F4=`#ifdef USE_GRADIENTMAP +#endif`,G4=`#ifdef USE_GRADIENTMAP uniform sampler2D gradientMap; #endif vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { @@ -732,16 +732,16 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 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 -}`,O4=`#ifdef USE_LIGHTMAP +}`,H4=`#ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,U4=`#ifdef USE_LIGHTMAP +#endif`,V4=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; -#endif`,k4=`LambertMaterial material; +#endif`,W4=`LambertMaterial material; material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,z4=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,X4=`varying vec3 vViewPosition; struct LambertMaterial { vec3 diffuseColor; float specularStrength; @@ -755,7 +755,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,G4=`uniform bool receiveShadow; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,J4=`uniform bool receiveShadow; uniform vec3 ambientLightColor; #if defined( USE_LIGHT_PROBES ) uniform vec3 lightProbe[ 9 ]; @@ -878,7 +878,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); return irradiance; } -#endif`,H4=`#ifdef USE_ENVMAP +#endif`,j4=`#ifdef USE_ENVMAP vec3 getIBLIrradiance( const in vec3 normal ) { #ifdef ENVMAP_TYPE_CUBE_UV vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); @@ -911,8 +911,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi #endif } #endif -#endif`,V4=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,W4=`varying vec3 vViewPosition; +#endif`,Y4=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,K4=`varying vec3 vViewPosition; struct ToonMaterial { vec3 diffuseColor; }; @@ -924,11 +924,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,X4=`BlinnPhongMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Q4=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; -material.specularStrength = specularStrength;`,J4=`varying vec3 vViewPosition; +material.specularStrength = specularStrength;`,Z4=`varying vec3 vViewPosition; struct BlinnPhongMaterial { vec3 diffuseColor; vec3 specularColor; @@ -945,7 +945,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); } #define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,j4=`PhysicalMaterial material; +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,q4=`PhysicalMaterial material; material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); @@ -1028,7 +1028,7 @@ material.roughness = min( material.roughness, 1.0 ); 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`,Y4=`struct PhysicalMaterial { +#endif`,$4=`struct PhysicalMaterial { vec3 diffuseColor; float roughness; vec3 specularColor; @@ -1328,7 +1328,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia #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 ); -}`,K4=` +}`,e5=` vec3 geometryPosition = - vViewPosition; vec3 geometryNormal = normal; vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); @@ -1443,7 +1443,7 @@ IncidentLight directLight; #if defined( RE_IndirectSpecular ) vec3 radiance = vec3( 0.0 ); vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,Q4=`#if defined( RE_IndirectDiffuse ) +#endif`,t5=`#if defined( RE_IndirectDiffuse ) #ifdef USE_LIGHTMAP vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; @@ -1462,25 +1462,25 @@ IncidentLight directLight; #ifdef USE_CLEARCOAT clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); #endif -#endif`,Z4=`#if defined( RE_IndirectDiffuse ) +#endif`,n5=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,q4=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,i5=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,$4=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) +#endif`,r5=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; -#endif`,e5=`#ifdef USE_LOGDEPTHBUF +#endif`,s5=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif -#endif`,t5=`#ifdef USE_LOGDEPTHBUF +#endif`,o5=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT vFragDepth = 1.0 + gl_Position.w; vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); @@ -1490,16 +1490,16 @@ IncidentLight directLight; gl_Position.z *= gl_Position.w; } #endif -#endif`,n5=`#ifdef USE_MAP +#endif`,a5=`#ifdef USE_MAP vec4 sampledDiffuseColor = texture2D( map, vMapUv ); #ifdef DECODE_VIDEO_TEXTURE sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); #endif diffuseColor *= sampledDiffuseColor; -#endif`,i5=`#ifdef USE_MAP +#endif`,l5=`#ifdef USE_MAP uniform sampler2D map; -#endif`,r5=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) +#endif`,u5=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) #if defined( USE_POINTS_UV ) vec2 uv = vUv; #else @@ -1511,7 +1511,7 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,s5=`#if defined( USE_POINTS_UV ) +#endif`,c5=`#if defined( USE_POINTS_UV ) varying vec2 vUv; #else #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) @@ -1523,19 +1523,19 @@ IncidentLight directLight; #endif #ifdef USE_ALPHAMAP uniform sampler2D alphaMap; -#endif`,o5=`float metalnessFactor = metalness; +#endif`,f5=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); metalnessFactor *= texelMetalness.b; -#endif`,a5=`#ifdef USE_METALNESSMAP +#endif`,h5=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; -#endif`,l5=`#ifdef USE_INSTANCING_MORPH +#endif`,d5=`#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`,u5=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) +#endif`,p5=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) vColor *= morphTargetBaseInfluence; for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { #if defined( USE_COLOR_ALPHA ) @@ -1544,7 +1544,7 @@ IncidentLight directLight; if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; #endif } -#endif`,c5=`#ifdef USE_MORPHNORMALS +#endif`,m5=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1556,7 +1556,7 @@ IncidentLight directLight; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif -#endif`,f5=`#ifdef USE_MORPHTARGETS +#endif`,g5=`#ifdef USE_MORPHTARGETS #ifndef USE_INSTANCING_MORPH uniform float morphTargetBaseInfluence; #endif @@ -1580,7 +1580,7 @@ IncidentLight directLight; uniform float morphTargetInfluences[ 4 ]; #endif #endif -#endif`,h5=`#ifdef USE_MORPHTARGETS +#endif`,v5=`#ifdef USE_MORPHTARGETS transformed *= morphTargetBaseInfluence; #ifdef MORPHTARGETS_TEXTURE for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { @@ -1598,7 +1598,7 @@ IncidentLight directLight; transformed += morphTarget7 * morphTargetInfluences[ 7 ]; #endif #endif -#endif`,d5=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#endif`,_5=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; #ifdef FLAT_SHADED vec3 fdx = dFdx( vViewPosition ); vec3 fdy = dFdy( vViewPosition ); @@ -1639,7 +1639,7 @@ IncidentLight directLight; tbn2[1] *= faceDirection; #endif #endif -vec3 nonPerturbedNormal = normal;`,p5=`#ifdef USE_NORMALMAP_OBJECTSPACE +vec3 nonPerturbedNormal = normal;`,y5=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; #ifdef FLIP_SIDED normal = - normal; @@ -1654,25 +1654,25 @@ vec3 nonPerturbedNormal = normal;`,p5=`#ifdef USE_NORMALMAP_OBJECTSPACE normal = normalize( tbn * mapN ); #elif defined( USE_BUMPMAP ) normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,m5=`#ifndef FLAT_SHADED +#endif`,x5=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,g5=`#ifndef FLAT_SHADED +#endif`,A5=`#ifndef FLAT_SHADED varying vec3 vNormal; #ifdef USE_TANGENT varying vec3 vTangent; varying vec3 vBitangent; #endif -#endif`,v5=`#ifndef FLAT_SHADED +#endif`,S5=`#ifndef FLAT_SHADED vNormal = normalize( transformedNormal ); #ifdef USE_TANGENT vTangent = normalize( transformedTangent ); vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); #endif -#endif`,_5=`#ifdef USE_NORMALMAP +#endif`,M5=`#ifdef USE_NORMALMAP uniform sampler2D normalMap; uniform vec2 normalScale; #endif @@ -1694,13 +1694,13 @@ vec3 nonPerturbedNormal = normal;`,p5=`#ifdef USE_NORMALMAP_OBJECTSPACE float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); return mat3( T * scale, B * scale, N ); } -#endif`,y5=`#ifdef USE_CLEARCOAT +#endif`,E5=`#ifdef USE_CLEARCOAT vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,x5=`#ifdef USE_CLEARCOAT_NORMALMAP +#endif`,w5=`#ifdef USE_CLEARCOAT_NORMALMAP vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; clearcoatMapN.xy *= clearcoatNormalScale; clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,A5=`#ifdef USE_CLEARCOATMAP +#endif`,T5=`#ifdef USE_CLEARCOATMAP uniform sampler2D clearcoatMap; #endif #ifdef USE_CLEARCOAT_NORMALMAP @@ -1709,18 +1709,18 @@ vec3 nonPerturbedNormal = normal;`,p5=`#ifdef USE_NORMALMAP_OBJECTSPACE #endif #ifdef USE_CLEARCOAT_ROUGHNESSMAP uniform sampler2D clearcoatRoughnessMap; -#endif`,S5=`#ifdef USE_IRIDESCENCEMAP +#endif`,C5=`#ifdef USE_IRIDESCENCEMAP uniform sampler2D iridescenceMap; #endif #ifdef USE_IRIDESCENCE_THICKNESSMAP uniform sampler2D iridescenceThicknessMap; -#endif`,M5=`#ifdef OPAQUE +#endif`,R5=`#ifdef OPAQUE diffuseColor.a = 1.0; #endif #ifdef USE_TRANSMISSION diffuseColor.a *= material.transmissionAlpha; #endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,E5=`vec3 packNormalToRGB( const in vec3 normal ) { +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,b5=`vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { @@ -1761,9 +1761,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const } float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * depth - far ); -}`,w5=`#ifdef PREMULTIPLIED_ALPHA +}`,P5=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; -#endif`,T5=`vec4 mvPosition = vec4( transformed, 1.0 ); +#endif`,B5=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_BATCHING mvPosition = batchingMatrix * mvPosition; #endif @@ -1771,22 +1771,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING +gl_Position = projectionMatrix * mvPosition;`,I5=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,R5=`#ifdef DITHERING +#endif`,L5=`#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`,b5=`float roughnessFactor = roughness; +#endif`,D5=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); roughnessFactor *= texelRoughness.g; -#endif`,P5=`#ifdef USE_ROUGHNESSMAP +#endif`,N5=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; -#endif`,B5=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,F5=`#if NUM_SPOT_LIGHT_COORDS > 0 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif #if NUM_SPOT_LIGHT_MAPS > 0 @@ -1963,7 +1963,7 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); #endif } -#endif`,I5=`#if NUM_SPOT_LIGHT_COORDS > 0 +#endif`,O5=`#if NUM_SPOT_LIGHT_COORDS > 0 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; #endif @@ -2001,7 +2001,7 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING }; uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; #endif -#endif`,L5=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) +#endif`,U5=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); vec4 shadowWorldPosition; #endif @@ -2033,7 +2033,7 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; } #pragma unroll_loop_end -#endif`,D5=`float getShadowMask() { +#endif`,k5=`float getShadowMask() { float shadow = 1.0; #ifdef USE_SHADOWMAP #if NUM_DIR_LIGHT_SHADOWS > 0 @@ -2065,12 +2065,12 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING #endif #endif return shadow; -}`,N5=`#ifdef USE_SKINNING +}`,z5=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,F5=`#ifdef USE_SKINNING +#endif`,G5=`#ifdef USE_SKINNING uniform mat4 bindMatrix; uniform mat4 bindMatrixInverse; uniform highp sampler2D boneTexture; @@ -2085,7 +2085,7 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); return mat4( v1, v2, v3, v4 ); } -#endif`,O5=`#ifdef USE_SKINNING +#endif`,H5=`#ifdef USE_SKINNING vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); vec4 skinned = vec4( 0.0 ); skinned += boneMatX * skinVertex * skinWeight.x; @@ -2093,7 +2093,7 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING skinned += boneMatZ * skinVertex * skinWeight.z; skinned += boneMatW * skinVertex * skinWeight.w; transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,U5=`#ifdef USE_SKINNING +#endif`,V5=`#ifdef USE_SKINNING mat4 skinMatrix = mat4( 0.0 ); skinMatrix += skinWeight.x * boneMatX; skinMatrix += skinWeight.y * boneMatY; @@ -2104,17 +2104,17 @@ gl_Position = projectionMatrix * mvPosition;`,C5=`#ifdef DITHERING #ifdef USE_TANGENT objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; #endif -#endif`,k5=`float specularStrength; +#endif`,W5=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; -#endif`,z5=`#ifdef USE_SPECULARMAP +#endif`,X5=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; -#endif`,G5=`#if defined( TONE_MAPPING ) +#endif`,J5=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,H5=`#ifndef saturate +#endif`,j5=`#ifndef saturate #define saturate( a ) clamp( a, 0.0, 1.0 ) #endif uniform float toneMappingExposure; @@ -2211,7 +2211,7 @@ vec3 NeutralToneMapping( vec3 color ) { float g = 1. - 1. / (desaturation * (peak - newPeak) + 1.); return mix(color, vec3(1, 1, 1), g); } -vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISSION +vec3 CustomToneMapping( vec3 color ) { return color; }`,Y5=`#ifdef USE_TRANSMISSION material.transmission = transmission; material.transmissionAlpha = 1.0; material.thickness = thickness; @@ -2232,7 +2232,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS material.attenuationColor, material.attenuationDistance ); material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,W5=`#ifdef USE_TRANSMISSION +#endif`,K5=`#ifdef USE_TRANSMISSION uniform float transmission; uniform float thickness; uniform float attenuationDistance; @@ -2338,7 +2338,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); } -#endif`,X5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Q5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2408,7 +2408,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,J5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,Z5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) varying vec2 vUv; #endif #ifdef USE_MAP @@ -2502,7 +2502,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS #ifdef USE_THICKNESSMAP uniform mat3 thicknessMapTransform; varying vec2 vThicknessMapUv; -#endif`,j5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) +#endif`,q5=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) vUv = vec3( uv, 1 ).xy; #endif #ifdef USE_MAP @@ -2573,7 +2573,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS #endif #ifdef USE_THICKNESSMAP vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,Y5=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 +#endif`,$5=`#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; @@ -2582,12 +2582,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,V5=`#ifdef USE_TRANSMISS worldPosition = instanceMatrix * worldPosition; #endif worldPosition = modelMatrix * worldPosition; -#endif`;const K5=`varying vec2 vUv; +#endif`;const e8=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,Q5=`uniform sampler2D t2D; +}`,t8=`uniform sampler2D t2D; uniform float backgroundIntensity; varying vec2 vUv; void main() { @@ -2599,14 +2599,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,Z5=`varying vec3 vWorldDirection; +}`,n8=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,q5=`#ifdef ENVMAP_TYPE_CUBE +}`,i8=`#ifdef ENVMAP_TYPE_CUBE uniform samplerCube envMap; #elif defined( ENVMAP_TYPE_CUBE_UV ) uniform sampler2D envMap; @@ -2629,14 +2629,14 @@ void main() { gl_FragColor = texColor; #include #include -}`,$5=`varying vec3 vWorldDirection; +}`,r8=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; -}`,e8=`uniform samplerCube tCube; +}`,s8=`uniform samplerCube tCube; uniform float tFlip; uniform float opacity; varying vec3 vWorldDirection; @@ -2646,7 +2646,7 @@ void main() { gl_FragColor.a *= opacity; #include #include -}`,t8=`#include +}`,o8=`#include #include #include #include @@ -2673,7 +2673,7 @@ void main() { #include #include vHighPrecisionZW = gl_Position.zw; -}`,n8=`#if DEPTH_PACKING == 3200 +}`,a8=`#if DEPTH_PACKING == 3200 uniform float opacity; #endif #include @@ -2703,7 +2703,7 @@ void main() { #elif DEPTH_PACKING == 3201 gl_FragColor = packDepthToRGBA( fragCoordZ ); #endif -}`,i8=`#define DISTANCE +}`,l8=`#define DISTANCE varying vec3 vWorldPosition; #include #include @@ -2730,7 +2730,7 @@ void main() { #include #include vWorldPosition = worldPosition.xyz; -}`,r8=`#define DISTANCE +}`,u8=`#define DISTANCE uniform vec3 referencePosition; uniform float nearDistance; uniform float farDistance; @@ -2754,13 +2754,13 @@ void main () { dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); dist = saturate( dist ); gl_FragColor = packDepthToRGBA( dist ); -}`,s8=`varying vec3 vWorldDirection; +}`,c8=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include -}`,o8=`uniform sampler2D tEquirect; +}`,f8=`uniform sampler2D tEquirect; varying vec3 vWorldDirection; #include void main() { @@ -2769,7 +2769,7 @@ void main() { gl_FragColor = texture2D( tEquirect, sampleUV ); #include #include -}`,a8=`uniform float scale; +}`,h8=`uniform float scale; attribute float lineDistance; varying float vLineDistance; #include @@ -2791,7 +2791,7 @@ void main() { #include #include #include -}`,l8=`uniform vec3 diffuse; +}`,d8=`uniform vec3 diffuse; uniform float opacity; uniform float dashSize; uniform float totalSize; @@ -2819,7 +2819,7 @@ void main() { #include #include #include -}`,u8=`#include +}`,p8=`#include #include #include #include @@ -2851,7 +2851,7 @@ void main() { #include #include #include -}`,c8=`uniform vec3 diffuse; +}`,m8=`uniform vec3 diffuse; uniform float opacity; #ifndef FLAT_SHADED varying vec3 vNormal; @@ -2899,7 +2899,7 @@ void main() { #include #include #include -}`,f8=`#define LAMBERT +}`,g8=`#define LAMBERT varying vec3 vViewPosition; #include #include @@ -2938,7 +2938,7 @@ void main() { #include #include #include -}`,h8=`#define LAMBERT +}`,v8=`#define LAMBERT uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -2995,7 +2995,7 @@ void main() { #include #include #include -}`,d8=`#define MATCAP +}`,_8=`#define MATCAP varying vec3 vViewPosition; #include #include @@ -3029,7 +3029,7 @@ void main() { #include #include vViewPosition = - mvPosition.xyz; -}`,p8=`#define MATCAP +}`,y8=`#define MATCAP uniform vec3 diffuse; uniform float opacity; uniform sampler2D matcap; @@ -3075,7 +3075,7 @@ void main() { #include #include #include -}`,m8=`#define NORMAL +}`,x8=`#define NORMAL #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; #endif @@ -3108,7 +3108,7 @@ void main() { #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) vViewPosition = - mvPosition.xyz; #endif -}`,g8=`#define NORMAL +}`,A8=`#define NORMAL uniform float opacity; #if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) varying vec3 vViewPosition; @@ -3130,7 +3130,7 @@ void main() { #ifdef OPAQUE gl_FragColor.a = 1.0; #endif -}`,v8=`#define PHONG +}`,S8=`#define PHONG varying vec3 vViewPosition; #include #include @@ -3169,7 +3169,7 @@ void main() { #include #include #include -}`,_8=`#define PHONG +}`,M8=`#define PHONG uniform vec3 diffuse; uniform vec3 emissive; uniform vec3 specular; @@ -3228,7 +3228,7 @@ void main() { #include #include #include -}`,y8=`#define STANDARD +}`,E8=`#define STANDARD varying vec3 vViewPosition; #ifdef USE_TRANSMISSION varying vec3 vWorldPosition; @@ -3271,7 +3271,7 @@ void main() { #ifdef USE_TRANSMISSION vWorldPosition = worldPosition.xyz; #endif -}`,x8=`#define STANDARD +}`,w8=`#define STANDARD #ifdef PHYSICAL #define IOR #define USE_SPECULAR @@ -3393,7 +3393,7 @@ void main() { #include #include #include -}`,A8=`#define TOON +}`,T8=`#define TOON varying vec3 vViewPosition; #include #include @@ -3430,7 +3430,7 @@ void main() { #include #include #include -}`,S8=`#define TOON +}`,C8=`#define TOON uniform vec3 diffuse; uniform vec3 emissive; uniform float opacity; @@ -3483,7 +3483,7 @@ void main() { #include #include #include -}`,M8=`uniform float size; +}`,R8=`uniform float size; uniform float scale; #include #include @@ -3514,7 +3514,7 @@ void main() { #include #include #include -}`,E8=`uniform vec3 diffuse; +}`,b8=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3539,7 +3539,7 @@ void main() { #include #include #include -}`,w8=`#include +}`,P8=`#include #include #include #include @@ -3562,7 +3562,7 @@ void main() { #include #include #include -}`,T8=`uniform vec3 color; +}`,B8=`uniform vec3 color; uniform float opacity; #include #include @@ -3578,7 +3578,7 @@ void main() { #include #include #include -}`,C8=`uniform float rotation; +}`,I8=`uniform float rotation; uniform vec2 center; #include #include @@ -3604,7 +3604,7 @@ void main() { #include #include #include -}`,R8=`uniform vec3 diffuse; +}`,L8=`uniform vec3 diffuse; uniform float opacity; #include #include @@ -3629,7 +3629,7 @@ void main() { #include #include #include -}`,Wt={alphahash_fragment:KH,alphahash_pars_fragment:QH,alphamap_fragment:ZH,alphamap_pars_fragment:qH,alphatest_fragment:$H,alphatest_pars_fragment:e4,aomap_fragment:t4,aomap_pars_fragment:n4,batching_pars_vertex:i4,batching_vertex:r4,begin_vertex:s4,beginnormal_vertex:o4,bsdfs:a4,iridescence_fragment:l4,bumpmap_pars_fragment:u4,clipping_planes_fragment:c4,clipping_planes_pars_fragment:f4,clipping_planes_pars_vertex:h4,clipping_planes_vertex:d4,color_fragment:p4,color_pars_fragment:m4,color_pars_vertex:g4,color_vertex:v4,common:_4,cube_uv_reflection_fragment:y4,defaultnormal_vertex:x4,displacementmap_pars_vertex:A4,displacementmap_vertex:S4,emissivemap_fragment:M4,emissivemap_pars_fragment:E4,colorspace_fragment:w4,colorspace_pars_fragment:T4,envmap_fragment:C4,envmap_common_pars_fragment:R4,envmap_pars_fragment:b4,envmap_pars_vertex:P4,envmap_physical_pars_fragment:H4,envmap_vertex:B4,fog_vertex:I4,fog_pars_vertex:L4,fog_fragment:D4,fog_pars_fragment:N4,gradientmap_pars_fragment:F4,lightmap_fragment:O4,lightmap_pars_fragment:U4,lights_lambert_fragment:k4,lights_lambert_pars_fragment:z4,lights_pars_begin:G4,lights_toon_fragment:V4,lights_toon_pars_fragment:W4,lights_phong_fragment:X4,lights_phong_pars_fragment:J4,lights_physical_fragment:j4,lights_physical_pars_fragment:Y4,lights_fragment_begin:K4,lights_fragment_maps:Q4,lights_fragment_end:Z4,logdepthbuf_fragment:q4,logdepthbuf_pars_fragment:$4,logdepthbuf_pars_vertex:e5,logdepthbuf_vertex:t5,map_fragment:n5,map_pars_fragment:i5,map_particle_fragment:r5,map_particle_pars_fragment:s5,metalnessmap_fragment:o5,metalnessmap_pars_fragment:a5,morphinstance_vertex:l5,morphcolor_vertex:u5,morphnormal_vertex:c5,morphtarget_pars_vertex:f5,morphtarget_vertex:h5,normal_fragment_begin:d5,normal_fragment_maps:p5,normal_pars_fragment:m5,normal_pars_vertex:g5,normal_vertex:v5,normalmap_pars_fragment:_5,clearcoat_normal_fragment_begin:y5,clearcoat_normal_fragment_maps:x5,clearcoat_pars_fragment:A5,iridescence_pars_fragment:S5,opaque_fragment:M5,packing:E5,premultiplied_alpha_fragment:w5,project_vertex:T5,dithering_fragment:C5,dithering_pars_fragment:R5,roughnessmap_fragment:b5,roughnessmap_pars_fragment:P5,shadowmap_pars_fragment:B5,shadowmap_pars_vertex:I5,shadowmap_vertex:L5,shadowmask_pars_fragment:D5,skinbase_vertex:N5,skinning_pars_vertex:F5,skinning_vertex:O5,skinnormal_vertex:U5,specularmap_fragment:k5,specularmap_pars_fragment:z5,tonemapping_fragment:G5,tonemapping_pars_fragment:H5,transmission_fragment:V5,transmission_pars_fragment:W5,uv_pars_fragment:X5,uv_pars_vertex:J5,uv_vertex:j5,worldpos_vertex:Y5,background_vert:K5,background_frag:Q5,backgroundCube_vert:Z5,backgroundCube_frag:q5,cube_vert:$5,cube_frag:e8,depth_vert:t8,depth_frag:n8,distanceRGBA_vert:i8,distanceRGBA_frag:r8,equirect_vert:s8,equirect_frag:o8,linedashed_vert:a8,linedashed_frag:l8,meshbasic_vert:u8,meshbasic_frag:c8,meshlambert_vert:f8,meshlambert_frag:h8,meshmatcap_vert:d8,meshmatcap_frag:p8,meshnormal_vert:m8,meshnormal_frag:g8,meshphong_vert:v8,meshphong_frag:_8,meshphysical_vert:y8,meshphysical_frag:x8,meshtoon_vert:A8,meshtoon_frag:S8,points_vert:M8,points_frag:E8,shadow_vert:w8,shadow_frag:T8,sprite_vert:C8,sprite_frag:R8},nt={common:{diffuse:{value:new it(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ht}},envmap:{envMap:{value:null},envMapRotation:{value:new Ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ht},normalScale:{value:new Re(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new it(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new it(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0},uvTransform:{value:new Ht}},sprite:{diffuse:{value:new it(16777215)},opacity:{value:1},center:{value:new Re(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}}},ro={basic:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.fog]),vertexShader:Wt.meshbasic_vert,fragmentShader:Wt.meshbasic_frag},lambert:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new it(0)}}]),vertexShader:Wt.meshlambert_vert,fragmentShader:Wt.meshlambert_frag},phong:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new it(0)},specular:{value:new it(1118481)},shininess:{value:30}}]),vertexShader:Wt.meshphong_vert,fragmentShader:Wt.meshphong_frag},standard:{uniforms:pr([nt.common,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.roughnessmap,nt.metalnessmap,nt.fog,nt.lights,{emissive:{value:new it(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Wt.meshphysical_vert,fragmentShader:Wt.meshphysical_frag},toon:{uniforms:pr([nt.common,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.gradientmap,nt.fog,nt.lights,{emissive:{value:new it(0)}}]),vertexShader:Wt.meshtoon_vert,fragmentShader:Wt.meshtoon_frag},matcap:{uniforms:pr([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,{matcap:{value:null}}]),vertexShader:Wt.meshmatcap_vert,fragmentShader:Wt.meshmatcap_frag},points:{uniforms:pr([nt.points,nt.fog]),vertexShader:Wt.points_vert,fragmentShader:Wt.points_frag},dashed:{uniforms:pr([nt.common,nt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Wt.linedashed_vert,fragmentShader:Wt.linedashed_frag},depth:{uniforms:pr([nt.common,nt.displacementmap]),vertexShader:Wt.depth_vert,fragmentShader:Wt.depth_frag},normal:{uniforms:pr([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,{opacity:{value:1}}]),vertexShader:Wt.meshnormal_vert,fragmentShader:Wt.meshnormal_frag},sprite:{uniforms:pr([nt.sprite,nt.fog]),vertexShader:Wt.sprite_vert,fragmentShader:Wt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Wt.background_vert,fragmentShader:Wt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ht}},vertexShader:Wt.backgroundCube_vert,fragmentShader:Wt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Wt.cube_vert,fragmentShader:Wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Wt.equirect_vert,fragmentShader:Wt.equirect_frag},distanceRGBA:{uniforms:pr([nt.common,nt.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Wt.distanceRGBA_vert,fragmentShader:Wt.distanceRGBA_frag},shadow:{uniforms:pr([nt.lights,nt.fog,{color:{value:new it(0)},opacity:{value:1}}]),vertexShader:Wt.shadow_vert,fragmentShader:Wt.shadow_frag}};ro.physical={uniforms:pr([ro.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ht},clearcoatNormalScale:{value:new Re(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ht},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ht},sheen:{value:0},sheenColor:{value:new it(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ht},transmissionSamplerSize:{value:new Re},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ht},attenuationDistance:{value:0},attenuationColor:{value:new it(0)},specularColor:{value:new it(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ht},anisotropyVector:{value:new Re},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ht}}]),vertexShader:Wt.meshphysical_vert,fragmentShader:Wt.meshphysical_frag};const Xg={r:0,b:0,g:0},$l=new cs,b8=new bt;function P8(n,e,t,i,r,s,o){const a=new it(0);let l=s===!0?0:1,u,h,d=null,p=0,m=null;function v(y,g){let S=!1,A=g.isScene===!0?g.background:null;A&&A.isTexture&&(A=(g.backgroundBlurriness>0?t:e).get(A)),A===null?x(a,l):A&&A.isColor&&(x(A,1),S=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),A&&(A.isCubeTexture||A.mapping===fh)?(h===void 0&&(h=new ei(new ac(1,1,1),new Ws({name:"BackgroundCubeMaterial",uniforms:$f(ro.backgroundCube.uniforms),vertexShader:ro.backgroundCube.vertexShader,fragmentShader:ro.backgroundCube.fragmentShader,side:Er,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(b,C,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),$l.copy(g.backgroundRotation),$l.x*=-1,$l.y*=-1,$l.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&($l.y*=-1,$l.z*=-1),h.material.uniforms.envMap.value=A,h.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(b8.makeRotationFromEuler($l)),h.material.toneMapped=vn.getTransfer(A.colorSpace)!==Mn,(d!==A||p!==A.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=A,p=A.version,m=n.toneMapping),h.layers.enableAll(),y.unshift(h,h.geometry,h.material,0,0,null)):A&&A.isTexture&&(u===void 0&&(u=new ei(new hh(2,2),new Ws({name:"BackgroundMaterial",uniforms:$f(ro.background.uniforms),vertexShader:ro.background.vertexShader,fragmentShader:ro.background.fragmentShader,side:ko,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=A,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=vn.getTransfer(A.colorSpace)!==Mn,A.matrixAutoUpdate===!0&&A.updateMatrix(),u.material.uniforms.uvTransform.value.copy(A.matrix),(d!==A||p!==A.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,d=A,p=A.version,m=n.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null))}function x(y,g){y.getRGB(Xg,eN(n)),i.buffers.color.setClear(Xg.r,Xg.g,Xg.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(y,g=1){a.set(y),l=g,x(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,x(a,l)},render:v}}function B8(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=y(null);let u=l,h=!1;function d(W,te,$,oe,F){let V=!1;if(o){const N=x(oe,$,te);u!==N&&(u=N,m(u.object)),V=g(W,oe,$,F),V&&S(W,oe,$,F)}else{const N=te.wireframe===!0;(u.geometry!==oe.id||u.program!==$.id||u.wireframe!==N)&&(u.geometry=oe.id,u.program=$.id,u.wireframe=N,V=!0)}F!==null&&t.update(F,n.ELEMENT_ARRAY_BUFFER),(V||h)&&(h=!1,I(W,te,$,oe),F!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(W){return i.isWebGL2?n.bindVertexArray(W):s.bindVertexArrayOES(W)}function v(W){return i.isWebGL2?n.deleteVertexArray(W):s.deleteVertexArrayOES(W)}function x(W,te,$){const oe=$.wireframe===!0;let F=a[W.id];F===void 0&&(F={},a[W.id]=F);let V=F[te.id];V===void 0&&(V={},F[te.id]=V);let N=V[oe];return N===void 0&&(N=y(p()),V[oe]=N),N}function y(W){const te=[],$=[],oe=[];for(let F=0;F=0){const ae=F[ce];let xe=V[ce];if(xe===void 0&&(ce==="instanceMatrix"&&W.instanceMatrix&&(xe=W.instanceMatrix),ce==="instanceColor"&&W.instanceColor&&(xe=W.instanceColor)),ae===void 0||ae.attribute!==xe||xe&&ae.data!==xe.data)return!0;N++}return u.attributesNum!==N||u.index!==oe}function S(W,te,$,oe){const F={},V=te.attributes;let N=0;const ee=$.getAttributes();for(const ce in ee)if(ee[ce].location>=0){let ae=V[ce];ae===void 0&&(ce==="instanceMatrix"&&W.instanceMatrix&&(ae=W.instanceMatrix),ce==="instanceColor"&&W.instanceColor&&(ae=W.instanceColor));const xe={};xe.attribute=ae,ae&&ae.data&&(xe.data=ae.data),F[ce]=xe,N++}u.attributes=F,u.attributesNum=N,u.index=oe}function A(){const W=u.newAttributes;for(let te=0,$=W.length;te<$;te++)W[te]=0}function E(W){b(W,0)}function b(W,te){const $=u.newAttributes,oe=u.enabledAttributes,F=u.attributeDivisors;$[W]=1,oe[W]===0&&(n.enableVertexAttribArray(W),oe[W]=1),F[W]!==te&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](W,te),F[W]=te)}function C(){const W=u.newAttributes,te=u.enabledAttributes;for(let $=0,oe=te.length;$=0){let Be=F[ee];if(Be===void 0&&(ee==="instanceMatrix"&&W.instanceMatrix&&(Be=W.instanceMatrix),ee==="instanceColor"&&W.instanceColor&&(Be=W.instanceColor)),Be!==void 0){const ae=Be.normalized,xe=Be.itemSize,Se=t.get(Be);if(Se===void 0)continue;const ke=Se.buffer,We=Se.type,Qe=Se.bytesPerElement,lt=i.isWebGL2===!0&&(We===n.INT||We===n.UNSIGNED_INT||Be.gpuType===_E);if(Be.isInterleavedBufferAttribute){const Ne=Be.data,Y=Ne.stride,Ae=Be.offset;if(Ne.isInstancedInterleavedBuffer){for(let ge=0;ge0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),x=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=p>0,E=o||e.has("OES_texture_float"),b=A&&E,C=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:x,maxVertexUniforms:y,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:A,floatFragmentTextures:E,floatVertexTextures:b,maxSamples:C}}function D8(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new sa,a=new Ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,m){const v=d.clippingPlanes,x=d.clipIntersection,y=d.clipShadows,g=n.get(d);if(!r||v===null||v.length===0||s&&!y)s?h(null):u();else{const S=s?0:i,A=S*4;let E=g.clippingState||null;l.value=E,E=h(v,p,A,m);for(let b=0;b!==A;++b)E[b]=t[b];g.clippingState=E,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=S}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,v){const x=d!==null?d.length:0;let y=null;if(x!==0){if(y=l.value,v!==!0||y===null){const g=m+x*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const u=new LE(l.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",r),t(u.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Os extends Gp{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const gf=4,ub=[.125,.215,.35,.446,.526,.582],_u=20,Kx=new Os,cb=new it;let Qx=null,Zx=0,qx=0;const gu=(1+Math.sqrt(5))/2,Gc=1/gu,fb=[new G(1,1,1),new G(-1,1,1),new G(1,1,-1),new G(-1,1,-1),new G(0,gu,Gc),new G(0,gu,-Gc),new G(Gc,0,gu),new G(-Gc,0,gu),new G(gu,Gc,0),new G(-gu,Gc,0)];class OS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Qx=this._renderer.getRenderTarget(),Zx=this._renderer.getActiveCubeFace(),qx=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=pb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=db(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?A:0,A,A),h.setRenderTarget(r),x&&h.render(v,a),h.render(e,a)}v.geometry.dispose(),v.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===zo||e.mapping===Cl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=pb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=db());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new ei(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Jg(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Kx)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r_u&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${_u}`);const g=[];let S=0;for(let R=0;R<_u;++R){const I=R/x,O=Math.exp(-I*I/2);g.push(O),R===0?S+=O:RA-gf?r-A+gf:0),C=4*(this._cubeSize-E);Jg(t,b,C,3*E,2*E),l.setRenderTarget(t),l.render(d,Kx)}}function F8(n){const e=[],t=[],i=[];let r=n;const s=n-gf+1+ub.length;for(let o=0;on-gf?l=ub[o-n+gf-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),h=-u,d=1+u,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,v=6,x=3,y=2,g=1,S=new Float32Array(x*v*m),A=new Float32Array(y*v*m),E=new Float32Array(g*v*m);for(let C=0;C2?0:-1,O=[R,I,0,R+2/3,I,0,R+2/3,I+1,0,R,I,0,R+2/3,I+1,0,R,I+1,0];S.set(O,x*v*C),A.set(p,y*v*C);const T=[C,C,C,C,C,C];E.set(T,g*v*C)}const b=new zt;b.setAttribute("position",new un(S,x)),b.setAttribute("uv",new un(A,y)),b.setAttribute("faceIndex",new un(E,g)),e.push(b),r>gf&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function hb(n,e,t){const i=new Vs(n,e,t);return i.texture.mapping=fh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jg(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function O8(n,e,t){const i=new Float32Array(_u),r=new G(0,1,0);return new Ws({name:"SphericalGaussianBlur",defines:{n:_u,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:DE(),fragmentShader:` +}`,Wt={alphahash_fragment:e4,alphahash_pars_fragment:t4,alphamap_fragment:n4,alphamap_pars_fragment:i4,alphatest_fragment:r4,alphatest_pars_fragment:s4,aomap_fragment:o4,aomap_pars_fragment:a4,batching_pars_vertex:l4,batching_vertex:u4,begin_vertex:c4,beginnormal_vertex:f4,bsdfs:h4,iridescence_fragment:d4,bumpmap_pars_fragment:p4,clipping_planes_fragment:m4,clipping_planes_pars_fragment:g4,clipping_planes_pars_vertex:v4,clipping_planes_vertex:_4,color_fragment:y4,color_pars_fragment:x4,color_pars_vertex:A4,color_vertex:S4,common:M4,cube_uv_reflection_fragment:E4,defaultnormal_vertex:w4,displacementmap_pars_vertex:T4,displacementmap_vertex:C4,emissivemap_fragment:R4,emissivemap_pars_fragment:b4,colorspace_fragment:P4,colorspace_pars_fragment:B4,envmap_fragment:I4,envmap_common_pars_fragment:L4,envmap_pars_fragment:D4,envmap_pars_vertex:N4,envmap_physical_pars_fragment:j4,envmap_vertex:F4,fog_vertex:O4,fog_pars_vertex:U4,fog_fragment:k4,fog_pars_fragment:z4,gradientmap_pars_fragment:G4,lightmap_fragment:H4,lightmap_pars_fragment:V4,lights_lambert_fragment:W4,lights_lambert_pars_fragment:X4,lights_pars_begin:J4,lights_toon_fragment:Y4,lights_toon_pars_fragment:K4,lights_phong_fragment:Q4,lights_phong_pars_fragment:Z4,lights_physical_fragment:q4,lights_physical_pars_fragment:$4,lights_fragment_begin:e5,lights_fragment_maps:t5,lights_fragment_end:n5,logdepthbuf_fragment:i5,logdepthbuf_pars_fragment:r5,logdepthbuf_pars_vertex:s5,logdepthbuf_vertex:o5,map_fragment:a5,map_pars_fragment:l5,map_particle_fragment:u5,map_particle_pars_fragment:c5,metalnessmap_fragment:f5,metalnessmap_pars_fragment:h5,morphinstance_vertex:d5,morphcolor_vertex:p5,morphnormal_vertex:m5,morphtarget_pars_vertex:g5,morphtarget_vertex:v5,normal_fragment_begin:_5,normal_fragment_maps:y5,normal_pars_fragment:x5,normal_pars_vertex:A5,normal_vertex:S5,normalmap_pars_fragment:M5,clearcoat_normal_fragment_begin:E5,clearcoat_normal_fragment_maps:w5,clearcoat_pars_fragment:T5,iridescence_pars_fragment:C5,opaque_fragment:R5,packing:b5,premultiplied_alpha_fragment:P5,project_vertex:B5,dithering_fragment:I5,dithering_pars_fragment:L5,roughnessmap_fragment:D5,roughnessmap_pars_fragment:N5,shadowmap_pars_fragment:F5,shadowmap_pars_vertex:O5,shadowmap_vertex:U5,shadowmask_pars_fragment:k5,skinbase_vertex:z5,skinning_pars_vertex:G5,skinning_vertex:H5,skinnormal_vertex:V5,specularmap_fragment:W5,specularmap_pars_fragment:X5,tonemapping_fragment:J5,tonemapping_pars_fragment:j5,transmission_fragment:Y5,transmission_pars_fragment:K5,uv_pars_fragment:Q5,uv_pars_vertex:Z5,uv_vertex:q5,worldpos_vertex:$5,background_vert:e8,background_frag:t8,backgroundCube_vert:n8,backgroundCube_frag:i8,cube_vert:r8,cube_frag:s8,depth_vert:o8,depth_frag:a8,distanceRGBA_vert:l8,distanceRGBA_frag:u8,equirect_vert:c8,equirect_frag:f8,linedashed_vert:h8,linedashed_frag:d8,meshbasic_vert:p8,meshbasic_frag:m8,meshlambert_vert:g8,meshlambert_frag:v8,meshmatcap_vert:_8,meshmatcap_frag:y8,meshnormal_vert:x8,meshnormal_frag:A8,meshphong_vert:S8,meshphong_frag:M8,meshphysical_vert:E8,meshphysical_frag:w8,meshtoon_vert:T8,meshtoon_frag:C8,points_vert:R8,points_frag:b8,shadow_vert:P8,shadow_frag:B8,sprite_vert:I8,sprite_frag:L8},nt={common:{diffuse:{value:new it(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ht}},envmap:{envMap:{value:null},envMapRotation:{value:new Ht},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ht}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ht}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ht},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ht},normalScale:{value:new Re(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ht},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ht}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ht}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ht}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new it(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new it(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0},uvTransform:{value:new Ht}},sprite:{diffuse:{value:new it(16777215)},opacity:{value:1},center:{value:new Re(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ht},alphaMap:{value:null},alphaMapTransform:{value:new Ht},alphaTest:{value:0}}},ro={basic:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.fog]),vertexShader:Wt.meshbasic_vert,fragmentShader:Wt.meshbasic_frag},lambert:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new it(0)}}]),vertexShader:Wt.meshlambert_vert,fragmentShader:Wt.meshlambert_frag},phong:{uniforms:pr([nt.common,nt.specularmap,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,nt.lights,{emissive:{value:new it(0)},specular:{value:new it(1118481)},shininess:{value:30}}]),vertexShader:Wt.meshphong_vert,fragmentShader:Wt.meshphong_frag},standard:{uniforms:pr([nt.common,nt.envmap,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.roughnessmap,nt.metalnessmap,nt.fog,nt.lights,{emissive:{value:new it(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Wt.meshphysical_vert,fragmentShader:Wt.meshphysical_frag},toon:{uniforms:pr([nt.common,nt.aomap,nt.lightmap,nt.emissivemap,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.gradientmap,nt.fog,nt.lights,{emissive:{value:new it(0)}}]),vertexShader:Wt.meshtoon_vert,fragmentShader:Wt.meshtoon_frag},matcap:{uniforms:pr([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,nt.fog,{matcap:{value:null}}]),vertexShader:Wt.meshmatcap_vert,fragmentShader:Wt.meshmatcap_frag},points:{uniforms:pr([nt.points,nt.fog]),vertexShader:Wt.points_vert,fragmentShader:Wt.points_frag},dashed:{uniforms:pr([nt.common,nt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Wt.linedashed_vert,fragmentShader:Wt.linedashed_frag},depth:{uniforms:pr([nt.common,nt.displacementmap]),vertexShader:Wt.depth_vert,fragmentShader:Wt.depth_frag},normal:{uniforms:pr([nt.common,nt.bumpmap,nt.normalmap,nt.displacementmap,{opacity:{value:1}}]),vertexShader:Wt.meshnormal_vert,fragmentShader:Wt.meshnormal_frag},sprite:{uniforms:pr([nt.sprite,nt.fog]),vertexShader:Wt.sprite_vert,fragmentShader:Wt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ht},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Wt.background_vert,fragmentShader:Wt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Ht}},vertexShader:Wt.backgroundCube_vert,fragmentShader:Wt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Wt.cube_vert,fragmentShader:Wt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Wt.equirect_vert,fragmentShader:Wt.equirect_frag},distanceRGBA:{uniforms:pr([nt.common,nt.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Wt.distanceRGBA_vert,fragmentShader:Wt.distanceRGBA_frag},shadow:{uniforms:pr([nt.lights,nt.fog,{color:{value:new it(0)},opacity:{value:1}}]),vertexShader:Wt.shadow_vert,fragmentShader:Wt.shadow_frag}};ro.physical={uniforms:pr([ro.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ht},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ht},clearcoatNormalScale:{value:new Re(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ht},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ht},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ht},sheen:{value:0},sheenColor:{value:new it(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ht},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ht},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ht},transmissionSamplerSize:{value:new Re},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ht},attenuationDistance:{value:0},attenuationColor:{value:new it(0)},specularColor:{value:new it(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ht},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ht},anisotropyVector:{value:new Re},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ht}}]),vertexShader:Wt.meshphysical_vert,fragmentShader:Wt.meshphysical_frag};const Xg={r:0,b:0,g:0},eu=new cs,D8=new bt;function N8(n,e,t,i,r,s,o){const a=new it(0);let l=s===!0?0:1,u,h,d=null,p=0,m=null;function v(y,g){let S=!1,A=g.isScene===!0?g.background:null;A&&A.isTexture&&(A=(g.backgroundBlurriness>0?t:e).get(A)),A===null?x(a,l):A&&A.isColor&&(x(A,1),S=!0);const E=n.xr.getEnvironmentBlendMode();E==="additive"?i.buffers.color.setClear(0,0,0,1,o):E==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,o),(n.autoClear||S)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),A&&(A.isCubeTexture||A.mapping===fh)?(h===void 0&&(h=new ti(new ac(1,1,1),new Ws({name:"BackgroundCubeMaterial",uniforms:$f(ro.backgroundCube.uniforms),vertexShader:ro.backgroundCube.vertexShader,fragmentShader:ro.backgroundCube.fragmentShader,side:Er,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(b,C,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),eu.copy(g.backgroundRotation),eu.x*=-1,eu.y*=-1,eu.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(eu.y*=-1,eu.z*=-1),h.material.uniforms.envMap.value=A,h.material.uniforms.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(D8.makeRotationFromEuler(eu)),h.material.toneMapped=vn.getTransfer(A.colorSpace)!==Mn,(d!==A||p!==A.version||m!==n.toneMapping)&&(h.material.needsUpdate=!0,d=A,p=A.version,m=n.toneMapping),h.layers.enableAll(),y.unshift(h,h.geometry,h.material,0,0,null)):A&&A.isTexture&&(u===void 0&&(u=new ti(new hh(2,2),new Ws({name:"BackgroundMaterial",uniforms:$f(ro.background.uniforms),vertexShader:ro.background.vertexShader,fragmentShader:ro.background.fragmentShader,side:ko,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=A,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=vn.getTransfer(A.colorSpace)!==Mn,A.matrixAutoUpdate===!0&&A.updateMatrix(),u.material.uniforms.uvTransform.value.copy(A.matrix),(d!==A||p!==A.version||m!==n.toneMapping)&&(u.material.needsUpdate=!0,d=A,p=A.version,m=n.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null))}function x(y,g){y.getRGB(Xg,nN(n)),i.buffers.color.setClear(Xg.r,Xg.g,Xg.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(y,g=1){a.set(y),l=g,x(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,x(a,l)},render:v}}function F8(n,e,t,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),o=i.isWebGL2||s!==null,a={},l=y(null);let u=l,h=!1;function d(W,te,$,oe,F){let V=!1;if(o){const N=x(oe,$,te);u!==N&&(u=N,m(u.object)),V=g(W,oe,$,F),V&&S(W,oe,$,F)}else{const N=te.wireframe===!0;(u.geometry!==oe.id||u.program!==$.id||u.wireframe!==N)&&(u.geometry=oe.id,u.program=$.id,u.wireframe=N,V=!0)}F!==null&&t.update(F,n.ELEMENT_ARRAY_BUFFER),(V||h)&&(h=!1,I(W,te,$,oe),F!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(F).buffer))}function p(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function m(W){return i.isWebGL2?n.bindVertexArray(W):s.bindVertexArrayOES(W)}function v(W){return i.isWebGL2?n.deleteVertexArray(W):s.deleteVertexArrayOES(W)}function x(W,te,$){const oe=$.wireframe===!0;let F=a[W.id];F===void 0&&(F={},a[W.id]=F);let V=F[te.id];V===void 0&&(V={},F[te.id]=V);let N=V[oe];return N===void 0&&(N=y(p()),V[oe]=N),N}function y(W){const te=[],$=[],oe=[];for(let F=0;F=0){const ae=F[fe];let xe=V[fe];if(xe===void 0&&(fe==="instanceMatrix"&&W.instanceMatrix&&(xe=W.instanceMatrix),fe==="instanceColor"&&W.instanceColor&&(xe=W.instanceColor)),ae===void 0||ae.attribute!==xe||xe&&ae.data!==xe.data)return!0;N++}return u.attributesNum!==N||u.index!==oe}function S(W,te,$,oe){const F={},V=te.attributes;let N=0;const ee=$.getAttributes();for(const fe in ee)if(ee[fe].location>=0){let ae=V[fe];ae===void 0&&(fe==="instanceMatrix"&&W.instanceMatrix&&(ae=W.instanceMatrix),fe==="instanceColor"&&W.instanceColor&&(ae=W.instanceColor));const xe={};xe.attribute=ae,ae&&ae.data&&(xe.data=ae.data),F[fe]=xe,N++}u.attributes=F,u.attributesNum=N,u.index=oe}function A(){const W=u.newAttributes;for(let te=0,$=W.length;te<$;te++)W[te]=0}function E(W){b(W,0)}function b(W,te){const $=u.newAttributes,oe=u.enabledAttributes,F=u.attributeDivisors;$[W]=1,oe[W]===0&&(n.enableVertexAttribArray(W),oe[W]=1),F[W]!==te&&((i.isWebGL2?n:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](W,te),F[W]=te)}function C(){const W=u.newAttributes,te=u.enabledAttributes;for(let $=0,oe=te.length;$=0){let Be=F[ee];if(Be===void 0&&(ee==="instanceMatrix"&&W.instanceMatrix&&(Be=W.instanceMatrix),ee==="instanceColor"&&W.instanceColor&&(Be=W.instanceColor)),Be!==void 0){const ae=Be.normalized,xe=Be.itemSize,Se=t.get(Be);if(Se===void 0)continue;const ke=Se.buffer,We=Se.type,Qe=Se.bytesPerElement,lt=i.isWebGL2===!0&&(We===n.INT||We===n.UNSIGNED_INT||Be.gpuType===_E);if(Be.isInterleavedBufferAttribute){const Ne=Be.data,Y=Ne.stride,Ae=Be.offset;if(Ne.isInstancedInterleavedBuffer){for(let ge=0;ge0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=o||e.has("WEBGL_draw_buffers"),h=t.logarithmicDepthBuffer===!0,d=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),p=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),x=n.getParameter(n.MAX_VERTEX_ATTRIBS),y=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),g=n.getParameter(n.MAX_VARYING_VECTORS),S=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),A=p>0,E=o||e.has("OES_texture_float"),b=A&&E,C=o?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:h,maxTextures:d,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:x,maxVertexUniforms:y,maxVaryings:g,maxFragmentUniforms:S,vertexTextures:A,floatFragmentTextures:E,floatVertexTextures:b,maxSamples:C}}function k8(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new sa,a=new Ht,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const m=d.length!==0||p||i!==0||r;return r=p,i=d.length,m},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){t=h(d,p,0)},this.setState=function(d,p,m){const v=d.clippingPlanes,x=d.clipIntersection,y=d.clipShadows,g=n.get(d);if(!r||v===null||v.length===0||s&&!y)s?h(null):u();else{const S=s?0:i,A=S*4;let E=g.clippingState||null;l.value=E,E=h(v,p,A,m);for(let b=0;b!==A;++b)E[b]=t[b];g.clippingState=E,this.numIntersection=x?this.numPlanes:0,this.numPlanes+=S}};function u(){l.value!==t&&(l.value=t,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,m,v){const x=d!==null?d.length:0;let y=null;if(x!==0){if(y=l.value,v!==!0||y===null){const g=m+x*4,S=p.matrixWorldInverse;a.getNormalMatrix(S),(y===null||y.length0){const u=new LE(l.height);return u.fromEquirectangularTexture(n,o),e.set(o,u),o.addEventListener("dispose",r),t(u.texture,o.mapping)}else return null}}return o}function r(o){const a=o.target;a.removeEventListener("dispose",r);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}class Os extends Gp{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,a=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const gf=4,fb=[.125,.215,.35,.446,.526,.582],yu=20,Kx=new Os,hb=new it;let Qx=null,Zx=0,qx=0;const vu=(1+Math.sqrt(5))/2,Gc=1/vu,db=[new G(1,1,1),new G(-1,1,1),new G(1,1,-1),new G(-1,1,-1),new G(0,vu,Gc),new G(0,vu,-Gc),new G(Gc,0,vu),new G(-Gc,0,vu),new G(vu,Gc,0),new G(-vu,Gc,0)];class OS{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){Qx=this._renderer.getRenderTarget(),Zx=this._renderer.getActiveCubeFace(),qx=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=gb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=mb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?A:0,A,A),h.setRenderTarget(r),x&&h.render(v,a),h.render(e,a)}v.geometry.dispose(),v.material.dispose(),h.toneMapping=p,h.autoClear=d,e.background=y}_textureToCubeUV(e,t){const i=this._renderer,r=e.mapping===zo||e.mapping===Cl;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=gb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=mb());const s=r?this._cubemapMaterial:this._equirectMaterial,o=new ti(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Jg(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,Kx)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;ryu&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${yu}`);const g=[];let S=0;for(let R=0;RA-gf?r-A+gf:0),C=4*(this._cubeSize-E);Jg(t,b,C,3*E,2*E),l.setRenderTarget(t),l.render(d,Kx)}}function G8(n){const e=[],t=[],i=[];let r=n;const s=n-gf+1+fb.length;for(let o=0;on-gf?l=fb[o-n+gf-1]:o===0&&(l=0),i.push(l);const u=1/(a-2),h=-u,d=1+u,p=[h,h,d,h,d,d,h,h,d,d,h,d],m=6,v=6,x=3,y=2,g=1,S=new Float32Array(x*v*m),A=new Float32Array(y*v*m),E=new Float32Array(g*v*m);for(let C=0;C2?0:-1,O=[R,I,0,R+2/3,I,0,R+2/3,I+1,0,R,I,0,R+2/3,I+1,0,R,I+1,0];S.set(O,x*v*C),A.set(p,y*v*C);const T=[C,C,C,C,C,C];E.set(T,g*v*C)}const b=new zt;b.setAttribute("position",new un(S,x)),b.setAttribute("uv",new un(A,y)),b.setAttribute("faceIndex",new un(E,g)),e.push(b),r>gf&&r--}return{lodPlanes:e,sizeLods:t,sigmas:i}}function pb(n,e,t){const i=new Vs(n,e,t);return i.texture.mapping=fh,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Jg(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function H8(n,e,t){const i=new Float32Array(yu),r=new G(0,1,0);return new Ws({name:"SphericalGaussianBlur",defines:{n:yu,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:DE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3689,7 +3689,7 @@ void main() { } } - `,blending:ga,depthTest:!1,depthWrite:!1})}function db(){return new Ws({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:DE(),fragmentShader:` + `,blending:ga,depthTest:!1,depthWrite:!1})}function mb(){return new Ws({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:DE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3708,7 +3708,7 @@ void main() { gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); } - `,blending:ga,depthTest:!1,depthWrite:!1})}function pb(){return new Ws({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:DE(),fragmentShader:` + `,blending:ga,depthTest:!1,depthWrite:!1})}function gb(){return new Ws({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:DE(),fragmentShader:` precision mediump float; precision mediump int; @@ -3779,16 +3779,16 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function U8(n){let e=new WeakMap,t=null;function i(a){if(a&&a.isTexture){const l=a.mapping,u=l===Kf||l===_p,h=l===zo||l===Cl;if(u||h)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return t===null&&(t=new OS(n)),d=u?t.fromEquirectangular(a,d):t.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(u&&d&&d.height>0||h&&d&&r(d)){t===null&&(t=new OS(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let l=0;const u=6;for(let h=0;he.maxTextureSize&&(O=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const T=new Float32Array(I*O*4*x),L=new p_(T,I,O,x);L.type=pi,L.needsUpdate=!0;const K=R*4;for(let W=0;W0)return n;const r=e*t;let s=mb[r];if(s===void 0&&(s=new Float32Array(r),mb[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Ai(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t0||h&&d&&r(d)){t===null&&(t=new OS(n));const p=u?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function r(a){let l=0;const u=6;for(let h=0;he.maxTextureSize&&(O=Math.ceil(I/e.maxTextureSize),I=e.maxTextureSize);const T=new Float32Array(I*O*4*x),L=new p_(T,I,O,x);L.type=pi,L.needsUpdate=!0;const K=R*4;for(let W=0;W0)return n;const r=e*t;let s=vb[r];if(s===void 0&&(s=new Float32Array(r),vb[r]=s),e!==0){i.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,n[o].toArray(s,a)}return s}function Ai(n,e){if(n.length!==e.length)return!1;for(let t=0,i=n.length;t":" "} ${a}: ${t[o]}`)}return i.join(` -`)}function zV(n){const e=vn.getPrimaries(vn.workingColorSpace),t=vn.getPrimaries(n);let i;switch(e===t?i="":e===Mp&&t===Sp?i="LinearDisplayP3ToLinearSRGB":e===Sp&&t===Mp&&(i="LinearSRGBToLinearDisplayP3"),n){case wa:case zp:return[i,"LinearTransferOETF"];case Cs:case d_:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function Sb(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` +`)}function XV(n){const e=vn.getPrimaries(vn.workingColorSpace),t=vn.getPrimaries(n);let i;switch(e===t?i="":e===Mp&&t===Sp?i="LinearDisplayP3ToLinearSRGB":e===Sp&&t===Mp&&(i="LinearSRGBToLinearDisplayP3"),n){case wa:case zp:return[i,"LinearTransferOETF"];case Cs:case d_:return[i,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),[i,"LinearTransferOETF"]}}function Eb(n,e,t){const i=n.getShaderParameter(e,n.COMPILE_STATUS),r=n.getShaderInfoLog(e).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` `+r+` -`+kV(n.getShaderSource(e),o)}else return r}function GV(n,e){const t=zV(e);return`vec4 ${n}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function HV(n,e){let t;switch(e){case xD:t="Linear";break;case AD:t="Reinhard";break;case SD:t="OptimizedCineon";break;case vE:t="ACESFilmic";break;case ED:t="AgX";break;case wD:t="Neutral";break;case MD:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+n+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function VV(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.alphaToCoverage||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(vf).join(` -`)}function WV(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(vf).join(` -`)}function XV(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` -`)}function JV(n,e){const t={},i=n.getProgramParameter(e,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function US(n){return n.replace(jV,KV)}const YV=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function KV(n,e){let t=Wt[e];if(t===void 0){const i=YV.get(e);if(i!==void 0)t=Wt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return US(t)}const QV=/#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 wb(n){return n.replace(QV,ZV)}function ZV(n,e,t,i){let r="";for(let s=parseInt(e);s/gm;function US(n){return n.replace(qV,e9)}const $V=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function e9(n,e){let t=Wt[e];if(t===void 0){const i=$V.get(e);if(i!==void 0)t=Wt[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return US(t)}const t9=/#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 Cb(n){return n.replace(t9,n9)}function n9(n,e,t,i){let r="";for(let s=parseInt(e);s0&&(g+=` `),S=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x].filter(vf).join(` `),S.length>0&&(S+=` -`)):(g=[Tb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",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 "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," 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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`)):(g=[Rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",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 "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," 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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(vf).join(` -`),S=[m,Tb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,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 "+u:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.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?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Do?"#define TONE_MAPPING":"",t.toneMapping!==Do?Wt.tonemapping_pars_fragment:"",t.toneMapping!==Do?HV("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Wt.colorspace_pars_fragment,GV("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`),S=[m,Rb(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,x,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 "+u:"",t.envMap?"#define "+h:"",t.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.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?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Do?"#define TONE_MAPPING":"",t.toneMapping!==Do?Wt.tonemapping_pars_fragment:"",t.toneMapping!==Do?jV("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Wt.colorspace_pars_fragment,JV("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(vf).join(` -`)),o=US(o),o=Mb(o,t),o=Eb(o,t),a=US(a),a=Mb(a,t),a=Eb(a,t),o=wb(o),a=wb(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(A=`#version 300 es +`)),o=US(o),o=wb(o,t),o=Tb(o,t),a=US(a),a=wb(a,t),a=Tb(a,t),o=Cb(o),a=Cb(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(A=`#version 300 es `,g=[v,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+g,S=["precision mediump sampler2DArray;","#define varying in",t.glslVersion===NS?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===NS?"":"#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(` `)+` -`+S);const E=A+g+o,b=A+S+a,C=Ab(r,r.VERTEX_SHADER,E),R=Ab(r,r.FRAGMENT_SHADER,b);r.attachShader(y,C),r.attachShader(y,R),t.index0AttributeName!==void 0?r.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);function I(K){if(n.debug.checkShaderErrors){const se=r.getProgramInfoLog(y).trim(),W=r.getShaderInfoLog(C).trim(),te=r.getShaderInfoLog(R).trim();let $=!0,oe=!0;if(r.getProgramParameter(y,r.LINK_STATUS)===!1)if($=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,y,C,R);else{const F=Sb(r,C,"vertex"),V=Sb(r,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,r.VALIDATE_STATUS)+` +`+S);const E=A+g+o,b=A+S+a,C=Mb(r,r.VERTEX_SHADER,E),R=Mb(r,r.FRAGMENT_SHADER,b);r.attachShader(y,C),r.attachShader(y,R),t.index0AttributeName!==void 0?r.bindAttribLocation(y,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y);function I(K){if(n.debug.checkShaderErrors){const se=r.getProgramInfoLog(y).trim(),W=r.getShaderInfoLog(C).trim(),te=r.getShaderInfoLog(R).trim();let $=!0,oe=!0;if(r.getProgramParameter(y,r.LINK_STATUS)===!1)if($=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,y,C,R);else{const F=Eb(r,C,"vertex"),V=Eb(r,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(y,r.VALIDATE_STATUS)+` Material Name: `+K.name+` Material Type: `+K.type+` Program Info Log: `+se+` `+F+` -`+V)}else se!==""?console.warn("THREE.WebGLProgram: Program Info Log:",se):(W===""||te==="")&&(oe=!1);oe&&(K.diagnostics={runnable:$,programLog:se,vertexShader:{log:W,prefix:g},fragmentShader:{log:te,prefix:S}})}r.deleteShader(C),r.deleteShader(R),O=new Q0(r,y),T=JV(r,y)}let O;this.getUniforms=function(){return O===void 0&&I(this),O};let T;this.getAttributes=function(){return T===void 0&&I(this),T};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=r.getProgramParameter(y,OV)),L},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=UV++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=C,this.fragmentShader=R,this}let r9=0;class s9{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new o9(e),t.set(e,i)),i}}class o9{constructor(e){this.id=r9++,this.code=e,this.usedTimes=0}}function a9(n,e,t,i,r,s,o){const a=new Gu,l=new s9,u=new Set,h=[],d=r.isWebGL2,p=r.logarithmicDepthBuffer,m=r.vertexTextures;let v=r.precision;const x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(T){return u.add(T),T===0?"uv":`uv${T}`}function g(T,L,K,se,W){const te=se.fog,$=W.geometry,oe=T.isMeshStandardMaterial?se.environment:null,F=(T.isMeshStandardMaterial?t:e).get(T.envMap||oe),V=F&&F.mapping===fh?F.image.height:null,N=x[T.type];T.precision!==null&&(v=r.getMaxPrecision(T.precision),v!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",v,"instead."));const ee=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,ce=ee!==void 0?ee.length:0;let Be=0;$.morphAttributes.position!==void 0&&(Be=1),$.morphAttributes.normal!==void 0&&(Be=2),$.morphAttributes.color!==void 0&&(Be=3);let ae,xe,Se,ke;if(N){const Ot=ro[N];ae=Ot.vertexShader,xe=Ot.fragmentShader}else ae=T.vertexShader,xe=T.fragmentShader,l.update(T),Se=l.getVertexShaderID(T),ke=l.getFragmentShaderID(T);const We=n.getRenderTarget(),Qe=W.isInstancedMesh===!0,lt=W.isBatchedMesh===!0,Ne=!!T.map,Y=!!T.matcap,Ae=!!F,ge=!!T.aoMap,Fe=!!T.lightMap,Ce=!!T.bumpMap,re=!!T.normalMap,Xe=!!T.displacementMap,et=!!T.emissiveMap,Et=!!T.metalnessMap,H=!!T.roughnessMap,U=T.anisotropy>0,ve=T.clearcoat>0,Me=T.iridescence>0,be=T.sheen>0,Ie=T.transmission>0,tt=U&&!!T.anisotropyMap,ct=ve&&!!T.clearcoatMap,Ge=ve&&!!T.clearcoatNormalMap,Ke=ve&&!!T.clearcoatRoughnessMap,Rt=Me&&!!T.iridescenceMap,Oe=Me&&!!T.iridescenceThicknessMap,qt=be&&!!T.sheenColorMap,pt=be&&!!T.sheenRoughnessMap,ht=!!T.specularMap,Z=!!T.specularColorMap,de=!!T.specularIntensityMap,Ue=Ie&&!!T.transmissionMap,Le=Ie&&!!T.thicknessMap,Pe=!!T.gradientMap,ie=!!T.alphaMap,He=T.alphaTest>0,pe=!!T.alphaHash,Ve=!!T.extensions;let Je=Do;T.toneMapped&&(We===null||We.isXRRenderTarget===!0)&&(Je=n.toneMapping);const Mt={isWebGL2:d,shaderID:N,shaderType:T.type,shaderName:T.name,vertexShader:ae,fragmentShader:xe,defines:T.defines,customVertexShaderID:Se,customFragmentShaderID:ke,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:v,batching:lt,instancing:Qe,instancingColor:Qe&&W.instanceColor!==null,instancingMorph:Qe&&W.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:We===null?n.outputColorSpace:We.isXRRenderTarget===!0?We.texture.colorSpace:wa,alphaToCoverage:!!T.alphaToCoverage,map:Ne,matcap:Y,envMap:Ae,envMapMode:Ae&&F.mapping,envMapCubeUVHeight:V,aoMap:ge,lightMap:Fe,bumpMap:Ce,normalMap:re,displacementMap:m&&Xe,emissiveMap:et,normalMapObjectSpace:re&&T.normalMapType===zD,normalMapTangentSpace:re&&T.normalMapType===Nl,metalnessMap:Et,roughnessMap:H,anisotropy:U,anisotropyMap:tt,clearcoat:ve,clearcoatMap:ct,clearcoatNormalMap:Ge,clearcoatRoughnessMap:Ke,iridescence:Me,iridescenceMap:Rt,iridescenceThicknessMap:Oe,sheen:be,sheenColorMap:qt,sheenRoughnessMap:pt,specularMap:ht,specularColorMap:Z,specularIntensityMap:de,transmission:Ie,transmissionMap:Ue,thicknessMap:Le,gradientMap:Pe,opaque:T.transparent===!1&&T.blending===ku&&T.alphaToCoverage===!1,alphaMap:ie,alphaTest:He,alphaHash:pe,combine:T.combine,mapUv:Ne&&y(T.map.channel),aoMapUv:ge&&y(T.aoMap.channel),lightMapUv:Fe&&y(T.lightMap.channel),bumpMapUv:Ce&&y(T.bumpMap.channel),normalMapUv:re&&y(T.normalMap.channel),displacementMapUv:Xe&&y(T.displacementMap.channel),emissiveMapUv:et&&y(T.emissiveMap.channel),metalnessMapUv:Et&&y(T.metalnessMap.channel),roughnessMapUv:H&&y(T.roughnessMap.channel),anisotropyMapUv:tt&&y(T.anisotropyMap.channel),clearcoatMapUv:ct&&y(T.clearcoatMap.channel),clearcoatNormalMapUv:Ge&&y(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ke&&y(T.clearcoatRoughnessMap.channel),iridescenceMapUv:Rt&&y(T.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&y(T.iridescenceThicknessMap.channel),sheenColorMapUv:qt&&y(T.sheenColorMap.channel),sheenRoughnessMapUv:pt&&y(T.sheenRoughnessMap.channel),specularMapUv:ht&&y(T.specularMap.channel),specularColorMapUv:Z&&y(T.specularColorMap.channel),specularIntensityMapUv:de&&y(T.specularIntensityMap.channel),transmissionMapUv:Ue&&y(T.transmissionMap.channel),thicknessMapUv:Le&&y(T.thicknessMap.channel),alphaMapUv:ie&&y(T.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(re||U),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!$.attributes.uv&&(Ne||ie),fog:!!te,useFog:T.fog===!0,fogExp2:!!te&&te.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:W.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:ce,morphTextureStride:Be,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&K.length>0,shadowMapType:n.shadowMap.type,toneMapping:Je,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ne&&T.map.isVideoTexture===!0&&vn.getTransfer(T.map.colorSpace)===Mn,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Lr,flipSided:T.side===Er,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:Ve&&T.extensions.derivatives===!0,extensionFragDepth:Ve&&T.extensions.fragDepth===!0,extensionDrawBuffers:Ve&&T.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ve&&T.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ve&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ve&&T.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Mt.vertexUv1s=u.has(1),Mt.vertexUv2s=u.has(2),Mt.vertexUv3s=u.has(3),u.clear(),Mt}function S(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const K in T.defines)L.push(K),L.push(T.defines[K]);return T.isRawShaderMaterial===!1&&(A(L,T),E(L,T),L.push(n.outputColorSpace)),L.push(T.customProgramCacheKey),L.join()}function A(T,L){T.push(L.precision),T.push(L.outputColorSpace),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.mapUv),T.push(L.alphaMapUv),T.push(L.lightMapUv),T.push(L.aoMapUv),T.push(L.bumpMapUv),T.push(L.normalMapUv),T.push(L.displacementMapUv),T.push(L.emissiveMapUv),T.push(L.metalnessMapUv),T.push(L.roughnessMapUv),T.push(L.anisotropyMapUv),T.push(L.clearcoatMapUv),T.push(L.clearcoatNormalMapUv),T.push(L.clearcoatRoughnessMapUv),T.push(L.iridescenceMapUv),T.push(L.iridescenceThicknessMapUv),T.push(L.sheenColorMapUv),T.push(L.sheenRoughnessMapUv),T.push(L.specularMapUv),T.push(L.specularColorMapUv),T.push(L.specularIntensityMapUv),T.push(L.transmissionMapUv),T.push(L.thicknessMapUv),T.push(L.combine),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.numLightProbes),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function E(T,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.instancingMorph&&a.enable(4),L.matcap&&a.enable(5),L.envMap&&a.enable(6),L.normalMapObjectSpace&&a.enable(7),L.normalMapTangentSpace&&a.enable(8),L.clearcoat&&a.enable(9),L.iridescence&&a.enable(10),L.alphaTest&&a.enable(11),L.vertexColors&&a.enable(12),L.vertexAlphas&&a.enable(13),L.vertexUv1s&&a.enable(14),L.vertexUv2s&&a.enable(15),L.vertexUv3s&&a.enable(16),L.vertexTangents&&a.enable(17),L.anisotropy&&a.enable(18),L.alphaHash&&a.enable(19),L.batching&&a.enable(20),T.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),L.decodeVideoTexture&&a.enable(19),L.alphaToCoverage&&a.enable(20),T.push(a.mask)}function b(T){const L=x[T.type];let K;if(L){const se=ro[L];K=tN.clone(se.uniforms)}else K=T.uniforms;return K}function C(T,L){let K;for(let se=0,W=h.length;se0?i.push(g):m.transparent===!0?r.push(g):t.push(g)}function l(d,p,m,v,x,y){const g=o(d,p,m,v,x,y);m.transmission>0?i.unshift(g):m.transparent===!0?r.unshift(g):t.unshift(g)}function u(d,p){t.length>1&&t.sort(d||u9),i.length>1&&i.sort(p||Cb),r.length>1&&r.sort(p||Cb)}function h(){for(let d=e,p=n.length;d=s.length?(o=new Rb,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function f9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new it};break;case"SpotLight":t={position:new G,direction:new G,color:new it,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new it,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new it,groundColor:new it};break;case"RectAreaLight":t={color:new it,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function h9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let d9=0;function p9(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function m9(n,e){const t=new f9,i=h9(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)r.probe.push(new G);const s=new G,o=new bt,a=new bt;function l(h,d){let p=0,m=0,v=0;for(let K=0;K<9;K++)r.probe[K].set(0,0,0);let x=0,y=0,g=0,S=0,A=0,E=0,b=0,C=0,R=0,I=0,O=0;h.sort(p9);const T=d===!0?Math.PI:1;for(let K=0,se=h.length;K0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_FLOAT_1,r.rectAreaLTC2=nt.LTC_FLOAT_2):(r.rectAreaLTC1=nt.LTC_HALF_1,r.rectAreaLTC2=nt.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_FLOAT_1,r.rectAreaLTC2=nt.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_HALF_1,r.rectAreaLTC2=nt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=m,r.ambient[2]=v;const L=r.hash;(L.directionalLength!==x||L.pointLength!==y||L.spotLength!==g||L.rectAreaLength!==S||L.hemiLength!==A||L.numDirectionalShadows!==E||L.numPointShadows!==b||L.numSpotShadows!==C||L.numSpotMaps!==R||L.numLightProbes!==O)&&(r.directional.length=x,r.spot.length=g,r.rectArea.length=S,r.point.length=y,r.hemi.length=A,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=C,r.spotShadowMap.length=C,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=C+R-I,r.spotLightMap.length=R,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=O,L.directionalLength=x,L.pointLength=y,L.spotLength=g,L.rectAreaLength=S,L.hemiLength=A,L.numDirectionalShadows=E,L.numPointShadows=b,L.numSpotShadows=C,L.numSpotMaps=R,L.numLightProbes=O,r.version=d9++)}function u(h,d){let p=0,m=0,v=0,x=0,y=0;const g=d.matrixWorldInverse;for(let S=0,A=h.length;S=a.length?(l=new bb(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class NE extends mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=UD,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 FE extends mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const v9=`void main() { +`+V)}else se!==""?console.warn("THREE.WebGLProgram: Program Info Log:",se):(W===""||te==="")&&(oe=!1);oe&&(K.diagnostics={runnable:$,programLog:se,vertexShader:{log:W,prefix:g},fragmentShader:{log:te,prefix:S}})}r.deleteShader(C),r.deleteShader(R),O=new Q0(r,y),T=ZV(r,y)}let O;this.getUniforms=function(){return O===void 0&&I(this),O};let T;this.getAttributes=function(){return T===void 0&&I(this),T};let L=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return L===!1&&(L=r.getProgramParameter(y,HV)),L},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=VV++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=C,this.fragmentShader=R,this}let u9=0;class c9{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){const t=this.shaderCache;let i=t.get(e);return i===void 0&&(i=new f9(e),t.set(e,i)),i}}class f9{constructor(e){this.id=u9++,this.code=e,this.usedTimes=0}}function h9(n,e,t,i,r,s,o){const a=new Hu,l=new c9,u=new Set,h=[],d=r.isWebGL2,p=r.logarithmicDepthBuffer,m=r.vertexTextures;let v=r.precision;const x={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function y(T){return u.add(T),T===0?"uv":`uv${T}`}function g(T,L,K,se,W){const te=se.fog,$=W.geometry,oe=T.isMeshStandardMaterial?se.environment:null,F=(T.isMeshStandardMaterial?t:e).get(T.envMap||oe),V=F&&F.mapping===fh?F.image.height:null,N=x[T.type];T.precision!==null&&(v=r.getMaxPrecision(T.precision),v!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",v,"instead."));const ee=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,fe=ee!==void 0?ee.length:0;let Be=0;$.morphAttributes.position!==void 0&&(Be=1),$.morphAttributes.normal!==void 0&&(Be=2),$.morphAttributes.color!==void 0&&(Be=3);let ae,xe,Se,ke;if(N){const Ot=ro[N];ae=Ot.vertexShader,xe=Ot.fragmentShader}else ae=T.vertexShader,xe=T.fragmentShader,l.update(T),Se=l.getVertexShaderID(T),ke=l.getFragmentShaderID(T);const We=n.getRenderTarget(),Qe=W.isInstancedMesh===!0,lt=W.isBatchedMesh===!0,Ne=!!T.map,Y=!!T.matcap,Ae=!!F,ge=!!T.aoMap,Fe=!!T.lightMap,Ce=!!T.bumpMap,re=!!T.normalMap,Xe=!!T.displacementMap,et=!!T.emissiveMap,Et=!!T.metalnessMap,H=!!T.roughnessMap,U=T.anisotropy>0,ve=T.clearcoat>0,Me=T.iridescence>0,be=T.sheen>0,Ie=T.transmission>0,tt=U&&!!T.anisotropyMap,ct=ve&&!!T.clearcoatMap,Ge=ve&&!!T.clearcoatNormalMap,Ke=ve&&!!T.clearcoatRoughnessMap,Rt=Me&&!!T.iridescenceMap,Oe=Me&&!!T.iridescenceThicknessMap,qt=be&&!!T.sheenColorMap,pt=be&&!!T.sheenRoughnessMap,ht=!!T.specularMap,Z=!!T.specularColorMap,de=!!T.specularIntensityMap,Ue=Ie&&!!T.transmissionMap,Le=Ie&&!!T.thicknessMap,Pe=!!T.gradientMap,ie=!!T.alphaMap,He=T.alphaTest>0,pe=!!T.alphaHash,Ve=!!T.extensions;let Je=Do;T.toneMapped&&(We===null||We.isXRRenderTarget===!0)&&(Je=n.toneMapping);const Mt={isWebGL2:d,shaderID:N,shaderType:T.type,shaderName:T.name,vertexShader:ae,fragmentShader:xe,defines:T.defines,customVertexShaderID:Se,customFragmentShaderID:ke,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:v,batching:lt,instancing:Qe,instancingColor:Qe&&W.instanceColor!==null,instancingMorph:Qe&&W.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:We===null?n.outputColorSpace:We.isXRRenderTarget===!0?We.texture.colorSpace:wa,alphaToCoverage:!!T.alphaToCoverage,map:Ne,matcap:Y,envMap:Ae,envMapMode:Ae&&F.mapping,envMapCubeUVHeight:V,aoMap:ge,lightMap:Fe,bumpMap:Ce,normalMap:re,displacementMap:m&&Xe,emissiveMap:et,normalMapObjectSpace:re&&T.normalMapType===HD,normalMapTangentSpace:re&&T.normalMapType===Fl,metalnessMap:Et,roughnessMap:H,anisotropy:U,anisotropyMap:tt,clearcoat:ve,clearcoatMap:ct,clearcoatNormalMap:Ge,clearcoatRoughnessMap:Ke,iridescence:Me,iridescenceMap:Rt,iridescenceThicknessMap:Oe,sheen:be,sheenColorMap:qt,sheenRoughnessMap:pt,specularMap:ht,specularColorMap:Z,specularIntensityMap:de,transmission:Ie,transmissionMap:Ue,thicknessMap:Le,gradientMap:Pe,opaque:T.transparent===!1&&T.blending===zu&&T.alphaToCoverage===!1,alphaMap:ie,alphaTest:He,alphaHash:pe,combine:T.combine,mapUv:Ne&&y(T.map.channel),aoMapUv:ge&&y(T.aoMap.channel),lightMapUv:Fe&&y(T.lightMap.channel),bumpMapUv:Ce&&y(T.bumpMap.channel),normalMapUv:re&&y(T.normalMap.channel),displacementMapUv:Xe&&y(T.displacementMap.channel),emissiveMapUv:et&&y(T.emissiveMap.channel),metalnessMapUv:Et&&y(T.metalnessMap.channel),roughnessMapUv:H&&y(T.roughnessMap.channel),anisotropyMapUv:tt&&y(T.anisotropyMap.channel),clearcoatMapUv:ct&&y(T.clearcoatMap.channel),clearcoatNormalMapUv:Ge&&y(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ke&&y(T.clearcoatRoughnessMap.channel),iridescenceMapUv:Rt&&y(T.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&y(T.iridescenceThicknessMap.channel),sheenColorMapUv:qt&&y(T.sheenColorMap.channel),sheenRoughnessMapUv:pt&&y(T.sheenRoughnessMap.channel),specularMapUv:ht&&y(T.specularMap.channel),specularColorMapUv:Z&&y(T.specularColorMap.channel),specularIntensityMapUv:de&&y(T.specularIntensityMap.channel),transmissionMapUv:Ue&&y(T.transmissionMap.channel),thicknessMapUv:Le&&y(T.thicknessMap.channel),alphaMapUv:ie&&y(T.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(re||U),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:W.isPoints===!0&&!!$.attributes.uv&&(Ne||ie),fog:!!te,useFog:T.fog===!0,fogExp2:!!te&&te.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:W.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:fe,morphTextureStride:Be,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numLightProbes:L.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:n.shadowMap.enabled&&K.length>0,shadowMapType:n.shadowMap.type,toneMapping:Je,useLegacyLights:n._useLegacyLights,decodeVideoTexture:Ne&&T.map.isVideoTexture===!0&&vn.getTransfer(T.map.colorSpace)===Mn,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===Lr,flipSided:T.side===Er,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:Ve&&T.extensions.derivatives===!0,extensionFragDepth:Ve&&T.extensions.fragDepth===!0,extensionDrawBuffers:Ve&&T.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ve&&T.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ve&&T.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ve&&T.extensions.multiDraw===!0&&i.has("WEBGL_multi_draw"),rendererExtensionFragDepth:d||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:d||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:d||i.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()};return Mt.vertexUv1s=u.has(1),Mt.vertexUv2s=u.has(2),Mt.vertexUv3s=u.has(3),u.clear(),Mt}function S(T){const L=[];if(T.shaderID?L.push(T.shaderID):(L.push(T.customVertexShaderID),L.push(T.customFragmentShaderID)),T.defines!==void 0)for(const K in T.defines)L.push(K),L.push(T.defines[K]);return T.isRawShaderMaterial===!1&&(A(L,T),E(L,T),L.push(n.outputColorSpace)),L.push(T.customProgramCacheKey),L.join()}function A(T,L){T.push(L.precision),T.push(L.outputColorSpace),T.push(L.envMapMode),T.push(L.envMapCubeUVHeight),T.push(L.mapUv),T.push(L.alphaMapUv),T.push(L.lightMapUv),T.push(L.aoMapUv),T.push(L.bumpMapUv),T.push(L.normalMapUv),T.push(L.displacementMapUv),T.push(L.emissiveMapUv),T.push(L.metalnessMapUv),T.push(L.roughnessMapUv),T.push(L.anisotropyMapUv),T.push(L.clearcoatMapUv),T.push(L.clearcoatNormalMapUv),T.push(L.clearcoatRoughnessMapUv),T.push(L.iridescenceMapUv),T.push(L.iridescenceThicknessMapUv),T.push(L.sheenColorMapUv),T.push(L.sheenRoughnessMapUv),T.push(L.specularMapUv),T.push(L.specularColorMapUv),T.push(L.specularIntensityMapUv),T.push(L.transmissionMapUv),T.push(L.thicknessMapUv),T.push(L.combine),T.push(L.fogExp2),T.push(L.sizeAttenuation),T.push(L.morphTargetsCount),T.push(L.morphAttributeCount),T.push(L.numDirLights),T.push(L.numPointLights),T.push(L.numSpotLights),T.push(L.numSpotLightMaps),T.push(L.numHemiLights),T.push(L.numRectAreaLights),T.push(L.numDirLightShadows),T.push(L.numPointLightShadows),T.push(L.numSpotLightShadows),T.push(L.numSpotLightShadowsWithMaps),T.push(L.numLightProbes),T.push(L.shadowMapType),T.push(L.toneMapping),T.push(L.numClippingPlanes),T.push(L.numClipIntersection),T.push(L.depthPacking)}function E(T,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.instancingMorph&&a.enable(4),L.matcap&&a.enable(5),L.envMap&&a.enable(6),L.normalMapObjectSpace&&a.enable(7),L.normalMapTangentSpace&&a.enable(8),L.clearcoat&&a.enable(9),L.iridescence&&a.enable(10),L.alphaTest&&a.enable(11),L.vertexColors&&a.enable(12),L.vertexAlphas&&a.enable(13),L.vertexUv1s&&a.enable(14),L.vertexUv2s&&a.enable(15),L.vertexUv3s&&a.enable(16),L.vertexTangents&&a.enable(17),L.anisotropy&&a.enable(18),L.alphaHash&&a.enable(19),L.batching&&a.enable(20),T.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),L.decodeVideoTexture&&a.enable(19),L.alphaToCoverage&&a.enable(20),T.push(a.mask)}function b(T){const L=x[T.type];let K;if(L){const se=ro[L];K=iN.clone(se.uniforms)}else K=T.uniforms;return K}function C(T,L){let K;for(let se=0,W=h.length;se0?i.push(g):m.transparent===!0?r.push(g):t.push(g)}function l(d,p,m,v,x,y){const g=o(d,p,m,v,x,y);m.transmission>0?i.unshift(g):m.transparent===!0?r.unshift(g):t.unshift(g)}function u(d,p){t.length>1&&t.sort(d||p9),i.length>1&&i.sort(p||bb),r.length>1&&r.sort(p||bb)}function h(){for(let d=e,p=n.length;d=s.length?(o=new Pb,s.push(o)):o=s[r],o}function t(){n=new WeakMap}return{get:e,dispose:t}}function g9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new G,color:new it};break;case"SpotLight":t={position:new G,direction:new G,color:new it,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new G,color:new it,distance:0,decay:0};break;case"HemisphereLight":t={direction:new G,skyColor:new it,groundColor:new it};break;case"RectAreaLight":t={color:new it,position:new G,halfWidth:new G,halfHeight:new G};break}return n[e.id]=t,t}}}function v9(){const n={};return{get:function(e){if(n[e.id]!==void 0)return n[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Re,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let _9=0;function y9(n,e){return(e.castShadow?2:0)-(n.castShadow?2:0)+(e.map?1:0)-(n.map?1:0)}function x9(n,e){const t=new g9,i=v9(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let h=0;h<9;h++)r.probe.push(new G);const s=new G,o=new bt,a=new bt;function l(h,d){let p=0,m=0,v=0;for(let K=0;K<9;K++)r.probe[K].set(0,0,0);let x=0,y=0,g=0,S=0,A=0,E=0,b=0,C=0,R=0,I=0,O=0;h.sort(y9);const T=d===!0?Math.PI:1;for(let K=0,se=h.length;K0&&(e.isWebGL2?n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_FLOAT_1,r.rectAreaLTC2=nt.LTC_FLOAT_2):(r.rectAreaLTC1=nt.LTC_HALF_1,r.rectAreaLTC2=nt.LTC_HALF_2):n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_FLOAT_1,r.rectAreaLTC2=nt.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=nt.LTC_HALF_1,r.rectAreaLTC2=nt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=p,r.ambient[1]=m,r.ambient[2]=v;const L=r.hash;(L.directionalLength!==x||L.pointLength!==y||L.spotLength!==g||L.rectAreaLength!==S||L.hemiLength!==A||L.numDirectionalShadows!==E||L.numPointShadows!==b||L.numSpotShadows!==C||L.numSpotMaps!==R||L.numLightProbes!==O)&&(r.directional.length=x,r.spot.length=g,r.rectArea.length=S,r.point.length=y,r.hemi.length=A,r.directionalShadow.length=E,r.directionalShadowMap.length=E,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=C,r.spotShadowMap.length=C,r.directionalShadowMatrix.length=E,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=C+R-I,r.spotLightMap.length=R,r.numSpotLightShadowsWithMaps=I,r.numLightProbes=O,L.directionalLength=x,L.pointLength=y,L.spotLength=g,L.rectAreaLength=S,L.hemiLength=A,L.numDirectionalShadows=E,L.numPointShadows=b,L.numSpotShadows=C,L.numSpotMaps=R,L.numLightProbes=O,r.version=_9++)}function u(h,d){let p=0,m=0,v=0,x=0,y=0;const g=d.matrixWorldInverse;for(let S=0,A=h.length;S=a.length?(l=new Bb(n,e),a.push(l)):l=a[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class NE extends mi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=zD,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 FE extends mi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const S9=`void main() { gl_Position = vec4( position, 1.0 ); -}`,_9=`uniform sampler2D shadow_pass; +}`,M9=`uniform sampler2D shadow_pass; uniform vec2 resolution; uniform float radius; #include @@ -3857,12 +3857,12 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function y9(n,e,t){let i=new Vp;const r=new Re,s=new Re,o=new _n,a=new NE({depthPacking:kD}),l=new FE,u={},h=t.maxTextureSize,d={[ko]:Er,[Er]:ko,[Lr]:Lr},p=new Ws({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Re},radius:{value:4}},vertexShader:v9,fragmentShader:_9}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new zt;v.setAttribute("position",new un(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new ei(v,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=l_;let g=this.type;this.render=function(C,R,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||C.length===0)return;const O=n.getRenderTarget(),T=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),K=n.state;K.setBlending(ga),K.buffers.color.setClear(1,1,1,1),K.buffers.depth.setTest(!0),K.setScissorTest(!1);const se=g!==eo&&this.type===eo,W=g===eo&&this.type!==eo;for(let te=0,$=C.length;te<$;te++){const oe=C[te],F=oe.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;r.copy(F.mapSize);const V=F.getFrameExtents();if(r.multiply(V),s.copy(F.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/V.x),r.x=s.x*V.x,F.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/V.y),r.y=s.y*V.y,F.mapSize.y=s.y)),F.map===null||se===!0||W===!0){const ee=this.type!==eo?{minFilter:Zn,magFilter:Zn}:{};F.map!==null&&F.map.dispose(),F.map=new Vs(r.x,r.y,ee),F.map.texture.name=oe.name+".shadowMap",F.camera.updateProjectionMatrix()}n.setRenderTarget(F.map),n.clear();const N=F.getViewportCount();for(let ee=0;ee0||R.map&&R.alphaTest>0){const K=T.uuid,se=R.uuid;let W=u[K];W===void 0&&(W={},u[K]=W);let te=W[se];te===void 0&&(te=T.clone(),W[se]=te,R.addEventListener("dispose",b)),T=te}if(T.visible=R.visible,T.wireframe=R.wireframe,O===eo?T.side=R.shadowSide!==null?R.shadowSide:R.side:T.side=R.shadowSide!==null?R.shadowSide:d[R.side],T.alphaMap=R.alphaMap,T.alphaTest=R.alphaTest,T.map=R.map,T.clipShadows=R.clipShadows,T.clippingPlanes=R.clippingPlanes,T.clipIntersection=R.clipIntersection,T.displacementMap=R.displacementMap,T.displacementScale=R.displacementScale,T.displacementBias=R.displacementBias,T.wireframeLinewidth=R.wireframeLinewidth,T.linewidth=R.linewidth,I.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const K=n.properties.get(T);K.light=I}return T}function E(C,R,I,O,T){if(C.visible===!1)return;if(C.layers.test(R.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&T===eo)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld);const se=e.update(C),W=C.material;if(Array.isArray(W)){const te=se.groups;for(let $=0,oe=te.length;$=1):N.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),F=V>=2);let ee=null,ce={};const Be=n.getParameter(n.SCISSOR_BOX),ae=n.getParameter(n.VIEWPORT),xe=new _n().fromArray(Be),Se=new _n().fromArray(ae);function ke(ie,He,pe,Ve){const Je=new Uint8Array(4),Mt=n.createTexture();n.bindTexture(ie,Mt),n.texParameteri(ie,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ie,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ot=0;Ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Re,d=new WeakMap;let p;const m=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(H,U){return v?new OffscreenCanvas(H,U):Tp("canvas")}function y(H,U,ve,Me){let be=1;const Ie=Et(H);if((Ie.width>Me||Ie.height>Me)&&(be=Me/Math.max(Ie.width,Ie.height)),be<1||U===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap||typeof VideoFrame<"u"&&H instanceof VideoFrame){const tt=U?kv:Math.floor,ct=tt(be*Ie.width),Ge=tt(be*Ie.height);p===void 0&&(p=x(ct,Ge));const Ke=ve?x(ct,Ge):p;return Ke.width=ct,Ke.height=Ge,Ke.getContext("2d").drawImage(H,0,0,ct,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ie.width+"x"+Ie.height+") to ("+ct+"x"+Ge+")."),Ke}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ie.width+"x"+Ie.height+")."),H;return H}function g(H){const U=Et(H);return FS(U.width)&&FS(U.height)}function S(H){return a?!1:H.wrapS!==Fi||H.wrapT!==Fi||H.minFilter!==Zn&&H.minFilter!==pn}function A(H,U){return H.generateMipmaps&&U&&H.minFilter!==Zn&&H.minFilter!==pn}function E(H){n.generateMipmap(H)}function b(H,U,ve,Me,be=!1){if(a===!1)return U;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let Ie=U;if(U===n.RED&&(ve===n.FLOAT&&(Ie=n.R32F),ve===n.HALF_FLOAT&&(Ie=n.R16F),ve===n.UNSIGNED_BYTE&&(Ie=n.R8)),U===n.RED_INTEGER&&(ve===n.UNSIGNED_BYTE&&(Ie=n.R8UI),ve===n.UNSIGNED_SHORT&&(Ie=n.R16UI),ve===n.UNSIGNED_INT&&(Ie=n.R32UI),ve===n.BYTE&&(Ie=n.R8I),ve===n.SHORT&&(Ie=n.R16I),ve===n.INT&&(Ie=n.R32I)),U===n.RG&&(ve===n.FLOAT&&(Ie=n.RG32F),ve===n.HALF_FLOAT&&(Ie=n.RG16F),ve===n.UNSIGNED_BYTE&&(Ie=n.RG8)),U===n.RG_INTEGER&&(ve===n.UNSIGNED_BYTE&&(Ie=n.RG8UI),ve===n.UNSIGNED_SHORT&&(Ie=n.RG16UI),ve===n.UNSIGNED_INT&&(Ie=n.RG32UI),ve===n.BYTE&&(Ie=n.RG8I),ve===n.SHORT&&(Ie=n.RG16I),ve===n.INT&&(Ie=n.RG32I)),U===n.RGBA){const tt=be?Ap:vn.getTransfer(Me);ve===n.FLOAT&&(Ie=n.RGBA32F),ve===n.HALF_FLOAT&&(Ie=n.RGBA16F),ve===n.UNSIGNED_BYTE&&(Ie=tt===Mn?n.SRGB8_ALPHA8:n.RGBA8),ve===n.UNSIGNED_SHORT_4_4_4_4&&(Ie=n.RGBA4),ve===n.UNSIGNED_SHORT_5_5_5_1&&(Ie=n.RGB5_A1)}return(Ie===n.R16F||Ie===n.R32F||Ie===n.RG16F||Ie===n.RG32F||Ie===n.RGBA16F||Ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ie}function C(H,U,ve){return A(H,ve)===!0||H.isFramebufferTexture&&H.minFilter!==Zn&&H.minFilter!==pn?Math.log2(Math.max(U.width,U.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?U.mipmaps.length:1}function R(H){return H===Zn||H===yp||H===$a?n.NEAREST:n.LINEAR}function I(H){const U=H.target;U.removeEventListener("dispose",I),T(U),U.isVideoTexture&&d.delete(U)}function O(H){const U=H.target;U.removeEventListener("dispose",O),K(U)}function T(H){const U=i.get(H);if(U.__webglInit===void 0)return;const ve=H.source,Me=m.get(ve);if(Me){const be=Me[U.__cacheKey];be.usedTimes--,be.usedTimes===0&&L(H),Object.keys(Me).length===0&&m.delete(ve)}i.remove(H)}function L(H){const U=i.get(H);n.deleteTexture(U.__webglTexture);const ve=H.source,Me=m.get(ve);delete Me[U.__cacheKey],o.memory.textures--}function K(H){const U=i.get(H);if(H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let Me=0;Me<6;Me++){if(Array.isArray(U.__webglFramebuffer[Me]))for(let be=0;be=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+r.maxTextures),se+=1,H}function $(H){const U=[];return U.push(H.wrapS),U.push(H.wrapT),U.push(H.wrapR||0),U.push(H.magFilter),U.push(H.minFilter),U.push(H.anisotropy),U.push(H.internalFormat),U.push(H.format),U.push(H.type),U.push(H.generateMipmaps),U.push(H.premultiplyAlpha),U.push(H.flipY),U.push(H.unpackAlignment),U.push(H.colorSpace),U.join()}function oe(H,U){const ve=i.get(H);if(H.isVideoTexture&&Xe(H),H.isRenderTargetTexture===!1&&H.version>0&&ve.__version!==H.version){const Me=H.image;if(Me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Se(ve,H,U);return}}t.bindTexture(n.TEXTURE_2D,ve.__webglTexture,n.TEXTURE0+U)}function F(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){Se(ve,H,U);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ve.__webglTexture,n.TEXTURE0+U)}function V(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){Se(ve,H,U);return}t.bindTexture(n.TEXTURE_3D,ve.__webglTexture,n.TEXTURE0+U)}function N(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){ke(ve,H,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ve.__webglTexture,n.TEXTURE0+U)}const ee={[Rl]:n.REPEAT,[Fi]:n.CLAMP_TO_EDGE,[Qf]:n.MIRRORED_REPEAT},ce={[Zn]:n.NEAREST,[yp]:n.NEAREST_MIPMAP_NEAREST,[$a]:n.NEAREST_MIPMAP_LINEAR,[pn]:n.LINEAR,[If]:n.LINEAR_MIPMAP_NEAREST,[Fs]:n.LINEAR_MIPMAP_LINEAR},Be={[GD]:n.NEVER,[jD]:n.ALWAYS,[HD]:n.LESS,[CE]:n.LEQUAL,[VD]:n.EQUAL,[JD]:n.GEQUAL,[WD]:n.GREATER,[XD]:n.NOTEQUAL};function ae(H,U,ve){if(U.type===pi&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===pn||U.magFilter===If||U.magFilter===$a||U.magFilter===Fs||U.minFilter===pn||U.minFilter===If||U.minFilter===$a||U.minFilter===Fs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ve?(n.texParameteri(H,n.TEXTURE_WRAP_S,ee[U.wrapS]),n.texParameteri(H,n.TEXTURE_WRAP_T,ee[U.wrapT]),(H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY)&&n.texParameteri(H,n.TEXTURE_WRAP_R,ee[U.wrapR]),n.texParameteri(H,n.TEXTURE_MAG_FILTER,ce[U.magFilter]),n.texParameteri(H,n.TEXTURE_MIN_FILTER,ce[U.minFilter])):(n.texParameteri(H,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(H,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY)&&n.texParameteri(H,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(U.wrapS!==Fi||U.wrapT!==Fi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,n.TEXTURE_MAG_FILTER,R(U.magFilter)),n.texParameteri(H,n.TEXTURE_MIN_FILTER,R(U.minFilter)),U.minFilter!==Zn&&U.minFilter!==pn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),U.compareFunction&&(n.texParameteri(H,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(H,n.TEXTURE_COMPARE_FUNC,Be[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===Zn||U.minFilter!==$a&&U.minFilter!==Fs||U.type===pi&&e.has("OES_texture_float_linear")===!1||a===!1&&U.type===tr&&e.has("OES_texture_half_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const Me=e.get("EXT_texture_filter_anisotropic");n.texParameterf(H,Me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function xe(H,U){let ve=!1;H.__webglInit===void 0&&(H.__webglInit=!0,U.addEventListener("dispose",I));const Me=U.source;let be=m.get(Me);be===void 0&&(be={},m.set(Me,be));const Ie=$(U);if(Ie!==H.__cacheKey){be[Ie]===void 0&&(be[Ie]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ve=!0),be[Ie].usedTimes++;const tt=be[H.__cacheKey];tt!==void 0&&(be[H.__cacheKey].usedTimes--,tt.usedTimes===0&&L(U)),H.__cacheKey=Ie,H.__webglTexture=be[Ie].texture}return ve}function Se(H,U,ve){let Me=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(Me=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(Me=n.TEXTURE_3D);const be=xe(H,U),Ie=U.source;t.bindTexture(Me,H.__webglTexture,n.TEXTURE0+ve);const tt=i.get(Ie);if(Ie.version!==tt.__version||be===!0){t.activeTexture(n.TEXTURE0+ve);const ct=vn.getPrimaries(vn.workingColorSpace),Ge=U.colorSpace===aa?null:vn.getPrimaries(U.colorSpace),Ke=U.colorSpace===aa||ct===Ge?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ke);const Rt=S(U)&&g(U.image)===!1;let Oe=y(U.image,Rt,!1,r.maxTextureSize);Oe=et(U,Oe);const qt=g(Oe)||a,pt=s.convert(U.format,U.colorSpace);let ht=s.convert(U.type),Z=b(U.internalFormat,pt,ht,U.colorSpace,U.isVideoTexture);ae(Me,U,qt);let de;const Ue=U.mipmaps,Le=a&&U.isVideoTexture!==!0&&Z!==EE,Pe=tt.__version===void 0||be===!0,ie=Ie.dataReady,He=C(U,Oe,qt);if(U.isDepthTexture)Z=n.DEPTH_COMPONENT,a?U.type===pi?Z=n.DEPTH_COMPONENT32F:U.type===ha?Z=n.DEPTH_COMPONENT24:U.type===yl?Z=n.DEPTH24_STENCIL8:Z=n.DEPTH_COMPONENT16:U.type===pi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===xl&&Z===n.DEPTH_COMPONENT&&U.type!==c_&&U.type!==ha&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=ha,ht=s.convert(U.type)),U.format===$u&&Z===n.DEPTH_COMPONENT&&(Z=n.DEPTH_STENCIL,U.type!==yl&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=yl,ht=s.convert(U.type))),Pe&&(Le?t.texStorage2D(n.TEXTURE_2D,1,Z,Oe.width,Oe.height):t.texImage2D(n.TEXTURE_2D,0,Z,Oe.width,Oe.height,0,pt,ht,null));else if(U.isDataTexture)if(Ue.length>0&&qt){Le&&Pe&&t.texStorage2D(n.TEXTURE_2D,He,Z,Ue[0].width,Ue[0].height);for(let pe=0,Ve=Ue.length;pe>=1,Ve>>=1}}else if(Ue.length>0&&qt){if(Le&&Pe){const pe=Et(Ue[0]);t.texStorage2D(n.TEXTURE_2D,He,Z,pe.width,pe.height)}for(let pe=0,Ve=Ue.length;pe0&&ie++;const pe=Et(Oe[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ie,de,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(Rt){Ue?Pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Oe[pe].width,Oe[pe].height,ht,Z,Oe[pe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,de,Oe[pe].width,Oe[pe].height,0,ht,Z,Oe[pe].data);for(let Ve=0;Ve>Ie),Oe=Math.max(1,U.height>>Ie);be===n.TEXTURE_3D||be===n.TEXTURE_2D_ARRAY?t.texImage3D(be,Ie,Ge,Rt,Oe,U.depth,0,tt,ct,null):t.texImage2D(be,Ie,Ge,Rt,Oe,0,tt,ct,null)}t.bindFramebuffer(n.FRAMEBUFFER,H),re(U)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Me,be,i.get(ve).__webglTexture,0,Ce(U)):(be===n.TEXTURE_2D||be>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Me,be,i.get(ve).__webglTexture,Ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(H,U,ve){if(n.bindRenderbuffer(n.RENDERBUFFER,H),U.depthBuffer&&!U.stencilBuffer){let Me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ve||re(U)){const be=U.depthTexture;be&&be.isDepthTexture&&(be.type===pi?Me=n.DEPTH_COMPONENT32F:be.type===ha&&(Me=n.DEPTH_COMPONENT24));const Ie=Ce(U);re(U)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ie,Me,U.width,U.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Ie,Me,U.width,U.height)}else n.renderbufferStorage(n.RENDERBUFFER,Me,U.width,U.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,H)}else if(U.depthBuffer&&U.stencilBuffer){const Me=Ce(U);ve&&re(U)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Me,n.DEPTH24_STENCIL8,U.width,U.height):re(U)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Me,n.DEPTH24_STENCIL8,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,H)}else{const Me=U.textures;for(let be=0;be1,ct=g(H)||a;if(tt||(Me.__webglTexture===void 0&&(Me.__webglTexture=n.createTexture()),Me.__version=U.version,o.memory.textures++),Ie){ve.__webglFramebuffer=[];for(let Ge=0;Ge<6;Ge++)if(a&&U.mipmaps&&U.mipmaps.length>0){ve.__webglFramebuffer[Ge]=[];for(let Ke=0;Ke0){ve.__webglFramebuffer=[];for(let Ge=0;Ge0&&re(H)===!1){ve.__webglMultisampledFramebuffer=n.createFramebuffer(),ve.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ve.__webglMultisampledFramebuffer);for(let Ge=0;Ge0)for(let Ke=0;Ke0)for(let Ke=0;Ke0&&re(H)===!1){const U=H.textures,ve=H.width,Me=H.height;let be=n.COLOR_BUFFER_BIT;const Ie=[],tt=H.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ct=i.get(H),Ge=U.length>1;if(Ge)for(let Ke=0;Ke0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function Xe(H){const U=o.render.frame;d.get(H)!==U&&(d.set(H,U),H.update())}function et(H,U){const ve=H.colorSpace,Me=H.format,be=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===Uv||ve!==wa&&ve!==aa&&(vn.getTransfer(ve)===Mn?a===!1?e.has("EXT_sRGB")===!0&&Me===er?(H.format=Uv,H.minFilter=pn,H.generateMipmaps=!1):U=bE.sRGBToLinear(U):(Me!==er||be!==No)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ve)),U}function Et(H){return typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement?(h.width=H.naturalWidth||H.width,h.height=H.naturalHeight||H.height):typeof VideoFrame<"u"&&H instanceof VideoFrame?(h.width=H.displayWidth,h.height=H.displayHeight):(h.width=H.width,h.height=H.height),h}this.allocateTextureUnit=te,this.resetTextureUnits=W,this.setTexture2D=oe,this.setTexture2DArray=F,this.setTexture3D=V,this.setTextureCube=N,this.rebindTextures=Y,this.setupRenderTarget=Ae,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=Fe,this.setupDepthRenderbuffer=Ne,this.setupFrameBufferTexture=We,this.useMultisampledRTT=re}function uN(n,e,t){const i=t.isWebGL2;function r(s,o=aa){let a;const l=vn.getTransfer(o);if(s===No)return n.UNSIGNED_BYTE;if(s===yE)return n.UNSIGNED_SHORT_4_4_4_4;if(s===xE)return n.UNSIGNED_SHORT_5_5_5_1;if(s===CD)return n.BYTE;if(s===RD)return n.SHORT;if(s===c_)return n.UNSIGNED_SHORT;if(s===_E)return n.INT;if(s===ha)return n.UNSIGNED_INT;if(s===pi)return n.FLOAT;if(s===tr)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===bD)return n.ALPHA;if(s===er)return n.RGBA;if(s===PD)return n.LUMINANCE;if(s===BD)return n.LUMINANCE_ALPHA;if(s===xl)return n.DEPTH_COMPONENT;if(s===$u)return n.DEPTH_STENCIL;if(s===Uv)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===f_)return n.RED;if(s===AE)return n.RED_INTEGER;if(s===ID)return n.RG;if(s===SE)return n.RG_INTEGER;if(s===ME)return n.RGBA_INTEGER;if(s===W0||s===X0||s===J0||s===j0)if(l===Mn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===W0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===X0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===J0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===j0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===W0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===X0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===J0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===j0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===uS||s===cS||s===fS||s===hS)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===uS)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===cS)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===fS)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===hS)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===EE)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===dS||s===pS)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===dS)return l===Mn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===pS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===mS||s===gS||s===vS||s===_S||s===yS||s===xS||s===AS||s===SS||s===MS||s===ES||s===wS||s===TS||s===CS||s===RS)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===mS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===gS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===vS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===_S)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===yS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===xS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===AS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===SS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===MS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ES)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===wS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===TS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===CS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===RS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Y0||s===bS||s===PS)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Y0)return l===Mn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===bS)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===PS)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===LD||s===BS||s===IS||s===LS)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Y0)return a.COMPRESSED_RED_RGTC1_EXT;if(s===BS)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===IS)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===LS)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===yl?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class cN extends Pn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class so extends an{constructor(){super(),this.isGroup=!0,this.type="Group"}}const S9={type:"move"};class e1{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new so,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new so,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new so,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const x of e.hand.values()){const y=t.getJointPose(x,i),g=this._getHandJoint(u,x);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,v=.005;u.inputState.pinching&&p>m+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(S9)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new so;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const M9=` +}`;function E9(n,e,t){let i=new Vp;const r=new Re,s=new Re,o=new _n,a=new NE({depthPacking:GD}),l=new FE,u={},h=t.maxTextureSize,d={[ko]:Er,[Er]:ko,[Lr]:Lr},p=new Ws({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Re},radius:{value:4}},vertexShader:S9,fragmentShader:M9}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new zt;v.setAttribute("position",new un(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const x=new ti(v,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=l_;let g=this.type;this.render=function(C,R,I){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||C.length===0)return;const O=n.getRenderTarget(),T=n.getActiveCubeFace(),L=n.getActiveMipmapLevel(),K=n.state;K.setBlending(ga),K.buffers.color.setClear(1,1,1,1),K.buffers.depth.setTest(!0),K.setScissorTest(!1);const se=g!==eo&&this.type===eo,W=g===eo&&this.type!==eo;for(let te=0,$=C.length;te<$;te++){const oe=C[te],F=oe.shadow;if(F===void 0){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(F.autoUpdate===!1&&F.needsUpdate===!1)continue;r.copy(F.mapSize);const V=F.getFrameExtents();if(r.multiply(V),s.copy(F.mapSize),(r.x>h||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/V.x),r.x=s.x*V.x,F.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/V.y),r.y=s.y*V.y,F.mapSize.y=s.y)),F.map===null||se===!0||W===!0){const ee=this.type!==eo?{minFilter:qn,magFilter:qn}:{};F.map!==null&&F.map.dispose(),F.map=new Vs(r.x,r.y,ee),F.map.texture.name=oe.name+".shadowMap",F.camera.updateProjectionMatrix()}n.setRenderTarget(F.map),n.clear();const N=F.getViewportCount();for(let ee=0;ee0||R.map&&R.alphaTest>0){const K=T.uuid,se=R.uuid;let W=u[K];W===void 0&&(W={},u[K]=W);let te=W[se];te===void 0&&(te=T.clone(),W[se]=te,R.addEventListener("dispose",b)),T=te}if(T.visible=R.visible,T.wireframe=R.wireframe,O===eo?T.side=R.shadowSide!==null?R.shadowSide:R.side:T.side=R.shadowSide!==null?R.shadowSide:d[R.side],T.alphaMap=R.alphaMap,T.alphaTest=R.alphaTest,T.map=R.map,T.clipShadows=R.clipShadows,T.clippingPlanes=R.clippingPlanes,T.clipIntersection=R.clipIntersection,T.displacementMap=R.displacementMap,T.displacementScale=R.displacementScale,T.displacementBias=R.displacementBias,T.wireframeLinewidth=R.wireframeLinewidth,T.linewidth=R.linewidth,I.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const K=n.properties.get(T);K.light=I}return T}function E(C,R,I,O,T){if(C.visible===!1)return;if(C.layers.test(R.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&T===eo)&&(!C.frustumCulled||i.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(I.matrixWorldInverse,C.matrixWorld);const se=e.update(C),W=C.material;if(Array.isArray(W)){const te=se.groups;for(let $=0,oe=te.length;$=1):N.indexOf("OpenGL ES")!==-1&&(V=parseFloat(/^OpenGL ES (\d)/.exec(N)[1]),F=V>=2);let ee=null,fe={};const Be=n.getParameter(n.SCISSOR_BOX),ae=n.getParameter(n.VIEWPORT),xe=new _n().fromArray(Be),Se=new _n().fromArray(ae);function ke(ie,He,pe,Ve){const Je=new Uint8Array(4),Mt=n.createTexture();n.bindTexture(ie,Mt),n.texParameteri(ie,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(ie,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ot=0;Ot"u"?!1:/OculusBrowser/g.test(navigator.userAgent),h=new Re,d=new WeakMap;let p;const m=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(H,U){return v?new OffscreenCanvas(H,U):Tp("canvas")}function y(H,U,ve,Me){let be=1;const Ie=Et(H);if((Ie.width>Me||Ie.height>Me)&&(be=Me/Math.max(Ie.width,Ie.height)),be<1||U===!0)if(typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&H instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&H instanceof ImageBitmap||typeof VideoFrame<"u"&&H instanceof VideoFrame){const tt=U?kv:Math.floor,ct=tt(be*Ie.width),Ge=tt(be*Ie.height);p===void 0&&(p=x(ct,Ge));const Ke=ve?x(ct,Ge):p;return Ke.width=ct,Ke.height=Ge,Ke.getContext("2d").drawImage(H,0,0,ct,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ie.width+"x"+Ie.height+") to ("+ct+"x"+Ge+")."),Ke}else return"data"in H&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ie.width+"x"+Ie.height+")."),H;return H}function g(H){const U=Et(H);return FS(U.width)&&FS(U.height)}function S(H){return a?!1:H.wrapS!==Fi||H.wrapT!==Fi||H.minFilter!==qn&&H.minFilter!==pn}function A(H,U){return H.generateMipmaps&&U&&H.minFilter!==qn&&H.minFilter!==pn}function E(H){n.generateMipmap(H)}function b(H,U,ve,Me,be=!1){if(a===!1)return U;if(H!==null){if(n[H]!==void 0)return n[H];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+H+"'")}let Ie=U;if(U===n.RED&&(ve===n.FLOAT&&(Ie=n.R32F),ve===n.HALF_FLOAT&&(Ie=n.R16F),ve===n.UNSIGNED_BYTE&&(Ie=n.R8)),U===n.RED_INTEGER&&(ve===n.UNSIGNED_BYTE&&(Ie=n.R8UI),ve===n.UNSIGNED_SHORT&&(Ie=n.R16UI),ve===n.UNSIGNED_INT&&(Ie=n.R32UI),ve===n.BYTE&&(Ie=n.R8I),ve===n.SHORT&&(Ie=n.R16I),ve===n.INT&&(Ie=n.R32I)),U===n.RG&&(ve===n.FLOAT&&(Ie=n.RG32F),ve===n.HALF_FLOAT&&(Ie=n.RG16F),ve===n.UNSIGNED_BYTE&&(Ie=n.RG8)),U===n.RG_INTEGER&&(ve===n.UNSIGNED_BYTE&&(Ie=n.RG8UI),ve===n.UNSIGNED_SHORT&&(Ie=n.RG16UI),ve===n.UNSIGNED_INT&&(Ie=n.RG32UI),ve===n.BYTE&&(Ie=n.RG8I),ve===n.SHORT&&(Ie=n.RG16I),ve===n.INT&&(Ie=n.RG32I)),U===n.RGBA){const tt=be?Ap:vn.getTransfer(Me);ve===n.FLOAT&&(Ie=n.RGBA32F),ve===n.HALF_FLOAT&&(Ie=n.RGBA16F),ve===n.UNSIGNED_BYTE&&(Ie=tt===Mn?n.SRGB8_ALPHA8:n.RGBA8),ve===n.UNSIGNED_SHORT_4_4_4_4&&(Ie=n.RGBA4),ve===n.UNSIGNED_SHORT_5_5_5_1&&(Ie=n.RGB5_A1)}return(Ie===n.R16F||Ie===n.R32F||Ie===n.RG16F||Ie===n.RG32F||Ie===n.RGBA16F||Ie===n.RGBA32F)&&e.get("EXT_color_buffer_float"),Ie}function C(H,U,ve){return A(H,ve)===!0||H.isFramebufferTexture&&H.minFilter!==qn&&H.minFilter!==pn?Math.log2(Math.max(U.width,U.height))+1:H.mipmaps!==void 0&&H.mipmaps.length>0?H.mipmaps.length:H.isCompressedTexture&&Array.isArray(H.image)?U.mipmaps.length:1}function R(H){return H===qn||H===yp||H===$a?n.NEAREST:n.LINEAR}function I(H){const U=H.target;U.removeEventListener("dispose",I),T(U),U.isVideoTexture&&d.delete(U)}function O(H){const U=H.target;U.removeEventListener("dispose",O),K(U)}function T(H){const U=i.get(H);if(U.__webglInit===void 0)return;const ve=H.source,Me=m.get(ve);if(Me){const be=Me[U.__cacheKey];be.usedTimes--,be.usedTimes===0&&L(H),Object.keys(Me).length===0&&m.delete(ve)}i.remove(H)}function L(H){const U=i.get(H);n.deleteTexture(U.__webglTexture);const ve=H.source,Me=m.get(ve);delete Me[U.__cacheKey],o.memory.textures--}function K(H){const U=i.get(H);if(H.depthTexture&&H.depthTexture.dispose(),H.isWebGLCubeRenderTarget)for(let Me=0;Me<6;Me++){if(Array.isArray(U.__webglFramebuffer[Me]))for(let be=0;be=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+H+" texture units while this GPU supports only "+r.maxTextures),se+=1,H}function $(H){const U=[];return U.push(H.wrapS),U.push(H.wrapT),U.push(H.wrapR||0),U.push(H.magFilter),U.push(H.minFilter),U.push(H.anisotropy),U.push(H.internalFormat),U.push(H.format),U.push(H.type),U.push(H.generateMipmaps),U.push(H.premultiplyAlpha),U.push(H.flipY),U.push(H.unpackAlignment),U.push(H.colorSpace),U.join()}function oe(H,U){const ve=i.get(H);if(H.isVideoTexture&&Xe(H),H.isRenderTargetTexture===!1&&H.version>0&&ve.__version!==H.version){const Me=H.image;if(Me===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Me.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Se(ve,H,U);return}}t.bindTexture(n.TEXTURE_2D,ve.__webglTexture,n.TEXTURE0+U)}function F(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){Se(ve,H,U);return}t.bindTexture(n.TEXTURE_2D_ARRAY,ve.__webglTexture,n.TEXTURE0+U)}function V(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){Se(ve,H,U);return}t.bindTexture(n.TEXTURE_3D,ve.__webglTexture,n.TEXTURE0+U)}function N(H,U){const ve=i.get(H);if(H.version>0&&ve.__version!==H.version){ke(ve,H,U);return}t.bindTexture(n.TEXTURE_CUBE_MAP,ve.__webglTexture,n.TEXTURE0+U)}const ee={[Rl]:n.REPEAT,[Fi]:n.CLAMP_TO_EDGE,[Qf]:n.MIRRORED_REPEAT},fe={[qn]:n.NEAREST,[yp]:n.NEAREST_MIPMAP_NEAREST,[$a]:n.NEAREST_MIPMAP_LINEAR,[pn]:n.LINEAR,[If]:n.LINEAR_MIPMAP_NEAREST,[Fs]:n.LINEAR_MIPMAP_LINEAR},Be={[VD]:n.NEVER,[KD]:n.ALWAYS,[WD]:n.LESS,[CE]:n.LEQUAL,[XD]:n.EQUAL,[YD]:n.GEQUAL,[JD]:n.GREATER,[jD]:n.NOTEQUAL};function ae(H,U,ve){if(U.type===pi&&e.has("OES_texture_float_linear")===!1&&(U.magFilter===pn||U.magFilter===If||U.magFilter===$a||U.magFilter===Fs||U.minFilter===pn||U.minFilter===If||U.minFilter===$a||U.minFilter===Fs)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),ve?(n.texParameteri(H,n.TEXTURE_WRAP_S,ee[U.wrapS]),n.texParameteri(H,n.TEXTURE_WRAP_T,ee[U.wrapT]),(H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY)&&n.texParameteri(H,n.TEXTURE_WRAP_R,ee[U.wrapR]),n.texParameteri(H,n.TEXTURE_MAG_FILTER,fe[U.magFilter]),n.texParameteri(H,n.TEXTURE_MIN_FILTER,fe[U.minFilter])):(n.texParameteri(H,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(H,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY)&&n.texParameteri(H,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(U.wrapS!==Fi||U.wrapT!==Fi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(H,n.TEXTURE_MAG_FILTER,R(U.magFilter)),n.texParameteri(H,n.TEXTURE_MIN_FILTER,R(U.minFilter)),U.minFilter!==qn&&U.minFilter!==pn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),U.compareFunction&&(n.texParameteri(H,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(H,n.TEXTURE_COMPARE_FUNC,Be[U.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(U.magFilter===qn||U.minFilter!==$a&&U.minFilter!==Fs||U.type===pi&&e.has("OES_texture_float_linear")===!1||a===!1&&U.type===tr&&e.has("OES_texture_half_float_linear")===!1)return;if(U.anisotropy>1||i.get(U).__currentAnisotropy){const Me=e.get("EXT_texture_filter_anisotropic");n.texParameterf(H,Me.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(U.anisotropy,r.getMaxAnisotropy())),i.get(U).__currentAnisotropy=U.anisotropy}}}function xe(H,U){let ve=!1;H.__webglInit===void 0&&(H.__webglInit=!0,U.addEventListener("dispose",I));const Me=U.source;let be=m.get(Me);be===void 0&&(be={},m.set(Me,be));const Ie=$(U);if(Ie!==H.__cacheKey){be[Ie]===void 0&&(be[Ie]={texture:n.createTexture(),usedTimes:0},o.memory.textures++,ve=!0),be[Ie].usedTimes++;const tt=be[H.__cacheKey];tt!==void 0&&(be[H.__cacheKey].usedTimes--,tt.usedTimes===0&&L(U)),H.__cacheKey=Ie,H.__webglTexture=be[Ie].texture}return ve}function Se(H,U,ve){let Me=n.TEXTURE_2D;(U.isDataArrayTexture||U.isCompressedArrayTexture)&&(Me=n.TEXTURE_2D_ARRAY),U.isData3DTexture&&(Me=n.TEXTURE_3D);const be=xe(H,U),Ie=U.source;t.bindTexture(Me,H.__webglTexture,n.TEXTURE0+ve);const tt=i.get(Ie);if(Ie.version!==tt.__version||be===!0){t.activeTexture(n.TEXTURE0+ve);const ct=vn.getPrimaries(vn.workingColorSpace),Ge=U.colorSpace===aa?null:vn.getPrimaries(U.colorSpace),Ke=U.colorSpace===aa||ct===Ge?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,U.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,U.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,U.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ke);const Rt=S(U)&&g(U.image)===!1;let Oe=y(U.image,Rt,!1,r.maxTextureSize);Oe=et(U,Oe);const qt=g(Oe)||a,pt=s.convert(U.format,U.colorSpace);let ht=s.convert(U.type),Z=b(U.internalFormat,pt,ht,U.colorSpace,U.isVideoTexture);ae(Me,U,qt);let de;const Ue=U.mipmaps,Le=a&&U.isVideoTexture!==!0&&Z!==EE,Pe=tt.__version===void 0||be===!0,ie=Ie.dataReady,He=C(U,Oe,qt);if(U.isDepthTexture)Z=n.DEPTH_COMPONENT,a?U.type===pi?Z=n.DEPTH_COMPONENT32F:U.type===ha?Z=n.DEPTH_COMPONENT24:U.type===yl?Z=n.DEPTH24_STENCIL8:Z=n.DEPTH_COMPONENT16:U.type===pi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),U.format===xl&&Z===n.DEPTH_COMPONENT&&U.type!==c_&&U.type!==ha&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),U.type=ha,ht=s.convert(U.type)),U.format===ec&&Z===n.DEPTH_COMPONENT&&(Z=n.DEPTH_STENCIL,U.type!==yl&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),U.type=yl,ht=s.convert(U.type))),Pe&&(Le?t.texStorage2D(n.TEXTURE_2D,1,Z,Oe.width,Oe.height):t.texImage2D(n.TEXTURE_2D,0,Z,Oe.width,Oe.height,0,pt,ht,null));else if(U.isDataTexture)if(Ue.length>0&&qt){Le&&Pe&&t.texStorage2D(n.TEXTURE_2D,He,Z,Ue[0].width,Ue[0].height);for(let pe=0,Ve=Ue.length;pe>=1,Ve>>=1}}else if(Ue.length>0&&qt){if(Le&&Pe){const pe=Et(Ue[0]);t.texStorage2D(n.TEXTURE_2D,He,Z,pe.width,pe.height)}for(let pe=0,Ve=Ue.length;pe0&&ie++;const pe=Et(Oe[0]);t.texStorage2D(n.TEXTURE_CUBE_MAP,ie,de,pe.width,pe.height)}for(let pe=0;pe<6;pe++)if(Rt){Ue?Pe&&t.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,0,0,Oe[pe].width,Oe[pe].height,ht,Z,Oe[pe].data):t.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+pe,0,de,Oe[pe].width,Oe[pe].height,0,ht,Z,Oe[pe].data);for(let Ve=0;Ve>Ie),Oe=Math.max(1,U.height>>Ie);be===n.TEXTURE_3D||be===n.TEXTURE_2D_ARRAY?t.texImage3D(be,Ie,Ge,Rt,Oe,U.depth,0,tt,ct,null):t.texImage2D(be,Ie,Ge,Rt,Oe,0,tt,ct,null)}t.bindFramebuffer(n.FRAMEBUFFER,H),re(U)?l.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,Me,be,i.get(ve).__webglTexture,0,Ce(U)):(be===n.TEXTURE_2D||be>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,Me,be,i.get(ve).__webglTexture,Ie),t.bindFramebuffer(n.FRAMEBUFFER,null)}function Qe(H,U,ve){if(n.bindRenderbuffer(n.RENDERBUFFER,H),U.depthBuffer&&!U.stencilBuffer){let Me=a===!0?n.DEPTH_COMPONENT24:n.DEPTH_COMPONENT16;if(ve||re(U)){const be=U.depthTexture;be&&be.isDepthTexture&&(be.type===pi?Me=n.DEPTH_COMPONENT32F:be.type===ha&&(Me=n.DEPTH_COMPONENT24));const Ie=Ce(U);re(U)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Ie,Me,U.width,U.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Ie,Me,U.width,U.height)}else n.renderbufferStorage(n.RENDERBUFFER,Me,U.width,U.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,H)}else if(U.depthBuffer&&U.stencilBuffer){const Me=Ce(U);ve&&re(U)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Me,n.DEPTH24_STENCIL8,U.width,U.height):re(U)?l.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Me,n.DEPTH24_STENCIL8,U.width,U.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,U.width,U.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,H)}else{const Me=U.textures;for(let be=0;be1,ct=g(H)||a;if(tt||(Me.__webglTexture===void 0&&(Me.__webglTexture=n.createTexture()),Me.__version=U.version,o.memory.textures++),Ie){ve.__webglFramebuffer=[];for(let Ge=0;Ge<6;Ge++)if(a&&U.mipmaps&&U.mipmaps.length>0){ve.__webglFramebuffer[Ge]=[];for(let Ke=0;Ke0){ve.__webglFramebuffer=[];for(let Ge=0;Ge0&&re(H)===!1){ve.__webglMultisampledFramebuffer=n.createFramebuffer(),ve.__webglColorRenderbuffer=[],t.bindFramebuffer(n.FRAMEBUFFER,ve.__webglMultisampledFramebuffer);for(let Ge=0;Ge0)for(let Ke=0;Ke0)for(let Ke=0;Ke0&&re(H)===!1){const U=H.textures,ve=H.width,Me=H.height;let be=n.COLOR_BUFFER_BIT;const Ie=[],tt=H.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,ct=i.get(H),Ge=U.length>1;if(Ge)for(let Ke=0;Ke0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&U.__useRenderToTexture!==!1}function Xe(H){const U=o.render.frame;d.get(H)!==U&&(d.set(H,U),H.update())}function et(H,U){const ve=H.colorSpace,Me=H.format,be=H.type;return H.isCompressedTexture===!0||H.isVideoTexture===!0||H.format===Uv||ve!==wa&&ve!==aa&&(vn.getTransfer(ve)===Mn?a===!1?e.has("EXT_sRGB")===!0&&Me===er?(H.format=Uv,H.minFilter=pn,H.generateMipmaps=!1):U=bE.sRGBToLinear(U):(Me!==er||be!==No)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ve)),U}function Et(H){return typeof HTMLImageElement<"u"&&H instanceof HTMLImageElement?(h.width=H.naturalWidth||H.width,h.height=H.naturalHeight||H.height):typeof VideoFrame<"u"&&H instanceof VideoFrame?(h.width=H.displayWidth,h.height=H.displayHeight):(h.width=H.width,h.height=H.height),h}this.allocateTextureUnit=te,this.resetTextureUnits=W,this.setTexture2D=oe,this.setTexture2DArray=F,this.setTexture3D=V,this.setTextureCube=N,this.rebindTextures=Y,this.setupRenderTarget=Ae,this.updateRenderTargetMipmap=ge,this.updateMultisampleRenderTarget=Fe,this.setupDepthRenderbuffer=Ne,this.setupFrameBufferTexture=We,this.useMultisampledRTT=re}function fN(n,e,t){const i=t.isWebGL2;function r(s,o=aa){let a;const l=vn.getTransfer(o);if(s===No)return n.UNSIGNED_BYTE;if(s===yE)return n.UNSIGNED_SHORT_4_4_4_4;if(s===xE)return n.UNSIGNED_SHORT_5_5_5_1;if(s===bD)return n.BYTE;if(s===PD)return n.SHORT;if(s===c_)return n.UNSIGNED_SHORT;if(s===_E)return n.INT;if(s===ha)return n.UNSIGNED_INT;if(s===pi)return n.FLOAT;if(s===tr)return i?n.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===BD)return n.ALPHA;if(s===er)return n.RGBA;if(s===ID)return n.LUMINANCE;if(s===LD)return n.LUMINANCE_ALPHA;if(s===xl)return n.DEPTH_COMPONENT;if(s===ec)return n.DEPTH_STENCIL;if(s===Uv)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===f_)return n.RED;if(s===AE)return n.RED_INTEGER;if(s===DD)return n.RG;if(s===SE)return n.RG_INTEGER;if(s===ME)return n.RGBA_INTEGER;if(s===W0||s===X0||s===J0||s===j0)if(l===Mn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===W0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===X0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===J0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===j0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===W0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===X0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===J0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===j0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===uS||s===cS||s===fS||s===hS)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===uS)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===cS)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===fS)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===hS)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===EE)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===dS||s===pS)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===dS)return l===Mn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===pS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===mS||s===gS||s===vS||s===_S||s===yS||s===xS||s===AS||s===SS||s===MS||s===ES||s===wS||s===TS||s===CS||s===RS)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===mS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===gS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===vS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===_S)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===yS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===xS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===AS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===SS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===MS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ES)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===wS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===TS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===CS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===RS)return l===Mn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Y0||s===bS||s===PS)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===Y0)return l===Mn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===bS)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===PS)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===ND||s===BS||s===IS||s===LS)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===Y0)return a.COMPRESSED_RED_RGTC1_EXT;if(s===BS)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===IS)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===LS)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===yl?i?n.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class hN extends Pn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class so extends an{constructor(){super(),this.isGroup=!0,this.type="Group"}}const C9={type:"move"};class e1{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new so,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new so,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new so,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,s=null,o=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const x of e.hand.values()){const y=t.getJointPose(x,i),g=this._getHandJoint(u,x);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),m=.02,v=.005;u.inputState.pinching&&p>m+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=m-v&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&s!==null&&(r=s),r!==null&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(C9)))}return a!==null&&(a.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const i=new so;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const R9=` void main() { gl_Position = vec4( position, 1.0 ); -}`,E9=` +}`,b9=` uniform sampler2DArray depthColor; uniform float depthWidth; uniform float depthHeight; @@ -3881,7 +3881,7 @@ void main() { } -}`;class w9{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){const r=new Tn,s=e.properties.get(r);s.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}render(e,t){if(this.texture!==null){if(this.mesh===null){const i=t.cameras[0].viewport,r=new Ws({extensions:{fragDepth:!0},vertexShader:M9,fragmentShader:E9,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new ei(new hh(20,20),r)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class T9 extends Go{constructor(e,t){super();const i=this;let r=null,s=1,o=null,a="local-floor",l=1,u=null,h=null,d=null,p=null,m=null,v=null;const x=new w9,y=t.getContextAttributes();let g=null,S=null;const A=[],E=[],b=new Re;let C=null;const R=new Pn;R.layers.enable(1),R.viewport=new _n;const I=new Pn;I.layers.enable(2),I.viewport=new _n;const O=[R,I],T=new cN;T.layers.enable(1),T.layers.enable(2);let L=null,K=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ae){let xe=A[ae];return xe===void 0&&(xe=new e1,A[ae]=xe),xe.getTargetRaySpace()},this.getControllerGrip=function(ae){let xe=A[ae];return xe===void 0&&(xe=new e1,A[ae]=xe),xe.getGripSpace()},this.getHand=function(ae){let xe=A[ae];return xe===void 0&&(xe=new e1,A[ae]=xe),xe.getHandSpace()};function se(ae){const xe=E.indexOf(ae.inputSource);if(xe===-1)return;const Se=A[xe];Se!==void 0&&(Se.update(ae.inputSource,ae.frame,u||o),Se.dispatchEvent({type:ae.type,data:ae.inputSource}))}function W(){r.removeEventListener("select",se),r.removeEventListener("selectstart",se),r.removeEventListener("selectend",se),r.removeEventListener("squeeze",se),r.removeEventListener("squeezestart",se),r.removeEventListener("squeezeend",se),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",te);for(let ae=0;ae=0&&(E[ke]=null,A[ke].disconnect(Se))}for(let xe=0;xe=E.length){E.push(Se),ke=Qe;break}else if(E[Qe]===null){E[Qe]=Se,ke=Qe;break}if(ke===-1)break}const We=A[ke];We&&We.connect(Se)}}const $=new G,oe=new G;function F(ae,xe,Se){$.setFromMatrixPosition(xe.matrixWorld),oe.setFromMatrixPosition(Se.matrixWorld);const ke=$.distanceTo(oe),We=xe.projectionMatrix.elements,Qe=Se.projectionMatrix.elements,lt=We[14]/(We[10]-1),Ne=We[14]/(We[10]+1),Y=(We[9]+1)/We[5],Ae=(We[9]-1)/We[5],ge=(We[8]-1)/We[0],Fe=(Qe[8]+1)/Qe[0],Ce=lt*ge,re=lt*Fe,Xe=ke/(-ge+Fe),et=Xe*-ge;xe.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(et),ae.translateZ(Xe),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert();const Et=lt+Xe,H=Ne+Xe,U=Ce-et,ve=re+(ke-et),Me=Y*Ne/H*Et,be=Ae*Ne/H*Et;ae.projectionMatrix.makePerspective(U,ve,Me,be,Et,H),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}function V(ae,xe){xe===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(xe.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(r===null)return;x.texture!==null&&(ae.near=x.depthNear,ae.far=x.depthFar),T.near=I.near=R.near=ae.near,T.far=I.far=R.far=ae.far,(L!==T.near||K!==T.far)&&(r.updateRenderState({depthNear:T.near,depthFar:T.far}),L=T.near,K=T.far,R.near=L,R.far=K,I.near=L,I.far=K,R.updateProjectionMatrix(),I.updateProjectionMatrix(),ae.updateProjectionMatrix());const xe=ae.parent,Se=T.cameras;V(T,xe);for(let ke=0;ke0&&(y.alphaTest.value=g.alphaTest);const S=e.get(g),A=S.envMap,E=S.envMapRotation;if(A&&(y.envMap.value=A,eu.copy(E),eu.x*=-1,eu.y*=-1,eu.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(eu.y*=-1,eu.z*=-1),y.envMapRotation.value.setFromMatrix4(C9.makeRotationFromEuler(eu)),y.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap){y.lightMap.value=g.lightMap;const b=n._useLegacyLights===!0?Math.PI:1;y.lightMapIntensity.value=g.lightMapIntensity*b,t(g.lightMap,y.lightMapTransform)}g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,y.aoMapTransform))}function o(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function l(y,g,S,A){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*S,y.scale.value=A*.5,g.map&&(y.map.value=g.map,t(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function h(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function d(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function p(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,y.roughnessMapTransform)),e.get(g).envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function m(y,g,S){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Er&&y.clearcoatNormalScale.value.negate())),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function x(y,g){const S=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function b9(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,A){const E=A.program;i.uniformBlockBinding(S,E)}function u(S,A){let E=r[S.id];E===void 0&&(v(S),E=h(S),r[S.id]=E,S.addEventListener("dispose",y));const b=A.program;i.updateUBOMapping(S,b);const C=e.render.frame;s[S.id]!==C&&(p(S),s[S.id]=C)}function h(S){const A=d();S.__bindingPointIndex=A;const E=n.createBuffer(),b=S.__size,C=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,b,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,A,E),E}function d(){for(let S=0;S0&&(E+=b-C),S.__size=E,S.__cache={},this}function x(S){const A={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(A.boundary=4,A.storage=4):S.isVector2?(A.boundary=8,A.storage=8):S.isVector3||S.isColor?(A.boundary=16,A.storage=12):S.isVector4?(A.boundary=16,A.storage=16):S.isMatrix3?(A.boundary=48,A.storage=48):S.isMatrix4?(A.boundary=64,A.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),A}function y(S){const A=S.target;A.removeEventListener("dispose",y);const E=o.indexOf(A.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[A.id]),delete r[A.id],delete s[A.id]}function g(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:u,dispose:g}}class OE{constructor(e={}){const{canvas:t=QD(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let x=null,y=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Cs,this._useLegacyLights=!1,this.toneMapping=Do,this.toneMappingExposure=1;const A=this;let E=!1,b=0,C=0,R=null,I=-1,O=null;const T=new _n,L=new _n;let K=null;const se=new it(0);let W=0,te=t.width,$=t.height,oe=1,F=null,V=null;const N=new _n(0,0,te,$),ee=new _n(0,0,te,$);let ce=!1;const Be=new Vp;let ae=!1,xe=!1,Se=null;const ke=new bt,We=new Re,Qe=new G,lt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ne(){return R===null?oe:1}let Y=i;function Ae(B,z){for(let X=0;X{function he(){if(Q.forEach(function(ye){Xe.get(ye).currentProgram.isReady()&&Q.delete(ye)}),Q.size===0){j(B);return}setTimeout(he,10)}ge.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let Ot=null;function ut(B){Ot&&Ot(B)}function ot(){je.stop()}function dt(){je.start()}const je=new iN;je.setAnimationLoop(ut),typeof self<"u"&&je.setContext(self),this.setAnimationLoop=function(B){Ot=B,Le.setAnimationLoop(B),B===null?je.stop():je.start()},Le.addEventListener("sessionstart",ot),Le.addEventListener("sessionend",dt),this.render=function(B,z){if(z!==void 0&&z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(z),z=Le.getCamera()),B.isScene===!0&&B.onBeforeRender(A,B,z,R),y=ct.get(B,S.length),y.init(),S.push(y),ke.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),Be.setFromProjectionMatrix(ke),xe=this.localClippingEnabled,ae=Ge.init(this.clippingPlanes,xe),x=tt.get(B,g.length),x.init(),g.push(x),Tt(B,z,0,A.sortObjects),x.finish(),A.sortObjects===!0&&x.sort(F,V),this.info.render.frame++,ae===!0&&Ge.beginShadows();const X=y.state.shadowsArray;if(Ke.render(X,B,z),ae===!0&&Ge.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1)&&Rt.render(x,B),y.setupLights(A._useLegacyLights),z.isArrayCamera){const Q=z.cameras;for(let j=0,he=Q.length;j0?y=S[S.length-1]:y=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function Tt(B,z,X,Q){if(B.visible===!1)return;if(B.layers.test(z.layers)){if(B.isGroup)X=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(z);else if(B.isLight)y.pushLight(B),B.castShadow&&y.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||Be.intersectsSprite(B)){Q&&Qe.setFromMatrixPosition(B.matrixWorld).applyMatrix4(ke);const ye=Me.update(B),we=B.material;we.visible&&x.push(B,ye,we,X,Qe.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||Be.intersectsObject(B))){const ye=Me.update(B),we=B.material;if(Q&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),Qe.copy(B.boundingSphere.center)):(ye.boundingSphere===null&&ye.computeBoundingSphere(),Qe.copy(ye.boundingSphere.center)),Qe.applyMatrix4(B.matrixWorld).applyMatrix4(ke)),Array.isArray(we)){const _e=ye.groups;for(let Ze=0,De=_e.length;Ze0&&It(j,he,z,X),Q&&Ce.viewport(T.copy(Q)),j.length>0&&dn(j,z,X),he.length>0&&dn(he,z,X),ye.length>0&&dn(ye,z,X),Ce.buffers.depth.setTest(!0),Ce.buffers.depth.setMask(!0),Ce.buffers.color.setMask(!0),Ce.setPolygonOffset(!1)}function It(B,z,X,Q){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;const he=Fe.isWebGL2;Se===null&&(Se=new Vs(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?tr:No,minFilter:Fs,samples:he?4:0})),A.getDrawingBufferSize(We),he?Se.setSize(We.x,We.y):Se.setSize(kv(We.x),kv(We.y));const ye=A.getRenderTarget();A.setRenderTarget(Se),A.getClearColor(se),W=A.getClearAlpha(),W<1&&A.setClearColor(16777215,.5),A.clear();const we=A.toneMapping;A.toneMapping=Do,dn(B,X,Q),et.updateMultisampleRenderTarget(Se),et.updateRenderTargetMipmap(Se);let _e=!1;for(let Ze=0,De=z.length;Ze0),ze=!!X.morphAttributes.position,ft=!!X.morphAttributes.normal,At=!!X.morphAttributes.color;let yt=Do;Q.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(yt=A.toneMapping);const Lt=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,rt=Lt!==void 0?Lt.length:0,qe=Xe.get(Q),Jt=y.state.lights;if(ae===!0&&(xe===!0||B!==O)){const Gt=B===O&&Q.id===I;Ge.setState(Q,B,Gt)}let Pt=!1;Q.version===qe.__version?(qe.needsLights&&qe.lightsStateVersion!==Jt.state.version||qe.outputColorSpace!==we||j.isBatchedMesh&&qe.batching===!1||!j.isBatchedMesh&&qe.batching===!0||j.isInstancedMesh&&qe.instancing===!1||!j.isInstancedMesh&&qe.instancing===!0||j.isSkinnedMesh&&qe.skinning===!1||!j.isSkinnedMesh&&qe.skinning===!0||j.isInstancedMesh&&qe.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&qe.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&qe.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&qe.instancingMorph===!1&&j.morphTexture!==null||qe.envMap!==_e||Q.fog===!0&&qe.fog!==he||qe.numClippingPlanes!==void 0&&(qe.numClippingPlanes!==Ge.numPlanes||qe.numIntersection!==Ge.numIntersection)||qe.vertexAlphas!==Ze||qe.vertexTangents!==De||qe.morphTargets!==ze||qe.morphNormals!==ft||qe.morphColors!==At||qe.toneMapping!==yt||Fe.isWebGL2===!0&&qe.morphTargetsCount!==rt)&&(Pt=!0):(Pt=!0,qe.__version=Q.version);let Nt=qe.currentProgram;Pt===!0&&(Nt=_t(Q,z,j));let gn=!1,jn=!1,Dn=!1;const sn=Nt.getUniforms(),Yt=qe.uniforms;if(Ce.useProgram(Nt.program)&&(gn=!0,jn=!0,Dn=!0),Q.id!==I&&(I=Q.id,jn=!0),gn||O!==B){sn.setValue(Y,"projectionMatrix",B.projectionMatrix),sn.setValue(Y,"viewMatrix",B.matrixWorldInverse);const Gt=sn.map.cameraPosition;Gt!==void 0&&Gt.setValue(Y,Qe.setFromMatrixPosition(B.matrixWorld)),Fe.logarithmicDepthBuffer&&sn.setValue(Y,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(Q.isMeshPhongMaterial||Q.isMeshToonMaterial||Q.isMeshLambertMaterial||Q.isMeshBasicMaterial||Q.isMeshStandardMaterial||Q.isShaderMaterial)&&sn.setValue(Y,"isOrthographic",B.isOrthographicCamera===!0),O!==B&&(O=B,jn=!0,Dn=!0)}if(j.isSkinnedMesh){sn.setOptional(Y,j,"bindMatrix"),sn.setOptional(Y,j,"bindMatrixInverse");const Gt=j.skeleton;Gt&&(Fe.floatVertexTextures?(Gt.boneTexture===null&&Gt.computeBoneTexture(),sn.setValue(Y,"boneTexture",Gt.boneTexture,et)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}j.isBatchedMesh&&(sn.setOptional(Y,j,"batchingTexture"),sn.setValue(Y,"batchingTexture",j._matricesTexture,et));const Un=X.morphAttributes;if((Un.position!==void 0||Un.normal!==void 0||Un.color!==void 0&&Fe.isWebGL2===!0)&&Oe.update(j,X,Nt),(jn||qe.receiveShadow!==j.receiveShadow)&&(qe.receiveShadow=j.receiveShadow,sn.setValue(Y,"receiveShadow",j.receiveShadow)),Q.isMeshGouraudMaterial&&Q.envMap!==null&&(Yt.envMap.value=_e,Yt.flipEnvMap.value=_e.isCubeTexture&&_e.isRenderTargetTexture===!1?-1:1),jn&&(sn.setValue(Y,"toneMappingExposure",A.toneMappingExposure),qe.needsLights&&k(Yt,Dn),he&&Q.fog===!0&&Ie.refreshFogUniforms(Yt,he),Ie.refreshMaterialUniforms(Yt,Q,oe,$,Se),Q0.upload(Y,Ln(qe),Yt,et)),Q.isShaderMaterial&&Q.uniformsNeedUpdate===!0&&(Q0.upload(Y,Ln(qe),Yt,et),Q.uniformsNeedUpdate=!1),Q.isSpriteMaterial&&sn.setValue(Y,"center",j.center),sn.setValue(Y,"modelViewMatrix",j.modelViewMatrix),sn.setValue(Y,"normalMatrix",j.normalMatrix),sn.setValue(Y,"modelMatrix",j.matrixWorld),Q.isShaderMaterial||Q.isRawShaderMaterial){const Gt=Q.uniformsGroups;for(let $t=0,Sn=Gt.length;$t0&&et.useMultisampledRTT(B)===!1?j=Xe.get(B).__webglMultisampledFramebuffer:Array.isArray(De)?j=De[X]:j=De,T.copy(B.viewport),L.copy(B.scissor),K=B.scissorTest}else T.copy(N).multiplyScalar(oe).floor(),L.copy(ee).multiplyScalar(oe).floor(),K=ce;if(Ce.bindFramebuffer(Y.FRAMEBUFFER,j)&&Fe.drawBuffers&&Q&&Ce.drawBuffers(B,j),Ce.viewport(T),Ce.scissor(L),Ce.setScissorTest(K),he){const _e=Xe.get(B.texture);Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_CUBE_MAP_POSITIVE_X+z,_e.__webglTexture,X)}else if(ye){const _e=Xe.get(B.texture),Ze=z||0;Y.framebufferTextureLayer(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,_e.__webglTexture,X||0,Ze)}I=-1},this.readRenderTargetPixels=function(B,z,X,Q,j,he,ye){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=Xe.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&ye!==void 0&&(we=we[ye]),we){Ce.bindFramebuffer(Y.FRAMEBUFFER,we);try{const _e=B.texture,Ze=_e.format,De=_e.type;if(Ze!==er&&ht.convert(Ze)!==Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ze=De===tr&&(ge.has("EXT_color_buffer_half_float")||Fe.isWebGL2&&ge.has("EXT_color_buffer_float"));if(De!==No&&ht.convert(De)!==Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_TYPE)&&!(De===pi&&(Fe.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!ze){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=B.width-Q&&X>=0&&X<=B.height-j&&Y.readPixels(z,X,Q,j,ht.convert(Ze),ht.convert(De),he)}finally{const _e=R!==null?Xe.get(R).__webglFramebuffer:null;Ce.bindFramebuffer(Y.FRAMEBUFFER,_e)}}},this.copyFramebufferToTexture=function(B,z,X=0){const Q=Math.pow(2,-X),j=Math.floor(z.image.width*Q),he=Math.floor(z.image.height*Q);et.setTexture2D(z,0),Y.copyTexSubImage2D(Y.TEXTURE_2D,X,0,0,B.x,B.y,j,he),Ce.unbindTexture()},this.copyTextureToTexture=function(B,z,X,Q=0){const j=z.image.width,he=z.image.height,ye=ht.convert(X.format),we=ht.convert(X.type);et.setTexture2D(X,0),Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,X.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,X.unpackAlignment),z.isDataTexture?Y.texSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,j,he,ye,we,z.image.data):z.isCompressedTexture?Y.compressedTexSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,z.mipmaps[0].width,z.mipmaps[0].height,ye,z.mipmaps[0].data):Y.texSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,ye,we,z.image),Q===0&&X.generateMipmaps&&Y.generateMipmap(Y.TEXTURE_2D),Ce.unbindTexture()},this.copyTextureToTexture3D=function(B,z,X,Q,j=0){if(A.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const he=Math.round(B.max.x-B.min.x),ye=Math.round(B.max.y-B.min.y),we=B.max.z-B.min.z+1,_e=ht.convert(Q.format),Ze=ht.convert(Q.type);let De;if(Q.isData3DTexture)et.setTexture3D(Q,0),De=Y.TEXTURE_3D;else if(Q.isDataArrayTexture||Q.isCompressedArrayTexture)et.setTexture2DArray(Q,0),De=Y.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,Q.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,Q.unpackAlignment);const ze=Y.getParameter(Y.UNPACK_ROW_LENGTH),ft=Y.getParameter(Y.UNPACK_IMAGE_HEIGHT),At=Y.getParameter(Y.UNPACK_SKIP_PIXELS),yt=Y.getParameter(Y.UNPACK_SKIP_ROWS),Lt=Y.getParameter(Y.UNPACK_SKIP_IMAGES),rt=X.isCompressedTexture?X.mipmaps[j]:X.image;Y.pixelStorei(Y.UNPACK_ROW_LENGTH,rt.width),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,rt.height),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,B.min.x),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,B.min.y),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,B.min.z),X.isDataTexture||X.isData3DTexture?Y.texSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,Ze,rt.data):Q.isCompressedArrayTexture?Y.compressedTexSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,rt.data):Y.texSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,Ze,rt),Y.pixelStorei(Y.UNPACK_ROW_LENGTH,ze),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,ft),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,At),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,yt),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,Lt),j===0&&Q.generateMipmaps&&Y.generateMipmap(De),Ce.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?et.setTextureCube(B,0):B.isData3DTexture?et.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?et.setTexture2DArray(B,0):et.setTexture2D(B,0),Ce.unbindTexture()},this.resetState=function(){b=0,C=0,R=null,Ce.reset(),Z.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return bo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===d_?"display-p3":"srgb",t.unpackColorSpace=vn.workingColorSpace===zp?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class fN extends OE{}fN.prototype.isWebGL1Renderer=!0;class v_{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new it(e),this.density=t}clone(){return new v_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class __{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new it(e),this.near=t,this.far=i}clone(){return new __(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class eh extends an{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cs,this.environmentRotation=new cs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Wp{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ep,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=as()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return ZD("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:Qh.clone(),uv:ts.getInterpolation(Qh,jg,qh,Yg,Pb,t1,Bb,new Re),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Kg(n,e,t,i,r,s){Xc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Zh.x=s*Xc.x-r*Xc.y,Zh.y=r*Xc.x+s*Xc.y):Zh.copy(Xc),n.copy(e),n.x+=Zh.x,n.y+=Zh.y,n.applyMatrix4(hN)}const Qg=new G,Ib=new G;class pN extends an{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Qg.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Qg);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qg.setFromMatrixPosition(e.matrixWorld),Ib.setFromMatrixPosition(this.matrixWorld);const i=Qg.distanceTo(Ib)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=i.length&&i.push({start:-1,count:-1,z:-1});const s=i[this.index];r.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const jc="batchId",Ha=new bt,Gb=new bt,F9=new bt,Hb=new bt,r1=new Vp,$g=new rr,tu=new ki,td=new G,s1=new N9,Ki=new ei,e0=[];function O9(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new un(a,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute(jc,new un(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(jc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${jc}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(i===jc)continue;if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this._geometryCount,t=this.boundingBox,i=this._active;t.makeEmpty();for(let r=0;r=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),h=u!==null;if(h&&(i===-1?r.indexCount=u.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._visibility,p=this._active,m=this._matricesTexture,v=this._matricesTexture.image.data;d.push(!0),p.push(!0);const x=this._geometryCount;this._geometryCount++,F9.toArray(v,x*16),m.needsUpdate=!0,o.push(r),a.push({start:h?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new rr,sphereInitialized:!1,sphere:new ki});const y=this.geometry.getAttribute(jc);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,u=a.vertexCount;for(const m in i.attributes){if(m===jc)continue;const v=t.getAttribute(m),x=i.getAttribute(m);O9(v,x,l);const y=v.itemSize;for(let g=v.count,S=u;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return null;const r=this._bounds[e],s=r.box,o=this.geometry;if(r.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,u=this._drawRanges[e];for(let h=u.start,d=u.start+u.count;h=o||i[e]===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._active,r=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||i[e]===!1?null:t.fromArray(r,e*16)}setVisibleAt(e,t){const i=this._visibility,r=this._active,s=this._geometryCount;return e>=s||r[e]===!1||i[e]===t?this:(i[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,i=this._active,r=this._geometryCount;return e>=r||i[e]===!1?!1:t[e]}raycast(e,t){const i=this._visibility,r=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;Ki.material=this.material,Ki.geometry.index=l.index,Ki.geometry.attributes=l.attributes,Ki.geometry.boundingBox===null&&(Ki.geometry.boundingBox=new rr),Ki.geometry.boundingSphere===null&&(Ki.geometry.boundingSphere=new ki);for(let u=0;u({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._active,u=this._visibility,h=this._multiDrawStarts,d=this._multiDrawCounts,p=this._drawRanges,m=this.perObjectFrustumCulled;m&&(Hb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),r1.setFromProjectionMatrix(Hb,e.coordinateSystem));let v=0;if(this.sortObjects){Gb.copy(this.matrixWorld).invert(),td.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Gb);for(let g=0,S=u.length;gl)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);Ie.far||t.push({distance:I,point:d.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(y.count,o.start+o.count);for(let A=g,E=S-1;Al)continue;p.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(p);Ce.far||t.push({distance:C,point:d.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object: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 s=0,o=r.length;s0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class U9 extends Tn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:pn,this.magFilter=s!==void 0?s:pn,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class k9 extends Tn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Zn,this.minFilter=Zn,this.generateMipmaps=!1,this.needsUpdate=!0}}class A_ extends Tn{constructor(e,t,i,r,s,o,a,l,u,h,d,p){super(null,o,a,l,u,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class z9 extends A_{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Fi}}class G9 extends A_{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,zo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class H9 extends Tn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class co{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,u;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),u=i[r]-o,u<0)a=r+1;else if(u>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Re:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new bt;for(let m=0;m<=e;m++){const v=m/e;r[m]=this.getTangentAt(v,new G)}s[0]=new G,o[0]=new G;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(qn(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos(qn(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],m*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class S_ extends co{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Re){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,h;this.closed||a>0?u=r[(a-1)%s]:(r0.subVectors(r[0],r[1]).add(r[0]),u=r0);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(Qb(a,l.x,u.x,h.x,d.x),Qb(a,l.y,u.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Jp extends zt{constructor(e=[new Re(0,-.5),new Re(.5,0),new Re(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=qn(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],h=1/t,d=new G,p=new Re,m=new G,v=new G,x=new G;let y=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-y,m.z=g*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:y=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-y,m.z=g*0,v.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(v)}for(let S=0;S<=t;S++){const A=i+S*h*r,E=Math.sin(A),b=Math.cos(A);for(let C=0;C<=e.length-1;C++){d.x=e[C].x*E,d.y=e[C].y,d.z=e[C].x*b,o.push(d.x,d.y,d.z),p.x=S/t,p.y=C/(e.length-1),a.push(p.x,p.y);const R=l[3*C+0]*E,I=l[3*C+1],O=l[3*C+0]*b;u.push(R,I,O)}}for(let S=0;S0&&A(!0),t>0&&A(!1)),this.setIndex(h),this.setAttribute("position",new St(d,3)),this.setAttribute("normal",new St(p,3)),this.setAttribute("uv",new St(m,2));function S(){const E=new G,b=new G;let C=0;const R=(t-e)/i;for(let I=0;I<=s;I++){const O=[],T=I/s,L=T*(t-e)+e;for(let K=0;K<=r;K++){const se=K/r,W=se*l+a,te=Math.sin(W),$=Math.cos(W);b.x=L*te,b.y=-T*i+y,b.z=L*$,d.push(b.x,b.y,b.z),E.set(te,R,$).normalize(),p.push(E.x,E.y,E.z),m.push(se,1-T),O.push(v++)}x.push(O)}for(let I=0;I.9&&R<.1&&(A<.2&&(o[S+0]+=1),E<.2&&(o[S+2]+=1),b<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,A){const E=S*3;A.x=e[E+0],A.y=e[E+1],A.z=e[E+2]}function v(){const S=new G,A=new G,E=new G,b=new G,C=new Re,R=new Re,I=new Re;for(let O=0,T=0;O80*t){a=u=n[0],l=h=n[1];for(let v=t;vu&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?32767/m:0}return Rp(s,o,t,a,l,m,0),o}};function SN(n,e,t,i,r){let s,o;if(r===h6(n,e,t,i)>0)for(s=e;s=e;s-=i)o=Zb(s,n[s],n[s+1],o);return o&&C_(o,o.next)&&(Pp(o),o=o.next),o}function tc(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(C_(t,t.next)||Wn(t.prev,t,t.next)===0)){if(Pp(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Rp(n,e,t,i,r,s,o){if(!n)return;!o&&s&&o6(n,i,r,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?q9(n,i,r,s):Z9(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),Pp(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=$9(tc(n),e,t),Rp(n,e,t,i,r,s,2)):o===2&&e6(n,e,t,i,r,s):Rp(tc(n),e,t,i,r,s,1);break}}}function Z9(n){const e=n.prev,t=n,i=n.next;if(Wn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,u=i.y,h=rs?r>o?r:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let v=i.next;for(;v!==e;){if(v.x>=h&&v.x<=p&&v.y>=d&&v.y<=m&&_f(r,a,s,l,o,u,v.x,v.y)&&Wn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function q9(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Wn(r,s,o)>=0)return!1;const a=r.x,l=s.x,u=o.x,h=r.y,d=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,y=h>d?h>p?h:p:d>p?d:p,g=zS(m,v,e,t,i),S=zS(x,y,e,t,i);let A=n.prevZ,E=n.nextZ;for(;A&&A.z>=g&&E&&E.z<=S;){if(A.x>=m&&A.x<=x&&A.y>=v&&A.y<=y&&A!==r&&A!==o&&_f(a,h,l,d,u,p,A.x,A.y)&&Wn(A.prev,A,A.next)>=0||(A=A.prevZ,E.x>=m&&E.x<=x&&E.y>=v&&E.y<=y&&E!==r&&E!==o&&_f(a,h,l,d,u,p,E.x,E.y)&&Wn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;A&&A.z>=g;){if(A.x>=m&&A.x<=x&&A.y>=v&&A.y<=y&&A!==r&&A!==o&&_f(a,h,l,d,u,p,A.x,A.y)&&Wn(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;E&&E.z<=S;){if(E.x>=m&&E.x<=x&&E.y>=v&&E.y<=y&&E!==r&&E!==o&&_f(a,h,l,d,u,p,E.x,E.y)&&Wn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function $9(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!C_(r,s)&&MN(r,i,i.next,s)&&bp(r,s)&&bp(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Pp(i),Pp(i.next),i=n=s),i=i.next}while(i!==n);return tc(i)}function e6(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&u6(o,a)){let l=EN(o,a);o=tc(o,o.next),l=tc(l,l.next),Rp(o,e,t,i,r,s,0),Rp(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function t6(n,e,t,i){const r=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&_f(or.x||t.x===r.x&&s6(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function s6(n,e){return Wn(n.prev,n,e.prev)<0&&Wn(e.next,n,n.next)<0}function o6(n,e,t,i){let r=n;do r.z===0&&(r.z=zS(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,a6(r)}function a6(n){let e,t,i,r,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,u*=2}while(o>1);return n}function zS(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function l6(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function u6(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!c6(n,e)&&(bp(n,e)&&bp(e,n)&&f6(n,e)&&(Wn(n.prev,n,e.prev)||Wn(n,e.prev,e))||C_(n,e)&&Wn(n.prev,n,n.next)>0&&Wn(e.prev,e,e.next)>0)}function Wn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function C_(n,e){return n.x===e.x&&n.y===e.y}function MN(n,e,t,i){const r=u0(Wn(n,e,t)),s=u0(Wn(n,e,i)),o=u0(Wn(t,i,n)),a=u0(Wn(t,i,e));return!!(r!==s&&o!==a||r===0&&l0(n,t,e)||s===0&&l0(n,i,e)||o===0&&l0(t,n,i)||a===0&&l0(t,e,i))}function l0(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function u0(n){return n>0?1:n<0?-1:0}function c6(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&MN(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function bp(n,e){return Wn(n.prev,n,n.next)<0?Wn(n,e,n.next)>=0&&Wn(n,n.prev,e)>=0:Wn(n,e,n.prev)<0||Wn(n,n.next,e)<0}function f6(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function EN(n,e){const t=new GS(n.i,n.x,n.y),i=new GS(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Zb(n,e,t,i){const r=new GS(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Pp(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function GS(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function h6(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function $b(n,e){for(let t=0;tNumber.EPSILON){const Me=Math.sqrt(U),be=Math.sqrt(Et*Et+H*H),Ie=Ae.x-et/Me,tt=Ae.y+Xe/Me,ct=ge.x-H/be,Ge=ge.y+Et/be,Ke=((ct-Ie)*H-(Ge-tt)*Et)/(Xe*H-et*Et);Fe=Ie+Xe*Ke-Y.x,Ce=tt+et*Ke-Y.y;const Rt=Fe*Fe+Ce*Ce;if(Rt<=2)return new Re(Fe,Ce);re=Math.sqrt(Rt/2)}else{let Me=!1;Xe>Number.EPSILON?Et>Number.EPSILON&&(Me=!0):Xe<-Number.EPSILON?Et<-Number.EPSILON&&(Me=!0):Math.sign(et)===Math.sign(H)&&(Me=!0),Me?(Fe=-et,Ce=Xe,re=Math.sqrt(U)):(Fe=Xe,Ce=et,re=Math.sqrt(U/2))}return new Re(Fe/re,Ce/re)}const V=[];for(let Y=0,Ae=W.length,ge=Ae-1,Fe=Y+1;Y=0;Y--){const Ae=Y/y,ge=m*Math.cos(Ae*Math.PI/2),Fe=v*Math.sin(Ae*Math.PI/2)+x;for(let Ce=0,re=W.length;Ce=0;){const Fe=ge;let Ce=ge-1;Ce<0&&(Ce=Y.length-1);for(let re=0,Xe=h+y*2;re0)&&m.push(A,E,C),(g!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class RN extends mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new it(16777215),this.specular=new it(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class bN extends mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new it(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class PN extends mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class BN extends mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new it(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class IN extends mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new it(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Nl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class LN extends or{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Ru(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function DN(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function NN(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function HS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function KE(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function g6(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){d.push(u.times[m]);for(let x=0;xs.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*d+h,S=g+d-h;x=a.values.slice(g,S)}else{const g=a.createInterpolant(),S=h,A=d-h;g.evaluate(s),x=g.resultBuffer.slice(S,A)}l==="quaternion"&&new Ii().fromArray(x).normalize().conjugate().toArray(x);const y=u.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&DN(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===K0,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}fo.prototype.TimeBufferType=Float32Array;fo.prototype.ValueBufferType=Float32Array;fo.prototype.DefaultInterpolation=ec;class lc extends fo{}lc.prototype.ValueTypeName="bool";lc.prototype.ValueBufferType=Array;lc.prototype.DefaultInterpolation=Zf;lc.prototype.InterpolantFactoryMethodLinear=void 0;lc.prototype.InterpolantFactoryMethodSmooth=void 0;class ZE extends fo{}ZE.prototype.ValueTypeName="color";class nh extends fo{}nh.prototype.ValueTypeName="number";class UN extends mh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let u=e*a;for(let h=u+a;u!==h;u+=4)Ii.slerpFlat(s,0,o,u-a,o,u,l);return s}}class Pl extends fo{InterpolantFactoryMethodLinear(e){return new UN(this.times,this.values,this.getValueSize(),e)}}Pl.prototype.ValueTypeName="quaternion";Pl.prototype.DefaultInterpolation=ec;Pl.prototype.InterpolantFactoryMethodSmooth=void 0;class uc extends fo{}uc.prototype.ValueTypeName="string";uc.prototype.ValueBufferType=Array;uc.prototype.DefaultInterpolation=Zf;uc.prototype.InterpolantFactoryMethodLinear=void 0;uc.prototype.InterpolantFactoryMethodSmooth=void 0;class ih extends fo{}ih.prototype.ValueTypeName="vector";class rh{constructor(e,t=-1,i,r=h_){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=as(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(x6(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(fo.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,v,x){if(m.length!==0){const y=[],g=[];KE(m,y,g,v),y.length!==0&&x.push(new d(p,y,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(ea[e]!==void 0){ea[e].push({onLoad:t,onProgress:i,onError:r});return}ea[e]=[],ea[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const h=ea[e],d=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let x=0;const y=new ReadableStream({start(g){S();function S(){d.read().then(({done:A,value:E})=>{if(A)g.close();else{x+=E.byteLength;const b=new ProgressEvent("progress",{lengthComputable:v,loaded:x,total:m});for(let C=0,R=h.length;C{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return u.json();default:if(a===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(v=>m.decode(v))}}}).then(u=>{da.add(e,u);const h=ea[e];delete ea[e];for(let d=0,p=h.length;d{const h=ea[e];if(h===void 0)throw this.manager.itemError(e),u;delete ea[e];for(let d=0,p=h.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class S6 extends ar{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new fs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new it().setHex(o.value);break;case"v2":r.uniforms[s].value=new Re().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new _n().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ht().fromArray(o.value);break;case"m4":r.uniforms[s].value=new bt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Re().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Re().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:TN,SpriteMaterial:UE,RawShaderMaterial:CN,ShaderMaterial:Ws,PointsMaterial:x_,MeshPhysicalMaterial:Ho,MeshStandardMaterial:Qp,MeshPhongMaterial:RN,MeshToonMaterial:bN,MeshNormalMaterial:PN,MeshLambertMaterial:BN,MeshDepthMaterial:NE,MeshDistanceMaterial:FE,MeshBasicMaterial:rs,MeshMatcapMaterial:IN,LineDashedMaterial:LN,LineBasicMaterial:or,Material:mi};return new t[e]}}class Oo{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new qE(t);s=new Bp(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,h=e.length;u0){r=new Bp(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new rr;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const g=new ki;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":o=new pN;break;case"Line":o=new Ma(a(e.geometry),l(e.material));break;case"LineLoop":o=new GE(a(e.geometry),l(e.material));break;case"LineSegments":o=new uo(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new HE(a(e.geometry),l(e.material));break;case"Sprite":o=new dN(l(e.material));break;case"Group":o=new so;break;case"Bone":o=new y_;break;default:o=new an}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=da.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{r&&r(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return da.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){r&&r(u),da.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});da.add(e,l),s.manager.itemStart(e)}}let c0;class rw{static getContext(){return c0===void 0&&(c0=new(window.AudioContext||window.webkitAudioContext)),c0}static setContext(e){c0=e}}class b6 extends ar{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new fs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);rw.getContext().decodeAudioData(u,function(d){t(d)}).catch(a)}catch(u){a(u)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const aP=new bt,lP=new bt,nu=new bt;class P6{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Pn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Pn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,nu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(zu*t.fov*.5)/t.zoom;let a,l;lP.elements[12]=-r,aP.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,nu.elements[0]=2*t.near/(l-a),nu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(nu),a=-o*t.aspect-s,l=o*t.aspect-s,nu.elements[0]=2*t.near/(l-a),nu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(nu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(lP),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(aP)}}class sw{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=uP(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=uP();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function uP(){return(typeof performance>"u"?Date:performance).now()}const iu=new G,cP=new Ii,B6=new G,ru=new G;class I6 extends an{constructor(){super(),this.type="AudioListener",this.context=rw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sw}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(iu,cP,B6),ru.set(0,0,-1).applyQuaternion(cP),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(iu.x,r),t.positionY.linearRampToValueAtTime(iu.y,r),t.positionZ.linearRampToValueAtTime(iu.z,r),t.forwardX.linearRampToValueAtTime(ru.x,r),t.forwardY.linearRampToValueAtTime(ru.y,r),t.forwardZ.linearRampToValueAtTime(ru.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(iu.x,iu.y,iu.z),t.setOrientation(ru.x,ru.y,ru.z,i.x,i.y,i.z)}}class KN extends an{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Ii.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Ii.multiplyQuaternionsFlat(e,o,e,t,e,i),Ii.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const ow="\\[\\]\\.:\\/",F6=new RegExp("["+ow+"]","g"),aw="[^"+ow+"]",O6="[^"+ow.replace("\\.","")+"]",U6=/((?:WC+[\/:])*)/.source.replace("WC",aw),k6=/(WCOD+)?/.source.replace("WCOD",O6),z6=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",aw),G6=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",aw),H6=new RegExp("^"+U6+k6+z6+G6+"$"),V6=["material","materials","bones","map"];class W6{constructor(e,t,i){const r=i||on.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class on{constructor(e,t,i){this.path=t,this.parsedPath=i||on.parseTrackName(t),this.node=on.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new on.Composite(e,t,i):new on(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(F6,"")}static parseTrackName(e){const t=H6.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);V6.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[u]=d,e[d]=l;for(let m=0,v=r;m!==v;++m){const x=i[m],y=x[d],g=x[h];x[h]=y,x[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],h=u.uuid,d=t[h];if(d!==void 0)if(delete t[h],d0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let v=0,x=r;v!==x;++v){const y=i[v];y[d]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,m=l.length;p!==m;++p){const v=l[p];d[p]=new on(v,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class ZN{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:Eu,endingEnd:Eu};for(let u=0;u!==o;++u){const h=s[u].createInterpolant(null);a[u]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ND,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+i,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case wE:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulateAdditive(a);break;case h_:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===FD;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===DD){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=wu,r.endingEnd=wu):(e?r.endingStart=this.zeroSlopeAtStart?wu:Eu:r.endingStart=xp,t?r.endingEnd=this.zeroSlopeAtEnd?wu:Eu:r.endingEnd=xp)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const J6=new Float32Array(1);class j6 extends Go{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let v=h[m];if(v!==void 0)++v.referenceCount,o[d]=v;else{if(v=o[d],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const x=t&&t._propertyBindings[d].binding.parsedPath;v=new QN(on.create(i,m,x),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[d]=v}a[d].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==i;++u)t[u]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,pP).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const mP=new G,f0=new G;class eW{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){mP.subVectors(e,this.start),f0.subVectors(this.end,this.start);const i=f0.dot(f0);let s=f0.dot(mP)/i;return t&&(s=qn(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const gP=new G;class tW extends an{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new zt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{AP.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(AP,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class pW extends uo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new zt;r.setAttribute("position",new St(t,3)),r.setAttribute("color",new St(i,3));const s=new or({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new it,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class mW{constructor(){this.type="ShapePath",this.color=new it,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Cp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let A=0,E=g.length;ANumber.EPSILON){if(T<0&&(R=S[C],O=-O,I=S[b],T=-T),g.yI.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const L=T*(g.x-R.x)-O*(g.y-R.y);if(L===0)return!0;if(L<0)continue;E=!E}}else{if(g.y!==R.y)continue;if(I.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=I.x)return!0}}return E}const r=Fo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new Hu,l.curves=a.curves,u.push(l),u;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],v=0,x;p[v]=void 0,m[v]=[];for(let g=0,S=s.length;g1){let g=!1,S=0;for(let A=0,E=p.length;A0&&g===!1&&(m=d)}let y;for(let g=0,S=p.length;g=0&&(E[ke]=null,A[ke].disconnect(Se))}for(let xe=0;xe=E.length){E.push(Se),ke=Qe;break}else if(E[Qe]===null){E[Qe]=Se,ke=Qe;break}if(ke===-1)break}const We=A[ke];We&&We.connect(Se)}}const $=new G,oe=new G;function F(ae,xe,Se){$.setFromMatrixPosition(xe.matrixWorld),oe.setFromMatrixPosition(Se.matrixWorld);const ke=$.distanceTo(oe),We=xe.projectionMatrix.elements,Qe=Se.projectionMatrix.elements,lt=We[14]/(We[10]-1),Ne=We[14]/(We[10]+1),Y=(We[9]+1)/We[5],Ae=(We[9]-1)/We[5],ge=(We[8]-1)/We[0],Fe=(Qe[8]+1)/Qe[0],Ce=lt*ge,re=lt*Fe,Xe=ke/(-ge+Fe),et=Xe*-ge;xe.matrixWorld.decompose(ae.position,ae.quaternion,ae.scale),ae.translateX(et),ae.translateZ(Xe),ae.matrixWorld.compose(ae.position,ae.quaternion,ae.scale),ae.matrixWorldInverse.copy(ae.matrixWorld).invert();const Et=lt+Xe,H=Ne+Xe,U=Ce-et,ve=re+(ke-et),Me=Y*Ne/H*Et,be=Ae*Ne/H*Et;ae.projectionMatrix.makePerspective(U,ve,Me,be,Et,H),ae.projectionMatrixInverse.copy(ae.projectionMatrix).invert()}function V(ae,xe){xe===null?ae.matrixWorld.copy(ae.matrix):ae.matrixWorld.multiplyMatrices(xe.matrixWorld,ae.matrix),ae.matrixWorldInverse.copy(ae.matrixWorld).invert()}this.updateCamera=function(ae){if(r===null)return;x.texture!==null&&(ae.near=x.depthNear,ae.far=x.depthFar),T.near=I.near=R.near=ae.near,T.far=I.far=R.far=ae.far,(L!==T.near||K!==T.far)&&(r.updateRenderState({depthNear:T.near,depthFar:T.far}),L=T.near,K=T.far,R.near=L,R.far=K,I.near=L,I.far=K,R.updateProjectionMatrix(),I.updateProjectionMatrix(),ae.updateProjectionMatrix());const xe=ae.parent,Se=T.cameras;V(T,xe);for(let ke=0;ke0&&(y.alphaTest.value=g.alphaTest);const S=e.get(g),A=S.envMap,E=S.envMapRotation;if(A&&(y.envMap.value=A,tu.copy(E),tu.x*=-1,tu.y*=-1,tu.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(tu.y*=-1,tu.z*=-1),y.envMapRotation.value.setFromMatrix4(I9.makeRotationFromEuler(tu)),y.flipEnvMap.value=A.isCubeTexture&&A.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap){y.lightMap.value=g.lightMap;const b=n._useLegacyLights===!0?Math.PI:1;y.lightMapIntensity.value=g.lightMapIntensity*b,t(g.lightMap,y.lightMapTransform)}g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,y.aoMapTransform))}function o(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function l(y,g,S,A){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*S,y.scale.value=A*.5,g.map&&(y.map.value=g.map,t(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function h(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function d(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function p(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,y.roughnessMapTransform)),e.get(g).envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function m(y,g,S){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Er&&y.clearcoatNormalScale.value.negate())),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=S.texture,y.transmissionSamplerSize.value.set(S.width,S.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function x(y,g){const S=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(S.matrixWorld),y.nearDistance.value=S.shadow.camera.near,y.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function D9(n,e,t,i){let r={},s={},o=[];const a=t.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(S,A){const E=A.program;i.uniformBlockBinding(S,E)}function u(S,A){let E=r[S.id];E===void 0&&(v(S),E=h(S),r[S.id]=E,S.addEventListener("dispose",y));const b=A.program;i.updateUBOMapping(S,b);const C=e.render.frame;s[S.id]!==C&&(p(S),s[S.id]=C)}function h(S){const A=d();S.__bindingPointIndex=A;const E=n.createBuffer(),b=S.__size,C=S.usage;return n.bindBuffer(n.UNIFORM_BUFFER,E),n.bufferData(n.UNIFORM_BUFFER,b,C),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,A,E),E}function d(){for(let S=0;S0&&(E+=b-C),S.__size=E,S.__cache={},this}function x(S){const A={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(A.boundary=4,A.storage=4):S.isVector2?(A.boundary=8,A.storage=8):S.isVector3||S.isColor?(A.boundary=16,A.storage=12):S.isVector4?(A.boundary=16,A.storage=16):S.isMatrix3?(A.boundary=48,A.storage=48):S.isMatrix4?(A.boundary=64,A.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),A}function y(S){const A=S.target;A.removeEventListener("dispose",y);const E=o.indexOf(A.__bindingPointIndex);o.splice(E,1),n.deleteBuffer(r[A.id]),delete r[A.id],delete s[A.id]}function g(){for(const S in r)n.deleteBuffer(r[S]);o=[],r={},s={}}return{bind:l,update:u,dispose:g}}class OE{constructor(e={}){const{canvas:t=qD(),context:i=null,depth:r=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let p;i!==null?p=i.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let x=null,y=null;const g=[],S=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Cs,this._useLegacyLights=!1,this.toneMapping=Do,this.toneMappingExposure=1;const A=this;let E=!1,b=0,C=0,R=null,I=-1,O=null;const T=new _n,L=new _n;let K=null;const se=new it(0);let W=0,te=t.width,$=t.height,oe=1,F=null,V=null;const N=new _n(0,0,te,$),ee=new _n(0,0,te,$);let fe=!1;const Be=new Vp;let ae=!1,xe=!1,Se=null;const ke=new bt,We=new Re,Qe=new G,lt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Ne(){return R===null?oe:1}let Y=i;function Ae(B,z){for(let X=0;X{function he(){if(Q.forEach(function(ye){Xe.get(ye).currentProgram.isReady()&&Q.delete(ye)}),Q.size===0){j(B);return}setTimeout(he,10)}ge.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let Ot=null;function ut(B){Ot&&Ot(B)}function ot(){je.stop()}function dt(){je.start()}const je=new sN;je.setAnimationLoop(ut),typeof self<"u"&&je.setContext(self),this.setAnimationLoop=function(B){Ot=B,Le.setAnimationLoop(B),B===null?je.stop():je.start()},Le.addEventListener("sessionstart",ot),Le.addEventListener("sessionend",dt),this.render=function(B,z){if(z!==void 0&&z.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(E===!0)return;B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),z.parent===null&&z.matrixWorldAutoUpdate===!0&&z.updateMatrixWorld(),Le.enabled===!0&&Le.isPresenting===!0&&(Le.cameraAutoUpdate===!0&&Le.updateCamera(z),z=Le.getCamera()),B.isScene===!0&&B.onBeforeRender(A,B,z,R),y=ct.get(B,S.length),y.init(),S.push(y),ke.multiplyMatrices(z.projectionMatrix,z.matrixWorldInverse),Be.setFromProjectionMatrix(ke),xe=this.localClippingEnabled,ae=Ge.init(this.clippingPlanes,xe),x=tt.get(B,g.length),x.init(),g.push(x),Tt(B,z,0,A.sortObjects),x.finish(),A.sortObjects===!0&&x.sort(F,V),this.info.render.frame++,ae===!0&&Ge.beginShadows();const X=y.state.shadowsArray;if(Ke.render(X,B,z),ae===!0&&Ge.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Le.enabled===!1||Le.isPresenting===!1||Le.hasDepthSensing()===!1)&&Rt.render(x,B),y.setupLights(A._useLegacyLights),z.isArrayCamera){const Q=z.cameras;for(let j=0,he=Q.length;j0?y=S[S.length-1]:y=null,g.pop(),g.length>0?x=g[g.length-1]:x=null};function Tt(B,z,X,Q){if(B.visible===!1)return;if(B.layers.test(z.layers)){if(B.isGroup)X=B.renderOrder;else if(B.isLOD)B.autoUpdate===!0&&B.update(z);else if(B.isLight)y.pushLight(B),B.castShadow&&y.pushShadow(B);else if(B.isSprite){if(!B.frustumCulled||Be.intersectsSprite(B)){Q&&Qe.setFromMatrixPosition(B.matrixWorld).applyMatrix4(ke);const ye=Me.update(B),we=B.material;we.visible&&x.push(B,ye,we,X,Qe.z,null)}}else if((B.isMesh||B.isLine||B.isPoints)&&(!B.frustumCulled||Be.intersectsObject(B))){const ye=Me.update(B),we=B.material;if(Q&&(B.boundingSphere!==void 0?(B.boundingSphere===null&&B.computeBoundingSphere(),Qe.copy(B.boundingSphere.center)):(ye.boundingSphere===null&&ye.computeBoundingSphere(),Qe.copy(ye.boundingSphere.center)),Qe.applyMatrix4(B.matrixWorld).applyMatrix4(ke)),Array.isArray(we)){const _e=ye.groups;for(let Ze=0,De=_e.length;Ze0&&It(j,he,z,X),Q&&Ce.viewport(T.copy(Q)),j.length>0&&dn(j,z,X),he.length>0&&dn(he,z,X),ye.length>0&&dn(ye,z,X),Ce.buffers.depth.setTest(!0),Ce.buffers.depth.setMask(!0),Ce.buffers.color.setMask(!0),Ce.setPolygonOffset(!1)}function It(B,z,X,Q){if((X.isScene===!0?X.overrideMaterial:null)!==null)return;const he=Fe.isWebGL2;Se===null&&(Se=new Vs(1,1,{generateMipmaps:!0,type:ge.has("EXT_color_buffer_half_float")?tr:No,minFilter:Fs,samples:he?4:0})),A.getDrawingBufferSize(We),he?Se.setSize(We.x,We.y):Se.setSize(kv(We.x),kv(We.y));const ye=A.getRenderTarget();A.setRenderTarget(Se),A.getClearColor(se),W=A.getClearAlpha(),W<1&&A.setClearColor(16777215,.5),A.clear();const we=A.toneMapping;A.toneMapping=Do,dn(B,X,Q),et.updateMultisampleRenderTarget(Se),et.updateRenderTargetMipmap(Se);let _e=!1;for(let Ze=0,De=z.length;Ze0),ze=!!X.morphAttributes.position,ft=!!X.morphAttributes.normal,At=!!X.morphAttributes.color;let yt=Do;Q.toneMapped&&(R===null||R.isXRRenderTarget===!0)&&(yt=A.toneMapping);const Lt=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,rt=Lt!==void 0?Lt.length:0,qe=Xe.get(Q),Jt=y.state.lights;if(ae===!0&&(xe===!0||B!==O)){const Gt=B===O&&Q.id===I;Ge.setState(Q,B,Gt)}let Pt=!1;Q.version===qe.__version?(qe.needsLights&&qe.lightsStateVersion!==Jt.state.version||qe.outputColorSpace!==we||j.isBatchedMesh&&qe.batching===!1||!j.isBatchedMesh&&qe.batching===!0||j.isInstancedMesh&&qe.instancing===!1||!j.isInstancedMesh&&qe.instancing===!0||j.isSkinnedMesh&&qe.skinning===!1||!j.isSkinnedMesh&&qe.skinning===!0||j.isInstancedMesh&&qe.instancingColor===!0&&j.instanceColor===null||j.isInstancedMesh&&qe.instancingColor===!1&&j.instanceColor!==null||j.isInstancedMesh&&qe.instancingMorph===!0&&j.morphTexture===null||j.isInstancedMesh&&qe.instancingMorph===!1&&j.morphTexture!==null||qe.envMap!==_e||Q.fog===!0&&qe.fog!==he||qe.numClippingPlanes!==void 0&&(qe.numClippingPlanes!==Ge.numPlanes||qe.numIntersection!==Ge.numIntersection)||qe.vertexAlphas!==Ze||qe.vertexTangents!==De||qe.morphTargets!==ze||qe.morphNormals!==ft||qe.morphColors!==At||qe.toneMapping!==yt||Fe.isWebGL2===!0&&qe.morphTargetsCount!==rt)&&(Pt=!0):(Pt=!0,qe.__version=Q.version);let Nt=qe.currentProgram;Pt===!0&&(Nt=_t(Q,z,j));let gn=!1,jn=!1,Dn=!1;const sn=Nt.getUniforms(),Yt=qe.uniforms;if(Ce.useProgram(Nt.program)&&(gn=!0,jn=!0,Dn=!0),Q.id!==I&&(I=Q.id,jn=!0),gn||O!==B){sn.setValue(Y,"projectionMatrix",B.projectionMatrix),sn.setValue(Y,"viewMatrix",B.matrixWorldInverse);const Gt=sn.map.cameraPosition;Gt!==void 0&&Gt.setValue(Y,Qe.setFromMatrixPosition(B.matrixWorld)),Fe.logarithmicDepthBuffer&&sn.setValue(Y,"logDepthBufFC",2/(Math.log(B.far+1)/Math.LN2)),(Q.isMeshPhongMaterial||Q.isMeshToonMaterial||Q.isMeshLambertMaterial||Q.isMeshBasicMaterial||Q.isMeshStandardMaterial||Q.isShaderMaterial)&&sn.setValue(Y,"isOrthographic",B.isOrthographicCamera===!0),O!==B&&(O=B,jn=!0,Dn=!0)}if(j.isSkinnedMesh){sn.setOptional(Y,j,"bindMatrix"),sn.setOptional(Y,j,"bindMatrixInverse");const Gt=j.skeleton;Gt&&(Fe.floatVertexTextures?(Gt.boneTexture===null&&Gt.computeBoneTexture(),sn.setValue(Y,"boneTexture",Gt.boneTexture,et)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}j.isBatchedMesh&&(sn.setOptional(Y,j,"batchingTexture"),sn.setValue(Y,"batchingTexture",j._matricesTexture,et));const Un=X.morphAttributes;if((Un.position!==void 0||Un.normal!==void 0||Un.color!==void 0&&Fe.isWebGL2===!0)&&Oe.update(j,X,Nt),(jn||qe.receiveShadow!==j.receiveShadow)&&(qe.receiveShadow=j.receiveShadow,sn.setValue(Y,"receiveShadow",j.receiveShadow)),Q.isMeshGouraudMaterial&&Q.envMap!==null&&(Yt.envMap.value=_e,Yt.flipEnvMap.value=_e.isCubeTexture&&_e.isRenderTargetTexture===!1?-1:1),jn&&(sn.setValue(Y,"toneMappingExposure",A.toneMappingExposure),qe.needsLights&&k(Yt,Dn),he&&Q.fog===!0&&Ie.refreshFogUniforms(Yt,he),Ie.refreshMaterialUniforms(Yt,Q,oe,$,Se),Q0.upload(Y,Ln(qe),Yt,et)),Q.isShaderMaterial&&Q.uniformsNeedUpdate===!0&&(Q0.upload(Y,Ln(qe),Yt,et),Q.uniformsNeedUpdate=!1),Q.isSpriteMaterial&&sn.setValue(Y,"center",j.center),sn.setValue(Y,"modelViewMatrix",j.modelViewMatrix),sn.setValue(Y,"normalMatrix",j.normalMatrix),sn.setValue(Y,"modelMatrix",j.matrixWorld),Q.isShaderMaterial||Q.isRawShaderMaterial){const Gt=Q.uniformsGroups;for(let $t=0,Sn=Gt.length;$t0&&et.useMultisampledRTT(B)===!1?j=Xe.get(B).__webglMultisampledFramebuffer:Array.isArray(De)?j=De[X]:j=De,T.copy(B.viewport),L.copy(B.scissor),K=B.scissorTest}else T.copy(N).multiplyScalar(oe).floor(),L.copy(ee).multiplyScalar(oe).floor(),K=fe;if(Ce.bindFramebuffer(Y.FRAMEBUFFER,j)&&Fe.drawBuffers&&Q&&Ce.drawBuffers(B,j),Ce.viewport(T),Ce.scissor(L),Ce.setScissorTest(K),he){const _e=Xe.get(B.texture);Y.framebufferTexture2D(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,Y.TEXTURE_CUBE_MAP_POSITIVE_X+z,_e.__webglTexture,X)}else if(ye){const _e=Xe.get(B.texture),Ze=z||0;Y.framebufferTextureLayer(Y.FRAMEBUFFER,Y.COLOR_ATTACHMENT0,_e.__webglTexture,X||0,Ze)}I=-1},this.readRenderTargetPixels=function(B,z,X,Q,j,he,ye){if(!(B&&B.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let we=Xe.get(B).__webglFramebuffer;if(B.isWebGLCubeRenderTarget&&ye!==void 0&&(we=we[ye]),we){Ce.bindFramebuffer(Y.FRAMEBUFFER,we);try{const _e=B.texture,Ze=_e.format,De=_e.type;if(Ze!==er&&ht.convert(Ze)!==Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ze=De===tr&&(ge.has("EXT_color_buffer_half_float")||Fe.isWebGL2&&ge.has("EXT_color_buffer_float"));if(De!==No&&ht.convert(De)!==Y.getParameter(Y.IMPLEMENTATION_COLOR_READ_TYPE)&&!(De===pi&&(Fe.isWebGL2||ge.has("OES_texture_float")||ge.has("WEBGL_color_buffer_float")))&&!ze){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}z>=0&&z<=B.width-Q&&X>=0&&X<=B.height-j&&Y.readPixels(z,X,Q,j,ht.convert(Ze),ht.convert(De),he)}finally{const _e=R!==null?Xe.get(R).__webglFramebuffer:null;Ce.bindFramebuffer(Y.FRAMEBUFFER,_e)}}},this.copyFramebufferToTexture=function(B,z,X=0){const Q=Math.pow(2,-X),j=Math.floor(z.image.width*Q),he=Math.floor(z.image.height*Q);et.setTexture2D(z,0),Y.copyTexSubImage2D(Y.TEXTURE_2D,X,0,0,B.x,B.y,j,he),Ce.unbindTexture()},this.copyTextureToTexture=function(B,z,X,Q=0){const j=z.image.width,he=z.image.height,ye=ht.convert(X.format),we=ht.convert(X.type);et.setTexture2D(X,0),Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,X.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,X.unpackAlignment),z.isDataTexture?Y.texSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,j,he,ye,we,z.image.data):z.isCompressedTexture?Y.compressedTexSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,z.mipmaps[0].width,z.mipmaps[0].height,ye,z.mipmaps[0].data):Y.texSubImage2D(Y.TEXTURE_2D,Q,B.x,B.y,ye,we,z.image),Q===0&&X.generateMipmaps&&Y.generateMipmap(Y.TEXTURE_2D),Ce.unbindTexture()},this.copyTextureToTexture3D=function(B,z,X,Q,j=0){if(A.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const he=Math.round(B.max.x-B.min.x),ye=Math.round(B.max.y-B.min.y),we=B.max.z-B.min.z+1,_e=ht.convert(Q.format),Ze=ht.convert(Q.type);let De;if(Q.isData3DTexture)et.setTexture3D(Q,0),De=Y.TEXTURE_3D;else if(Q.isDataArrayTexture||Q.isCompressedArrayTexture)et.setTexture2DArray(Q,0),De=Y.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}Y.pixelStorei(Y.UNPACK_FLIP_Y_WEBGL,Q.flipY),Y.pixelStorei(Y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Q.premultiplyAlpha),Y.pixelStorei(Y.UNPACK_ALIGNMENT,Q.unpackAlignment);const ze=Y.getParameter(Y.UNPACK_ROW_LENGTH),ft=Y.getParameter(Y.UNPACK_IMAGE_HEIGHT),At=Y.getParameter(Y.UNPACK_SKIP_PIXELS),yt=Y.getParameter(Y.UNPACK_SKIP_ROWS),Lt=Y.getParameter(Y.UNPACK_SKIP_IMAGES),rt=X.isCompressedTexture?X.mipmaps[j]:X.image;Y.pixelStorei(Y.UNPACK_ROW_LENGTH,rt.width),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,rt.height),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,B.min.x),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,B.min.y),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,B.min.z),X.isDataTexture||X.isData3DTexture?Y.texSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,Ze,rt.data):Q.isCompressedArrayTexture?Y.compressedTexSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,rt.data):Y.texSubImage3D(De,j,z.x,z.y,z.z,he,ye,we,_e,Ze,rt),Y.pixelStorei(Y.UNPACK_ROW_LENGTH,ze),Y.pixelStorei(Y.UNPACK_IMAGE_HEIGHT,ft),Y.pixelStorei(Y.UNPACK_SKIP_PIXELS,At),Y.pixelStorei(Y.UNPACK_SKIP_ROWS,yt),Y.pixelStorei(Y.UNPACK_SKIP_IMAGES,Lt),j===0&&Q.generateMipmaps&&Y.generateMipmap(De),Ce.unbindTexture()},this.initTexture=function(B){B.isCubeTexture?et.setTextureCube(B,0):B.isData3DTexture?et.setTexture3D(B,0):B.isDataArrayTexture||B.isCompressedArrayTexture?et.setTexture2DArray(B,0):et.setTexture2D(B,0),Ce.unbindTexture()},this.resetState=function(){b=0,C=0,R=null,Ce.reset(),Z.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return bo}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===d_?"display-p3":"srgb",t.unpackColorSpace=vn.workingColorSpace===zp?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class dN extends OE{}dN.prototype.isWebGL1Renderer=!0;class v_{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new it(e),this.density=t}clone(){return new v_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class __{constructor(e,t=1,i=1e3){this.isFog=!0,this.name="",this.color=new it(e),this.near=t,this.far=i}clone(){return new __(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class eh extends an{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cs,this.environmentRotation=new cs,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Wp{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ep,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=as()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return $D("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,s=this.stride;re.far||t.push({distance:l,point:Qh.clone(),uv:ts.getInterpolation(Qh,jg,qh,Yg,Ib,t1,Lb,new Re),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Kg(n,e,t,i,r,s){Xc.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(Zh.x=s*Xc.x-r*Xc.y,Zh.y=r*Xc.x+s*Xc.y):Zh.copy(Xc),n.copy(e),n.x+=Zh.x,n.y+=Zh.y,n.applyMatrix4(pN)}const Qg=new G,Db=new G;class gN extends an{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i0){let i,r;for(i=1,r=t.length;i0){Qg.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Qg);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Qg.setFromMatrixPosition(e.matrixWorld),Db.setFromMatrixPosition(this.matrixWorld);const i=Qg.distanceTo(Db)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r=o)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r=i.length&&i.push({start:-1,count:-1,z:-1});const s=i[this.index];r.push(s),this.index++,s.start=e.start,s.count=e.count,s.z=t}reset(){this.list.length=0,this.index=0}}const jc="batchId",Ha=new bt,Vb=new bt,G9=new bt,Wb=new bt,r1=new Vp,$g=new rr,nu=new ki,td=new G,s1=new z9,Ki=new ti,e0=[];function H9(n,e,t=0){const i=e.itemSize;if(n.isInterleavedBufferAttribute||n.array.constructor!==e.array.constructor){const r=n.count;for(let s=0;s65536?new Uint32Array(s):new Uint16Array(s);t.setIndex(new un(a,1))}const o=r>65536?new Uint32Array(i):new Uint16Array(i);t.setAttribute(jc,new un(o,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(jc))throw new Error(`BatchedMesh: Geometry cannot use attribute "${jc}"`);const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const i in t.attributes){if(i===jc)continue;if(!e.hasAttribute(i))throw new Error(`BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const r=e.getAttribute(i),s=t.getAttribute(i);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new rr);const e=this._geometryCount,t=this.boundingBox,i=this._active;t.makeEmpty();for(let r=0;r=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const r={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let s=null;const o=this._reservedRanges,a=this._drawRanges,l=this._bounds;this._geometryCount!==0&&(s=o[o.length-1]),t===-1?r.vertexCount=e.getAttribute("position").count:r.vertexCount=t,s===null?r.vertexStart=0:r.vertexStart=s.vertexStart+s.vertexCount;const u=e.getIndex(),h=u!==null;if(h&&(i===-1?r.indexCount=u.count:r.indexCount=i,s===null?r.indexStart=0:r.indexStart=s.indexStart+s.indexCount),r.indexStart!==-1&&r.indexStart+r.indexCount>this._maxIndexCount||r.vertexStart+r.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const d=this._visibility,p=this._active,m=this._matricesTexture,v=this._matricesTexture.image.data;d.push(!0),p.push(!0);const x=this._geometryCount;this._geometryCount++,G9.toArray(v,x*16),m.needsUpdate=!0,o.push(r),a.push({start:h?r.indexStart:r.vertexStart,count:-1}),l.push({boxInitialized:!1,box:new rr,sphereInitialized:!1,sphere:new ki});const y=this.geometry.getAttribute(jc);for(let g=0;g=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const i=this.geometry,r=i.getIndex()!==null,s=i.getIndex(),o=t.getIndex(),a=this._reservedRanges[e];if(r&&o.count>a.indexCount||t.attributes.position.count>a.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const l=a.vertexStart,u=a.vertexCount;for(const m in i.attributes){if(m===jc)continue;const v=t.getAttribute(m),x=i.getAttribute(m);H9(v,x,l);const y=v.itemSize;for(let g=v.count,S=u;g=t.length||t[e]===!1?this:(t[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,t){if(this._active[e]===!1)return null;const r=this._bounds[e],s=r.box,o=this.geometry;if(r.boxInitialized===!1){s.makeEmpty();const a=o.index,l=o.attributes.position,u=this._drawRanges[e];for(let h=u.start,d=u.start+u.count;h=o||i[e]===!1?this:(t.toArray(s,e*16),r.needsUpdate=!0,this)}getMatrixAt(e,t){const i=this._active,r=this._matricesTexture.image.data,s=this._geometryCount;return e>=s||i[e]===!1?null:t.fromArray(r,e*16)}setVisibleAt(e,t){const i=this._visibility,r=this._active,s=this._geometryCount;return e>=s||r[e]===!1||i[e]===t?this:(i[e]=t,this._visibilityChanged=!0,this)}getVisibleAt(e){const t=this._visibility,i=this._active,r=this._geometryCount;return e>=r||i[e]===!1?!1:t[e]}raycast(e,t){const i=this._visibility,r=this._active,s=this._drawRanges,o=this._geometryCount,a=this.matrixWorld,l=this.geometry;Ki.material=this.material,Ki.geometry.index=l.index,Ki.geometry.attributes=l.attributes,Ki.geometry.boundingBox===null&&(Ki.geometry.boundingBox=new rr),Ki.geometry.boundingSphere===null&&(Ki.geometry.boundingSphere=new ki);for(let u=0;u({...t})),this._reservedRanges=e._reservedRanges.map(t=>({...t})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(t=>({boxInitialized:t.boxInitialized,box:t.box.clone(),sphereInitialized:t.sphereInitialized,sphere:t.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,t,i,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const o=r.getIndex(),a=o===null?1:o.array.BYTES_PER_ELEMENT,l=this._active,u=this._visibility,h=this._multiDrawStarts,d=this._multiDrawCounts,p=this._drawRanges,m=this.perObjectFrustumCulled;m&&(Wb.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),r1.setFromProjectionMatrix(Wb,e.coordinateSystem));let v=0;if(this.sortObjects){Vb.copy(this.matrixWorld).invert(),td.setFromMatrixPosition(i.matrixWorld).applyMatrix4(Vb);for(let g=0,S=u.length;gl)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);Ie.far||t.push({distance:I,point:d.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),S=Math.min(y.count,o.start+o.count);for(let A=g,E=S-1;Al)continue;p.applyMatrix4(this.matrixWorld);const C=e.ray.origin.distanceTo(p);Ce.far||t.push({distance:C,point:d.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object: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 s=0,o=r.length;s0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;sr.far)return;s.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class V9 extends Tn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:pn,this.magFilter=s!==void 0?s:pn,this.generateMipmaps=!1;const h=this;function d(){h.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class W9 extends Tn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=qn,this.minFilter=qn,this.generateMipmaps=!1,this.needsUpdate=!0}}class A_ extends Tn{constructor(e,t,i,r,s,o,a,l,u,h,d,p){super(null,o,a,l,u,h,r,s,d,p),this.isCompressedTexture=!0,this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class X9 extends A_{constructor(e,t,i,r,s,o){super(e,t,i,s,o),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Fi}}class J9 extends A_{constructor(e,t,i){super(void 0,e[0].width,e[0].height,t,i,zo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class j9 extends Tn{constructor(e,t,i,r,s,o,a,l,u){super(e,t,i,r,s,o,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class co{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let a=0,l=s-1,u;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),u=i[r]-o,u<0)a=r+1;else if(u>0)l=r-1;else{l=r;break}if(r=l,i[r]===o)return r/(s-1);const h=i[r],p=i[r+1]-h,m=(o-h)/p;return(r+m)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),a=this.getPoint(s),l=t||(o.isVector2?new Re:new G);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new G,r=[],s=[],o=[],a=new G,l=new bt;for(let m=0;m<=e;m++){const v=m/e;r[m]=this.getTangentAt(v,new G)}s[0]=new G,o[0]=new G;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),a.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],a),o[0].crossVectors(r[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(r[m-1],r[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos($n(r[m-1].dot(r[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(r[m],s[m])}if(t===!0){let m=Math.acos($n(s[0].dot(s[e]),-1,1));m/=e,r[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(r[v],m*v)),o[v].crossVectors(r[v],s[v])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class S_ extends co{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t=new Re){const i=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let u,h;this.closed||a>0?u=r[(a-1)%s]:(r0.subVectors(r[0],r[1]).add(r[0]),u=r0);const d=r[a%s],p=r[(a+1)%s];if(this.closed||a+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(qb(a,l.x,u.x,h.x,d.x),qb(a,l.y,u.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t=i){const o=r[s]-i,a=this.curves[s],l=a.getLength(),u=l===0?0:1-o/l;return a.getPointAt(u,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let i=0,r=this.curves.length;i1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,i=e.curves.length;t0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Jp extends zt{constructor(e=[new Re(0,-.5),new Re(.5,0),new Re(0,.5)],t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$n(r,0,Math.PI*2);const s=[],o=[],a=[],l=[],u=[],h=1/t,d=new G,p=new Re,m=new G,v=new G,x=new G;let y=0,g=0;for(let S=0;S<=e.length-1;S++)switch(S){case 0:y=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-y,m.z=g*0,x.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(x.x,x.y,x.z);break;default:y=e[S+1].x-e[S].x,g=e[S+1].y-e[S].y,m.x=g*1,m.y=-y,m.z=g*0,v.copy(m),m.x+=x.x,m.y+=x.y,m.z+=x.z,m.normalize(),l.push(m.x,m.y,m.z),x.copy(v)}for(let S=0;S<=t;S++){const A=i+S*h*r,E=Math.sin(A),b=Math.cos(A);for(let C=0;C<=e.length-1;C++){d.x=e[C].x*E,d.y=e[C].y,d.z=e[C].x*b,o.push(d.x,d.y,d.z),p.x=S/t,p.y=C/(e.length-1),a.push(p.x,p.y);const R=l[3*C+0]*E,I=l[3*C+1],O=l[3*C+0]*b;u.push(R,I,O)}}for(let S=0;S0&&A(!0),t>0&&A(!1)),this.setIndex(h),this.setAttribute("position",new St(d,3)),this.setAttribute("normal",new St(p,3)),this.setAttribute("uv",new St(m,2));function S(){const E=new G,b=new G;let C=0;const R=(t-e)/i;for(let I=0;I<=s;I++){const O=[],T=I/s,L=T*(t-e)+e;for(let K=0;K<=r;K++){const se=K/r,W=se*l+a,te=Math.sin(W),$=Math.cos(W);b.x=L*te,b.y=-T*i+y,b.z=L*$,d.push(b.x,b.y,b.z),E.set(te,R,$).normalize(),p.push(E.x,E.y,E.z),m.push(se,1-T),O.push(v++)}x.push(O)}for(let I=0;I.9&&R<.1&&(A<.2&&(o[S+0]+=1),E<.2&&(o[S+2]+=1),b<.2&&(o[S+4]+=1))}}function p(S){s.push(S.x,S.y,S.z)}function m(S,A){const E=S*3;A.x=e[E+0],A.y=e[E+1],A.z=e[E+2]}function v(){const S=new G,A=new G,E=new G,b=new G,C=new Re,R=new Re,I=new Re;for(let O=0,T=0;O80*t){a=u=n[0],l=h=n[1];for(let v=t;vu&&(u=d),p>h&&(h=p);m=Math.max(u-a,h-l),m=m!==0?32767/m:0}return Rp(s,o,t,a,l,m,0),o}};function EN(n,e,t,i,r){let s,o;if(r===v6(n,e,t,i)>0)for(s=e;s=e;s-=i)o=$b(s,n[s],n[s+1],o);return o&&C_(o,o.next)&&(Pp(o),o=o.next),o}function nc(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(C_(t,t.next)||Wn(t.prev,t,t.next)===0)){if(Pp(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Rp(n,e,t,i,r,s,o){if(!n)return;!o&&s&&f6(n,i,r,s);let a=n,l,u;for(;n.prev!==n.next;){if(l=n.prev,u=n.next,s?i6(n,i,r,s):n6(n)){e.push(l.i/t|0),e.push(n.i/t|0),e.push(u.i/t|0),Pp(n),n=u.next,a=u.next;continue}if(n=u,n===a){o?o===1?(n=r6(nc(n),e,t),Rp(n,e,t,i,r,s,2)):o===2&&s6(n,e,t,i,r,s):Rp(nc(n),e,t,i,r,s,1);break}}}function n6(n){const e=n.prev,t=n,i=n.next;if(Wn(e,t,i)>=0)return!1;const r=e.x,s=t.x,o=i.x,a=e.y,l=t.y,u=i.y,h=rs?r>o?r:o:s>o?s:o,m=a>l?a>u?a:u:l>u?l:u;let v=i.next;for(;v!==e;){if(v.x>=h&&v.x<=p&&v.y>=d&&v.y<=m&&_f(r,a,s,l,o,u,v.x,v.y)&&Wn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function i6(n,e,t,i){const r=n.prev,s=n,o=n.next;if(Wn(r,s,o)>=0)return!1;const a=r.x,l=s.x,u=o.x,h=r.y,d=s.y,p=o.y,m=al?a>u?a:u:l>u?l:u,y=h>d?h>p?h:p:d>p?d:p,g=zS(m,v,e,t,i),S=zS(x,y,e,t,i);let A=n.prevZ,E=n.nextZ;for(;A&&A.z>=g&&E&&E.z<=S;){if(A.x>=m&&A.x<=x&&A.y>=v&&A.y<=y&&A!==r&&A!==o&&_f(a,h,l,d,u,p,A.x,A.y)&&Wn(A.prev,A,A.next)>=0||(A=A.prevZ,E.x>=m&&E.x<=x&&E.y>=v&&E.y<=y&&E!==r&&E!==o&&_f(a,h,l,d,u,p,E.x,E.y)&&Wn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;A&&A.z>=g;){if(A.x>=m&&A.x<=x&&A.y>=v&&A.y<=y&&A!==r&&A!==o&&_f(a,h,l,d,u,p,A.x,A.y)&&Wn(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;E&&E.z<=S;){if(E.x>=m&&E.x<=x&&E.y>=v&&E.y<=y&&E!==r&&E!==o&&_f(a,h,l,d,u,p,E.x,E.y)&&Wn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function r6(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!C_(r,s)&&wN(r,i,i.next,s)&&bp(r,s)&&bp(s,r)&&(e.push(r.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Pp(i),Pp(i.next),i=n=s),i=i.next}while(i!==n);return nc(i)}function s6(n,e,t,i,r,s){let o=n;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&p6(o,a)){let l=TN(o,a);o=nc(o,o.next),l=nc(l,l.next),Rp(o,e,t,i,r,s,0),Rp(l,e,t,i,r,s,0);return}a=a.next}o=o.next}while(o!==n)}function o6(n,e,t,i){const r=[];let s,o,a,l,u;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>i&&(i=p,r=t.x=t.x&&t.x>=l&&s!==t.x&&_f(or.x||t.x===r.x&&c6(r,t)))&&(r=t,h=d)),t=t.next;while(t!==a);return r}function c6(n,e){return Wn(n.prev,n,e.prev)<0&&Wn(e.next,n,n.next)<0}function f6(n,e,t,i){let r=n;do r.z===0&&(r.z=zS(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,h6(r)}function h6(n){let e,t,i,r,s,o,a,l,u=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e0||l>0&&i;)a!==0&&(l===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,u*=2}while(o>1);return n}function zS(n,e,t,i,r){return n=(n-t)*r|0,e=(e-i)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function d6(n){let e=n,t=n;do(e.x=(n-o)*(s-a)&&(n-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(r-o)*(i-a)}function p6(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!m6(n,e)&&(bp(n,e)&&bp(e,n)&&g6(n,e)&&(Wn(n.prev,n,e.prev)||Wn(n,e.prev,e))||C_(n,e)&&Wn(n.prev,n,n.next)>0&&Wn(e.prev,e,e.next)>0)}function Wn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function C_(n,e){return n.x===e.x&&n.y===e.y}function wN(n,e,t,i){const r=u0(Wn(n,e,t)),s=u0(Wn(n,e,i)),o=u0(Wn(t,i,n)),a=u0(Wn(t,i,e));return!!(r!==s&&o!==a||r===0&&l0(n,t,e)||s===0&&l0(n,i,e)||o===0&&l0(t,n,i)||a===0&&l0(t,e,i))}function l0(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function u0(n){return n>0?1:n<0?-1:0}function m6(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&wN(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function bp(n,e){return Wn(n.prev,n,n.next)<0?Wn(n,e,n.next)>=0&&Wn(n,n.prev,e)>=0:Wn(n,e,n.prev)<0||Wn(n,n.next,e)<0}function g6(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function TN(n,e){const t=new GS(n.i,n.x,n.y),i=new GS(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function $b(n,e,t,i){const r=new GS(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Pp(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function GS(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function v6(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function tP(n,e){for(let t=0;tNumber.EPSILON){const Me=Math.sqrt(U),be=Math.sqrt(Et*Et+H*H),Ie=Ae.x-et/Me,tt=Ae.y+Xe/Me,ct=ge.x-H/be,Ge=ge.y+Et/be,Ke=((ct-Ie)*H-(Ge-tt)*Et)/(Xe*H-et*Et);Fe=Ie+Xe*Ke-Y.x,Ce=tt+et*Ke-Y.y;const Rt=Fe*Fe+Ce*Ce;if(Rt<=2)return new Re(Fe,Ce);re=Math.sqrt(Rt/2)}else{let Me=!1;Xe>Number.EPSILON?Et>Number.EPSILON&&(Me=!0):Xe<-Number.EPSILON?Et<-Number.EPSILON&&(Me=!0):Math.sign(et)===Math.sign(H)&&(Me=!0),Me?(Fe=-et,Ce=Xe,re=Math.sqrt(U)):(Fe=Xe,Ce=et,re=Math.sqrt(U/2))}return new Re(Fe/re,Ce/re)}const V=[];for(let Y=0,Ae=W.length,ge=Ae-1,Fe=Y+1;Y=0;Y--){const Ae=Y/y,ge=m*Math.cos(Ae*Math.PI/2),Fe=v*Math.sin(Ae*Math.PI/2)+x;for(let Ce=0,re=W.length;Ce=0;){const Fe=ge;let Ce=ge-1;Ce<0&&(Ce=Y.length-1);for(let re=0,Xe=h+y*2;re0)&&m.push(A,E,C),(g!==i-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PN extends mi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new it(16777215),this.specular=new it(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class BN extends mi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new it(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class IN extends mi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class LN extends mi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new it(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new it(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new cs,this.combine=kp,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DN extends mi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new it(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fl,this.normalScale=new Re(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NN extends or{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function bu(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)}function FN(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function ON(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i}function HS(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const a=t[s]*e;for(let l=0;l!==e;++l)r[o++]=n[a+l]}return r}function KE(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)}function A6(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let l=0;l=i)){d.push(u.times[m]);for(let x=0;xs.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*d+h,S=g+d-h;x=a.values.slice(g,S)}else{const g=a.createInterpolant(),S=h,A=d-h;g.evaluate(s),x=g.resultBuffer.slice(S,A)}l==="quaternion"&&new Ii().fromArray(x).normalize().conjugate().toArray(x);const y=u.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=i,i=0;break n}break e}for(;i>>1;et;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=i.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=i[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(r!==void 0&&FN(r))for(let a=0,l=r.length;a!==l;++a){const u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===K0,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*i,l=o*i,u=0;u!==i;++u)t[l+u]=t[a+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}fo.prototype.TimeBufferType=Float32Array;fo.prototype.ValueBufferType=Float32Array;fo.prototype.DefaultInterpolation=tc;class lc extends fo{}lc.prototype.ValueTypeName="bool";lc.prototype.ValueBufferType=Array;lc.prototype.DefaultInterpolation=Zf;lc.prototype.InterpolantFactoryMethodLinear=void 0;lc.prototype.InterpolantFactoryMethodSmooth=void 0;class ZE extends fo{}ZE.prototype.ValueTypeName="color";class nh extends fo{}nh.prototype.ValueTypeName="number";class zN extends mh{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(i-t)/(r-t);let u=e*a;for(let h=u+a;u!==h;u+=4)Ii.slerpFlat(s,0,o,u-a,o,u,l);return s}}class Pl extends fo{InterpolantFactoryMethodLinear(e){return new zN(this.times,this.values,this.getValueSize(),e)}}Pl.prototype.ValueTypeName="quaternion";Pl.prototype.DefaultInterpolation=tc;Pl.prototype.InterpolantFactoryMethodSmooth=void 0;class uc extends fo{}uc.prototype.ValueTypeName="string";uc.prototype.ValueBufferType=Array;uc.prototype.DefaultInterpolation=Zf;uc.prototype.InterpolantFactoryMethodLinear=void 0;uc.prototype.InterpolantFactoryMethodSmooth=void 0;class ih extends fo{}ih.prototype.ValueTypeName="vector";class rh{constructor(e,t=-1,i,r=h_){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=as(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,a=i.length;o!==a;++o)t.push(w6(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(fo.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let a=0;a1){const d=h[1];let p=r[d];p||(r[d]=p=[]),p.push(u)}}const o=[];for(const a in r)o.push(this.CreateFromMorphTargetSequence(a,r[a],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,m,v,x){if(m.length!==0){const y=[],g=[];KE(m,y,g,v),y.length!==0&&x.push(new d(p,y,g))}},r=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{t&&t(s),this.manager.itemEnd(e)},0),s;if(ea[e]!==void 0){ea[e].push({onLoad:t,onProgress:i,onError:r});return}ea[e]=[],ea[e].push({onLoad:t,onProgress:i,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const h=ea[e],d=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let x=0;const y=new ReadableStream({start(g){S();function S(){d.read().then(({done:A,value:E})=>{if(A)g.close();else{x+=E.byteLength;const b=new ProgressEvent("progress",{lengthComputable:v,loaded:x,total:m});for(let C=0,R=h.length;C{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(h=>new DOMParser().parseFromString(h,a));case"json":return u.json();default:if(a===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),p=d&&d[1]?d[1].toLowerCase():void 0,m=new TextDecoder(p);return u.arrayBuffer().then(v=>m.decode(v))}}}).then(u=>{da.add(e,u);const h=ea[e];delete ea[e];for(let d=0,p=h.length;d{const h=ea[e];if(h===void 0)throw this.manager.itemError(e),u;delete ea[e];for(let d=0,p=h.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class C6 extends ar{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new fs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){r?r(l):console.error(l),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new it().setHex(o.value);break;case"v2":r.uniforms[s].value=new Re().fromArray(o.value);break;case"v3":r.uniforms[s].value=new G().fromArray(o.value);break;case"v4":r.uniforms[s].value=new _n().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Ht().fromArray(o.value);break;case"m4":r.uniforms[s].value=new bt().fromArray(o.value);break;default:r.uniforms[s].value=o.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Re().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Re().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=i(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:RN,SpriteMaterial:UE,RawShaderMaterial:bN,ShaderMaterial:Ws,PointsMaterial:x_,MeshPhysicalMaterial:Ho,MeshStandardMaterial:Qp,MeshPhongMaterial:PN,MeshToonMaterial:BN,MeshNormalMaterial:IN,MeshLambertMaterial:LN,MeshDepthMaterial:NE,MeshDistanceMaterial:FE,MeshBasicMaterial:rs,MeshMatcapMaterial:DN,LineDashedMaterial:NN,LineBasicMaterial:or,Material:mi};return new t[e]}}class Oo{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i0){const l=new qE(t);s=new Bp(l),s.setCrossOrigin(this.crossOrigin);for(let u=0,h=e.length;u0){r=new Bp(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o{const y=new rr;y.min.fromArray(x.boxMin),y.max.fromArray(x.boxMax);const g=new ki;return g.radius=x.sphereRadius,g.center.fromArray(x.sphereCenter),{boxInitialized:x.boxInitialized,box:y,sphereInitialized:x.sphereInitialized,sphere:g}}),o._maxGeometryCount=e.maxGeometryCount,o._maxVertexCount=e.maxVertexCount,o._maxIndexCount=e.maxIndexCount,o._geometryInitialized=e.geometryInitialized,o._geometryCount=e.geometryCount,o._matricesTexture=u(e.matricesTexture.uuid);break;case"LOD":o=new gN;break;case"Line":o=new Ma(a(e.geometry),l(e.material));break;case"LineLoop":o=new GE(a(e.geometry),l(e.material));break;case"LineSegments":o=new uo(a(e.geometry),l(e.material));break;case"PointCloud":case"Points":o=new HE(a(e.geometry),l(e.material));break;case"Sprite":o=new mN(l(e.material));break;case"Group":o=new so;break;case"Bone":o=new y_;break;default:o=new an}if(o.uuid=e.uuid,e.name!==void 0&&(o.name=e.name),e.matrix!==void 0?(o.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(o.matrixAutoUpdate=e.matrixAutoUpdate),o.matrixAutoUpdate&&o.matrix.decompose(o.position,o.quaternion,o.scale)):(e.position!==void 0&&o.position.fromArray(e.position),e.rotation!==void 0&&o.rotation.fromArray(e.rotation),e.quaternion!==void 0&&o.quaternion.fromArray(e.quaternion),e.scale!==void 0&&o.scale.fromArray(e.scale)),e.up!==void 0&&o.up.fromArray(e.up),e.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(o.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(o.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(o.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&o.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(o.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(o.visible=e.visible),e.frustumCulled!==void 0&&(o.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(o.renderOrder=e.renderOrder),e.userData!==void 0&&(o.userData=e.userData),e.layers!==void 0&&(o.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let m=0;m"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=da.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{r&&r(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader;const l=fetch(e,a).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return da.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){r&&r(u),da.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});da.add(e,l),s.manager.itemStart(e)}}let c0;class rw{static getContext(){return c0===void 0&&(c0=new(window.AudioContext||window.webkitAudioContext)),c0}static setContext(e){c0=e}}class D6 extends ar{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new fs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);rw.getContext().decodeAudioData(u,function(d){t(d)}).catch(a)}catch(u){a(u)}},i,r);function a(l){r?r(l):console.error(l),s.manager.itemError(e)}}}const uP=new bt,cP=new bt,iu=new bt;class N6{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Pn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Pn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,iu.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,o=t.near*Math.tan(Gu*t.fov*.5)/t.zoom;let a,l;cP.elements[12]=-r,uP.elements[12]=r,a=-o*t.aspect+s,l=o*t.aspect+s,iu.elements[0]=2*t.near/(l-a),iu.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(iu),a=-o*t.aspect-s,l=o*t.aspect-s,iu.elements[0]=2*t.near/(l-a),iu.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(iu)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(cP),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(uP)}}class sw{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=fP(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=fP();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function fP(){return(typeof performance>"u"?Date:performance).now()}const ru=new G,hP=new Ii,F6=new G,su=new G;class O6 extends an{constructor(){super(),this.type="AudioListener",this.context=rw.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new sw}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ru,hP,F6),su.set(0,0,-1).applyQuaternion(hP),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(ru.x,r),t.positionY.linearRampToValueAtTime(ru.y,r),t.positionZ.linearRampToValueAtTime(ru.z,r),t.forwardX.linearRampToValueAtTime(su.x,r),t.forwardY.linearRampToValueAtTime(su.y,r),t.forwardZ.linearRampToValueAtTime(su.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(ru.x,ru.y,ru.z),t.setOrientation(su.x,su.y,su.z,i.x,i.y,i.z)}}class ZN extends an{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let l=t,u=t+t;l!==u;++l)if(i[l]!==i[l+t]){a.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let i=e;i=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Ii.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Ii.multiplyQuaternionsFlat(e,o,e,t,e,i),Ii.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[i+a]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[i+o]*r}}}const ow="\\[\\]\\.:\\/",G6=new RegExp("["+ow+"]","g"),aw="[^"+ow+"]",H6="[^"+ow.replace("\\.","")+"]",V6=/((?:WC+[\/:])*)/.source.replace("WC",aw),W6=/(WCOD+)?/.source.replace("WCOD",H6),X6=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",aw),J6=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",aw),j6=new RegExp("^"+V6+W6+X6+J6+"$"),Y6=["material","materials","bones","map"];class K6{constructor(e,t,i){const r=i||on.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}class on{constructor(e,t,i){this.path=t,this.parsedPath=i||on.parseTrackName(t),this.node=on.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new on.Composite(e,t,i):new on(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(G6,"")}static parseTrackName(e){const t=j6.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);Y6.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(t);if(i!==void 0)return i}if(e.children){const i=function(s){for(let o=0;o=s){const d=s++,p=e[d];t[p.uuid]=h,e[h]=p,t[u]=d,e[d]=l;for(let m=0,v=r;m!==v;++m){const x=i[m],y=x[d],g=x[h];x[h]=y,x[d]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],h=u.uuid,d=t[h];if(d!==void 0)if(delete t[h],d0&&(t[m.uuid]=d),e[d]=m,e.pop();for(let v=0,x=r;v!==x;++v){const y=i[v];y[d]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,h=this.nCachedObjects_,d=new Array(u);r=s.length,i[e]=r,o.push(e),a.push(t),s.push(d);for(let p=h,m=l.length;p!==m;++p){const v=l[p];d[p]=new on(v,e,t)}return d}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],u=e[a];t[u]=i,o[i]=l,o.pop(),s[i]=s[a],s.pop(),r[i]=r[a],r.pop()}}}class $N{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:wu,endingEnd:wu};for(let u=0;u!==o;++u){const h=s[u].createInterpolant(null);a[u]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=OD,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,a=r/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,i){return e.crossFadeFrom(this,t,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,i){const r=this._mixer,s=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=s,l[1]=s+i,u[0]=e/o,u[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,i,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*i;l<0||i===0?t=0:(this._startTime=null,t=i*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case wE:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulateAdditive(a);break;case h_:default:for(let h=0,d=l.length;h!==d;++h)l[h].evaluate(o),u[h].accumulate(r,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,i=this.loop;let r=this.time+e,s=this._loopCount;const o=i===UD;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===FD){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const a=Math.floor(r/t);r-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Tu,r.endingEnd=Tu):(e?r.endingStart=this.zeroSlopeAtStart?Tu:wu:r.endingStart=xp,t?r.endingEnd=this.zeroSlopeAtEnd?Tu:wu:r.endingEnd=xp)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=i,this}}const Z6=new Float32Array(1);class q6 extends Go{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const i=e._localRoot||this._root,r=e._clip.tracks,s=r.length,o=e._propertyBindings,a=e._interpolants,l=i.uuid,u=this._bindingsByRootAndName;let h=u[l];h===void 0&&(h={},u[l]=h);for(let d=0;d!==s;++d){const p=r[d],m=p.name;let v=h[m];if(v!==void 0)++v.referenceCount,o[d]=v;else{if(v=o[d],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const x=t&&t._propertyBindings[d].binding.parsedPath;v=new qN(on.create(i,m,x),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[d]=v}a[d].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let u=0;u!==i;++u)t[u]._update(r,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,gP).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const vP=new G,f0=new G;class sW{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){vP.subVectors(e,this.start),f0.subVectors(this.end,this.start);const i=f0.dot(f0);let s=f0.dot(vP)/i;return t&&(s=$n(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const _P=new G;class oW extends an{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const i=new zt,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{MP.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(MP,t)}}setLength(e,t=e*.2,i=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class yW extends uo{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new zt;r.setAttribute("position",new St(t,3)),r.setAttribute("color",new St(i,3));const s=new or({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new it,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class xW{constructor(){this.type="ShapePath",this.color=new it,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Cp,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,i,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const S=[];for(let A=0,E=g.length;ANumber.EPSILON){if(T<0&&(R=S[C],O=-O,I=S[b],T=-T),g.yI.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const L=T*(g.x-R.x)-O*(g.y-R.y);if(L===0)return!0;if(L<0)continue;E=!E}}else{if(g.y!==R.y)continue;if(I.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=I.x)return!0}}return E}const r=Fo.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const u=[];if(s.length===1)return a=s[0],l=new Vu,l.curves=a.curves,u.push(l),u;let h=!r(s[0].getPoints());h=e?!h:h;const d=[],p=[];let m=[],v=0,x;p[v]=void 0,m[v]=[];for(let g=0,S=s.length;g1){let g=!1,S=0;for(let A=0,E=p.length;A0&&g===!1&&(m=d)}let y;for(let g=0,S=p.length;g{const d=typeof u=="function"?u(e):u;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(u,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const v=h(e);if(!d(p,v)){const x=p;u(p=v,x)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(u,h,d)=>h||d?s(u,h,d):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(i,r,l),l}const yW=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),SP=yW?ne.useEffect:ne.useLayoutEffect;function e3(n){const e=typeof n=="function"?_W(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=ne.useReducer(y=>y+1,0),o=e.getState(),a=ne.useRef(o),l=ne.useRef(i),u=ne.useRef(r),h=ne.useRef(!1),d=ne.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||u.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),SP(()=>{m&&(d.current=p),a.current=o,l.current=i,u.current=r,h.current=!1});const v=ne.useRef(o);SP(()=>{const y=()=>{try{const S=e.getState(),A=l.current(S);u.current(d.current,A)||(a.current=S,d.current=A,s())}catch{h.current=!0,s()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const x=m?p:d.current;return ne.useDebugValue(x),x};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 t3={exports:{}},m1={exports:{}},g1={};/** + */cc.ConcurrentRoot=1;cc.ContinuousEventPriority=4;cc.DefaultEventPriority=16;cc.DiscreteEventPriority=1;cc.IdleEventPriority=536870912;cc.LegacyRoot=0;t3.exports=cc;var yf=t3.exports;function MW(n){let e;const t=new Set,i=(u,h)=>{const d=typeof u=="function"?u(e):u;if(d!==e){const p=e;e=h?d:Object.assign({},e,d),t.forEach(m=>m(e,p))}},r=()=>e,s=(u,h=r,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=h(e);function m(){const v=h(e);if(!d(p,v)){const x=p;u(p=v,x)}}return t.add(m),()=>t.delete(m)},l={setState:i,getState:r,subscribe:(u,h,d)=>h||d?s(u,h,d):(t.add(u),()=>t.delete(u)),destroy:()=>t.clear()};return e=n(i,r,l),l}const EW=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),EP=EW?ne.useEffect:ne.useLayoutEffect;function n3(n){const e=typeof n=="function"?MW(n):n,t=(i=e.getState,r=Object.is)=>{const[,s]=ne.useReducer(y=>y+1,0),o=e.getState(),a=ne.useRef(o),l=ne.useRef(i),u=ne.useRef(r),h=ne.useRef(!1),d=ne.useRef();d.current===void 0&&(d.current=i(o));let p,m=!1;(a.current!==o||l.current!==i||u.current!==r||h.current)&&(p=i(o),m=!r(d.current,p)),EP(()=>{m&&(d.current=p),a.current=o,l.current=i,u.current=r,h.current=!1});const v=ne.useRef(o);EP(()=>{const y=()=>{try{const S=e.getState(),A=l.current(S);u.current(d.current,A)||(a.current=S,d.current=A,s())}catch{h.current=!0,s()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const x=m?p:d.current;return ne.useDebugValue(x),x};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 i3={exports:{}},m1={exports:{}},g1={};/** * @license React * scheduler.production.min.js * @@ -3897,7 +3897,7 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var MP;function xW(){return MP||(MP=1,function(n){function e(F,V){var N=F.length;F.push(V);e:for(;0>>1,ce=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var ce=ee(d.expirationTime<=V);V=n.unstable_now(),typeof ce=="function"?d.callback=ce:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=ce,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}}(g1)),g1}var EP;function AW(){return EP||(EP=1,m1.exports=xW()),m1.exports}/** + */var wP;function wW(){return wP||(wP=1,function(n){function e(F,V){var N=F.length;F.push(V);e:for(;0>>1,fe=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var fe=ee(d.expirationTime<=V);V=n.unstable_now(),typeof fe=="function"?d.callback=fe:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=fe,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}}(g1)),g1}var TP;function TW(){return TP||(TP=1,m1.exports=wW()),m1.exports}/** * @license React * react-reconciler.production.min.js * @@ -3905,17 +3905,17 @@ void main() { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var SW=function(e){var t={},i=ne,r=AW(),s=Object.assign;function o(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,_=1;_le||w[J]!==P[le]){var Te=` -`+w[J].replace(" at new "," at ");return c.displayName&&Te.includes("")&&(Te=Te.replace("",c.displayName)),Te}while(1<=J&&0<=le);break}}}finally{De=!1,Error.prepareStackTrace=_}return(c=c?c.displayName||c.name:"")?Ze(c):""}var ft=Object.prototype.hasOwnProperty,At=[],yt=-1;function Lt(c){return{current:c}}function rt(c){0>yt||(c.current=At[yt],At[yt]=null,yt--)}function qe(c,f){yt++,At[yt]=c.current,c.current=f}var Jt={},Pt=Lt(Jt),Nt=Lt(!1),gn=Jt;function jn(c,f){var _=c.type.contextTypes;if(!_)return Jt;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===f)return M.__reactInternalMemoizedMaskedChildContext;var w={},P;for(P in _)w[P]=f[P];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=w),w}function Dn(c){return c=c.childContextTypes,c!=null}function sn(){rt(Nt),rt(Pt)}function Yt(c,f,_){if(Pt.current!==Jt)throw Error(o(168));qe(Pt,f),qe(Nt,_)}function Un(c,f,_){var M=c.stateNode;if(f=f.childContextTypes,typeof M.getChildContext!="function")return _;M=M.getChildContext();for(var w in M)if(!(w in f))throw Error(o(108,I(c)||"Unknown",w));return s({},_,M)}function Gt(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Jt,gn=Pt.current,qe(Pt,c),qe(Nt,Nt.current),!0}function $t(c,f,_){var M=c.stateNode;if(!M)throw Error(o(169));_?(c=Un(c,f,gn),M.__reactInternalMemoizedMergedChildContext=c,rt(Nt),rt(Pt),qe(Pt,c)):rt(Nt),qe(Nt,_)}var Sn=Math.clz32?Math.clz32:ho,ms=Math.log,lr=Math.LN2;function ho(c){return c>>>=0,c===0?32:31-(ms(c)/lr|0)|0}var im=64,rm=4194304;function gh(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function sm(c,f){var _=c.pendingLanes;if(_===0)return 0;var M=0,w=c.suspendedLanes,P=c.pingedLanes,J=_&268435455;if(J!==0){var le=J&~w;le!==0?M=gh(le):(P&=J,P!==0&&(M=gh(P)))}else J=_&~w,J!==0?M=gh(J):P!==0&&(M=gh(P));if(M===0)return 0;if(f!==0&&f!==M&&!(f&w)&&(w=M&-M,P=f&-f,w>=P||w===16&&(P&4194240)!==0))return f;if(M&4&&(M|=_&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=M;0_;_++)f.push(c);return f}function vh(c,f,_){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Sn(f),c[f]=_}function j3(c,f){var _=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0<_;){var w=31-Sn(_),P=1<>=J,w-=J,Xo=1<<32-Sn(f)+w|_<fn?(wi=kt,kt=null):wi=kt.sibling;var hn=Bt(me,kt,Ee[fn],at);if(hn===null){kt===null&&(kt=wi);break}c&&kt&&hn.alternate===null&&f(me,kt),ue=P(hn,ue,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn,kt=wi}if(fn===Ee.length)return _(me,kt),Nn&&kl(me,fn),wt;if(kt===null){for(;fnfn?(wi=kt,kt=null):wi=kt.sibling;var Da=Bt(me,kt,hn.value,at);if(Da===null){kt===null&&(kt=wi);break}c&&kt&&Da.alternate===null&&f(me,kt),ue=P(Da,ue,fn),Xt===null?wt=Da:Xt.sibling=Da,Xt=Da,kt=wi}if(hn.done)return _(me,kt),Nn&&kl(me,fn),wt;if(kt===null){for(;!hn.done;fn++,hn=Ee.next())hn=Ut(me,hn.value,at),hn!==null&&(ue=P(hn,ue,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn);return Nn&&kl(me,fn),wt}for(kt=M(me,kt);!hn.done;fn++,hn=Ee.next())hn=xn(kt,me,fn,hn.value,at),hn!==null&&(c&&hn.alternate!==null&&kt.delete(hn.key===null?fn:hn.key),ue=P(hn,ue,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn);return c&&kt.forEach(function(IF){return f(me,IF)}),Nn&&kl(me,fn),wt}function Ms(me,ue,Ee,at){if(typeof Ee=="object"&&Ee!==null&&Ee.type===h&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case l:e:{for(var wt=Ee.key,Xt=ue;Xt!==null;){if(Xt.key===wt){if(wt=Ee.type,wt===h){if(Xt.tag===7){_(me,Xt.sibling),ue=w(Xt,Ee.props.children),ue.return=me,me=ue;break e}}else if(Xt.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===A&&Dw(wt)===Xt.type){_(me,Xt.sibling),ue=w(Xt,Ee.props),ue.ref=xh(me,Xt,Ee),ue.return=me,me=ue;break e}_(me,Xt);break}else f(me,Xt);Xt=Xt.sibling}Ee.type===h?(ue=Jl(Ee.props.children,me.mode,at,Ee.key),ue.return=me,me=ue):(at=jm(Ee.type,Ee.key,Ee.props,null,me.mode,at),at.ref=xh(me,ue,Ee),at.return=me,me=at)}return J(me);case u:e:{for(Xt=Ee.key;ue!==null;){if(ue.key===Xt)if(ue.tag===4&&ue.stateNode.containerInfo===Ee.containerInfo&&ue.stateNode.implementation===Ee.implementation){_(me,ue.sibling),ue=w(ue,Ee.children||[]),ue.return=me,me=ue;break e}else{_(me,ue);break}else f(me,ue);ue=ue.sibling}ue=zy(Ee,me.mode,at),ue.return=me,me=ue}return J(me);case A:return Xt=Ee._init,Ms(me,ue,Xt(Ee._payload),at)}if(te(Ee))return Ct(me,ue,Ee,at);if(C(Ee))return Wi(me,ue,Ee,at);gm(me,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,ue!==null&&ue.tag===6?(_(me,ue.sibling),ue=w(ue,Ee),ue.return=me,me=ue):(_(me,ue),ue=ky(Ee,me.mode,at),ue.return=me,me=ue),J(me)):_(me,ue)}return Ms}var gc=Nw(!0),Fw=Nw(!1),Ah={},ys=Lt(Ah),Sh=Lt(Ah),vc=Lt(Ah);function _o(c){if(c===Ah)throw Error(o(174));return c}function iy(c,f){qe(vc,f),qe(Sh,c),qe(ys,Ah),c=oe(f),rt(ys),qe(ys,c)}function _c(){rt(ys),rt(Sh),rt(vc)}function Ow(c){var f=_o(vc.current),_=_o(ys.current);f=F(_,c.type,f),_!==f&&(qe(Sh,c),qe(ys,f))}function ry(c){Sh.current===c&&(rt(ys),rt(Sh))}var kn=Lt(0);function vm(c){for(var f=c;f!==null;){if(f.tag===13){var _=f.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||xt(_)||It(_)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var sy=[];function oy(){for(var c=0;c_?_:4,c(!0);var M=xs.transition;xs.transition={};try{c(!1),f()}finally{cn=_,xs.transition=M}}function Zw(){return yo().memoizedState}function sF(c,f,_){var M=Ba(c);_={lane:M,action:_,hasEagerState:!1,eagerState:null,next:null},qw(c)?$w(f,_):(eT(c,f,_),_=cr(),c=As(c,M,_),c!==null&&tT(c,f,M))}function oF(c,f,_){var M=Ba(c),w={lane:M,action:_,hasEagerState:!1,eagerState:null,next:null};if(qw(c))$w(f,w);else{eT(c,f,w);var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var J=f.lastRenderedState,le=P(J,_);if(w.hasEagerState=!0,w.eagerState=le,mo(le,J))return}catch{}finally{}_=cr(),c=As(c,M,_),c!==null&&tT(c,f,M)}}function qw(c){var f=c.alternate;return c===Yn||f!==null&&f===Yn}function $w(c,f){Mh=ym=!0;var _=c.pending;_===null?f.next=f:(f.next=_.next,_.next=f),c.pending=f}function eT(c,f,_){ai!==null&&c.mode&1&&!(jt&2)?(c=f.interleaved,c===null?(_.next=_,vo===null?vo=[f]:vo.push(f)):(_.next=c.next,c.next=_),f.interleaved=_):(c=f.pending,c===null?_.next=_:(_.next=c.next,c.next=_),f.pending=_)}function tT(c,f,_){if(_&4194240){var M=f.lanes;M&=c.pendingLanes,_|=M,f.lanes=_,z_(c,_)}}var Em={readContext:gs,useCallback:Hi,useContext:Hi,useEffect:Hi,useImperativeHandle:Hi,useInsertionEffect:Hi,useLayoutEffect:Hi,useMemo:Hi,useReducer:Hi,useRef:Hi,useState:Hi,useDebugValue:Hi,useDeferredValue:Hi,useTransition:Hi,useMutableSource:Hi,useSyncExternalStore:Hi,useId:Hi,unstable_isNewReconciler:!1},aF={readContext:gs,useCallback:function(c,f){return jo().memoizedState=[c,f===void 0?null:f],c},useContext:gs,useEffect:fy,useImperativeHandle:function(c,f,_){return _=_!=null?_.concat([c]):null,Sm(4194308,4,jw.bind(null,f,c),_)},useLayoutEffect:function(c,f){return Sm(4194308,4,c,f)},useInsertionEffect:function(c,f){return Sm(4,2,c,f)},useMemo:function(c,f){var _=jo();return f=f===void 0?null:f,c=c(),_.memoizedState=[c,f],c},useReducer:function(c,f,_){var M=jo();return f=_!==void 0?_(f):f,M.memoizedState=M.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},M.queue=c,c=c.dispatch=sF.bind(null,Yn,c),[M.memoizedState,c]},useRef:function(c){var f=jo();return c={current:c},f.memoizedState=c},useState:cy,useDebugValue:hy,useDeferredValue:function(c){var f=cy(c),_=f[0],M=f[1];return fy(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=cy(!1),f=c[0];return c=rF.bind(null,c[1]),jo().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,_){var M=Yn,w=jo();if(Nn){if(_===void 0)throw Error(o(407));_=_()}else{if(_=f(),ai===null)throw Error(o(349));yc&30||zw(M,f,_)}w.memoizedState=_;var P={value:_,getSnapshot:f};return w.queue=P,fy(Hw.bind(null,M,P,c),[c]),M.flags|=2048,wh(9,Gw.bind(null,M,P,_,f),void 0,null),_},useId:function(){var c=jo(),f=ai.identifierPrefix;if(Nn){var _=Jo,M=Xo;_=(M&~(1<<32-Sn(M)-1)).toString(32)+_,f=":"+f+"R"+_,_=Eh++,0<_&&(f+="H"+_.toString(32)),f+=":"}else _=iF++,f=":"+f+"r"+_.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},lF={readContext:gs,useCallback:Kw,useContext:gs,useEffect:Th,useImperativeHandle:Yw,useInsertionEffect:Xw,useLayoutEffect:Jw,useMemo:Qw,useReducer:xm,useRef:Ww,useState:function(){return xm(zl)},useDebugValue:hy,useDeferredValue:function(c){var f=xm(zl),_=f[0],M=f[1];return Th(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=xm(zl)[0],f=yo().memoizedState;return[c,f]},useMutableSource:Uw,useSyncExternalStore:kw,useId:Zw,unstable_isNewReconciler:!1},uF={readContext:gs,useCallback:Kw,useContext:gs,useEffect:Th,useImperativeHandle:Yw,useInsertionEffect:Xw,useLayoutEffect:Jw,useMemo:Qw,useReducer:Am,useRef:Ww,useState:function(){return Am(zl)},useDebugValue:hy,useDeferredValue:function(c){var f=Am(zl),_=f[0],M=f[1];return Th(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=Am(zl)[0],f=yo().memoizedState;return[c,f]},useMutableSource:Uw,useSyncExternalStore:kw,useId:Zw,unstable_isNewReconciler:!1};function dy(c,f){try{var _="",M=f;do _+=nF(M),M=M.return;while(M);var w=_}catch(P){w=` +`+w[J].replace(" at new "," at ");return c.displayName&&Te.includes("")&&(Te=Te.replace("",c.displayName)),Te}while(1<=J&&0<=le);break}}}finally{De=!1,Error.prepareStackTrace=_}return(c=c?c.displayName||c.name:"")?Ze(c):""}var ft=Object.prototype.hasOwnProperty,At=[],yt=-1;function Lt(c){return{current:c}}function rt(c){0>yt||(c.current=At[yt],At[yt]=null,yt--)}function qe(c,f){yt++,At[yt]=c.current,c.current=f}var Jt={},Pt=Lt(Jt),Nt=Lt(!1),gn=Jt;function jn(c,f){var _=c.type.contextTypes;if(!_)return Jt;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===f)return M.__reactInternalMemoizedMaskedChildContext;var w={},P;for(P in _)w[P]=f[P];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=w),w}function Dn(c){return c=c.childContextTypes,c!=null}function sn(){rt(Nt),rt(Pt)}function Yt(c,f,_){if(Pt.current!==Jt)throw Error(o(168));qe(Pt,f),qe(Nt,_)}function Un(c,f,_){var M=c.stateNode;if(f=f.childContextTypes,typeof M.getChildContext!="function")return _;M=M.getChildContext();for(var w in M)if(!(w in f))throw Error(o(108,I(c)||"Unknown",w));return s({},_,M)}function Gt(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Jt,gn=Pt.current,qe(Pt,c),qe(Nt,Nt.current),!0}function $t(c,f,_){var M=c.stateNode;if(!M)throw Error(o(169));_?(c=Un(c,f,gn),M.__reactInternalMemoizedMergedChildContext=c,rt(Nt),rt(Pt),qe(Pt,c)):rt(Nt),qe(Nt,_)}var Sn=Math.clz32?Math.clz32:ho,ms=Math.log,lr=Math.LN2;function ho(c){return c>>>=0,c===0?32:31-(ms(c)/lr|0)|0}var im=64,rm=4194304;function gh(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function sm(c,f){var _=c.pendingLanes;if(_===0)return 0;var M=0,w=c.suspendedLanes,P=c.pingedLanes,J=_&268435455;if(J!==0){var le=J&~w;le!==0?M=gh(le):(P&=J,P!==0&&(M=gh(P)))}else J=_&~w,J!==0?M=gh(J):P!==0&&(M=gh(P));if(M===0)return 0;if(f!==0&&f!==M&&!(f&w)&&(w=M&-M,P=f&-f,w>=P||w===16&&(P&4194240)!==0))return f;if(M&4&&(M|=_&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=M;0_;_++)f.push(c);return f}function vh(c,f,_){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Sn(f),c[f]=_}function K3(c,f){var _=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0<_;){var w=31-Sn(_),P=1<>=J,w-=J,Xo=1<<32-Sn(f)+w|_<fn?(wi=kt,kt=null):wi=kt.sibling;var hn=Bt(me,kt,Ee[fn],at);if(hn===null){kt===null&&(kt=wi);break}c&&kt&&hn.alternate===null&&f(me,kt),ce=P(hn,ce,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn,kt=wi}if(fn===Ee.length)return _(me,kt),Nn&&zl(me,fn),wt;if(kt===null){for(;fnfn?(wi=kt,kt=null):wi=kt.sibling;var Da=Bt(me,kt,hn.value,at);if(Da===null){kt===null&&(kt=wi);break}c&&kt&&Da.alternate===null&&f(me,kt),ce=P(Da,ce,fn),Xt===null?wt=Da:Xt.sibling=Da,Xt=Da,kt=wi}if(hn.done)return _(me,kt),Nn&&zl(me,fn),wt;if(kt===null){for(;!hn.done;fn++,hn=Ee.next())hn=Ut(me,hn.value,at),hn!==null&&(ce=P(hn,ce,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn);return Nn&&zl(me,fn),wt}for(kt=M(me,kt);!hn.done;fn++,hn=Ee.next())hn=xn(kt,me,fn,hn.value,at),hn!==null&&(c&&hn.alternate!==null&&kt.delete(hn.key===null?fn:hn.key),ce=P(hn,ce,fn),Xt===null?wt=hn:Xt.sibling=hn,Xt=hn);return c&&kt.forEach(function(DF){return f(me,DF)}),Nn&&zl(me,fn),wt}function Ms(me,ce,Ee,at){if(typeof Ee=="object"&&Ee!==null&&Ee.type===h&&Ee.key===null&&(Ee=Ee.props.children),typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case l:e:{for(var wt=Ee.key,Xt=ce;Xt!==null;){if(Xt.key===wt){if(wt=Ee.type,wt===h){if(Xt.tag===7){_(me,Xt.sibling),ce=w(Xt,Ee.props.children),ce.return=me,me=ce;break e}}else if(Xt.elementType===wt||typeof wt=="object"&&wt!==null&&wt.$$typeof===A&&Dw(wt)===Xt.type){_(me,Xt.sibling),ce=w(Xt,Ee.props),ce.ref=xh(me,Xt,Ee),ce.return=me,me=ce;break e}_(me,Xt);break}else f(me,Xt);Xt=Xt.sibling}Ee.type===h?(ce=jl(Ee.props.children,me.mode,at,Ee.key),ce.return=me,me=ce):(at=jm(Ee.type,Ee.key,Ee.props,null,me.mode,at),at.ref=xh(me,ce,Ee),at.return=me,me=at)}return J(me);case u:e:{for(Xt=Ee.key;ce!==null;){if(ce.key===Xt)if(ce.tag===4&&ce.stateNode.containerInfo===Ee.containerInfo&&ce.stateNode.implementation===Ee.implementation){_(me,ce.sibling),ce=w(ce,Ee.children||[]),ce.return=me,me=ce;break e}else{_(me,ce);break}else f(me,ce);ce=ce.sibling}ce=zy(Ee,me.mode,at),ce.return=me,me=ce}return J(me);case A:return Xt=Ee._init,Ms(me,ce,Xt(Ee._payload),at)}if(te(Ee))return Ct(me,ce,Ee,at);if(C(Ee))return Wi(me,ce,Ee,at);gm(me,Ee)}return typeof Ee=="string"&&Ee!==""||typeof Ee=="number"?(Ee=""+Ee,ce!==null&&ce.tag===6?(_(me,ce.sibling),ce=w(ce,Ee),ce.return=me,me=ce):(_(me,ce),ce=ky(Ee,me.mode,at),ce.return=me,me=ce),J(me)):_(me,ce)}return Ms}var gc=Nw(!0),Fw=Nw(!1),Ah={},ys=Lt(Ah),Sh=Lt(Ah),vc=Lt(Ah);function _o(c){if(c===Ah)throw Error(o(174));return c}function iy(c,f){qe(vc,f),qe(Sh,c),qe(ys,Ah),c=oe(f),rt(ys),qe(ys,c)}function _c(){rt(ys),rt(Sh),rt(vc)}function Ow(c){var f=_o(vc.current),_=_o(ys.current);f=F(_,c.type,f),_!==f&&(qe(Sh,c),qe(ys,f))}function ry(c){Sh.current===c&&(rt(ys),rt(Sh))}var kn=Lt(0);function vm(c){for(var f=c;f!==null;){if(f.tag===13){var _=f.memoizedState;if(_!==null&&(_=_.dehydrated,_===null||xt(_)||It(_)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if(f.flags&128)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var sy=[];function oy(){for(var c=0;c_?_:4,c(!0);var M=xs.transition;xs.transition={};try{c(!1),f()}finally{cn=_,xs.transition=M}}function Zw(){return yo().memoizedState}function aF(c,f,_){var M=Ba(c);_={lane:M,action:_,hasEagerState:!1,eagerState:null,next:null},qw(c)?$w(f,_):(eT(c,f,_),_=cr(),c=As(c,M,_),c!==null&&tT(c,f,M))}function lF(c,f,_){var M=Ba(c),w={lane:M,action:_,hasEagerState:!1,eagerState:null,next:null};if(qw(c))$w(f,w);else{eT(c,f,w);var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var J=f.lastRenderedState,le=P(J,_);if(w.hasEagerState=!0,w.eagerState=le,mo(le,J))return}catch{}finally{}_=cr(),c=As(c,M,_),c!==null&&tT(c,f,M)}}function qw(c){var f=c.alternate;return c===Yn||f!==null&&f===Yn}function $w(c,f){Mh=ym=!0;var _=c.pending;_===null?f.next=f:(f.next=_.next,_.next=f),c.pending=f}function eT(c,f,_){li!==null&&c.mode&1&&!(jt&2)?(c=f.interleaved,c===null?(_.next=_,vo===null?vo=[f]:vo.push(f)):(_.next=c.next,c.next=_),f.interleaved=_):(c=f.pending,c===null?_.next=_:(_.next=c.next,c.next=_),f.pending=_)}function tT(c,f,_){if(_&4194240){var M=f.lanes;M&=c.pendingLanes,_|=M,f.lanes=_,z_(c,_)}}var Em={readContext:gs,useCallback:Hi,useContext:Hi,useEffect:Hi,useImperativeHandle:Hi,useInsertionEffect:Hi,useLayoutEffect:Hi,useMemo:Hi,useReducer:Hi,useRef:Hi,useState:Hi,useDebugValue:Hi,useDeferredValue:Hi,useTransition:Hi,useMutableSource:Hi,useSyncExternalStore:Hi,useId:Hi,unstable_isNewReconciler:!1},uF={readContext:gs,useCallback:function(c,f){return jo().memoizedState=[c,f===void 0?null:f],c},useContext:gs,useEffect:fy,useImperativeHandle:function(c,f,_){return _=_!=null?_.concat([c]):null,Sm(4194308,4,jw.bind(null,f,c),_)},useLayoutEffect:function(c,f){return Sm(4194308,4,c,f)},useInsertionEffect:function(c,f){return Sm(4,2,c,f)},useMemo:function(c,f){var _=jo();return f=f===void 0?null:f,c=c(),_.memoizedState=[c,f],c},useReducer:function(c,f,_){var M=jo();return f=_!==void 0?_(f):f,M.memoizedState=M.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},M.queue=c,c=c.dispatch=aF.bind(null,Yn,c),[M.memoizedState,c]},useRef:function(c){var f=jo();return c={current:c},f.memoizedState=c},useState:cy,useDebugValue:hy,useDeferredValue:function(c){var f=cy(c),_=f[0],M=f[1];return fy(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=cy(!1),f=c[0];return c=oF.bind(null,c[1]),jo().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,_){var M=Yn,w=jo();if(Nn){if(_===void 0)throw Error(o(407));_=_()}else{if(_=f(),li===null)throw Error(o(349));yc&30||zw(M,f,_)}w.memoizedState=_;var P={value:_,getSnapshot:f};return w.queue=P,fy(Hw.bind(null,M,P,c),[c]),M.flags|=2048,wh(9,Gw.bind(null,M,P,_,f),void 0,null),_},useId:function(){var c=jo(),f=li.identifierPrefix;if(Nn){var _=Jo,M=Xo;_=(M&~(1<<32-Sn(M)-1)).toString(32)+_,f=":"+f+"R"+_,_=Eh++,0<_&&(f+="H"+_.toString(32)),f+=":"}else _=sF++,f=":"+f+"r"+_.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},cF={readContext:gs,useCallback:Kw,useContext:gs,useEffect:Th,useImperativeHandle:Yw,useInsertionEffect:Xw,useLayoutEffect:Jw,useMemo:Qw,useReducer:xm,useRef:Ww,useState:function(){return xm(Gl)},useDebugValue:hy,useDeferredValue:function(c){var f=xm(Gl),_=f[0],M=f[1];return Th(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=xm(Gl)[0],f=yo().memoizedState;return[c,f]},useMutableSource:Uw,useSyncExternalStore:kw,useId:Zw,unstable_isNewReconciler:!1},fF={readContext:gs,useCallback:Kw,useContext:gs,useEffect:Th,useImperativeHandle:Yw,useInsertionEffect:Xw,useLayoutEffect:Jw,useMemo:Qw,useReducer:Am,useRef:Ww,useState:function(){return Am(Gl)},useDebugValue:hy,useDeferredValue:function(c){var f=Am(Gl),_=f[0],M=f[1];return Th(function(){var w=xs.transition;xs.transition={};try{M(c)}finally{xs.transition=w}},[c]),_},useTransition:function(){var c=Am(Gl)[0],f=yo().memoizedState;return[c,f]},useMutableSource:Uw,useSyncExternalStore:kw,useId:Zw,unstable_isNewReconciler:!1};function dy(c,f){try{var _="",M=f;do _+=rF(M),M=M.return;while(M);var w=_}catch(P){w=` Error generating stack: `+P.message+` -`+P.stack}return{value:c,source:f,stack:w}}function py(c,f){try{console.error(f.value)}catch(_){setTimeout(function(){throw _})}}var cF=typeof WeakMap=="function"?WeakMap:Map;function nT(c,f,_){_=Wo(-1,_),_.tag=3,_.payload={element:null};var M=f.value;return _.callback=function(){zm||(zm=!0,Iy=M),py(c,f)},_}function iT(c,f,_){_=Wo(-1,_),_.tag=3;var M=c.type.getDerivedStateFromError;if(typeof M=="function"){var w=f.value;_.payload=function(){return M(w)},_.callback=function(){py(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(_.callback=function(){py(c,f),typeof M!="function"&&(ba===null?ba=new Set([this]):ba.add(this));var J=f.stack;this.componentDidCatch(f.value,{componentStack:J!==null?J:""})}),_}function rT(c,f,_){var M=c.pingCache;if(M===null){M=c.pingCache=new cF;var w=new Set;M.set(f,w)}else w=M.get(f),w===void 0&&(w=new Set,M.set(f,w));w.has(_)||(w.add(_),c=EF.bind(null,c,f,_),f.then(c,c))}function sT(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function oT(c,f,_,M,w){return c.mode&1?(c.flags|=65536,c.lanes=w,c):(c===f?c.flags|=65536:(c.flags|=128,_.flags|=131072,_.flags&=-52805,_.tag===1&&(_.alternate===null?_.tag=17:(f=Wo(-1,1),f.tag=2,Ra(_,f))),_.lanes|=1),c)}function xo(c){c.flags|=4}function aT(c,f){if(c!==null&&c.child===f.child)return!0;if(f.flags&16)return!1;for(c=f.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var Ch,Rh,wm,Tm;if(Ne)Ch=function(c,f){for(var _=f.child;_!==null;){if(_.tag===5||_.tag===6)ce(c,_.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}},Rh=function(){},wm=function(c,f,_,M,w){if(c=c.memoizedProps,c!==M){var P=f.stateNode,J=_o(ys.current);_=ae(P,_,c,M,w,J),(f.updateQueue=_)&&xo(f)}},Tm=function(c,f,_,M){_!==M&&xo(f)};else if(Y){Ch=function(c,f,_,M){for(var w=f.child;w!==null;){if(w.tag===5){var P=w.stateNode;_&&M&&(P=ut(P,w.type,w.memoizedProps,w)),ce(c,P)}else if(w.tag===6)P=w.stateNode,_&&M&&(P=ot(P,w.memoizedProps,w)),ce(c,P);else if(w.tag!==4){if(w.tag===22&&w.memoizedState!==null)P=w.child,P!==null&&(P.return=w),Ch(c,w,!0,!0);else if(w.child!==null){w.child.return=w,w=w.child;continue}}if(w===f)break;for(;w.sibling===null;){if(w.return===null||w.return===f)return;w=w.return}w.sibling.return=w.return,w=w.sibling}};var lT=function(c,f,_,M){for(var w=f.child;w!==null;){if(w.tag===5){var P=w.stateNode;_&&M&&(P=ut(P,w.type,w.memoizedProps,w)),Je(c,P)}else if(w.tag===6)P=w.stateNode,_&&M&&(P=ot(P,w.memoizedProps,w)),Je(c,P);else if(w.tag!==4){if(w.tag===22&&w.memoizedState!==null)P=w.child,P!==null&&(P.return=w),lT(c,w,!0,!0);else if(w.child!==null){w.child.return=w,w=w.child;continue}}if(w===f)break;for(;w.sibling===null;){if(w.return===null||w.return===f)return;w=w.return}w.sibling.return=w.return,w=w.sibling}};Rh=function(c,f){var _=f.stateNode;if(!aT(c,f)){c=_.containerInfo;var M=Ve(c);lT(M,f,!1,!1),_.pendingChildren=M,xo(f),Mt(c,M)}},wm=function(c,f,_,M,w){var P=c.stateNode,J=c.memoizedProps;if((c=aT(c,f))&&J===M)f.stateNode=P;else{var le=f.stateNode,Te=_o(ys.current),$e=null;J!==M&&($e=ae(le,_,J,M,w,Te)),c&&$e===null?f.stateNode=P:(P=pe(P,$e,_,J,M,f,c,le),Be(P,_,M,w,Te)&&xo(f),f.stateNode=P,c?xo(f):Ch(P,f,!1,!1))}},Tm=function(c,f,_,M){_!==M?(c=_o(vc.current),_=_o(ys.current),f.stateNode=Se(M,c,_,f),xo(f)):f.stateNode=c.stateNode}}else Rh=function(){},wm=function(){},Tm=function(){};function bh(c,f){if(!Nn)switch(c.tailMode){case"hidden":f=c.tail;for(var _=null;f!==null;)f.alternate!==null&&(_=f),f=f.sibling;_===null?c.tail=null:_.sibling=null;break;case"collapsed":_=c.tail;for(var M=null;_!==null;)_.alternate!==null&&(M=_),_=_.sibling;M===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:M.sibling=null}}function Vi(c){var f=c.alternate!==null&&c.alternate.child===c.child,_=0,M=0;if(f)for(var w=c.child;w!==null;)_|=w.lanes|w.childLanes,M|=w.subtreeFlags&14680064,M|=w.flags&14680064,w.return=c,w=w.sibling;else for(w=c.child;w!==null;)_|=w.lanes|w.childLanes,M|=w.subtreeFlags,M|=w.flags,w.return=c,w=w.sibling;return c.subtreeFlags|=M,c.childLanes=_,f}function fF(c,f,_){var M=f.pendingProps;switch($_(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vi(f),null;case 1:return Dn(f.type)&&sn(),Vi(f),null;case 3:return M=f.stateNode,_c(),rt(Nt),rt(Pt),oy(),M.pendingContext&&(M.context=M.pendingContext,M.pendingContext=null),(c===null||c.child===null)&&(yh(f)?xo(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,Js!==null&&(Ny(Js),Js=null))),Rh(c,f),Vi(f),null;case 5:ry(f),_=_o(vc.current);var w=f.type;if(c!==null&&f.stateNode!=null)wm(c,f,w,M,_),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!M){if(f.stateNode===null)throw Error(o(166));return Vi(f),null}if(c=_o(ys.current),yh(f)){if(!Ae)throw Error(o(175));c=D(f.stateNode,f.type,f.memoizedProps,_,c,f,!_h),f.updateQueue=c,c!==null&&xo(f)}else{var P=ee(w,M,_,c,f);Ch(P,f,!1,!1),f.stateNode=P,Be(P,w,M,_,c)&&xo(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Vi(f),null;case 6:if(c&&f.stateNode!=null)Tm(c,f,c.memoizedProps,M);else{if(typeof M!="string"&&f.stateNode===null)throw Error(o(166));if(c=_o(vc.current),_=_o(ys.current),yh(f)){if(!Ae)throw Error(o(176));if(c=f.stateNode,M=f.memoizedProps,(_=k(c,M,f,!_h))&&(w=Vr,w!==null))switch(P=(w.mode&1)!==0,w.tag){case 3:ye(w.stateNode.containerInfo,c,M,P);break;case 5:we(w.type,w.memoizedProps,w.stateNode,c,M,P)}_&&xo(f)}else f.stateNode=Se(M,c,_,f)}return Vi(f),null;case 13:if(rt(kn),M=f.memoizedState,Nn&&Wr!==null&&f.mode&1&&!(f.flags&128)){for(c=Wr;c;)c=Dt(c);return mc(),f.flags|=98560,f}if(M!==null&&M.dehydrated!==null){if(M=yh(f),c===null){if(!M)throw Error(o(318));if(!Ae)throw Error(o(344));if(c=f.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));q(c,f)}else mc(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;return Vi(f),null}return Js!==null&&(Ny(Js),Js=null),f.flags&128?(f.lanes=_,f):(M=M!==null,_=!1,c===null?yh(f):_=c.memoizedState!==null,M&&!_&&(f.child.flags|=8192,f.mode&1&&(c===null||kn.current&1?gi===0&&(gi=3):Oy())),f.updateQueue!==null&&(f.flags|=4),Vi(f),null);case 4:return _c(),Rh(c,f),c===null&&Fe(f.stateNode.containerInfo),Vi(f),null;case 10:return j_(f.type._context),Vi(f),null;case 17:return Dn(f.type)&&sn(),Vi(f),null;case 19:if(rt(kn),w=f.memoizedState,w===null)return Vi(f),null;if(M=(f.flags&128)!==0,P=w.rendering,P===null)if(M)bh(w,!1);else{if(gi!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=vm(c),P!==null){for(f.flags|=128,bh(w,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=_,M=f.child;M!==null;)_=M,w=c,_.flags&=14680066,P=_.alternate,P===null?(_.childLanes=0,_.lanes=w,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=P.childLanes,_.lanes=P.lanes,_.child=P.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=P.memoizedProps,_.memoizedState=P.memoizedState,_.updateQueue=P.updateQueue,_.type=P.type,w=P.dependencies,_.dependencies=w===null?null:{lanes:w.lanes,firstContext:w.firstContext}),M=M.sibling;return qe(kn,kn.current&1|2),f.child}c=c.sibling}w.tail!==null&&Mi()>By&&(f.flags|=128,M=!0,bh(w,!1),f.lanes=4194304)}else{if(!M)if(c=vm(P),c!==null){if(f.flags|=128,M=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),bh(w,!0),w.tail===null&&w.tailMode==="hidden"&&!P.alternate&&!Nn)return Vi(f),null}else 2*Mi()-w.renderingStartTime>By&&_!==1073741824&&(f.flags|=128,M=!0,bh(w,!1),f.lanes=4194304);w.isBackwards?(P.sibling=f.child,f.child=P):(c=w.last,c!==null?c.sibling=P:f.child=P,w.last=P)}return w.tail!==null?(f=w.tail,w.rendering=f,w.tail=f.sibling,w.renderingStartTime=Mi(),f.sibling=null,c=kn.current,qe(kn,M?c&1|2:c&1),f):(Vi(f),null);case 22:case 23:return Fy(),M=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(f.flags|=8192),M&&f.mode&1?Jr&1073741824&&(Vi(f),Ne&&f.subtreeFlags&6&&(f.flags|=8192)):Vi(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var hF=a.ReactCurrentOwner,Xr=!1;function ur(c,f,_,M){f.child=c===null?Fw(f,null,_,M):gc(f,c.child,_,M)}function uT(c,f,_,M,w){_=_.render;var P=f.ref;return hc(f,w),M=ly(c,f,_,M,P,w),_=uy(),c!==null&&!Xr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Yo(c,f,w)):(Nn&&_&&q_(f),f.flags|=1,ur(c,f,M,w),f.child)}function cT(c,f,_,M,w){if(c===null){var P=_.type;return typeof P=="function"&&!Uy(P)&&P.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(f.tag=15,f.type=P,fT(c,f,P,M,w)):(c=jm(_.type,null,M,f,f.mode,w),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&w)){var J=P.memoizedProps;if(_=_.compare,_=_!==null?_:lm,_(J,M)&&c.ref===f.ref)return Yo(c,f,w)}return f.flags|=1,c=La(P,M),c.ref=f.ref,c.return=f,f.child=c}function fT(c,f,_,M,w){if(c!==null&&lm(c.memoizedProps,M)&&c.ref===f.ref)if(Xr=!1,(c.lanes&w)!==0)c.flags&131072&&(Xr=!0);else return f.lanes=c.lanes,Yo(c,f,w);return my(c,f,_,M,w)}function hT(c,f,_){var M=f.pendingProps,w=M.children,P=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},qe(xc,Jr),Jr|=_;else if(_&1073741824)f.memoizedState={baseLanes:0,cachePool:null},M=P!==null?P.baseLanes:_,qe(xc,Jr),Jr|=M;else return c=P!==null?P.baseLanes|_:_,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null},f.updateQueue=null,qe(xc,Jr),Jr|=c,null;else P!==null?(M=P.baseLanes|_,f.memoizedState=null):M=_,qe(xc,Jr),Jr|=M;return ur(c,f,w,_),f.child}function dT(c,f){var _=f.ref;(c===null&&_!==null||c!==null&&c.ref!==_)&&(f.flags|=512,f.flags|=2097152)}function my(c,f,_,M,w){var P=Dn(_)?gn:Pt.current;return P=jn(f,P),hc(f,w),_=ly(c,f,_,M,P,w),M=uy(),c!==null&&!Xr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Yo(c,f,w)):(Nn&&M&&q_(f),f.flags|=1,ur(c,f,_,w),f.child)}function pT(c,f,_,M,w){if(Dn(_)){var P=!0;Gt(f)}else P=!1;if(hc(f,w),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),Rw(f,_,M),Z_(f,_,M,w),M=!0;else if(c===null){var J=f.stateNode,le=f.memoizedProps;J.props=le;var Te=J.context,$e=_.contextType;typeof $e=="object"&&$e!==null?$e=gs($e):($e=Dn(_)?gn:Pt.current,$e=jn(f,$e));var gt=_.getDerivedStateFromProps,Ut=typeof gt=="function"||typeof J.getSnapshotBeforeUpdate=="function";Ut||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==M||Te!==$e)&&bw(f,J,M,$e),Ca=!1;var Bt=f.memoizedState;J.state=Bt,hm(f,M,J,w),Te=f.memoizedState,le!==M||Bt!==Te||Nt.current||Ca?(typeof gt=="function"&&(Q_(f,_,gt,M),Te=f.memoizedState),(le=Ca||Cw(f,_,le,M,Bt,Te,$e))?(Ut||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(f.flags|=4194308)):(typeof J.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=Te),J.props=M,J.state=Te,J.context=$e,M=le):(typeof J.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{J=f.stateNode,Mw(c,f),le=f.memoizedProps,$e=f.type===f.elementType?le:Xs(f.type,le),J.props=$e,Ut=f.pendingProps,Bt=J.context,Te=_.contextType,typeof Te=="object"&&Te!==null?Te=gs(Te):(Te=Dn(_)?gn:Pt.current,Te=jn(f,Te));var xn=_.getDerivedStateFromProps;(gt=typeof xn=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==Ut||Bt!==Te)&&bw(f,J,M,Te),Ca=!1,Bt=f.memoizedState,J.state=Bt,hm(f,M,J,w);var Ct=f.memoizedState;le!==Ut||Bt!==Ct||Nt.current||Ca?(typeof xn=="function"&&(Q_(f,_,xn,M),Ct=f.memoizedState),($e=Ca||Cw(f,_,$e,M,Bt,Ct,Te)||!1)?(gt||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(M,Ct,Te),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(M,Ct,Te)),typeof J.componentDidUpdate=="function"&&(f.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof J.componentDidUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=Ct),J.props=M,J.state=Ct,J.context=Te,M=$e):(typeof J.componentDidUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=1024),M=!1)}return gy(c,f,_,M,P,w)}function gy(c,f,_,M,w,P){dT(c,f);var J=(f.flags&128)!==0;if(!M&&!J)return w&&$t(f,_,!1),Yo(c,f,P);M=f.stateNode,hF.current=f;var le=J&&typeof _.getDerivedStateFromError!="function"?null:M.render();return f.flags|=1,c!==null&&J?(f.child=gc(f,c.child,null,P),f.child=gc(f,null,le,P)):ur(c,f,le,P),f.memoizedState=M.state,w&&$t(f,_,!0),f.child}function mT(c){var f=c.stateNode;f.pendingContext?Yt(c,f.pendingContext,f.pendingContext!==f.context):f.context&&Yt(c,f.context,!1),iy(c,f.containerInfo)}function gT(c,f,_,M,w){return mc(),ny(w),f.flags|=256,ur(c,f,_,M),f.child}var Cm={dehydrated:null,treeContext:null,retryLane:0};function Rm(c){return{baseLanes:c,cachePool:null}}function vT(c,f,_){var M=f.pendingProps,w=kn.current,P=!1,J=(f.flags&128)!==0,le;if((le=J)||(le=c!==null&&c.memoizedState===null?!1:(w&2)!==0),le?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),qe(kn,w&1),c===null)return ty(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?It(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(w=M.children,c=M.fallback,P?(M=f.mode,P=f.child,w={mode:"hidden",children:w},!(M&1)&&P!==null?(P.childLanes=0,P.pendingProps=w):P=Ym(w,M,0,null),c=Jl(c,M,_,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=Rm(_),f.memoizedState=Cm,c):vy(f,w));if(w=c.memoizedState,w!==null){if(le=w.dehydrated,le!==null){if(J)return f.flags&256?(f.flags&=-257,bm(c,f,_,Error(o(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=M.fallback,w=f.mode,M=Ym({mode:"visible",children:M.children},w,0,null),P=Jl(P,w,_,null),P.flags|=2,M.return=f,P.return=f,M.sibling=P,f.child=M,f.mode&1&&gc(f,c.child,null,_),f.child.memoizedState=Rm(_),f.memoizedState=Cm,P);if(!(f.mode&1))f=bm(c,f,_,null);else if(It(le))f=bm(c,f,_,Error(o(419)));else if(M=(_&c.childLanes)!==0,Xr||M){if(M=ai,M!==null){switch(_&-_){case 4:P=2;break;case 16:P=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:P=32;break;case 536870912:P=268435456;break;default:P=0}M=P&(M.suspendedLanes|_)?0:P,M!==0&&M!==w.retryLane&&(w.retryLane=M,As(c,M,-1))}Oy(),f=bm(c,f,_,Error(o(421)))}else xt(le)?(f.flags|=128,f.child=c.child,f=wF.bind(null,c),dn(le,f),f=null):(_=w.treeContext,Ae&&(Wr=mn(le),Vr=f,Nn=!0,Js=null,_h=!1,_!==null&&(vs[_s++]=Xo,vs[_s++]=Jo,vs[_s++]=Ul,Xo=_.id,Jo=_.overflow,Ul=f)),f=vy(f,f.pendingProps.children),f.flags|=4096);return f}return P?(M=yT(c,f,M.children,M.fallback,_),P=f.child,w=c.child.memoizedState,P.memoizedState=w===null?Rm(_):{baseLanes:w.baseLanes|_,cachePool:null},P.childLanes=c.childLanes&~_,f.memoizedState=Cm,M):(_=_T(c,f,M.children,_),f.memoizedState=null,_)}return P?(M=yT(c,f,M.children,M.fallback,_),P=f.child,w=c.child.memoizedState,P.memoizedState=w===null?Rm(_):{baseLanes:w.baseLanes|_,cachePool:null},P.childLanes=c.childLanes&~_,f.memoizedState=Cm,M):(_=_T(c,f,M.children,_),f.memoizedState=null,_)}function vy(c,f){return f=Ym({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function _T(c,f,_,M){var w=c.child;return c=w.sibling,_=La(w,{mode:"visible",children:_}),!(f.mode&1)&&(_.lanes=M),_.return=f,_.sibling=null,c!==null&&(M=f.deletions,M===null?(f.deletions=[c],f.flags|=16):M.push(c)),f.child=_}function yT(c,f,_,M,w){var P=f.mode;c=c.child;var J=c.sibling,le={mode:"hidden",children:_};return!(P&1)&&f.child!==c?(_=f.child,_.childLanes=0,_.pendingProps=le,f.deletions=null):(_=La(c,le),_.subtreeFlags=c.subtreeFlags&14680064),J!==null?M=La(J,M):(M=Jl(M,P,w,null),M.flags|=2),M.return=f,_.return=f,_.sibling=M,f.child=_,M}function bm(c,f,_,M){return M!==null&&ny(M),gc(f,c.child,null,_),c=vy(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function xT(c,f,_){c.lanes|=f;var M=c.alternate;M!==null&&(M.lanes|=f),Y_(c.return,f,_)}function _y(c,f,_,M,w){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:_,tailMode:w}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=M,P.tail=_,P.tailMode=w)}function AT(c,f,_){var M=f.pendingProps,w=M.revealOrder,P=M.tail;if(ur(c,f,M.children,_),M=kn.current,M&2)M=M&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&xT(c,_,f);else if(c.tag===19)xT(c,_,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(qe(kn,M),!(f.mode&1))f.memoizedState=null;else switch(w){case"forwards":for(_=f.child,w=null;_!==null;)c=_.alternate,c!==null&&vm(c)===null&&(w=_),_=_.sibling;_=w,_===null?(w=f.child,f.child=null):(w=_.sibling,_.sibling=null),_y(f,!1,w,_,P);break;case"backwards":for(_=null,w=f.child,f.child=null;w!==null;){if(c=w.alternate,c!==null&&vm(c)===null){f.child=w;break}c=w.sibling,w.sibling=_,_=w,w=c}_y(f,!0,_,null,P);break;case"together":_y(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Yo(c,f,_){if(c!==null&&(f.dependencies=c.dependencies),Ac|=f.lanes,!(_&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(o(153));if(f.child!==null){for(c=f.child,_=La(c,c.pendingProps),f.child=_,_.return=f;c.sibling!==null;)c=c.sibling,_=_.sibling=La(c,c.pendingProps),_.return=f;_.sibling=null}return f.child}function dF(c,f,_){switch(f.tag){case 3:mT(f),mc();break;case 5:Ow(f);break;case 1:Dn(f.type)&&Gt(f);break;case 4:iy(f,f.stateNode.containerInfo);break;case 10:Sw(f,f.type._context,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(qe(kn,kn.current&1),f.flags|=128,null):_&f.child.childLanes?vT(c,f,_):(qe(kn,kn.current&1),c=Yo(c,f,_),c!==null?c.sibling:null);qe(kn,kn.current&1);break;case 19:if(M=(_&f.childLanes)!==0,c.flags&128){if(M)return AT(c,f,_);f.flags|=128}var w=f.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),qe(kn,kn.current),M)break;return null;case 22:case 23:return f.lanes=0,hT(c,f,_)}return Yo(c,f,_)}function pF(c,f){switch($_(f),f.tag){case 1:return Dn(f.type)&&sn(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return _c(),rt(Nt),rt(Pt),oy(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return ry(f),null;case 13:if(rt(kn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(o(340));mc()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return rt(kn),null;case 4:return _c(),null;case 10:return j_(f.type._context),null;case 22:case 23:return Fy(),null;case 24:return null;default:return null}}var Pm=!1,Gl=!1,mF=typeof WeakSet=="function"?WeakSet:Set,st=null;function Bm(c,f){var _=c.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(M){br(c,f,M)}else _.current=null}function yy(c,f,_){try{_()}catch(M){br(c,f,M)}}var ST=!1;function gF(c,f){for(V(c.containerInfo),st=f;st!==null;)if(c=st,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,st=f;else for(;st!==null;){c=st;try{var _=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var M=_.memoizedProps,w=_.memoizedState,P=c.stateNode,J=P.getSnapshotBeforeUpdate(c.elementType===c.type?M:Xs(c.type,M),w);P.__reactInternalSnapshotBeforeUpdate=J}break;case 3:Ne&&He(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(le){br(c,c.return,le)}if(f=c.sibling,f!==null){f.return=c.return,st=f;break}st=c.return}return _=ST,ST=!1,_}function Hl(c,f,_){var M=f.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var w=M=M.next;do{if((w.tag&c)===c){var P=w.destroy;w.destroy=void 0,P!==void 0&&yy(f,_,P)}w=w.next}while(w!==M)}}function Ph(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var _=f=f.next;do{if((_.tag&c)===c){var M=_.create;_.destroy=M()}_=_.next}while(_!==f)}}function xy(c){var f=c.ref;if(f!==null){var _=c.stateNode;switch(c.tag){case 5:c=$(_);break;default:c=_}typeof f=="function"?f(c):f.current=c}}function MT(c,f,_){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(om,f)}catch{}switch(f.tag){case 0:case 11:case 14:case 15:if(c=f.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var w=M,P=w.destroy;w=w.tag,P!==void 0&&(w&2||w&4)&&yy(f,_,P),M=M.next}while(M!==c)}break;case 1:if(Bm(f,_),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(J){br(f,_,J)}break;case 5:Bm(f,_);break;case 4:Ne?bT(c,f,_):Y&&Y&&(f=f.stateNode.containerInfo,_=Ve(f),Ot(f,_))}}function ET(c,f,_){for(var M=f;;)if(MT(c,M,_),M.child===null||Ne&&M.tag===4){if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function wT(c){var f=c.alternate;f!==null&&(c.alternate=null,wT(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&re(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function TT(c){return c.tag===5||c.tag===3||c.tag===4}function CT(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||TT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function RT(c){if(Ne){e:{for(var f=c.return;f!==null;){if(TT(f))break e;f=f.return}throw Error(o(160))}var _=f;switch(_.tag){case 5:f=_.stateNode,_.flags&32&&(de(f),_.flags&=-33),_=CT(c),Sy(c,_,f);break;case 3:case 4:f=_.stateNode.containerInfo,_=CT(c),Ay(c,_,f);break;default:throw Error(o(161))}}}function Ay(c,f,_){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?pt(_,c,f):Ge(_,c);else if(M!==4&&(c=c.child,c!==null))for(Ay(c,f,_),c=c.sibling;c!==null;)Ay(c,f,_),c=c.sibling}function Sy(c,f,_){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?qt(_,c,f):ct(_,c);else if(M!==4&&(c=c.child,c!==null))for(Sy(c,f,_),c=c.sibling;c!==null;)Sy(c,f,_),c=c.sibling}function bT(c,f,_){for(var M=f,w=!1,P,J;;){if(!w){w=M.return;e:for(;;){if(w===null)throw Error(o(160));switch(P=w.stateNode,w.tag){case 5:J=!1;break e;case 3:P=P.containerInfo,J=!0;break e;case 4:P=P.containerInfo,J=!0;break e}w=w.return}w=!0}if(M.tag===5||M.tag===6)ET(c,M,_),J?Z(P,M.stateNode):ht(P,M.stateNode);else if(M.tag===18)J?j(P,M.stateNode):Q(P,M.stateNode);else if(M.tag===4){if(M.child!==null){P=M.stateNode.containerInfo,J=!0,M.child.return=M,M=M.child;continue}}else if(MT(c,M,_),M.child!==null){M.child.return=M,M=M.child;continue}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return,M.tag===4&&(w=!1)}M.sibling.return=M.return,M=M.sibling}}function My(c,f){if(Ne){switch(f.tag){case 0:case 11:case 14:case 15:Hl(3,f,f.return),Ph(3,f),Hl(5,f,f.return);return;case 1:return;case 5:var _=f.stateNode;if(_!=null){var M=f.memoizedProps;c=c!==null?c.memoizedProps:M;var w=f.type,P=f.updateQueue;f.updateQueue=null,P!==null&&Oe(_,P,w,c,M,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));_=f.memoizedProps,Ke(f.stateNode,c!==null?c.memoizedProps:_,_);return;case 3:Ae&&c!==null&&c.memoizedState.isDehydrated&&z(f.stateNode.containerInfo);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:Hl(3,f,f.return),Ph(3,f),Hl(5,f,f.return);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 3:Ae&&c!==null&&c.memoizedState.isDehydrated&&z(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(Y){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Ot(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function Im(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var _=c.stateNode;_===null&&(_=c.stateNode=new mF),f.forEach(function(M){var w=TF.bind(null,c,M);_.has(M)||(_.add(M),M.then(w,w))})}}function vF(c,f){for(st=f;st!==null;){f=st;var _=f.deletions;if(_!==null)for(var M=0;M<_.length;M++){var w=_[M];try{var P=c;Ne?bT(P,w,f):ET(P,w,f);var J=w.alternate;J!==null&&(J.return=null),w.return=null}catch(wt){br(w,f,wt)}}if(_=f.child,f.subtreeFlags&12854&&_!==null)_.return=f,st=_;else for(;st!==null;){f=st;try{var le=f.flags;if(le&32&&Ne&&de(f.stateNode),le&512){var Te=f.alternate;if(Te!==null){var $e=Te.ref;$e!==null&&(typeof $e=="function"?$e(null):$e.current=null)}}if(le&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var gt=f.alternate;(gt===null||gt.memoizedState===null)&&(Py=Mi())}break;case 22:var Ut=f.memoizedState!==null,Bt=f.alternate,xn=Bt!==null&&Bt.memoizedState!==null;if(_=f,Ne){e:if(M=_,w=Ut,P=null,Ne)for(var Ct=M;;){if(Ct.tag===5){if(P===null){P=Ct;var Wi=Ct.stateNode;w?Ue(Wi):Pe(Ct.stateNode,Ct.memoizedProps)}}else if(Ct.tag===6){if(P===null){var Ms=Ct.stateNode;w?Le(Ms):ie(Ms,Ct.memoizedProps)}}else if((Ct.tag!==22&&Ct.tag!==23||Ct.memoizedState===null||Ct===M)&&Ct.child!==null){Ct.child.return=Ct,Ct=Ct.child;continue}if(Ct===M)break;for(;Ct.sibling===null;){if(Ct.return===null||Ct.return===M)break e;P===Ct&&(P=null),Ct=Ct.return}P===Ct&&(P=null),Ct.sibling.return=Ct.return,Ct=Ct.sibling}}if(Ut&&!xn&&_.mode&1){st=_;for(var me=_.child;me!==null;){for(_=st=me;st!==null;){M=st;var ue=M.child;switch(M.tag){case 0:case 11:case 14:case 15:Hl(4,M,M.return);break;case 1:Bm(M,M.return);var Ee=M.stateNode;if(typeof Ee.componentWillUnmount=="function"){var at=M.return;try{Ee.props=M.memoizedProps,Ee.state=M.memoizedState,Ee.componentWillUnmount()}catch(wt){br(M,at,wt)}}break;case 5:Bm(M,M.return);break;case 22:if(M.memoizedState!==null){IT(_);continue}}ue!==null?(ue.return=M,st=ue):IT(_)}me=me.sibling}}}switch(le&4102){case 2:RT(f),f.flags&=-3;break;case 6:RT(f),f.flags&=-3,My(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,My(f.alternate,f);break;case 4:My(f.alternate,f)}}catch(wt){br(f,f.return,wt)}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}}function _F(c,f,_){st=c,PT(c)}function PT(c,f,_){for(var M=(c.mode&1)!==0;st!==null;){var w=st,P=w.child;if(w.tag===22&&M){var J=w.memoizedState!==null||Pm;if(!J){var le=w.alternate,Te=le!==null&&le.memoizedState!==null||Gl;le=Pm;var $e=Gl;if(Pm=J,(Gl=Te)&&!$e)for(st=w;st!==null;)J=st,Te=J.child,J.tag===22&&J.memoizedState!==null?LT(w):Te!==null?(Te.return=J,st=Te):LT(w);for(;P!==null;)st=P,PT(P),P=P.sibling;st=w,Pm=le,Gl=$e}BT(c)}else w.subtreeFlags&8772&&P!==null?(P.return=w,st=P):BT(c)}}function BT(c){for(;st!==null;){var f=st;if(f.flags&8772){var _=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Gl||Ph(5,f);break;case 1:var M=f.stateNode;if(f.flags&4&&!Gl)if(_===null)M.componentDidMount();else{var w=f.elementType===f.type?_.memoizedProps:Xs(f.type,_.memoizedProps);M.componentDidUpdate(w,_.memoizedState,M.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&ww(f,P,M);break;case 3:var J=f.updateQueue;if(J!==null){if(_=null,f.child!==null)switch(f.child.tag){case 5:_=$(f.child.stateNode);break;case 1:_=f.child.stateNode}ww(f,J,_)}break;case 5:var le=f.stateNode;_===null&&f.flags&4&&Rt(le,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ae&&f.memoizedState===null){var Te=f.alternate;if(Te!==null){var $e=Te.memoizedState;if($e!==null){var gt=$e.dehydrated;gt!==null&&X(gt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}Gl||f.flags&512&&xy(f)}catch(Ut){br(f,f.return,Ut)}}if(f===c){st=null;break}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}function IT(c){for(;st!==null;){var f=st;if(f===c){st=null;break}var _=f.sibling;if(_!==null){_.return=f.return,st=_;break}st=f.return}}function LT(c){for(;st!==null;){var f=st;try{switch(f.tag){case 0:case 11:case 15:var _=f.return;try{Ph(4,f)}catch(Te){br(f,_,Te)}break;case 1:var M=f.stateNode;if(typeof M.componentDidMount=="function"){var w=f.return;try{M.componentDidMount()}catch(Te){br(f,w,Te)}}var P=f.return;try{xy(f)}catch(Te){br(f,P,Te)}break;case 5:var J=f.return;try{xy(f)}catch(Te){br(f,J,Te)}}}catch(Te){br(f,f.return,Te)}if(f===c){st=null;break}var le=f.sibling;if(le!==null){le.return=f.return,st=le;break}st=f.return}}var Lm=0,Dm=1,Nm=2,Fm=3,Om=4;if(typeof Symbol=="function"&&Symbol.for){var Bh=Symbol.for;Lm=Bh("selector.component"),Dm=Bh("selector.has_pseudo_class"),Nm=Bh("selector.role"),Fm=Bh("selector.test_id"),Om=Bh("selector.text")}function Ey(c){var f=ge(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(o(364));return f}if(c=H(c),c===null)throw Error(o(362));return c.stateNode.current}function wy(c,f){switch(f.$$typeof){case Lm:if(c.type===f.value)return!0;break;case Dm:e:{f=f.value,c=[c,0];for(var _=0;_";case Dm:return":has("+(Ty(c)||"")+")";case Nm:return'[role="'+c.value+'"]';case Om:return'"'+c.value+'"';case Fm:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function DT(c,f){var _=[];c=[c,0];for(var M=0;Mw&&(w=J),M&=~P}if(M=w,M=Mi()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*yF(M/1960))-M,10c?16:c,Pa===null)var M=!1;else{if(c=Pa,Pa=null,Hm=0,jt&6)throw Error(o(331));var w=jt;for(jt|=4,st=c.current;st!==null;){var P=st,J=P.child;if(st.flags&16){var le=P.deletions;if(le!==null){for(var Te=0;TeMi()-Py?Vl(c,0):by|=_),Rr(c,f)}function VT(c,f){f===0&&(c.mode&1?(f=rm,rm<<=1,!(rm&130023424)&&(rm=4194304)):f=1);var _=cr();c=Xm(c,f),c!==null&&(vh(c,f,_),Rr(c,_))}function wF(c){var f=c.memoizedState,_=0;f!==null&&(_=f.retryLane),VT(c,_)}function TF(c,f){var _=0;switch(c.tag){case 13:var M=c.stateNode,w=c.memoizedState;w!==null&&(_=w.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(f),VT(c,_)}var WT;WT=function(c,f,_){if(c!==null)if(c.memoizedProps!==f.pendingProps||Nt.current)Xr=!0;else{if(!(c.lanes&_)&&!(f.flags&128))return Xr=!1,dF(c,f,_);Xr=!!(c.flags&131072)}else Xr=!1,Nn&&f.flags&1048576&&Pw(f,mm,f.index);switch(f.lanes=0,f.tag){case 2:var M=f.type;c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps;var w=jn(f,Pt.current);hc(f,_),w=ly(null,f,M,c,w,_);var P=uy();return f.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Dn(M)?(P=!0,Gt(f)):P=!1,f.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,K_(f),w.updater=dm,f.stateNode=w,w._reactInternals=f,Z_(f,M,c,_),f=gy(null,f,M,!0,P,_)):(f.tag=0,Nn&&P&&q_(f),ur(null,f,w,_),f=f.child),f;case 16:M=f.elementType;e:{switch(c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps,w=M._init,M=w(M._payload),f.type=M,w=f.tag=RF(M),c=Xs(M,c),w){case 0:f=my(null,f,M,c,_);break e;case 1:f=pT(null,f,M,c,_);break e;case 11:f=uT(null,f,M,c,_);break e;case 14:f=cT(null,f,M,Xs(M.type,c),_);break e}throw Error(o(306,M,""))}return f;case 0:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),my(c,f,M,w,_);case 1:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),pT(c,f,M,w,_);case 3:e:{if(mT(f),c===null)throw Error(o(387));M=f.pendingProps,P=f.memoizedState,w=P.element,Mw(c,f),hm(f,M,null,_);var J=f.memoizedState;if(M=J.element,Ae&&P.isDehydrated)if(P={element:M,isDehydrated:!1,cache:J.cache,transitions:J.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){w=Error(o(423)),f=gT(c,f,M,_,w);break e}else if(M!==w){w=Error(o(424)),f=gT(c,f,M,_,w);break e}else for(Ae&&(Wr=Ln(f.stateNode.containerInfo),Vr=f,Nn=!0,Js=null,_h=!1),_=Fw(f,null,M,_),f.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(mc(),M===w){f=Yo(c,f,_);break e}ur(c,f,M,_)}f=f.child}return f;case 5:return Ow(f),c===null&&ty(f),M=f.type,w=f.pendingProps,P=c!==null?c.memoizedProps:null,J=w.children,xe(M,w)?J=null:P!==null&&xe(M,P)&&(f.flags|=32),dT(c,f),ur(c,f,J,_),f.child;case 6:return c===null&&ty(f),null;case 13:return vT(c,f,_);case 4:return iy(f,f.stateNode.containerInfo),M=f.pendingProps,c===null?f.child=gc(f,null,M,_):ur(c,f,M,_),f.child;case 11:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),uT(c,f,M,w,_);case 7:return ur(c,f,f.pendingProps,_),f.child;case 8:return ur(c,f,f.pendingProps.children,_),f.child;case 12:return ur(c,f,f.pendingProps.children,_),f.child;case 10:e:{if(M=f.type._context,w=f.pendingProps,P=f.memoizedProps,J=w.value,Sw(f,M,J),P!==null)if(mo(P.value,J)){if(P.children===w.children&&!Nt.current){f=Yo(c,f,_);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var le=P.dependencies;if(le!==null){J=P.child;for(var Te=le.firstContext;Te!==null;){if(Te.context===M){if(P.tag===1){Te=Wo(-1,_&-_),Te.tag=2;var $e=P.updateQueue;if($e!==null){$e=$e.shared;var gt=$e.pending;gt===null?Te.next=Te:(Te.next=gt.next,gt.next=Te),$e.pending=Te}}P.lanes|=_,Te=P.alternate,Te!==null&&(Te.lanes|=_),Y_(P.return,_,f),le.lanes|=_;break}Te=Te.next}}else if(P.tag===10)J=P.type===f.type?null:P.child;else if(P.tag===18){if(J=P.return,J===null)throw Error(o(341));J.lanes|=_,le=J.alternate,le!==null&&(le.lanes|=_),Y_(J,_,f),J=P.sibling}else J=P.child;if(J!==null)J.return=P;else for(J=P;J!==null;){if(J===f){J=null;break}if(P=J.sibling,P!==null){P.return=J.return,J=P;break}J=J.return}P=J}ur(c,f,w.children,_),f=f.child}return f;case 9:return w=f.type,M=f.pendingProps.children,hc(f,_),w=gs(w),M=M(w),f.flags|=1,ur(c,f,M,_),f.child;case 14:return M=f.type,w=Xs(M,f.pendingProps),w=Xs(M.type,w),cT(c,f,M,w,_);case 15:return fT(c,f,f.type,f.pendingProps,_);case 17:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,Dn(M)?(c=!0,Gt(f)):c=!1,hc(f,_),Rw(f,M,w),Z_(f,M,w,_),gy(null,f,M,!0,c,_);case 19:return AT(c,f,_);case 22:return hT(c,f,_)}throw Error(o(156,f.tag))};function XT(c,f){return G_(c,f)}function CF(c,f,_,M){this.tag=c,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=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(c,f,_,M){return new CF(c,f,_,M)}function Uy(c){return c=c.prototype,!(!c||!c.isReactComponent)}function RF(c){if(typeof c=="function")return Uy(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===S)return 14}return 2}function La(c,f){var _=c.alternate;return _===null?(_=Ss(c.tag,f,c.key,c.mode),_.elementType=c.elementType,_.type=c.type,_.stateNode=c.stateNode,_.alternate=c,c.alternate=_):(_.pendingProps=f,_.type=c.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=c.flags&14680064,_.childLanes=c.childLanes,_.lanes=c.lanes,_.child=c.child,_.memoizedProps=c.memoizedProps,_.memoizedState=c.memoizedState,_.updateQueue=c.updateQueue,f=c.dependencies,_.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},_.sibling=c.sibling,_.index=c.index,_.ref=c.ref,_}function jm(c,f,_,M,w,P){var J=2;if(M=c,typeof c=="function")Uy(c)&&(J=1);else if(typeof c=="string")J=5;else e:switch(c){case h:return Jl(_.children,w,P,f);case d:J=8,w|=8;break;case p:return c=Ss(12,_,f,w|2),c.elementType=p,c.lanes=P,c;case y:return c=Ss(13,_,f,w),c.elementType=y,c.lanes=P,c;case g:return c=Ss(19,_,f,w),c.elementType=g,c.lanes=P,c;case E:return Ym(_,w,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:J=10;break e;case v:J=9;break e;case x:J=11;break e;case S:J=14;break e;case A:J=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return f=Ss(J,_,f,w),f.elementType=c,f.type=M,f.lanes=P,f}function Jl(c,f,_,M){return c=Ss(7,c,M,f),c.lanes=_,c}function Ym(c,f,_,M){return c=Ss(22,c,M,f),c.elementType=E,c.lanes=_,c.stateNode={},c}function ky(c,f,_){return c=Ss(6,c,null,f),c.lanes=_,c}function zy(c,f,_){return f=Ss(4,c.children!==null?c.children:[],c.key,f),f.lanes=_,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function bF(c,f,_,M,w){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k_(0),this.expirationTimes=k_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k_(0),this.identifierPrefix=M,this.onRecoverableError=w,Ae&&(this.mutableSourceEagerHydrationData=null)}function JT(c,f,_,M,w,P,J,le,Te){return c=new bF(c,f,_,le,Te),f===1?(f=1,P===!0&&(f|=8)):f=0,P=Ss(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:M,isDehydrated:_,cache:null,transitions:null},K_(P),c}function jT(c){if(!c)return Jt;c=c._reactInternals;e:{if(O(c)!==c||c.tag!==1)throw Error(o(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Dn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(c.tag===1){var _=c.type;if(Dn(_))return Un(c,_,f)}return f}function YT(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=K(f),c===null?null:c.stateNode}function KT(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var _=c.retryLane;c.retryLane=_!==0&&_=$e&&P>=Ut&&w<=gt&&J<=Bt){c.splice(f,1);break}else if(M!==$e||_.width!==Te.width||BtJ){if(!(P!==Ut||_.height!==Te.height||gtw)){$e>M&&(Te.width+=$e-M,Te.x=M),gtP&&(Te.height+=Ut-P,Te.y=P),Bt_&&(_=J)),JBy&&(f.flags|=128,M=!0,bh(w,!1),f.lanes=4194304)}else{if(!M)if(c=vm(P),c!==null){if(f.flags|=128,M=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),bh(w,!0),w.tail===null&&w.tailMode==="hidden"&&!P.alternate&&!Nn)return Vi(f),null}else 2*Mi()-w.renderingStartTime>By&&_!==1073741824&&(f.flags|=128,M=!0,bh(w,!1),f.lanes=4194304);w.isBackwards?(P.sibling=f.child,f.child=P):(c=w.last,c!==null?c.sibling=P:f.child=P,w.last=P)}return w.tail!==null?(f=w.tail,w.rendering=f,w.tail=f.sibling,w.renderingStartTime=Mi(),f.sibling=null,c=kn.current,qe(kn,M?c&1|2:c&1),f):(Vi(f),null);case 22:case 23:return Fy(),M=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(f.flags|=8192),M&&f.mode&1?Jr&1073741824&&(Vi(f),Ne&&f.subtreeFlags&6&&(f.flags|=8192)):Vi(f),null;case 24:return null;case 25:return null}throw Error(o(156,f.tag))}var pF=a.ReactCurrentOwner,Xr=!1;function ur(c,f,_,M){f.child=c===null?Fw(f,null,_,M):gc(f,c.child,_,M)}function uT(c,f,_,M,w){_=_.render;var P=f.ref;return hc(f,w),M=ly(c,f,_,M,P,w),_=uy(),c!==null&&!Xr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Yo(c,f,w)):(Nn&&_&&q_(f),f.flags|=1,ur(c,f,M,w),f.child)}function cT(c,f,_,M,w){if(c===null){var P=_.type;return typeof P=="function"&&!Uy(P)&&P.defaultProps===void 0&&_.compare===null&&_.defaultProps===void 0?(f.tag=15,f.type=P,fT(c,f,P,M,w)):(c=jm(_.type,null,M,f,f.mode,w),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&w)){var J=P.memoizedProps;if(_=_.compare,_=_!==null?_:lm,_(J,M)&&c.ref===f.ref)return Yo(c,f,w)}return f.flags|=1,c=La(P,M),c.ref=f.ref,c.return=f,f.child=c}function fT(c,f,_,M,w){if(c!==null&&lm(c.memoizedProps,M)&&c.ref===f.ref)if(Xr=!1,(c.lanes&w)!==0)c.flags&131072&&(Xr=!0);else return f.lanes=c.lanes,Yo(c,f,w);return my(c,f,_,M,w)}function hT(c,f,_){var M=f.pendingProps,w=M.children,P=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null},qe(xc,Jr),Jr|=_;else if(_&1073741824)f.memoizedState={baseLanes:0,cachePool:null},M=P!==null?P.baseLanes:_,qe(xc,Jr),Jr|=M;else return c=P!==null?P.baseLanes|_:_,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null},f.updateQueue=null,qe(xc,Jr),Jr|=c,null;else P!==null?(M=P.baseLanes|_,f.memoizedState=null):M=_,qe(xc,Jr),Jr|=M;return ur(c,f,w,_),f.child}function dT(c,f){var _=f.ref;(c===null&&_!==null||c!==null&&c.ref!==_)&&(f.flags|=512,f.flags|=2097152)}function my(c,f,_,M,w){var P=Dn(_)?gn:Pt.current;return P=jn(f,P),hc(f,w),_=ly(c,f,_,M,P,w),M=uy(),c!==null&&!Xr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~w,Yo(c,f,w)):(Nn&&M&&q_(f),f.flags|=1,ur(c,f,_,w),f.child)}function pT(c,f,_,M,w){if(Dn(_)){var P=!0;Gt(f)}else P=!1;if(hc(f,w),f.stateNode===null)c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),Rw(f,_,M),Z_(f,_,M,w),M=!0;else if(c===null){var J=f.stateNode,le=f.memoizedProps;J.props=le;var Te=J.context,$e=_.contextType;typeof $e=="object"&&$e!==null?$e=gs($e):($e=Dn(_)?gn:Pt.current,$e=jn(f,$e));var gt=_.getDerivedStateFromProps,Ut=typeof gt=="function"||typeof J.getSnapshotBeforeUpdate=="function";Ut||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==M||Te!==$e)&&bw(f,J,M,$e),Ca=!1;var Bt=f.memoizedState;J.state=Bt,hm(f,M,J,w),Te=f.memoizedState,le!==M||Bt!==Te||Nt.current||Ca?(typeof gt=="function"&&(Q_(f,_,gt,M),Te=f.memoizedState),(le=Ca||Cw(f,_,le,M,Bt,Te,$e))?(Ut||typeof J.UNSAFE_componentWillMount!="function"&&typeof J.componentWillMount!="function"||(typeof J.componentWillMount=="function"&&J.componentWillMount(),typeof J.UNSAFE_componentWillMount=="function"&&J.UNSAFE_componentWillMount()),typeof J.componentDidMount=="function"&&(f.flags|=4194308)):(typeof J.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=M,f.memoizedState=Te),J.props=M,J.state=Te,J.context=$e,M=le):(typeof J.componentDidMount=="function"&&(f.flags|=4194308),M=!1)}else{J=f.stateNode,Mw(c,f),le=f.memoizedProps,$e=f.type===f.elementType?le:Xs(f.type,le),J.props=$e,Ut=f.pendingProps,Bt=J.context,Te=_.contextType,typeof Te=="object"&&Te!==null?Te=gs(Te):(Te=Dn(_)?gn:Pt.current,Te=jn(f,Te));var xn=_.getDerivedStateFromProps;(gt=typeof xn=="function"||typeof J.getSnapshotBeforeUpdate=="function")||typeof J.UNSAFE_componentWillReceiveProps!="function"&&typeof J.componentWillReceiveProps!="function"||(le!==Ut||Bt!==Te)&&bw(f,J,M,Te),Ca=!1,Bt=f.memoizedState,J.state=Bt,hm(f,M,J,w);var Ct=f.memoizedState;le!==Ut||Bt!==Ct||Nt.current||Ca?(typeof xn=="function"&&(Q_(f,_,xn,M),Ct=f.memoizedState),($e=Ca||Cw(f,_,$e,M,Bt,Ct,Te)||!1)?(gt||typeof J.UNSAFE_componentWillUpdate!="function"&&typeof J.componentWillUpdate!="function"||(typeof J.componentWillUpdate=="function"&&J.componentWillUpdate(M,Ct,Te),typeof J.UNSAFE_componentWillUpdate=="function"&&J.UNSAFE_componentWillUpdate(M,Ct,Te)),typeof J.componentDidUpdate=="function"&&(f.flags|=4),typeof J.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof J.componentDidUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=1024),f.memoizedProps=M,f.memoizedState=Ct),J.props=M,J.state=Ct,J.context=Te,M=$e):(typeof J.componentDidUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=4),typeof J.getSnapshotBeforeUpdate!="function"||le===c.memoizedProps&&Bt===c.memoizedState||(f.flags|=1024),M=!1)}return gy(c,f,_,M,P,w)}function gy(c,f,_,M,w,P){dT(c,f);var J=(f.flags&128)!==0;if(!M&&!J)return w&&$t(f,_,!1),Yo(c,f,P);M=f.stateNode,pF.current=f;var le=J&&typeof _.getDerivedStateFromError!="function"?null:M.render();return f.flags|=1,c!==null&&J?(f.child=gc(f,c.child,null,P),f.child=gc(f,null,le,P)):ur(c,f,le,P),f.memoizedState=M.state,w&&$t(f,_,!0),f.child}function mT(c){var f=c.stateNode;f.pendingContext?Yt(c,f.pendingContext,f.pendingContext!==f.context):f.context&&Yt(c,f.context,!1),iy(c,f.containerInfo)}function gT(c,f,_,M,w){return mc(),ny(w),f.flags|=256,ur(c,f,_,M),f.child}var Cm={dehydrated:null,treeContext:null,retryLane:0};function Rm(c){return{baseLanes:c,cachePool:null}}function vT(c,f,_){var M=f.pendingProps,w=kn.current,P=!1,J=(f.flags&128)!==0,le;if((le=J)||(le=c!==null&&c.memoizedState===null?!1:(w&2)!==0),le?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(w|=1),qe(kn,w&1),c===null)return ty(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?It(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(w=M.children,c=M.fallback,P?(M=f.mode,P=f.child,w={mode:"hidden",children:w},!(M&1)&&P!==null?(P.childLanes=0,P.pendingProps=w):P=Ym(w,M,0,null),c=jl(c,M,_,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=Rm(_),f.memoizedState=Cm,c):vy(f,w));if(w=c.memoizedState,w!==null){if(le=w.dehydrated,le!==null){if(J)return f.flags&256?(f.flags&=-257,bm(c,f,_,Error(o(422)))):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=M.fallback,w=f.mode,M=Ym({mode:"visible",children:M.children},w,0,null),P=jl(P,w,_,null),P.flags|=2,M.return=f,P.return=f,M.sibling=P,f.child=M,f.mode&1&&gc(f,c.child,null,_),f.child.memoizedState=Rm(_),f.memoizedState=Cm,P);if(!(f.mode&1))f=bm(c,f,_,null);else if(It(le))f=bm(c,f,_,Error(o(419)));else if(M=(_&c.childLanes)!==0,Xr||M){if(M=li,M!==null){switch(_&-_){case 4:P=2;break;case 16:P=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:P=32;break;case 536870912:P=268435456;break;default:P=0}M=P&(M.suspendedLanes|_)?0:P,M!==0&&M!==w.retryLane&&(w.retryLane=M,As(c,M,-1))}Oy(),f=bm(c,f,_,Error(o(421)))}else xt(le)?(f.flags|=128,f.child=c.child,f=CF.bind(null,c),dn(le,f),f=null):(_=w.treeContext,Ae&&(Wr=mn(le),Vr=f,Nn=!0,Js=null,_h=!1,_!==null&&(vs[_s++]=Xo,vs[_s++]=Jo,vs[_s++]=kl,Xo=_.id,Jo=_.overflow,kl=f)),f=vy(f,f.pendingProps.children),f.flags|=4096);return f}return P?(M=yT(c,f,M.children,M.fallback,_),P=f.child,w=c.child.memoizedState,P.memoizedState=w===null?Rm(_):{baseLanes:w.baseLanes|_,cachePool:null},P.childLanes=c.childLanes&~_,f.memoizedState=Cm,M):(_=_T(c,f,M.children,_),f.memoizedState=null,_)}return P?(M=yT(c,f,M.children,M.fallback,_),P=f.child,w=c.child.memoizedState,P.memoizedState=w===null?Rm(_):{baseLanes:w.baseLanes|_,cachePool:null},P.childLanes=c.childLanes&~_,f.memoizedState=Cm,M):(_=_T(c,f,M.children,_),f.memoizedState=null,_)}function vy(c,f){return f=Ym({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function _T(c,f,_,M){var w=c.child;return c=w.sibling,_=La(w,{mode:"visible",children:_}),!(f.mode&1)&&(_.lanes=M),_.return=f,_.sibling=null,c!==null&&(M=f.deletions,M===null?(f.deletions=[c],f.flags|=16):M.push(c)),f.child=_}function yT(c,f,_,M,w){var P=f.mode;c=c.child;var J=c.sibling,le={mode:"hidden",children:_};return!(P&1)&&f.child!==c?(_=f.child,_.childLanes=0,_.pendingProps=le,f.deletions=null):(_=La(c,le),_.subtreeFlags=c.subtreeFlags&14680064),J!==null?M=La(J,M):(M=jl(M,P,w,null),M.flags|=2),M.return=f,_.return=f,_.sibling=M,f.child=_,M}function bm(c,f,_,M){return M!==null&&ny(M),gc(f,c.child,null,_),c=vy(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function xT(c,f,_){c.lanes|=f;var M=c.alternate;M!==null&&(M.lanes|=f),Y_(c.return,f,_)}function _y(c,f,_,M,w){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:M,tail:_,tailMode:w}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=M,P.tail=_,P.tailMode=w)}function AT(c,f,_){var M=f.pendingProps,w=M.revealOrder,P=M.tail;if(ur(c,f,M.children,_),M=kn.current,M&2)M=M&1|2,f.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&xT(c,_,f);else if(c.tag===19)xT(c,_,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(qe(kn,M),!(f.mode&1))f.memoizedState=null;else switch(w){case"forwards":for(_=f.child,w=null;_!==null;)c=_.alternate,c!==null&&vm(c)===null&&(w=_),_=_.sibling;_=w,_===null?(w=f.child,f.child=null):(w=_.sibling,_.sibling=null),_y(f,!1,w,_,P);break;case"backwards":for(_=null,w=f.child,f.child=null;w!==null;){if(c=w.alternate,c!==null&&vm(c)===null){f.child=w;break}c=w.sibling,w.sibling=_,_=w,w=c}_y(f,!0,_,null,P);break;case"together":_y(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Yo(c,f,_){if(c!==null&&(f.dependencies=c.dependencies),Ac|=f.lanes,!(_&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(o(153));if(f.child!==null){for(c=f.child,_=La(c,c.pendingProps),f.child=_,_.return=f;c.sibling!==null;)c=c.sibling,_=_.sibling=La(c,c.pendingProps),_.return=f;_.sibling=null}return f.child}function mF(c,f,_){switch(f.tag){case 3:mT(f),mc();break;case 5:Ow(f);break;case 1:Dn(f.type)&&Gt(f);break;case 4:iy(f,f.stateNode.containerInfo);break;case 10:Sw(f,f.type._context,f.memoizedProps.value);break;case 13:var M=f.memoizedState;if(M!==null)return M.dehydrated!==null?(qe(kn,kn.current&1),f.flags|=128,null):_&f.child.childLanes?vT(c,f,_):(qe(kn,kn.current&1),c=Yo(c,f,_),c!==null?c.sibling:null);qe(kn,kn.current&1);break;case 19:if(M=(_&f.childLanes)!==0,c.flags&128){if(M)return AT(c,f,_);f.flags|=128}var w=f.memoizedState;if(w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),qe(kn,kn.current),M)break;return null;case 22:case 23:return f.lanes=0,hT(c,f,_)}return Yo(c,f,_)}function gF(c,f){switch($_(f),f.tag){case 1:return Dn(f.type)&&sn(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return _c(),rt(Nt),rt(Pt),oy(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return ry(f),null;case 13:if(rt(kn),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(o(340));mc()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return rt(kn),null;case 4:return _c(),null;case 10:return j_(f.type._context),null;case 22:case 23:return Fy(),null;case 24:return null;default:return null}}var Pm=!1,Hl=!1,vF=typeof WeakSet=="function"?WeakSet:Set,st=null;function Bm(c,f){var _=c.ref;if(_!==null)if(typeof _=="function")try{_(null)}catch(M){br(c,f,M)}else _.current=null}function yy(c,f,_){try{_()}catch(M){br(c,f,M)}}var ST=!1;function _F(c,f){for(V(c.containerInfo),st=f;st!==null;)if(c=st,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,st=f;else for(;st!==null;){c=st;try{var _=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var M=_.memoizedProps,w=_.memoizedState,P=c.stateNode,J=P.getSnapshotBeforeUpdate(c.elementType===c.type?M:Xs(c.type,M),w);P.__reactInternalSnapshotBeforeUpdate=J}break;case 3:Ne&&He(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(le){br(c,c.return,le)}if(f=c.sibling,f!==null){f.return=c.return,st=f;break}st=c.return}return _=ST,ST=!1,_}function Vl(c,f,_){var M=f.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var w=M=M.next;do{if((w.tag&c)===c){var P=w.destroy;w.destroy=void 0,P!==void 0&&yy(f,_,P)}w=w.next}while(w!==M)}}function Ph(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var _=f=f.next;do{if((_.tag&c)===c){var M=_.create;_.destroy=M()}_=_.next}while(_!==f)}}function xy(c){var f=c.ref;if(f!==null){var _=c.stateNode;switch(c.tag){case 5:c=$(_);break;default:c=_}typeof f=="function"?f(c):f.current=c}}function MT(c,f,_){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(om,f)}catch{}switch(f.tag){case 0:case 11:case 14:case 15:if(c=f.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var w=M,P=w.destroy;w=w.tag,P!==void 0&&(w&2||w&4)&&yy(f,_,P),M=M.next}while(M!==c)}break;case 1:if(Bm(f,_),c=f.stateNode,typeof c.componentWillUnmount=="function")try{c.props=f.memoizedProps,c.state=f.memoizedState,c.componentWillUnmount()}catch(J){br(f,_,J)}break;case 5:Bm(f,_);break;case 4:Ne?bT(c,f,_):Y&&Y&&(f=f.stateNode.containerInfo,_=Ve(f),Ot(f,_))}}function ET(c,f,_){for(var M=f;;)if(MT(c,M,_),M.child===null||Ne&&M.tag===4){if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function wT(c){var f=c.alternate;f!==null&&(c.alternate=null,wT(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&re(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function TT(c){return c.tag===5||c.tag===3||c.tag===4}function CT(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||TT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function RT(c){if(Ne){e:{for(var f=c.return;f!==null;){if(TT(f))break e;f=f.return}throw Error(o(160))}var _=f;switch(_.tag){case 5:f=_.stateNode,_.flags&32&&(de(f),_.flags&=-33),_=CT(c),Sy(c,_,f);break;case 3:case 4:f=_.stateNode.containerInfo,_=CT(c),Ay(c,_,f);break;default:throw Error(o(161))}}}function Ay(c,f,_){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?pt(_,c,f):Ge(_,c);else if(M!==4&&(c=c.child,c!==null))for(Ay(c,f,_),c=c.sibling;c!==null;)Ay(c,f,_),c=c.sibling}function Sy(c,f,_){var M=c.tag;if(M===5||M===6)c=c.stateNode,f?qt(_,c,f):ct(_,c);else if(M!==4&&(c=c.child,c!==null))for(Sy(c,f,_),c=c.sibling;c!==null;)Sy(c,f,_),c=c.sibling}function bT(c,f,_){for(var M=f,w=!1,P,J;;){if(!w){w=M.return;e:for(;;){if(w===null)throw Error(o(160));switch(P=w.stateNode,w.tag){case 5:J=!1;break e;case 3:P=P.containerInfo,J=!0;break e;case 4:P=P.containerInfo,J=!0;break e}w=w.return}w=!0}if(M.tag===5||M.tag===6)ET(c,M,_),J?Z(P,M.stateNode):ht(P,M.stateNode);else if(M.tag===18)J?j(P,M.stateNode):Q(P,M.stateNode);else if(M.tag===4){if(M.child!==null){P=M.stateNode.containerInfo,J=!0,M.child.return=M,M=M.child;continue}}else if(MT(c,M,_),M.child!==null){M.child.return=M,M=M.child;continue}if(M===f)break;for(;M.sibling===null;){if(M.return===null||M.return===f)return;M=M.return,M.tag===4&&(w=!1)}M.sibling.return=M.return,M=M.sibling}}function My(c,f){if(Ne){switch(f.tag){case 0:case 11:case 14:case 15:Vl(3,f,f.return),Ph(3,f),Vl(5,f,f.return);return;case 1:return;case 5:var _=f.stateNode;if(_!=null){var M=f.memoizedProps;c=c!==null?c.memoizedProps:M;var w=f.type,P=f.updateQueue;f.updateQueue=null,P!==null&&Oe(_,P,w,c,M,f)}return;case 6:if(f.stateNode===null)throw Error(o(162));_=f.memoizedProps,Ke(f.stateNode,c!==null?c.memoizedProps:_,_);return;case 3:Ae&&c!==null&&c.memoizedState.isDehydrated&&z(f.stateNode.containerInfo);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 17:return}throw Error(o(163))}switch(f.tag){case 0:case 11:case 14:case 15:Vl(3,f,f.return),Ph(3,f),Vl(5,f,f.return);return;case 12:return;case 13:Im(f);return;case 19:Im(f);return;case 3:Ae&&c!==null&&c.memoizedState.isDehydrated&&z(f.stateNode.containerInfo);break;case 22:case 23:return}e:if(Y){switch(f.tag){case 1:case 5:case 6:break e;case 3:case 4:f=f.stateNode,Ot(f.containerInfo,f.pendingChildren);break e}throw Error(o(163))}}function Im(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var _=c.stateNode;_===null&&(_=c.stateNode=new vF),f.forEach(function(M){var w=RF.bind(null,c,M);_.has(M)||(_.add(M),M.then(w,w))})}}function yF(c,f){for(st=f;st!==null;){f=st;var _=f.deletions;if(_!==null)for(var M=0;M<_.length;M++){var w=_[M];try{var P=c;Ne?bT(P,w,f):ET(P,w,f);var J=w.alternate;J!==null&&(J.return=null),w.return=null}catch(wt){br(w,f,wt)}}if(_=f.child,f.subtreeFlags&12854&&_!==null)_.return=f,st=_;else for(;st!==null;){f=st;try{var le=f.flags;if(le&32&&Ne&&de(f.stateNode),le&512){var Te=f.alternate;if(Te!==null){var $e=Te.ref;$e!==null&&(typeof $e=="function"?$e(null):$e.current=null)}}if(le&8192)switch(f.tag){case 13:if(f.memoizedState!==null){var gt=f.alternate;(gt===null||gt.memoizedState===null)&&(Py=Mi())}break;case 22:var Ut=f.memoizedState!==null,Bt=f.alternate,xn=Bt!==null&&Bt.memoizedState!==null;if(_=f,Ne){e:if(M=_,w=Ut,P=null,Ne)for(var Ct=M;;){if(Ct.tag===5){if(P===null){P=Ct;var Wi=Ct.stateNode;w?Ue(Wi):Pe(Ct.stateNode,Ct.memoizedProps)}}else if(Ct.tag===6){if(P===null){var Ms=Ct.stateNode;w?Le(Ms):ie(Ms,Ct.memoizedProps)}}else if((Ct.tag!==22&&Ct.tag!==23||Ct.memoizedState===null||Ct===M)&&Ct.child!==null){Ct.child.return=Ct,Ct=Ct.child;continue}if(Ct===M)break;for(;Ct.sibling===null;){if(Ct.return===null||Ct.return===M)break e;P===Ct&&(P=null),Ct=Ct.return}P===Ct&&(P=null),Ct.sibling.return=Ct.return,Ct=Ct.sibling}}if(Ut&&!xn&&_.mode&1){st=_;for(var me=_.child;me!==null;){for(_=st=me;st!==null;){M=st;var ce=M.child;switch(M.tag){case 0:case 11:case 14:case 15:Vl(4,M,M.return);break;case 1:Bm(M,M.return);var Ee=M.stateNode;if(typeof Ee.componentWillUnmount=="function"){var at=M.return;try{Ee.props=M.memoizedProps,Ee.state=M.memoizedState,Ee.componentWillUnmount()}catch(wt){br(M,at,wt)}}break;case 5:Bm(M,M.return);break;case 22:if(M.memoizedState!==null){IT(_);continue}}ce!==null?(ce.return=M,st=ce):IT(_)}me=me.sibling}}}switch(le&4102){case 2:RT(f),f.flags&=-3;break;case 6:RT(f),f.flags&=-3,My(f.alternate,f);break;case 4096:f.flags&=-4097;break;case 4100:f.flags&=-4097,My(f.alternate,f);break;case 4:My(f.alternate,f)}}catch(wt){br(f,f.return,wt)}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}}function xF(c,f,_){st=c,PT(c)}function PT(c,f,_){for(var M=(c.mode&1)!==0;st!==null;){var w=st,P=w.child;if(w.tag===22&&M){var J=w.memoizedState!==null||Pm;if(!J){var le=w.alternate,Te=le!==null&&le.memoizedState!==null||Hl;le=Pm;var $e=Hl;if(Pm=J,(Hl=Te)&&!$e)for(st=w;st!==null;)J=st,Te=J.child,J.tag===22&&J.memoizedState!==null?LT(w):Te!==null?(Te.return=J,st=Te):LT(w);for(;P!==null;)st=P,PT(P),P=P.sibling;st=w,Pm=le,Hl=$e}BT(c)}else w.subtreeFlags&8772&&P!==null?(P.return=w,st=P):BT(c)}}function BT(c){for(;st!==null;){var f=st;if(f.flags&8772){var _=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Hl||Ph(5,f);break;case 1:var M=f.stateNode;if(f.flags&4&&!Hl)if(_===null)M.componentDidMount();else{var w=f.elementType===f.type?_.memoizedProps:Xs(f.type,_.memoizedProps);M.componentDidUpdate(w,_.memoizedState,M.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&ww(f,P,M);break;case 3:var J=f.updateQueue;if(J!==null){if(_=null,f.child!==null)switch(f.child.tag){case 5:_=$(f.child.stateNode);break;case 1:_=f.child.stateNode}ww(f,J,_)}break;case 5:var le=f.stateNode;_===null&&f.flags&4&&Rt(le,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ae&&f.memoizedState===null){var Te=f.alternate;if(Te!==null){var $e=Te.memoizedState;if($e!==null){var gt=$e.dehydrated;gt!==null&&X(gt)}}}break;case 19:case 17:case 21:case 22:case 23:break;default:throw Error(o(163))}Hl||f.flags&512&&xy(f)}catch(Ut){br(f,f.return,Ut)}}if(f===c){st=null;break}if(_=f.sibling,_!==null){_.return=f.return,st=_;break}st=f.return}}function IT(c){for(;st!==null;){var f=st;if(f===c){st=null;break}var _=f.sibling;if(_!==null){_.return=f.return,st=_;break}st=f.return}}function LT(c){for(;st!==null;){var f=st;try{switch(f.tag){case 0:case 11:case 15:var _=f.return;try{Ph(4,f)}catch(Te){br(f,_,Te)}break;case 1:var M=f.stateNode;if(typeof M.componentDidMount=="function"){var w=f.return;try{M.componentDidMount()}catch(Te){br(f,w,Te)}}var P=f.return;try{xy(f)}catch(Te){br(f,P,Te)}break;case 5:var J=f.return;try{xy(f)}catch(Te){br(f,J,Te)}}}catch(Te){br(f,f.return,Te)}if(f===c){st=null;break}var le=f.sibling;if(le!==null){le.return=f.return,st=le;break}st=f.return}}var Lm=0,Dm=1,Nm=2,Fm=3,Om=4;if(typeof Symbol=="function"&&Symbol.for){var Bh=Symbol.for;Lm=Bh("selector.component"),Dm=Bh("selector.has_pseudo_class"),Nm=Bh("selector.role"),Fm=Bh("selector.test_id"),Om=Bh("selector.text")}function Ey(c){var f=ge(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(o(364));return f}if(c=H(c),c===null)throw Error(o(362));return c.stateNode.current}function wy(c,f){switch(f.$$typeof){case Lm:if(c.type===f.value)return!0;break;case Dm:e:{f=f.value,c=[c,0];for(var _=0;_";case Dm:return":has("+(Ty(c)||"")+")";case Nm:return'[role="'+c.value+'"]';case Om:return'"'+c.value+'"';case Fm:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function DT(c,f){var _=[];c=[c,0];for(var M=0;Mw&&(w=J),M&=~P}if(M=w,M=Mi()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*AF(M/1960))-M,10c?16:c,Pa===null)var M=!1;else{if(c=Pa,Pa=null,Hm=0,jt&6)throw Error(o(331));var w=jt;for(jt|=4,st=c.current;st!==null;){var P=st,J=P.child;if(st.flags&16){var le=P.deletions;if(le!==null){for(var Te=0;TeMi()-Py?Wl(c,0):by|=_),Rr(c,f)}function VT(c,f){f===0&&(c.mode&1?(f=rm,rm<<=1,!(rm&130023424)&&(rm=4194304)):f=1);var _=cr();c=Xm(c,f),c!==null&&(vh(c,f,_),Rr(c,_))}function CF(c){var f=c.memoizedState,_=0;f!==null&&(_=f.retryLane),VT(c,_)}function RF(c,f){var _=0;switch(c.tag){case 13:var M=c.stateNode,w=c.memoizedState;w!==null&&(_=w.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(f),VT(c,_)}var WT;WT=function(c,f,_){if(c!==null)if(c.memoizedProps!==f.pendingProps||Nt.current)Xr=!0;else{if(!(c.lanes&_)&&!(f.flags&128))return Xr=!1,mF(c,f,_);Xr=!!(c.flags&131072)}else Xr=!1,Nn&&f.flags&1048576&&Pw(f,mm,f.index);switch(f.lanes=0,f.tag){case 2:var M=f.type;c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps;var w=jn(f,Pt.current);hc(f,_),w=ly(null,f,M,c,w,_);var P=uy();return f.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Dn(M)?(P=!0,Gt(f)):P=!1,f.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,K_(f),w.updater=dm,f.stateNode=w,w._reactInternals=f,Z_(f,M,c,_),f=gy(null,f,M,!0,P,_)):(f.tag=0,Nn&&P&&q_(f),ur(null,f,w,_),f=f.child),f;case 16:M=f.elementType;e:{switch(c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),c=f.pendingProps,w=M._init,M=w(M._payload),f.type=M,w=f.tag=PF(M),c=Xs(M,c),w){case 0:f=my(null,f,M,c,_);break e;case 1:f=pT(null,f,M,c,_);break e;case 11:f=uT(null,f,M,c,_);break e;case 14:f=cT(null,f,M,Xs(M.type,c),_);break e}throw Error(o(306,M,""))}return f;case 0:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),my(c,f,M,w,_);case 1:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),pT(c,f,M,w,_);case 3:e:{if(mT(f),c===null)throw Error(o(387));M=f.pendingProps,P=f.memoizedState,w=P.element,Mw(c,f),hm(f,M,null,_);var J=f.memoizedState;if(M=J.element,Ae&&P.isDehydrated)if(P={element:M,isDehydrated:!1,cache:J.cache,transitions:J.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){w=Error(o(423)),f=gT(c,f,M,_,w);break e}else if(M!==w){w=Error(o(424)),f=gT(c,f,M,_,w);break e}else for(Ae&&(Wr=Ln(f.stateNode.containerInfo),Vr=f,Nn=!0,Js=null,_h=!1),_=Fw(f,null,M,_),f.child=_;_;)_.flags=_.flags&-3|4096,_=_.sibling;else{if(mc(),M===w){f=Yo(c,f,_);break e}ur(c,f,M,_)}f=f.child}return f;case 5:return Ow(f),c===null&&ty(f),M=f.type,w=f.pendingProps,P=c!==null?c.memoizedProps:null,J=w.children,xe(M,w)?J=null:P!==null&&xe(M,P)&&(f.flags|=32),dT(c,f),ur(c,f,J,_),f.child;case 6:return c===null&&ty(f),null;case 13:return vT(c,f,_);case 4:return iy(f,f.stateNode.containerInfo),M=f.pendingProps,c===null?f.child=gc(f,null,M,_):ur(c,f,M,_),f.child;case 11:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),uT(c,f,M,w,_);case 7:return ur(c,f,f.pendingProps,_),f.child;case 8:return ur(c,f,f.pendingProps.children,_),f.child;case 12:return ur(c,f,f.pendingProps.children,_),f.child;case 10:e:{if(M=f.type._context,w=f.pendingProps,P=f.memoizedProps,J=w.value,Sw(f,M,J),P!==null)if(mo(P.value,J)){if(P.children===w.children&&!Nt.current){f=Yo(c,f,_);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var le=P.dependencies;if(le!==null){J=P.child;for(var Te=le.firstContext;Te!==null;){if(Te.context===M){if(P.tag===1){Te=Wo(-1,_&-_),Te.tag=2;var $e=P.updateQueue;if($e!==null){$e=$e.shared;var gt=$e.pending;gt===null?Te.next=Te:(Te.next=gt.next,gt.next=Te),$e.pending=Te}}P.lanes|=_,Te=P.alternate,Te!==null&&(Te.lanes|=_),Y_(P.return,_,f),le.lanes|=_;break}Te=Te.next}}else if(P.tag===10)J=P.type===f.type?null:P.child;else if(P.tag===18){if(J=P.return,J===null)throw Error(o(341));J.lanes|=_,le=J.alternate,le!==null&&(le.lanes|=_),Y_(J,_,f),J=P.sibling}else J=P.child;if(J!==null)J.return=P;else for(J=P;J!==null;){if(J===f){J=null;break}if(P=J.sibling,P!==null){P.return=J.return,J=P;break}J=J.return}P=J}ur(c,f,w.children,_),f=f.child}return f;case 9:return w=f.type,M=f.pendingProps.children,hc(f,_),w=gs(w),M=M(w),f.flags|=1,ur(c,f,M,_),f.child;case 14:return M=f.type,w=Xs(M,f.pendingProps),w=Xs(M.type,w),cT(c,f,M,w,_);case 15:return fT(c,f,f.type,f.pendingProps,_);case 17:return M=f.type,w=f.pendingProps,w=f.elementType===M?w:Xs(M,w),c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2),f.tag=1,Dn(M)?(c=!0,Gt(f)):c=!1,hc(f,_),Rw(f,M,w),Z_(f,M,w,_),gy(null,f,M,!0,c,_);case 19:return AT(c,f,_);case 22:return hT(c,f,_)}throw Error(o(156,f.tag))};function XT(c,f){return G_(c,f)}function bF(c,f,_,M){this.tag=c,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=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(c,f,_,M){return new bF(c,f,_,M)}function Uy(c){return c=c.prototype,!(!c||!c.isReactComponent)}function PF(c){if(typeof c=="function")return Uy(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===S)return 14}return 2}function La(c,f){var _=c.alternate;return _===null?(_=Ss(c.tag,f,c.key,c.mode),_.elementType=c.elementType,_.type=c.type,_.stateNode=c.stateNode,_.alternate=c,c.alternate=_):(_.pendingProps=f,_.type=c.type,_.flags=0,_.subtreeFlags=0,_.deletions=null),_.flags=c.flags&14680064,_.childLanes=c.childLanes,_.lanes=c.lanes,_.child=c.child,_.memoizedProps=c.memoizedProps,_.memoizedState=c.memoizedState,_.updateQueue=c.updateQueue,f=c.dependencies,_.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},_.sibling=c.sibling,_.index=c.index,_.ref=c.ref,_}function jm(c,f,_,M,w,P){var J=2;if(M=c,typeof c=="function")Uy(c)&&(J=1);else if(typeof c=="string")J=5;else e:switch(c){case h:return jl(_.children,w,P,f);case d:J=8,w|=8;break;case p:return c=Ss(12,_,f,w|2),c.elementType=p,c.lanes=P,c;case y:return c=Ss(13,_,f,w),c.elementType=y,c.lanes=P,c;case g:return c=Ss(19,_,f,w),c.elementType=g,c.lanes=P,c;case E:return Ym(_,w,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case m:J=10;break e;case v:J=9;break e;case x:J=11;break e;case S:J=14;break e;case A:J=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return f=Ss(J,_,f,w),f.elementType=c,f.type=M,f.lanes=P,f}function jl(c,f,_,M){return c=Ss(7,c,M,f),c.lanes=_,c}function Ym(c,f,_,M){return c=Ss(22,c,M,f),c.elementType=E,c.lanes=_,c.stateNode={},c}function ky(c,f,_){return c=Ss(6,c,null,f),c.lanes=_,c}function zy(c,f,_){return f=Ss(4,c.children!==null?c.children:[],c.key,f),f.lanes=_,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function BF(c,f,_,M,w){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k_(0),this.expirationTimes=k_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k_(0),this.identifierPrefix=M,this.onRecoverableError=w,Ae&&(this.mutableSourceEagerHydrationData=null)}function JT(c,f,_,M,w,P,J,le,Te){return c=new BF(c,f,_,le,Te),f===1?(f=1,P===!0&&(f|=8)):f=0,P=Ss(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:M,isDehydrated:_,cache:null,transitions:null},K_(P),c}function jT(c){if(!c)return Jt;c=c._reactInternals;e:{if(O(c)!==c||c.tag!==1)throw Error(o(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Dn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(o(171))}if(c.tag===1){var _=c.type;if(Dn(_))return Un(c,_,f)}return f}function YT(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=K(f),c===null?null:c.stateNode}function KT(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var _=c.retryLane;c.retryLane=_!==0&&_=$e&&P>=Ut&&w<=gt&&J<=Bt){c.splice(f,1);break}else if(M!==$e||_.width!==Te.width||BtJ){if(!(P!==Ut||_.height!==Te.height||gtw)){$e>M&&(Te.width+=$e-M,Te.x=M),gtP&&(Te.height+=Ut-P,Te.y=P),Bt_&&(_=J)),J ")+` No matching component was found for: - `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return $(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:PF,findFiberByHostInstance:c.findFiberByHostInstance||BF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{om=f.inject(c),po=f}catch{}c=!!f.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,f,_,M){if(!Et)throw Error(o(363));c=Cy(c,f);var w=tt(c,_,M).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,f){var _=f._getVersion;_=_(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,_]:c.mutableSourceEagerHydrationData.push(f,_)},t.runWithPriority=function(c,f){var _=cn;try{return cn=c,f()}finally{cn=_}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,_,M){var w=f.current,P=cr(),J=Ba(w);return _=jT(_),f.context===null?f.context=_:f.pendingContext=_,f=Wo(P,J),f.payload={element:c},M=M===void 0?null:M,M!==null&&(f.callback=M),Ra(w,f),c=As(w,J,P),c!==null&&fm(c,w,J),J},t};t3.exports=SW;var MW=t3.exports;const EW=Gv(MW);var n3={exports:{}},i3={};/** + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return $(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:IF,findFiberByHostInstance:c.findFiberByHostInstance||LF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{om=f.inject(c),po=f}catch{}c=!!f.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,f,_,M){if(!Et)throw Error(o(363));c=Cy(c,f);var w=tt(c,_,M).disconnect;return{disconnect:function(){w()}}},t.registerMutableSourceForHydration=function(c,f){var _=f._getVersion;_=_(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,_]:c.mutableSourceEagerHydrationData.push(f,_)},t.runWithPriority=function(c,f){var _=cn;try{return cn=c,f()}finally{cn=_}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,f,_,M){var w=f.current,P=cr(),J=Ba(w);return _=jT(_),f.context===null?f.context=_:f.pendingContext=_,f=Wo(P,J),f.payload={element:c},M=M===void 0?null:M,M!==null&&(f.callback=M),Ra(w,f),c=As(w,J,P),c!==null&&fm(c,w,J),J},t};i3.exports=CW;var RW=i3.exports;const bW=Gv(RW);var r3={exports:{}},s3={};/** * @license React * scheduler.production.min.js * @@ -3923,7 +3923,7 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(F,V){var N=F.length;F.push(V);e:for(;0>>1,ce=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var ce=ee(d.expirationTime<=V);V=n.unstable_now(),typeof ce=="function"?d.callback=ce:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=ce,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}})(i3);n3.exports=i3;var wP=n3.exports;const wW=n=>typeof n=="object"&&typeof n.then=="function",bu=[];function r3(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=bu.indexOf(r);s!==-1&&bu.splice(s,1)},promise:(wW(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(bu.push(r),!t)throw r.promise}const TW=(n,e,t)=>s3(n,e,!1,t),CW=(n,e,t)=>void s3(n,e,!0,t),RW=n=>{if(n===void 0||n.length===0)bu.splice(0,bu.length);else{const e=bu.find(t=>r3(n,t.keys,t.equal));e&&e.remove()}},cw={},o3=n=>void Object.assign(cw,n);function bW(n,e){function t(h,{args:d=[],attach:p,...m},v){let x=`${h[0].toUpperCase()}${h.slice(1)}`,y;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;y=Zc(g,{type:h,root:v,attach:p,primitive:!0})}else{const g=cw[x];if(!g)throw new Error(`R3F: ${x} 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(d))throw new Error("R3F: The args prop must be an array!");y=Zc(new g(...d),{type:h,root:v,attach:p,memoizedProps:{args:d}})}return y.__r3f.attach===void 0&&(y instanceof zt?y.__r3f.attach="geometry":y instanceof mi&&(y.__r3f.attach="material")),x!=="inject"&&y1(y,m),y}function i(h,d){let p=!1;if(d){var m,v;(m=d.__r3f)!=null&&m.attach?_1(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(v=h.__r3f)==null||v.objects.push(d),d.__r3f||Zc(d,{}),d.__r3f.parent=h,JS(d),qc(d)}}function r(h,d,p){let m=!1;if(d){var v,x;if((v=d.__r3f)!=null&&v.attach)_1(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const y=h.children.filter(S=>S!==d),g=y.indexOf(p);h.children=[...y.slice(0,g),d,...y.slice(g)],m=!0}m||(x=h.__r3f)==null||x.objects.push(d),d.__r3f||Zc(d,{}),d.__r3f.parent=h,JS(d),qc(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,v,x;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(E=>E!==d)),(v=d.__r3f)!=null&&v.attach)PP(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var y;h.remove(d),(y=d.__r3f)!=null&&y.root&&OW(Z0(d),d)}const S=(x=d.__r3f)==null?void 0:x.primitive,A=!S&&(p===void 0?d.dispose!==null:p);if(!S){var g;s((g=d.__r3f)==null?void 0:g.objects,d,A),s(d.children,d,A)}if(delete d.__r3f,A&&d.dispose&&d.type!=="Scene"){const E=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?wP.unstable_scheduleCallback(wP.unstable_IdlePriority,E):E()}qc(h)}}function a(h,d,p,m){var v;const x=(v=h.__r3f)==null?void 0:v.parent;if(!x)return;const y=t(d,p,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(y,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(y,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(x,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(x,y),y.raycast&&y.__r3f.eventCount&&Z0(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:EW({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const m=h.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,p,m){var v;if(((v=h==null?void 0:h.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:y=[],children:g,...S}=m,{args:A=[],children:E,...b}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((R,I)=>R!==A[I]))return[!0];const C=d3(h,S,b,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[d,p],m,v,x,y){d?a(h,m,x,y):y1(h,p)},commitMount(h,d,p,m){var v;const x=(v=h.__r3f)!=null?v:{};h.raycast&&x.handlers&&x.eventCount&&Z0(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Zc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&PP(m,h,p),h.isObject3D&&(h.visible=!1),qc(h)},unhideInstance(h,d){var p;const{attach:m,parent:v}=(p=h.__r3f)!=null?p:{};m&&v&&_1(v,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),qc(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():yf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&bn.fun(performance.now)?performance.now:bn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:bn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:bn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:y1}}var TP,CP;const v1=n=>"colorSpace"in n||"outputColorSpace"in n,a3=()=>{var n;return(n=cw.ColorManagement)!=null?n:null},l3=n=>n&&n.isOrthographicCamera,PW=n=>n&&n.hasOwnProperty("current"),qp=typeof window<"u"&&((TP=window.document)!=null&&TP.createElement||((CP=window.navigator)==null?void 0:CP.product)==="ReactNative")?ne.useLayoutEffect:ne.useEffect;function u3(n){const e=ne.useRef(n);return qp(()=>void(e.current=n),[n]),e}function BW({set:n}){return qp(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class c3 extends ne.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}c3.getDerivedStateFromError=()=>({error:!0});const f3="__default",RP=new Map,IW=n=>n&&!!n.memoized&&!!n.changes;function h3(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 id=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Z0(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const bn={obj:n=>n===Object(n)&&!bn.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(bn.str(n)||bn.num(n))return n===e;const s=bn.obj(n);if(s&&i==="reference")return n===e;const o=bn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!bn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(bn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function LW(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function DW(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Zc(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function XS(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const bP=/-\d+$/;function _1(n,e,t){if(bn.str(t)){if(bP.test(t)){const s=t.replace(bP,""),{target:o,key:a}=XS(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=XS(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function PP(n,e,t){var i,r;if(bn.str(t)){const{target:s,key:o}=XS(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function d3(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},u=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),m=[];if(u){const x=Object.keys(l);for(let y=0;y{var g;if((g=n.__r3f)!=null&&g.primitive&&x==="object"||bn.equ(y,l[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return m.push([x,y,!0,[]]);let S=[];x.includes("-")&&(S=x.split("-")),m.push([x,y,!1,S]);for(const A in r){const E=r[A];A.startsWith(`${x}-`)&&m.push([A,E,!1,A.split("-")])}});const v={...r};return d.memoizedProps&&d.memoizedProps.args&&(v.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(v.attach=d.memoizedProps.attach),{memoized:v,changes:m}}const NW=typeof process<"u"&&!1;function y1(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:u}=IW(e)?e:d3(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;pA[E],n),!(S&&S.set))){const[A,...E]=y.reverse();g=E.reverse().reduce((b,C)=>b[C],n),m=A}if(v===f3+"remove")if(g.constructor){let A=RP.get(g.constructor);A||(A=new g.constructor,RP.set(g.constructor,A)),v=A[m]}else v=0;if(x)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(S&&S.set&&(S.copy||S instanceof Gu)){if(Array.isArray(v))S.fromArray?S.fromArray(v):S.set(...v);else if(S.copy&&v&&v.constructor&&(NW?S.constructor.name===v.constructor.name:S.constructor===v.constructor))S.copy(v);else if(v!==void 0){const A=S instanceof it;!A&&S.setScalar?S.setScalar(v):S instanceof Gu&&v instanceof Gu?S.mask=v.mask:S.set(v),!a3()&&!a.linear&&A&&S.convertSRGBToLinear()}}else if(g[m]=v,g[m]instanceof Tn&&g[m].format===er&&g[m].type===No){const A=g[m];v1(A)&&v1(a.gl)?A.colorSpace=a.gl.outputColorSpace:A.encoding=a.gl.outputEncoding}qc(n)}if(s.parent&&n.raycast&&h!==s.eventCount){const p=Z0(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),s.eventCount&&p.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(r=n.__r3f)!=null&&r.parent&&JS(n),n}function qc(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 JS(n){n.onUpdate==null||n.onUpdate(n)}function p3(n,e){n.manual||(l3(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 v0(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function FW(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return yf.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return yf.ContinuousEventPriority;default:return yf.DefaultEventPriority}}function m3(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function OW(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)=>{m3(t.capturedMap,e,i,r)})}function UW(n){function e(l){const{internal:u}=n.getState(),h=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,u){const h=n.getState(),d=new Set,p=[],m=u?u(h.internal.interaction):h.internal.interaction;for(let g=0;g{const A=id(g.object),E=id(S.object);return!A||!E?g.distance-S.distance:E.events.priority-A.events.priority||g.distance-S.distance}).filter(g=>{const S=v0(g);return d.has(S)?!1:(d.add(S),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const g of x){let S=g.object;for(;S;){var y;(y=S.__r3f)!=null&&y.eventCount&&p.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(v0(g.intersection))||p.push(g.intersection);return p}function r(l,u,h,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const x=id(v.object)||p,{raycaster:y,pointer:g,camera:S,internal:A}=x,E=new G(g.x,g.y,0).unproject(S),b=T=>{var L,K;return(L=(K=A.capturedMap.get(T))==null?void 0:K.has(v.eventObject))!=null?L:!1},C=T=>{const L={intersection:v,target:u.target};A.capturedMap.has(T)?A.capturedMap.get(T).set(v.eventObject,L):A.capturedMap.set(T,new Map([[v.eventObject,L]])),u.target.setPointerCapture(T)},R=T=>{const L=A.capturedMap.get(T);L&&m3(A.capturedMap,v.eventObject,L,T)};let I={};for(let T in u){let L=u[T];typeof L!="function"&&(I[T]=L)}let O={...v,...I,pointer:g,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:E,ray:y.ray,camera:S,stopPropagation(){const T="pointerId"in u&&A.capturedMap.get(u.pointerId);if((!T||T.has(v.eventObject))&&(O.stopped=m.stopped=!0,A.hovered.size&&Array.from(A.hovered.values()).find(L=>L.eventObject===v.eventObject))){const L=l.slice(0,l.indexOf(v));s([...L,v])}},target:{hasPointerCapture:b,setPointerCapture:C,releasePointerCapture:R},currentTarget:{hasPointerCapture:b,setPointerCapture:C,releasePointerCapture:R},nativeEvent:u};if(d(O),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const h of u.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(v0(h)),p!=null&&p.eventCount){const v={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,u){for(let h=0;hs([]);case"onLostPointerCapture":return u=>{const{internal:h}=n.getState();"pointerId"in u&&h.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(u.pointerId)&&(h.capturedMap.delete(u.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(h,m?t:void 0),g=v?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(A=>A.eventObject)),v&&!y.length&&g<=2&&(o(h,p.interaction),d&&d(h)),m&&s(y);function S(A){const E=A.eventObject,b=E.__r3f,C=b==null?void 0:b.handlers;if(b!=null&&b.eventCount)if(m){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const R=v0(A),I=p.hovered.get(R);I?I.stopped&&A.stopPropagation():(p.hovered.set(R,A),C.onPointerOver==null||C.onPointerOver(A),C.onPointerEnter==null||C.onPointerEnter(A))}C.onPointerMove==null||C.onPointerMove(A)}else{const R=C[l];R?(!v||p.initialHits.includes(E))&&(o(h,p.interaction.filter(I=>!p.initialHits.includes(I))),R(A)):v&&p.initialHits.includes(E)&&o(h,p.interaction.filter(I=>!p.initialHits.includes(I)))}}r(y,h,g,S)}}return{handlePointer:a}}const kW=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],g3=n=>!!(n!=null&&n.render),F_=ne.createContext(null),zW=(n,e)=>{const t=e3((a,l)=>{const u=new G,h=new G,d=new G;function p(g=l().camera,S=h,A=l().size){const{width:E,height:b,top:C,left:R}=A,I=E/b;S instanceof G?d.copy(S):d.set(...S);const O=g.getWorldPosition(u).distanceTo(d);if(l3(g))return{width:E/g.zoom,height:b/g.zoom,top:C,left:R,factor:1,distance:O,aspect:I};{const T=g.fov*Math.PI/180,L=2*Math.tan(T/2)*O,K=L*(E/b);return{width:K,height:L,top:C,left:R,factor:E/K,distance:O,aspect:I}}}let m;const v=g=>a(S=>({performance:{...S.performance,current:g}})),x=new Re;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,S)=>e(g,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new sw,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,A,E,b)=>{const C=l().camera,R={width:g,height:S,top:E||0,left:b||0,updateStyle:A};a(I=>({size:R,viewport:{...I.viewport,...p(C,h,R)}}))},setDpr:g=>a(S=>{const A=h3(g);return{viewport:{...S.viewport,dpr:A,initialDpr:S.viewport.initialDpr||A}}}),setFrameloop:(g="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ne.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,A)=>{const E=l().internal;return E.priority=E.priority+(S>0?1:0),E.subscribers.push({ref:g,priority:S,store:A}),E.subscribers=E.subscribers.sort((b,C)=>b.priority-C.priority),()=>{const b=l().internal;b!=null&&b.subscribers&&(b.priority=b.priority-(S>0?1:0),b.subscribers=b.subscribers.filter(C=>C.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:h,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||u.dpr!==s){var p;r=l,s=u.dpr,p3(a,l),h.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let _0,GW=new Set,HW=new Set,VW=new Set;function x1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function rd(n,e){switch(n){case"before":return x1(GW,e);case"after":return x1(HW,e);case"tail":return x1(VW,e)}}let A1,S1;function M1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),A1=e.internal.subscribers,_0=0;_00)&&!((u=r.gl.xr)!=null&&u.isPresenting)&&(t+=M1(l,r))}if(rd("after",l),t===0)return rd("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,u=1){var h;if(!l)return n.forEach(d=>o(d.store.getState(),u));(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,h,d){if(u&&rd("before",l),h)M1(l,h,d);else for(const p of n.values())M1(l,p.store.getState());u&&rd("after",l)}return{loop:s,invalidate:o,advance:a}}function fw(){const n=ne.useContext(F_);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function ri(n=t=>t,e){return fw()(n,e)}function $p(n,e=0){const t=fw(),i=t.getState().internal.subscribe,r=u3(n);return qp(()=>i(r,e,t),[e,i,t]),null}const BP=new WeakMap;function v3(n,e){return function(t,...i){let r=BP.get(t);return r||(r=new t,BP.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,LW(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function Ta(n,e,t,i){const r=Array.isArray(e)?e:[e],s=TW(v3(t,i),[n,...r],{equal:bn.equ});return Array.isArray(e)?s:s[0]}Ta.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return CW(v3(t),[n,...i])};Ta.clear=function(n,e){const t=Array.isArray(e)?e:[e];return RW([n,...t])};const sh=new Map,{invalidate:IP,advance:LP}=WW(sh),{reconciler:Ip,applyProps:vu}=bW(sh,FW),Yc={objects:"shallow",strict:!1},XW=(n,e)=>{const t=typeof n=="function"?n(e):n;return g3(t)?t:new OE({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function JW(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"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 jW(n){const e=sh.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||zW(IP,LP),o=t||Ip.createContainer(s,yf.ConcurrentRoot,null,!1,null,"",r,null);e||sh.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(h={}){let{gl:d,size:p,scene:m,events:v,onCreated:x,shadows:y=!1,linear:g=!1,flat:S=!1,legacy:A=!1,orthographic:E=!1,frameloop:b="always",dpr:C=[1,2],performance:R,raycaster:I,camera:O,onPointerMissed:T}=h,L=s.getState(),K=L.gl;L.gl||L.set({gl:K=XW(d,n)});let se=L.raycaster;se||L.set({raycaster:se=new uw});const{params:W,...te}=I||{};if(bn.equ(te,se,Yc)||vu(se,{...te}),bn.equ(W,se.params,Yc)||vu(se,{params:{...se.params,...W}}),!L.camera||L.camera===u&&!bn.equ(u,O,Yc)){u=O;const N=O instanceof Gp,ee=N?O:E?new Os(0,0,0,0,.1,1e3):new Pn(75,0,.1,1e3);N||(ee.position.z=5,O&&vu(ee,O),!L.camera&&!(O!=null&&O.rotation)&&ee.lookAt(0,0,0)),L.set({camera:ee}),se.camera=ee}if(!L.scene){let N;m instanceof eh?N=m:(N=new eh,m&&vu(N,m)),L.set({scene:Zc(N)})}if(!L.xr){var $;const N=(Be,ae)=>{const xe=s.getState();xe.frameloop!=="never"&&LP(Be,!0,xe,ae)},ee=()=>{const Be=s.getState();Be.gl.xr.enabled=Be.gl.xr.isPresenting,Be.gl.xr.setAnimationLoop(Be.gl.xr.isPresenting?N:null),Be.gl.xr.isPresenting||IP(Be)},ce={connect(){const Be=s.getState().gl;Be.xr.addEventListener("sessionstart",ee),Be.xr.addEventListener("sessionend",ee)},disconnect(){const Be=s.getState().gl;Be.xr.removeEventListener("sessionstart",ee),Be.xr.removeEventListener("sessionend",ee)}};typeof(($=K.xr)==null?void 0:$.addEventListener)=="function"&&ce.connect(),L.set({xr:ce})}if(K.shadowMap){const N=K.shadowMap.enabled,ee=K.shadowMap.type;if(K.shadowMap.enabled=!!y,bn.boo(y))K.shadowMap.type=zd;else if(bn.str(y)){var oe;const ce={basic:YL,percentage:l_,soft:zd,variance:eo};K.shadowMap.type=(oe=ce[y])!=null?oe:zd}else bn.obj(y)&&Object.assign(K.shadowMap,y);(N!==K.shadowMap.enabled||ee!==K.shadowMap.type)&&(K.shadowMap.needsUpdate=!0)}const F=a3();F&&("enabled"in F?F.enabled=!A:"legacyMode"in F&&(F.legacyMode=A)),l||vu(K,{outputEncoding:g?3e3:3001,toneMapping:S?Do:vE}),L.legacy!==A&&L.set(()=>({legacy:A})),L.linear!==g&&L.set(()=>({linear:g})),L.flat!==S&&L.set(()=>({flat:S})),d&&!bn.fun(d)&&!g3(d)&&!bn.equ(d,K,Yc)&&vu(K,d),v&&!L.events.handlers&&L.set({events:v(s)});const V=JW(n,p);return bn.equ(V,L.size,Yc)||L.setSize(V.width,V.height,V.updateStyle,V.top,V.left),C&&L.viewport.dpr!==h3(C)&&L.setDpr(C),L.frameloop!==b&&L.setFrameloop(b),L.onPointerMissed||L.set({onPointerMissed:T}),R&&!bn.equ(R,L.performance,Yc)&&L.set(N=>({performance:{...N.performance,...R}})),a=x,l=!0,this},render(h){return l||this.configure(),Ip.updateContainer(ne.createElement(YW,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){_3(n)}}}function YW({store:n,children:e,onCreated:t,rootElement:i}){return qp(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),ne.createElement(F_.Provider,{value:n},e)}function _3(n,e){const t=sh.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),Ip.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),DW(r),sh.delete(n),e&&e(n)}catch{}},500)})}}function y3(n,e,t){return ne.createElement(KW,{key:e.uuid,children:n,container:e,state:t})}function KW({state:n={},children:e,container:t}){const{events:i,size:r,...s}=n,o=fw(),[a]=ne.useState(()=>new uw),[l]=ne.useState(()=>new Re),u=ne.useCallback((d,p)=>{const m={...d};Object.keys(d).forEach(x=>{(kW.includes(x)||d[x]!==p[x]&&p[x])&&delete m[x]});let v;if(p&&r){const x=p.camera;v=d.viewport.getCurrentViewport(x,new G,r),x!==d.camera&&p3(x,r)}return{...m,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...d.events,...p==null?void 0:p.events,...i},size:{...d.size,...r},viewport:{...d.viewport,...v},...s}},[n]),[h]=ne.useState(()=>{const d=o.getState();return e3((m,v)=>({...d,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...d.events,...i},size:{...d.size,...r},...s,set:m,get:v,setEvents:x=>m(y=>({...y,events:{...y.events,...x}}))}))});return ne.useEffect(()=>{const d=o.subscribe(p=>h.setState(m=>u(p,m)));return()=>{d(),h.destroy()}},[]),ne.useEffect(()=>{h.setState(d=>u(o.getState(),d))},[u]),ne.createElement(ne.Fragment,null,Ip.createPortal(ne.createElement(F_.Provider,{value:h},e),h,null))}Ip.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ne.version});function hs(){return hs=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,e-h):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(l,e)),h&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}jS.debounce=jS;var QW=jS;const DP=Gv(QW);function ZW(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=ne.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=ne.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=ne.useRef(!1);ne.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,m,v]=ne.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:A,top:E,width:b,height:C,bottom:R,right:I,x:O,y:T}=l.current.element.getBoundingClientRect(),L={left:A,top:E,width:b,height:C,bottom:R,right:I,x:O,y:T};l.current.element instanceof HTMLElement&&r&&(L.height=l.current.element.offsetHeight,L.width=l.current.element.offsetWidth),Object.freeze(L),d.current&&!tX(l.current.lastBounds,L)&&a(l.current.lastBounds=L)};return[S,h?DP(S,h):S,u?DP(S,u):S]},[a,r,u,h]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function y(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",v,{capture:!0,passive:!0})))}const g=S=>{!S||S===l.current.element||(x(),l.current.element=S,l.current.scrollContainers=x3(S),y())};return $W(v,!!t),qW(m),ne.useEffect(()=>{x(),y()},[t,v,m]),ne.useEffect(()=>x,[]),[g,o,p]}function qW(n){ne.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function $W(n,e){ne.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function x3(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...x3(n.parentElement)]}const eX=["x","y","top","bottom","left","right","width","height"],tX=(n,e)=>eX.every(t=>n[t]===e[t]);var nX=Object.defineProperty,iX=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,NP=Object.getOwnPropertySymbols,sX=Object.prototype.hasOwnProperty,oX=Object.prototype.propertyIsEnumerable,FP=(n,e,t)=>e in n?nX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,OP=(n,e)=>{for(var t in e||(e={}))sX.call(e,t)&&FP(n,t,e[t]);if(NP)for(var t of NP(e))oX.call(e,t)&&FP(n,t,e[t]);return n},aX=(n,e)=>iX(n,rX(e));function A3(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=A3(i,e,t);if(r)return r;i=e?null:i.sibling}}function S3(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const hw=S3(ne.createContext(null));class M3 extends ne.Component{render(){return ne.createElement(hw.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:UP,ReactCurrentDispatcher:kP}=ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function lX(){const n=ne.useContext(hw);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=ne.useId();return ne.useMemo(()=>{for(const i of[UP==null?void 0:UP.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=A3(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function uX(){var n;const e=lX(),[t]=ne.useState(()=>new Map);t.clear();let i=e;for(;i;){if(i.type&&typeof i.type=="object"){const r="Provider"in i.type?i.type:i.type._context;r&&r!==hw&&!t.has(r)&&t.set(r,(n=kP==null?void 0:kP.current)==null?void 0:n.readContext(S3(r)))}i=i.return}return t}function cX(){const n=uX();return ne.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>ne.createElement(e,null,ne.createElement(t.Provider,aX(OP({},i),{value:n.get(t)}))),e=>ne.createElement(M3,OP({},e))),[n])}const E1={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 fX(n){const{handlePointer:e}=UW(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(E1).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:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=E1[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=E1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const hX=ne.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=fX,eventSource:a,eventPrefix:l,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:S,scene:A,onPointerMissed:E,onCreated:b,...C},R){ne.useMemo(()=>o3(vW),[]);const I=cX(),[O,T]=ZW({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=ne.useRef(null),K=ne.useRef(null);ne.useImperativeHandle(R,()=>L.current);const se=u3(E),[W,te]=ne.useState(!1),[$,oe]=ne.useState(!1);if(W)throw W;if($)throw $;const F=ne.useRef(null);qp(()=>{const N=L.current;T.width>0&&T.height>0&&N&&(F.current||(F.current=jW(N)),F.current.configure({gl:s,events:o,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:S,scene:A,size:T,onPointerMissed:(...ee)=>se.current==null?void 0:se.current(...ee),onCreated:ee=>{ee.events.connect==null||ee.events.connect(a?PW(a)?a.current:a:K.current),l&&ee.setEvents({compute:(ce,Be)=>{const ae=ce[l+"X"],xe=ce[l+"Y"];Be.pointer.set(ae/Be.size.width*2-1,-(xe/Be.size.height)*2+1),Be.raycaster.setFromCamera(Be.pointer,Be.camera)}}),b==null||b(ee)}}),F.current.render(ne.createElement(I,null,ne.createElement(c3,{set:oe},ne.createElement(ne.Suspense,{fallback:ne.createElement(BW,{set:te})},e)))))}),ne.useEffect(()=>{const N=L.current;if(N)return()=>_3(N)},[]);const V=a?"none":"auto";return ne.createElement("div",hs({ref:K,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:V,...r}},C),ne.createElement("div",{ref:O,style:{width:"100%",height:"100%"}},ne.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),dX=ne.forwardRef(function(e,t){return ne.createElement(M3,null,ne.createElement(hX,hs({},e,{ref:t})))}),em=new G,dw=new G,pX=new G,zP=new Re;function mX(n,e,t){const i=em.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function gX(n,e){const t=em.setFromMatrixPosition(n.matrixWorld),i=dw.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(pX);return r.angleTo(s)>Math.PI/2}function vX(n,e,t,i){const r=em.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),zP.set(s.x,s.y),t.setFromCamera(zP,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function E3(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=YS(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const xX=(n=>e=>E3(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),AX=(n=>(e,t)=>E3(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function SX(n){return n&&typeof n=="object"&&"current"in n}const MX=ne.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:u=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:y,zIndexRange:g=[16777271,0],calculatePosition:S=mX,as:A="div",wrapperClass:E,pointerEvents:b="auto",...C},R)=>{const{gl:I,camera:O,scene:T,size:L,raycaster:K,events:se,viewport:W}=ri(),[te]=ne.useState(()=>document.createElement(A)),$=ne.useRef(),oe=ne.useRef(null),F=ne.useRef(0),V=ne.useRef([0,0]),N=ne.useRef(null),ee=ne.useRef(null),ce=(a==null?void 0:a.current)||se.connected||I.domElement.parentNode,Be=ne.useRef(null),ae=ne.useRef(!1),xe=ne.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&SX(d[0]),[d]);ne.useLayoutEffect(()=>{const lt=I.domElement;d&&d==="blending"?(lt.style.zIndex=`${Math.floor(g[0]/2)}`,lt.style.position="absolute",lt.style.pointerEvents="none"):(lt.style.zIndex=null,lt.style.position=null,lt.style.pointerEvents=null)},[d]),ne.useLayoutEffect(()=>{if(oe.current){const lt=$.current=y2(te);if(T.updateMatrixWorld(),h)te.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ne=S(oe.current,O,L);te.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ne[0]}px,${Ne[1]}px,0);transform-origin:0 0;`}return ce&&(r?ce.prepend(te):ce.appendChild(te)),()=>{ce&&ce.removeChild(te),lt.unmount()}}},[ce,h]),ne.useLayoutEffect(()=>{E&&(te.className=E)},[E]);const Se=ne.useMemo(()=>h?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...t},[t,s,o,L,h]),ke=ne.useMemo(()=>({position:"absolute",pointerEvents:b}),[b]);ne.useLayoutEffect(()=>{if(ae.current=!1,h){var lt;(lt=$.current)==null||lt.render(ne.createElement("div",{ref:N,style:Se},ne.createElement("div",{ref:ee,style:ke},ne.createElement("div",{ref:R,className:i,style:t,children:n}))))}else{var Ne;(Ne=$.current)==null||Ne.render(ne.createElement("div",{ref:R,style:Se,className:i,children:n}))}});const We=ne.useRef(!0);$p(lt=>{if(oe.current){O.updateMatrixWorld(),oe.current.updateWorldMatrix(!0,!1);const Ne=h?V.current:S(oe.current,O,L);if(h||Math.abs(F.current-O.zoom)>e||Math.abs(V.current[0]-Ne[0])>e||Math.abs(V.current[1]-Ne[1])>e){const Y=gX(oe.current,O);let Ae=!1;xe&&(Array.isArray(d)?Ae=d.map(re=>re.current):d!=="blending"&&(Ae=[T]));const ge=We.current;if(Ae){const re=vX(oe.current,O,K,Ae);We.current=re&&!Y}else We.current=!Y;ge!==We.current&&(p?p(!We.current):te.style.display=We.current?"block":"none");const Fe=Math.floor(g[0]/2),Ce=d?xe?[g[0],Fe]:[Fe-1,0]:g;if(te.style.zIndex=`${yX(oe.current,O,Ce)}`,h){const[re,Xe]=[L.width/2,L.height/2],et=O.projectionMatrix.elements[5]*Xe,{isOrthographicCamera:Et,top:H,left:U,bottom:ve,right:Me}=O,be=xX(O.matrixWorldInverse),Ie=Et?`scale(${et})translate(${YS(-(Me+U)/2)}px,${YS((H+ve)/2)}px)`:`translateZ(${et}px)`;let tt=oe.current.matrixWorld;u&&(tt=O.matrixWorldInverse.clone().transpose().copyPosition(tt).scale(oe.current.scale),tt.elements[3]=tt.elements[7]=tt.elements[11]=0,tt.elements[15]=1),te.style.width=L.width+"px",te.style.height=L.height+"px",te.style.perspective=Et?"":`${et}px`,N.current&&ee.current&&(N.current.style.transform=`${Ie}${be}translate(${re}px,${Xe}px)`,ee.current.style.transform=AX(tt,1/((l||10)/400)))}else{const re=l===void 0?1:_X(oe.current,O)*l;te.style.transform=`translate3d(${Ne[0]}px,${Ne[1]}px,0) scale(${re})`}V.current=Ne,F.current=O.zoom}}if(!xe&&Be.current&&!ae.current)if(h){if(N.current){const Ne=N.current.children[0];if(Ne!=null&&Ne.clientWidth&&Ne!=null&&Ne.clientHeight){const{isOrthographicCamera:Y}=O;if(Y||y)C.scale&&(Array.isArray(C.scale)?C.scale instanceof G?Be.current.scale.copy(C.scale.clone().divideScalar(1)):Be.current.scale.set(1/C.scale[0],1/C.scale[1],1/C.scale[2]):Be.current.scale.setScalar(1/C.scale));else{const Ae=(l||10)/400,ge=Ne.clientWidth*Ae,Fe=Ne.clientHeight*Ae;Be.current.scale.set(ge,Fe,1)}ae.current=!0}}}else{const Ne=te.children[0];if(Ne!=null&&Ne.clientWidth&&Ne!=null&&Ne.clientHeight){const Y=1/W.factor,Ae=Ne.clientWidth*Y,ge=Ne.clientHeight*Y;Be.current.scale.set(Ae,ge,1),ae.current=!0}Be.current.lookAt(lt.camera.position)}});const Qe=ne.useMemo(()=>({vertexShader:h?void 0:` + */(function(n){function e(F,V){var N=F.length;F.push(V);e:for(;0>>1,fe=F[ee];if(0>>1;eer(xe,N))Ser(ke,xe)?(F[ee]=ke,F[Se]=N,ee=Se):(F[ee]=xe,F[ae]=N,ee=ae);else if(Ser(ke,N))F[ee]=ke,F[Se]=N,ee=Se;else break e}}return V}function r(F,V){var N=F.sortIndex-V.sortIndex;return N!==0?N:F.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();n.unstable_now=function(){return o.now()-a}}var l=[],u=[],h=1,d=null,p=3,m=!1,v=!1,x=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(F){for(var V=t(u);V!==null;){if(V.callback===null)i(u);else if(V.startTime<=F)i(u),V.sortIndex=V.expirationTime,e(l,V);else break;V=t(u)}}function E(F){if(x=!1,A(F),!v)if(t(l)!==null)v=!0,$(b);else{var V=t(u);V!==null&&oe(E,V.startTime-F)}}function b(F,V){v=!1,x&&(x=!1,g(I),I=-1),m=!0;var N=p;try{for(A(V),d=t(l);d!==null&&(!(d.expirationTime>V)||F&&!L());){var ee=d.callback;if(typeof ee=="function"){d.callback=null,p=d.priorityLevel;var fe=ee(d.expirationTime<=V);V=n.unstable_now(),typeof fe=="function"?d.callback=fe:d===t(l)&&i(l),A(V)}else i(l);d=t(l)}if(d!==null)var Be=!0;else{var ae=t(u);ae!==null&&oe(E,ae.startTime-V),Be=!1}return Be}finally{d=null,p=N,m=!1}}var C=!1,R=null,I=-1,O=5,T=-1;function L(){return!(n.unstable_now()-TF||125ee?(F.sortIndex=N,e(u,F),t(l)===null&&F===t(u)&&(x?(g(I),I=-1):x=!0,oe(E,N-ee))):(F.sortIndex=fe,e(l,F),v||m||(v=!0,$(b))),F},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(F){var V=p;return function(){var N=p;p=V;try{return F.apply(this,arguments)}finally{p=N}}}})(s3);r3.exports=s3;var CP=r3.exports;const PW=n=>typeof n=="object"&&typeof n.then=="function",Pu=[];function o3(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e)return!1;const i=n.length;if(e.length!==i)return!1;for(let r=0;r0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,i.lifespan)),s.response;if(!t)throw s.promise}const r={keys:e,equal:i.equal,remove:()=>{const s=Pu.indexOf(r);s!==-1&&Pu.splice(s,1)},promise:(PW(n)?n:n(...e)).then(s=>{r.response=s,i.lifespan&&i.lifespan>0&&(r.timeout=setTimeout(r.remove,i.lifespan))}).catch(s=>r.error=s)};if(Pu.push(r),!t)throw r.promise}const BW=(n,e,t)=>a3(n,e,!1,t),IW=(n,e,t)=>void a3(n,e,!0,t),LW=n=>{if(n===void 0||n.length===0)Pu.splice(0,Pu.length);else{const e=Pu.find(t=>o3(n,t.keys,t.equal));e&&e.remove()}},cw={},l3=n=>void Object.assign(cw,n);function DW(n,e){function t(h,{args:d=[],attach:p,...m},v){let x=`${h[0].toUpperCase()}${h.slice(1)}`,y;if(h==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;y=Zc(g,{type:h,root:v,attach:p,primitive:!0})}else{const g=cw[x];if(!g)throw new Error(`R3F: ${x} 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(d))throw new Error("R3F: The args prop must be an array!");y=Zc(new g(...d),{type:h,root:v,attach:p,memoizedProps:{args:d}})}return y.__r3f.attach===void 0&&(y instanceof zt?y.__r3f.attach="geometry":y instanceof mi&&(y.__r3f.attach="material")),x!=="inject"&&y1(y,m),y}function i(h,d){let p=!1;if(d){var m,v;(m=d.__r3f)!=null&&m.attach?_1(h,d,d.__r3f.attach):d.isObject3D&&h.isObject3D&&(h.add(d),p=!0),p||(v=h.__r3f)==null||v.objects.push(d),d.__r3f||Zc(d,{}),d.__r3f.parent=h,JS(d),qc(d)}}function r(h,d,p){let m=!1;if(d){var v,x;if((v=d.__r3f)!=null&&v.attach)_1(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){d.parent=h,d.dispatchEvent({type:"added"});const y=h.children.filter(S=>S!==d),g=y.indexOf(p);h.children=[...y.slice(0,g),d,...y.slice(g)],m=!0}m||(x=h.__r3f)==null||x.objects.push(d),d.__r3f||Zc(d,{}),d.__r3f.parent=h,JS(d),qc(d)}}function s(h,d,p=!1){h&&[...h].forEach(m=>o(d,m,p))}function o(h,d,p){if(d){var m,v,x;if(d.__r3f&&(d.__r3f.parent=null),(m=h.__r3f)!=null&&m.objects&&(h.__r3f.objects=h.__r3f.objects.filter(E=>E!==d)),(v=d.__r3f)!=null&&v.attach)IP(h,d,d.__r3f.attach);else if(d.isObject3D&&h.isObject3D){var y;h.remove(d),(y=d.__r3f)!=null&&y.root&&HW(Z0(d),d)}const S=(x=d.__r3f)==null?void 0:x.primitive,A=!S&&(p===void 0?d.dispose!==null:p);if(!S){var g;s((g=d.__r3f)==null?void 0:g.objects,d,A),s(d.children,d,A)}if(delete d.__r3f,A&&d.dispose&&d.type!=="Scene"){const E=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?CP.unstable_scheduleCallback(CP.unstable_IdlePriority,E):E()}qc(h)}}function a(h,d,p,m){var v;const x=(v=h.__r3f)==null?void 0:v.parent;if(!x)return;const y=t(d,p,h.__r3f.root);if(h.children){for(const g of h.children)g.__r3f&&i(y,g);h.children=h.children.filter(g=>!g.__r3f)}h.__r3f.objects.forEach(g=>i(y,g)),h.__r3f.objects=[],h.__r3f.autoRemovedBeforeAppend||o(x,h),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),i(x,y),y.raycast&&y.__r3f.eventCount&&Z0(y).getState().internal.interaction.push(y),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bW({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(h,d)=>{if(!d)return;const p=h.getState().scene;p.__r3f&&(p.__r3f.root=h,i(p,d))},removeChildFromContainer:(h,d)=>{d&&o(h.getState().scene,d)},insertInContainerBefore:(h,d,p)=>{if(!d||!p)return;const m=h.getState().scene;m.__r3f&&r(m,d,p)},getRootHostContext:()=>null,getChildHostContext:h=>h,finalizeInitialChildren(h){var d;return!!((d=h==null?void 0:h.__r3f)!=null?d:{}).handlers},prepareUpdate(h,d,p,m){var v;if(((v=h==null?void 0:h.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==h)return[!0];{const{args:y=[],children:g,...S}=m,{args:A=[],children:E,...b}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((R,I)=>R!==A[I]))return[!0];const C=m3(h,S,b,!0);return C.changes.length?[!1,C]:null}},commitUpdate(h,[d,p],m,v,x,y){d?a(h,m,x,y):y1(h,p)},commitMount(h,d,p,m){var v;const x=(v=h.__r3f)!=null?v:{};h.raycast&&x.handlers&&x.eventCount&&Z0(h).getState().internal.interaction.push(h)},getPublicInstance:h=>h,prepareForCommit:()=>null,preparePortalMount:h=>Zc(h.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(h){var d;const{attach:p,parent:m}=(d=h.__r3f)!=null?d:{};p&&m&&IP(m,h,p),h.isObject3D&&(h.visible=!1),qc(h)},unhideInstance(h,d){var p;const{attach:m,parent:v}=(p=h.__r3f)!=null?p:{};m&&v&&_1(v,h,m),(h.isObject3D&&d.visible==null||d.visible)&&(h.visible=!0),qc(h)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():yf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&bn.fun(performance.now)?performance.now:bn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:bn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:bn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:y1}}var RP,bP;const v1=n=>"colorSpace"in n||"outputColorSpace"in n,u3=()=>{var n;return(n=cw.ColorManagement)!=null?n:null},c3=n=>n&&n.isOrthographicCamera,NW=n=>n&&n.hasOwnProperty("current"),qp=typeof window<"u"&&((RP=window.document)!=null&&RP.createElement||((bP=window.navigator)==null?void 0:bP.product)==="ReactNative")?ne.useLayoutEffect:ne.useEffect;function f3(n){const e=ne.useRef(n);return qp(()=>void(e.current=n),[n]),e}function FW({set:n}){return qp(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class h3 extends ne.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}h3.getDerivedStateFromError=()=>({error:!0});const d3="__default",PP=new Map,OW=n=>n&&!!n.memoized&&!!n.changes;function p3(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 id=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function Z0(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const bn={obj:n=>n===Object(n)&&!bn.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(bn.str(n)||bn.num(n))return n===e;const s=bn.obj(n);if(s&&i==="reference")return n===e;const o=bn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!bn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(bn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function UW(n){const e={nodes:{},materials:{}};return n&&n.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material)}),e}function kW(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Zc(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function XS(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const BP=/-\d+$/;function _1(n,e,t){if(bn.str(t)){if(BP.test(t)){const s=t.replace(BP,""),{target:o,key:a}=XS(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=XS(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function IP(n,e,t){var i,r;if(bn.str(t)){const{target:s,key:o}=XS(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function m3(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},u=!1){var h;const d=(h=n==null?void 0:n.__r3f)!=null?h:{},p=Object.entries(r),m=[];if(u){const x=Object.keys(l);for(let y=0;y{var g;if((g=n.__r3f)!=null&&g.primitive&&x==="object"||bn.equ(y,l[x]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(x))return m.push([x,y,!0,[]]);let S=[];x.includes("-")&&(S=x.split("-")),m.push([x,y,!1,S]);for(const A in r){const E=r[A];A.startsWith(`${x}-`)&&m.push([A,E,!1,A.split("-")])}});const v={...r};return d.memoizedProps&&d.memoizedProps.args&&(v.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(v.attach=d.memoizedProps.attach),{memoized:v,changes:m}}const zW=typeof process<"u"&&!1;function y1(n,e){var t,i,r;const s=(t=n.__r3f)!=null?t:{},o=s.root,a=(i=o==null||o.getState==null?void 0:o.getState())!=null?i:{},{memoized:l,changes:u}=OW(e)?e:m3(n,e),h=s.eventCount;n.__r3f&&(n.__r3f.memoizedProps=l);for(let p=0;pA[E],n),!(S&&S.set))){const[A,...E]=y.reverse();g=E.reverse().reduce((b,C)=>b[C],n),m=A}if(v===d3+"remove")if(g.constructor){let A=PP.get(g.constructor);A||(A=new g.constructor,PP.set(g.constructor,A)),v=A[m]}else v=0;if(x)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(S&&S.set&&(S.copy||S instanceof Hu)){if(Array.isArray(v))S.fromArray?S.fromArray(v):S.set(...v);else if(S.copy&&v&&v.constructor&&(zW?S.constructor.name===v.constructor.name:S.constructor===v.constructor))S.copy(v);else if(v!==void 0){const A=S instanceof it;!A&&S.setScalar?S.setScalar(v):S instanceof Hu&&v instanceof Hu?S.mask=v.mask:S.set(v),!u3()&&!a.linear&&A&&S.convertSRGBToLinear()}}else if(g[m]=v,g[m]instanceof Tn&&g[m].format===er&&g[m].type===No){const A=g[m];v1(A)&&v1(a.gl)?A.colorSpace=a.gl.outputColorSpace:A.encoding=a.gl.outputEncoding}qc(n)}if(s.parent&&n.raycast&&h!==s.eventCount){const p=Z0(n).getState().internal,m=p.interaction.indexOf(n);m>-1&&p.interaction.splice(m,1),s.eventCount&&p.interaction.push(n)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(r=n.__r3f)!=null&&r.parent&&JS(n),n}function qc(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 JS(n){n.onUpdate==null||n.onUpdate(n)}function g3(n,e){n.manual||(c3(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 v0(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function GW(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return yf.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return yf.ContinuousEventPriority;default:return yf.DefaultEventPriority}}function v3(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function HW(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)=>{v3(t.capturedMap,e,i,r)})}function VW(n){function e(l){const{internal:u}=n.getState(),h=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(l,u){const h=n.getState(),d=new Set,p=[],m=u?u(h.internal.interaction):h.internal.interaction;for(let g=0;g{const A=id(g.object),E=id(S.object);return!A||!E?g.distance-S.distance:E.events.priority-A.events.priority||g.distance-S.distance}).filter(g=>{const S=v0(g);return d.has(S)?!1:(d.add(S),!0)});h.events.filter&&(x=h.events.filter(x,h));for(const g of x){let S=g.object;for(;S;){var y;(y=S.__r3f)!=null&&y.eventCount&&p.push({...g,eventObject:S}),S=S.parent}}if("pointerId"in l&&h.internal.capturedMap.has(l.pointerId))for(let g of h.internal.capturedMap.get(l.pointerId).values())d.has(v0(g.intersection))||p.push(g.intersection);return p}function r(l,u,h,d){const p=n.getState();if(l.length){const m={stopped:!1};for(const v of l){const x=id(v.object)||p,{raycaster:y,pointer:g,camera:S,internal:A}=x,E=new G(g.x,g.y,0).unproject(S),b=T=>{var L,K;return(L=(K=A.capturedMap.get(T))==null?void 0:K.has(v.eventObject))!=null?L:!1},C=T=>{const L={intersection:v,target:u.target};A.capturedMap.has(T)?A.capturedMap.get(T).set(v.eventObject,L):A.capturedMap.set(T,new Map([[v.eventObject,L]])),u.target.setPointerCapture(T)},R=T=>{const L=A.capturedMap.get(T);L&&v3(A.capturedMap,v.eventObject,L,T)};let I={};for(let T in u){let L=u[T];typeof L!="function"&&(I[T]=L)}let O={...v,...I,pointer:g,intersections:l,stopped:m.stopped,delta:h,unprojectedPoint:E,ray:y.ray,camera:S,stopPropagation(){const T="pointerId"in u&&A.capturedMap.get(u.pointerId);if((!T||T.has(v.eventObject))&&(O.stopped=m.stopped=!0,A.hovered.size&&Array.from(A.hovered.values()).find(L=>L.eventObject===v.eventObject))){const L=l.slice(0,l.indexOf(v));s([...L,v])}},target:{hasPointerCapture:b,setPointerCapture:C,releasePointerCapture:R},currentTarget:{hasPointerCapture:b,setPointerCapture:C,releasePointerCapture:R},nativeEvent:u};if(d(O),m.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const h of u.hovered.values())if(!l.length||!l.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f,m=p==null?void 0:p.handlers;if(u.hovered.delete(v0(h)),p!=null&&p.eventCount){const v={...h,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,u){for(let h=0;hs([]);case"onLostPointerCapture":return u=>{const{internal:h}=n.getState();"pointerId"in u&&h.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(u.pointerId)&&(h.capturedMap.delete(u.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=h;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=i(h,m?t:void 0),g=v?e(h):0;l==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=y.map(A=>A.eventObject)),v&&!y.length&&g<=2&&(o(h,p.interaction),d&&d(h)),m&&s(y);function S(A){const E=A.eventObject,b=E.__r3f,C=b==null?void 0:b.handlers;if(b!=null&&b.eventCount)if(m){if(C.onPointerOver||C.onPointerEnter||C.onPointerOut||C.onPointerLeave){const R=v0(A),I=p.hovered.get(R);I?I.stopped&&A.stopPropagation():(p.hovered.set(R,A),C.onPointerOver==null||C.onPointerOver(A),C.onPointerEnter==null||C.onPointerEnter(A))}C.onPointerMove==null||C.onPointerMove(A)}else{const R=C[l];R?(!v||p.initialHits.includes(E))&&(o(h,p.interaction.filter(I=>!p.initialHits.includes(I))),R(A)):v&&p.initialHits.includes(E)&&o(h,p.interaction.filter(I=>!p.initialHits.includes(I)))}}r(y,h,g,S)}}return{handlePointer:a}}const WW=["set","get","setSize","setFrameloop","setDpr","events","invalidate","advance","size","viewport"],_3=n=>!!(n!=null&&n.render),F_=ne.createContext(null),XW=(n,e)=>{const t=n3((a,l)=>{const u=new G,h=new G,d=new G;function p(g=l().camera,S=h,A=l().size){const{width:E,height:b,top:C,left:R}=A,I=E/b;S instanceof G?d.copy(S):d.set(...S);const O=g.getWorldPosition(u).distanceTo(d);if(c3(g))return{width:E/g.zoom,height:b/g.zoom,top:C,left:R,factor:1,distance:O,aspect:I};{const T=g.fov*Math.PI/180,L=2*Math.tan(T/2)*O,K=L*(E/b);return{width:K,height:L,top:C,left:R,factor:E/K,distance:O,aspect:I}}}let m;const v=g=>a(S=>({performance:{...S.performance,current:g}})),x=new Re;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>n(l(),g),advance:(g,S)=>e(g,S,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new sw,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(S=>({...S,events:{...S.events,...g}})),setSize:(g,S,A,E,b)=>{const C=l().camera,R={width:g,height:S,top:E||0,left:b||0,updateStyle:A};a(I=>({size:R,viewport:{...I.viewport,...p(C,h,R)}}))},setDpr:g=>a(S=>{const A=p3(g);return{viewport:{...S.viewport,dpr:A,initialDpr:S.viewport.initialDpr||A}}}),setFrameloop:(g="always")=>{const S=l().clock;S.stop(),S.elapsedTime=0,g!=="never"&&(S.start(),S.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:ne.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,S,A)=>{const E=l().internal;return E.priority=E.priority+(S>0?1:0),E.subscribers.push({ref:g,priority:S,store:A}),E.subscribers=E.subscribers.sort((b,C)=>b.priority-C.priority),()=>{const b=l().internal;b!=null&&b.subscribers&&(b.priority=b.priority-(S>0?1:0),b.subscribers=b.subscribers.filter(C=>C.ref!==g))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:h,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||u.dpr!==s){var p;r=l,s=u.dpr,g3(a,l),h.setPixelRatio(u.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(l.width,l.height,m)}a!==o&&(o=a,d(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let _0,JW=new Set,jW=new Set,YW=new Set;function x1(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function rd(n,e){switch(n){case"before":return x1(JW,e);case"after":return x1(jW,e);case"tail":return x1(YW,e)}}let A1,S1;function M1(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),A1=e.internal.subscribers,_0=0;_00)&&!((u=r.gl.xr)!=null&&u.isPresenting)&&(t+=M1(l,r))}if(rd("after",l),t===0)return rd("tail",l),e=!1,cancelAnimationFrame(i)}function o(l,u=1){var h;if(!l)return n.forEach(d=>o(d.store.getState(),u));(h=l.gl.xr)!=null&&h.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+u),e||(e=!0,requestAnimationFrame(s)))}function a(l,u=!0,h,d){if(u&&rd("before",l),h)M1(l,h,d);else for(const p of n.values())M1(l,p.store.getState());u&&rd("after",l)}return{loop:s,invalidate:o,advance:a}}function fw(){const n=ne.useContext(F_);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function si(n=t=>t,e){return fw()(n,e)}function $p(n,e=0){const t=fw(),i=t.getState().internal.subscribe,r=f3(n);return qp(()=>i(r,e,t),[e,i,t]),null}const LP=new WeakMap;function y3(n,e){return function(t,...i){let r=LP.get(t);return r||(r=new t,LP.set(t,r)),n&&n(r),Promise.all(i.map(s=>new Promise((o,a)=>r.load(s,l=>{l.scene&&Object.assign(l,UW(l.scene)),o(l)},e,l=>a(new Error(`Could not load ${s}: ${l==null?void 0:l.message}`)))))).finally(()=>r.dispose==null?void 0:r.dispose())}}function Ta(n,e,t,i){const r=Array.isArray(e)?e:[e],s=BW(y3(t,i),[n,...r],{equal:bn.equ});return Array.isArray(e)?s:s[0]}Ta.preload=function(n,e,t){const i=Array.isArray(e)?e:[e];return IW(y3(t),[n,...i])};Ta.clear=function(n,e){const t=Array.isArray(e)?e:[e];return LW([n,...t])};const sh=new Map,{invalidate:DP,advance:NP}=KW(sh),{reconciler:Ip,applyProps:_u}=DW(sh,GW),Yc={objects:"shallow",strict:!1},QW=(n,e)=>{const t=typeof n=="function"?n(e):n;return _3(t)?t:new OE({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function ZW(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"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 qW(n){const e=sh.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||XW(DP,NP),o=t||Ip.createContainer(s,yf.ConcurrentRoot,null,!1,null,"",r,null);e||sh.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(h={}){let{gl:d,size:p,scene:m,events:v,onCreated:x,shadows:y=!1,linear:g=!1,flat:S=!1,legacy:A=!1,orthographic:E=!1,frameloop:b="always",dpr:C=[1,2],performance:R,raycaster:I,camera:O,onPointerMissed:T}=h,L=s.getState(),K=L.gl;L.gl||L.set({gl:K=QW(d,n)});let se=L.raycaster;se||L.set({raycaster:se=new uw});const{params:W,...te}=I||{};if(bn.equ(te,se,Yc)||_u(se,{...te}),bn.equ(W,se.params,Yc)||_u(se,{params:{...se.params,...W}}),!L.camera||L.camera===u&&!bn.equ(u,O,Yc)){u=O;const N=O instanceof Gp,ee=N?O:E?new Os(0,0,0,0,.1,1e3):new Pn(75,0,.1,1e3);N||(ee.position.z=5,O&&_u(ee,O),!L.camera&&!(O!=null&&O.rotation)&&ee.lookAt(0,0,0)),L.set({camera:ee}),se.camera=ee}if(!L.scene){let N;m instanceof eh?N=m:(N=new eh,m&&_u(N,m)),L.set({scene:Zc(N)})}if(!L.xr){var $;const N=(Be,ae)=>{const xe=s.getState();xe.frameloop!=="never"&&NP(Be,!0,xe,ae)},ee=()=>{const Be=s.getState();Be.gl.xr.enabled=Be.gl.xr.isPresenting,Be.gl.xr.setAnimationLoop(Be.gl.xr.isPresenting?N:null),Be.gl.xr.isPresenting||DP(Be)},fe={connect(){const Be=s.getState().gl;Be.xr.addEventListener("sessionstart",ee),Be.xr.addEventListener("sessionend",ee)},disconnect(){const Be=s.getState().gl;Be.xr.removeEventListener("sessionstart",ee),Be.xr.removeEventListener("sessionend",ee)}};typeof(($=K.xr)==null?void 0:$.addEventListener)=="function"&&fe.connect(),L.set({xr:fe})}if(K.shadowMap){const N=K.shadowMap.enabled,ee=K.shadowMap.type;if(K.shadowMap.enabled=!!y,bn.boo(y))K.shadowMap.type=zd;else if(bn.str(y)){var oe;const fe={basic:QL,percentage:l_,soft:zd,variance:eo};K.shadowMap.type=(oe=fe[y])!=null?oe:zd}else bn.obj(y)&&Object.assign(K.shadowMap,y);(N!==K.shadowMap.enabled||ee!==K.shadowMap.type)&&(K.shadowMap.needsUpdate=!0)}const F=u3();F&&("enabled"in F?F.enabled=!A:"legacyMode"in F&&(F.legacyMode=A)),l||_u(K,{outputEncoding:g?3e3:3001,toneMapping:S?Do:vE}),L.legacy!==A&&L.set(()=>({legacy:A})),L.linear!==g&&L.set(()=>({linear:g})),L.flat!==S&&L.set(()=>({flat:S})),d&&!bn.fun(d)&&!_3(d)&&!bn.equ(d,K,Yc)&&_u(K,d),v&&!L.events.handlers&&L.set({events:v(s)});const V=ZW(n,p);return bn.equ(V,L.size,Yc)||L.setSize(V.width,V.height,V.updateStyle,V.top,V.left),C&&L.viewport.dpr!==p3(C)&&L.setDpr(C),L.frameloop!==b&&L.setFrameloop(b),L.onPointerMissed||L.set({onPointerMissed:T}),R&&!bn.equ(R,L.performance,Yc)&&L.set(N=>({performance:{...N.performance,...R}})),a=x,l=!0,this},render(h){return l||this.configure(),Ip.updateContainer(ne.createElement($W,{store:s,children:h,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){x3(n)}}}function $W({store:n,children:e,onCreated:t,rootElement:i}){return qp(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),ne.createElement(F_.Provider,{value:n},e)}function x3(n,e){const t=sh.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),Ip.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),kW(r),sh.delete(n),e&&e(n)}catch{}},500)})}}function A3(n,e,t){return ne.createElement(eX,{key:e.uuid,children:n,container:e,state:t})}function eX({state:n={},children:e,container:t}){const{events:i,size:r,...s}=n,o=fw(),[a]=ne.useState(()=>new uw),[l]=ne.useState(()=>new Re),u=ne.useCallback((d,p)=>{const m={...d};Object.keys(d).forEach(x=>{(WW.includes(x)||d[x]!==p[x]&&p[x])&&delete m[x]});let v;if(p&&r){const x=p.camera;v=d.viewport.getCurrentViewport(x,new G,r),x!==d.camera&&g3(x,r)}return{...m,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...d.events,...p==null?void 0:p.events,...i},size:{...d.size,...r},viewport:{...d.viewport,...v},...s}},[n]),[h]=ne.useState(()=>{const d=o.getState();return n3((m,v)=>({...d,scene:t,raycaster:a,pointer:l,mouse:l,previousRoot:o,events:{...d.events,...i},size:{...d.size,...r},...s,set:m,get:v,setEvents:x=>m(y=>({...y,events:{...y.events,...x}}))}))});return ne.useEffect(()=>{const d=o.subscribe(p=>h.setState(m=>u(p,m)));return()=>{d(),h.destroy()}},[]),ne.useEffect(()=>{h.setState(d=>u(o.getState(),d))},[u]),ne.createElement(ne.Fragment,null,Ip.createPortal(ne.createElement(F_.Provider,{value:h},e),h,null))}Ip.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:ne.version});function hs(){return hs=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0?i=setTimeout(l,e-h):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var h=t&&!i;return i||(i=setTimeout(l,e)),h&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}jS.debounce=jS;var tX=jS;const FP=Gv(tX);function nX(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=ne.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=ne.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,h=e?typeof e=="number"?e:e.resize:null,d=ne.useRef(!1);ne.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,m,v]=ne.useMemo(()=>{const S=()=>{if(!l.current.element)return;const{left:A,top:E,width:b,height:C,bottom:R,right:I,x:O,y:T}=l.current.element.getBoundingClientRect(),L={left:A,top:E,width:b,height:C,bottom:R,right:I,x:O,y:T};l.current.element instanceof HTMLElement&&r&&(L.height=l.current.element.offsetHeight,L.width=l.current.element.offsetWidth),Object.freeze(L),d.current&&!oX(l.current.lastBounds,L)&&a(l.current.lastBounds=L)};return[S,h?FP(S,h):S,u?FP(S,u):S]},[a,r,u,h]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function y(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(S=>S.addEventListener("scroll",v,{capture:!0,passive:!0})))}const g=S=>{!S||S===l.current.element||(x(),l.current.element=S,l.current.scrollContainers=S3(S),y())};return rX(v,!!t),iX(m),ne.useEffect(()=>{x(),y()},[t,v,m]),ne.useEffect(()=>x,[]),[g,o,p]}function iX(n){ne.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function rX(n,e){ne.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function S3(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...S3(n.parentElement)]}const sX=["x","y","top","bottom","left","right","width","height"],oX=(n,e)=>sX.every(t=>n[t]===e[t]);var aX=Object.defineProperty,lX=Object.defineProperties,uX=Object.getOwnPropertyDescriptors,OP=Object.getOwnPropertySymbols,cX=Object.prototype.hasOwnProperty,fX=Object.prototype.propertyIsEnumerable,UP=(n,e,t)=>e in n?aX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,kP=(n,e)=>{for(var t in e||(e={}))cX.call(e,t)&&UP(n,t,e[t]);if(OP)for(var t of OP(e))fX.call(e,t)&&UP(n,t,e[t]);return n},hX=(n,e)=>lX(n,uX(e));function M3(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=e?n.return:n.child;for(;i;){const r=M3(i,e,t);if(r)return r;i=e?null:i.sibling}}function E3(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const hw=E3(ne.createContext(null));class w3 extends ne.Component{render(){return ne.createElement(hw.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:zP,ReactCurrentDispatcher:GP}=ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function dX(){const n=ne.useContext(hw);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=ne.useId();return ne.useMemo(()=>{for(const i of[zP==null?void 0:zP.current,n,n==null?void 0:n.alternate]){if(!i)continue;const r=M3(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function pX(){var n;const e=dX(),[t]=ne.useState(()=>new Map);t.clear();let i=e;for(;i;){if(i.type&&typeof i.type=="object"){const r="Provider"in i.type?i.type:i.type._context;r&&r!==hw&&!t.has(r)&&t.set(r,(n=GP==null?void 0:GP.current)==null?void 0:n.readContext(E3(r)))}i=i.return}return t}function mX(){const n=pX();return ne.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>ne.createElement(e,null,ne.createElement(t.Provider,hX(kP({},i),{value:n.get(t)}))),e=>ne.createElement(w3,kP({},e))),[n])}const E1={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 gX(n){const{handlePointer:e}=VW(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(E1).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:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=E1[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=E1[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const vX=ne.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=gX,eventSource:a,eventPrefix:l,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:S,scene:A,onPointerMissed:E,onCreated:b,...C},R){ne.useMemo(()=>l3(SW),[]);const I=mX(),[O,T]=nX({scroll:!0,debounce:{scroll:50,resize:0},...i}),L=ne.useRef(null),K=ne.useRef(null);ne.useImperativeHandle(R,()=>L.current);const se=f3(E),[W,te]=ne.useState(!1),[$,oe]=ne.useState(!1);if(W)throw W;if($)throw $;const F=ne.useRef(null);qp(()=>{const N=L.current;T.width>0&&T.height>0&&N&&(F.current||(F.current=qW(N)),F.current.configure({gl:s,events:o,shadows:u,linear:h,flat:d,legacy:p,orthographic:m,frameloop:v,dpr:x,performance:y,raycaster:g,camera:S,scene:A,size:T,onPointerMissed:(...ee)=>se.current==null?void 0:se.current(...ee),onCreated:ee=>{ee.events.connect==null||ee.events.connect(a?NW(a)?a.current:a:K.current),l&&ee.setEvents({compute:(fe,Be)=>{const ae=fe[l+"X"],xe=fe[l+"Y"];Be.pointer.set(ae/Be.size.width*2-1,-(xe/Be.size.height)*2+1),Be.raycaster.setFromCamera(Be.pointer,Be.camera)}}),b==null||b(ee)}}),F.current.render(ne.createElement(I,null,ne.createElement(h3,{set:oe},ne.createElement(ne.Suspense,{fallback:ne.createElement(FW,{set:te})},e)))))}),ne.useEffect(()=>{const N=L.current;if(N)return()=>x3(N)},[]);const V=a?"none":"auto";return ne.createElement("div",hs({ref:K,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:V,...r}},C),ne.createElement("div",{ref:O,style:{width:"100%",height:"100%"}},ne.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),_X=ne.forwardRef(function(e,t){return ne.createElement(w3,null,ne.createElement(vX,hs({},e,{ref:t})))}),em=new G,dw=new G,yX=new G,HP=new Re;function xX(n,e,t){const i=em.setFromMatrixPosition(n.matrixWorld);i.project(e);const r=t.width/2,s=t.height/2;return[i.x*r+r,-(i.y*s)+s]}function AX(n,e){const t=em.setFromMatrixPosition(n.matrixWorld),i=dw.setFromMatrixPosition(e.matrixWorld),r=t.sub(i),s=e.getWorldDirection(yX);return r.angleTo(s)>Math.PI/2}function SX(n,e,t,i){const r=em.setFromMatrixPosition(n.matrixWorld),s=r.clone();s.project(e),HP.set(s.x,s.y),t.setFromCamera(HP,e);const o=t.intersectObjects(i,!0);if(o.length){const a=o[0].distance;return r.distanceTo(t.ray.origin)Math.abs(n)<1e-10?0:n;function T3(n,e,t=""){let i="matrix3d(";for(let r=0;r!==16;r++)i+=YS(e[r]*n.elements[r])+(r!==15?",":")");return t+i}const wX=(n=>e=>T3(e,n))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),TX=(n=>(e,t)=>T3(e,n(t),"translate(-50%,-50%)"))(n=>[1/n,1/n,1/n,1,-1/n,-1/n,-1/n,-1,1/n,1/n,1/n,1,1,1,1,1]);function CX(n){return n&&typeof n=="object"&&"current"in n}const RX=ne.forwardRef(({children:n,eps:e=.001,style:t,className:i,prepend:r,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:u=!1,transform:h=!1,occlude:d,onOcclude:p,castShadow:m,receiveShadow:v,material:x,geometry:y,zIndexRange:g=[16777271,0],calculatePosition:S=xX,as:A="div",wrapperClass:E,pointerEvents:b="auto",...C},R)=>{const{gl:I,camera:O,scene:T,size:L,raycaster:K,events:se,viewport:W}=si(),[te]=ne.useState(()=>document.createElement(A)),$=ne.useRef(),oe=ne.useRef(null),F=ne.useRef(0),V=ne.useRef([0,0]),N=ne.useRef(null),ee=ne.useRef(null),fe=(a==null?void 0:a.current)||se.connected||I.domElement.parentNode,Be=ne.useRef(null),ae=ne.useRef(!1),xe=ne.useMemo(()=>d&&d!=="blending"||Array.isArray(d)&&d.length&&CX(d[0]),[d]);ne.useLayoutEffect(()=>{const lt=I.domElement;d&&d==="blending"?(lt.style.zIndex=`${Math.floor(g[0]/2)}`,lt.style.position="absolute",lt.style.pointerEvents="none"):(lt.style.zIndex=null,lt.style.position=null,lt.style.pointerEvents=null)},[d]),ne.useLayoutEffect(()=>{if(oe.current){const lt=$.current=A2(te);if(T.updateMatrixWorld(),h)te.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const Ne=S(oe.current,O,L);te.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${Ne[0]}px,${Ne[1]}px,0);transform-origin:0 0;`}return fe&&(r?fe.prepend(te):fe.appendChild(te)),()=>{fe&&fe.removeChild(te),lt.unmount()}}},[fe,h]),ne.useLayoutEffect(()=>{E&&(te.className=E)},[E]);const Se=ne.useMemo(()=>h?{position:"absolute",top:0,left:0,width:L.width,height:L.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-L.height/2,left:-L.width/2,width:L.width,height:L.height},...t},[t,s,o,L,h]),ke=ne.useMemo(()=>({position:"absolute",pointerEvents:b}),[b]);ne.useLayoutEffect(()=>{if(ae.current=!1,h){var lt;(lt=$.current)==null||lt.render(ne.createElement("div",{ref:N,style:Se},ne.createElement("div",{ref:ee,style:ke},ne.createElement("div",{ref:R,className:i,style:t,children:n}))))}else{var Ne;(Ne=$.current)==null||Ne.render(ne.createElement("div",{ref:R,style:Se,className:i,children:n}))}});const We=ne.useRef(!0);$p(lt=>{if(oe.current){O.updateMatrixWorld(),oe.current.updateWorldMatrix(!0,!1);const Ne=h?V.current:S(oe.current,O,L);if(h||Math.abs(F.current-O.zoom)>e||Math.abs(V.current[0]-Ne[0])>e||Math.abs(V.current[1]-Ne[1])>e){const Y=AX(oe.current,O);let Ae=!1;xe&&(Array.isArray(d)?Ae=d.map(re=>re.current):d!=="blending"&&(Ae=[T]));const ge=We.current;if(Ae){const re=SX(oe.current,O,K,Ae);We.current=re&&!Y}else We.current=!Y;ge!==We.current&&(p?p(!We.current):te.style.display=We.current?"block":"none");const Fe=Math.floor(g[0]/2),Ce=d?xe?[g[0],Fe]:[Fe-1,0]:g;if(te.style.zIndex=`${EX(oe.current,O,Ce)}`,h){const[re,Xe]=[L.width/2,L.height/2],et=O.projectionMatrix.elements[5]*Xe,{isOrthographicCamera:Et,top:H,left:U,bottom:ve,right:Me}=O,be=wX(O.matrixWorldInverse),Ie=Et?`scale(${et})translate(${YS(-(Me+U)/2)}px,${YS((H+ve)/2)}px)`:`translateZ(${et}px)`;let tt=oe.current.matrixWorld;u&&(tt=O.matrixWorldInverse.clone().transpose().copyPosition(tt).scale(oe.current.scale),tt.elements[3]=tt.elements[7]=tt.elements[11]=0,tt.elements[15]=1),te.style.width=L.width+"px",te.style.height=L.height+"px",te.style.perspective=Et?"":`${et}px`,N.current&&ee.current&&(N.current.style.transform=`${Ie}${be}translate(${re}px,${Xe}px)`,ee.current.style.transform=TX(tt,1/((l||10)/400)))}else{const re=l===void 0?1:MX(oe.current,O)*l;te.style.transform=`translate3d(${Ne[0]}px,${Ne[1]}px,0) scale(${re})`}V.current=Ne,F.current=O.zoom}}if(!xe&&Be.current&&!ae.current)if(h){if(N.current){const Ne=N.current.children[0];if(Ne!=null&&Ne.clientWidth&&Ne!=null&&Ne.clientHeight){const{isOrthographicCamera:Y}=O;if(Y||y)C.scale&&(Array.isArray(C.scale)?C.scale instanceof G?Be.current.scale.copy(C.scale.clone().divideScalar(1)):Be.current.scale.set(1/C.scale[0],1/C.scale[1],1/C.scale[2]):Be.current.scale.setScalar(1/C.scale));else{const Ae=(l||10)/400,ge=Ne.clientWidth*Ae,Fe=Ne.clientHeight*Ae;Be.current.scale.set(ge,Fe,1)}ae.current=!0}}}else{const Ne=te.children[0];if(Ne!=null&&Ne.clientWidth&&Ne!=null&&Ne.clientHeight){const Y=1/W.factor,Ae=Ne.clientWidth*Y,ge=Ne.clientHeight*Y;Be.current.scale.set(Ae,ge,1),ae.current=!0}Be.current.lookAt(lt.camera.position)}});const Qe=ne.useMemo(()=>({vertexShader:h?void 0:` /* This shader is from the THREE's SpriteMaterial. We need to turn the backing plane into a Sprite @@ -3960,7 +3960,7 @@ No matching component was found for: void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); } - `}),[h]);return ne.createElement("group",hs({},C,{ref:oe}),d&&!xe&&ne.createElement("mesh",{castShadow:m,receiveShadow:v,ref:Be},y||ne.createElement("planeGeometry",null),x||ne.createElement("shaderMaterial",{side:Lr,vertexShader:Qe.vertexShader,fragmentShader:Qe.fragmentShader})))});function GP(n,e){if(e===OD)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Ov||e===TE){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l>>1|(Bn&21845)<<1;Wa=(Wa&52428)>>>2|(Wa&13107)<<2,Wa=(Wa&61680)>>>4|(Wa&3855)<<4,QS[Bn]=((Wa&65280)>>>8|(Wa&255)<<8)>>>1}var Wd=function(n,e,t){for(var i=n.length,r=0,s=new al(e);r>>l]=u}else for(a=new al(i),r=0;r>>15-n[r]);return a},tm=new Is(288);for(var Bn=0;Bn<144;++Bn)tm[Bn]=8;for(var Bn=144;Bn<256;++Bn)tm[Bn]=9;for(var Bn=256;Bn<280;++Bn)tm[Bn]=7;for(var Bn=280;Bn<288;++Bn)tm[Bn]=8;var P3=new Is(32);for(var Bn=0;Bn<32;++Bn)P3[Bn]=5;var bX=Wd(tm,9,1),PX=Wd(P3,5,1),w1=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},Zs=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},T1=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},BX=function(n){return(n/8|0)+(n&7&&1)},IX=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof al?al:n instanceof KS?KS:Is)(t-e);return i.set(n.subarray(e,t)),i},LX=function(n,e,t){var i=n.length;if(!i||t&&!t.l&&i<5)return e||new Is(0);var r=!e||t,s=!t||t.i;t||(t={}),e||(e=new Is(i*3));var o=function(Se){var ke=e.length;if(Se>ke){var We=new Is(Math.max(ke*2,Se));We.set(e),e=We}},a=t.f||0,l=t.p||0,u=t.b||0,h=t.l,d=t.d,p=t.m,m=t.n,v=i*8;do{if(!h){t.f=a=Zs(n,l,1);var x=Zs(n,l+1,3);if(l+=3,x)if(x==1)h=bX,d=PX,p=9,m=5;else if(x==2){var A=Zs(n,l,31)+257,E=Zs(n,l+10,15)+4,b=A+Zs(n,l+5,31)+1;l+=14;for(var C=new Is(b),R=new Is(19),I=0;I>>4;if(y<16)C[I++]=y;else{var se=0,W=0;for(y==16?(W=3+Zs(n,l,3),l+=2,se=C[I-1]):y==17?(W=3+Zs(n,l,7),l+=3):y==18&&(W=11+Zs(n,l,127),l+=7);W--;)C[I++]=se}}var te=C.subarray(0,A),$=C.subarray(A);p=w1(te),m=w1($),h=Wd(te,p,1),d=Wd($,m,1)}else throw"invalid block type";else{var y=BX(l)+4,g=n[y-4]|n[y-3]<<8,S=y+g;if(S>i){if(s)throw"unexpected EOF";break}r&&o(u+g),e.set(n.subarray(y,S),u),t.b=u+=g,t.p=l=S*8;continue}if(l>v){if(s)throw"unexpected EOF";break}}r&&o(u+131072);for(var oe=(1<>>4;if(l+=se&15,l>v){if(s)throw"unexpected EOF";break}if(!se)throw"invalid length/literal";if(N<256)e[u++]=N;else if(N==256){V=l,h=null;break}else{var ee=N-254;if(N>264){var I=N-257,ce=w3[I];ee=Zs(n,l,(1<>>4;if(!Be)throw"invalid distance";l+=Be&15;var $=RX[ae];if(ae>3){var ce=T3[ae];$+=T1(n,l)&(1<v){if(s)throw"unexpected EOF";break}r&&o(u+131072);for(var xe=u+ee;u>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(n[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function y0(n,e){return LX((NX(n),n.subarray(2,-4)),e)}var FX=typeof TextDecoder<"u"&&new TextDecoder,OX=0;try{FX.decode(DX,{stream:!0}),OX=1}catch{}const UX=n=>n&&n.isCubeTexture;class kX extends ei{constructor(e,t){var i,r;const s=UX(e),a=((r=s?(i=e.image[0])==null?void 0:i.width:e.image.width)!=null?r:1024)/4,l=Math.floor(Math.log2(a)),u=Math.pow(2,l),h=3*Math.max(u,16*7),d=4*u,p=[s?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/h}`,`#define CUBEUV_TEXEL_HEIGHT ${1/d}`,`#define CUBEUV_MAX_MIP ${l}.0`],m=` + `}),[h]);return ne.createElement("group",hs({},C,{ref:oe}),d&&!xe&&ne.createElement("mesh",{castShadow:m,receiveShadow:v,ref:Be},y||ne.createElement("planeGeometry",null),x||ne.createElement("shaderMaterial",{side:Lr,vertexShader:Qe.vertexShader,fragmentShader:Qe.fragmentShader})))});function VP(n,e){if(e===kD)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),n;if(e===Ov||e===TE){let t=n.getIndex();if(t===null){const o=[],a=n.getAttribute("position");if(a!==void 0){for(let l=0;l>>1|(Bn&21845)<<1;Wa=(Wa&52428)>>>2|(Wa&13107)<<2,Wa=(Wa&61680)>>>4|(Wa&3855)<<4,QS[Bn]=((Wa&65280)>>>8|(Wa&255)<<8)>>>1}var Wd=function(n,e,t){for(var i=n.length,r=0,s=new al(e);r>>l]=u}else for(a=new al(i),r=0;r>>15-n[r]);return a},tm=new Is(288);for(var Bn=0;Bn<144;++Bn)tm[Bn]=8;for(var Bn=144;Bn<256;++Bn)tm[Bn]=9;for(var Bn=256;Bn<280;++Bn)tm[Bn]=7;for(var Bn=280;Bn<288;++Bn)tm[Bn]=8;var I3=new Is(32);for(var Bn=0;Bn<32;++Bn)I3[Bn]=5;var DX=Wd(tm,9,1),NX=Wd(I3,5,1),w1=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},Zs=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},T1=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},FX=function(n){return(n/8|0)+(n&7&&1)},OX=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof al?al:n instanceof KS?KS:Is)(t-e);return i.set(n.subarray(e,t)),i},UX=function(n,e,t){var i=n.length;if(!i||t&&!t.l&&i<5)return e||new Is(0);var r=!e||t,s=!t||t.i;t||(t={}),e||(e=new Is(i*3));var o=function(Se){var ke=e.length;if(Se>ke){var We=new Is(Math.max(ke*2,Se));We.set(e),e=We}},a=t.f||0,l=t.p||0,u=t.b||0,h=t.l,d=t.d,p=t.m,m=t.n,v=i*8;do{if(!h){t.f=a=Zs(n,l,1);var x=Zs(n,l+1,3);if(l+=3,x)if(x==1)h=DX,d=NX,p=9,m=5;else if(x==2){var A=Zs(n,l,31)+257,E=Zs(n,l+10,15)+4,b=A+Zs(n,l+5,31)+1;l+=14;for(var C=new Is(b),R=new Is(19),I=0;I>>4;if(y<16)C[I++]=y;else{var se=0,W=0;for(y==16?(W=3+Zs(n,l,3),l+=2,se=C[I-1]):y==17?(W=3+Zs(n,l,7),l+=3):y==18&&(W=11+Zs(n,l,127),l+=7);W--;)C[I++]=se}}var te=C.subarray(0,A),$=C.subarray(A);p=w1(te),m=w1($),h=Wd(te,p,1),d=Wd($,m,1)}else throw"invalid block type";else{var y=FX(l)+4,g=n[y-4]|n[y-3]<<8,S=y+g;if(S>i){if(s)throw"unexpected EOF";break}r&&o(u+g),e.set(n.subarray(y,S),u),t.b=u+=g,t.p=l=S*8;continue}if(l>v){if(s)throw"unexpected EOF";break}}r&&o(u+131072);for(var oe=(1<>>4;if(l+=se&15,l>v){if(s)throw"unexpected EOF";break}if(!se)throw"invalid length/literal";if(N<256)e[u++]=N;else if(N==256){V=l,h=null;break}else{var ee=N-254;if(N>264){var I=N-257,fe=C3[I];ee=Zs(n,l,(1<>>4;if(!Be)throw"invalid distance";l+=Be&15;var $=LX[ae];if(ae>3){var fe=R3[ae];$+=T1(n,l)&(1<v){if(s)throw"unexpected EOF";break}r&&o(u+131072);for(var xe=u+ee;u>>4>7||(n[0]<<8|n[1])%31)throw"invalid zlib data";if(n[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function y0(n,e){return UX((zX(n),n.subarray(2,-4)),e)}var GX=typeof TextDecoder<"u"&&new TextDecoder,HX=0;try{GX.decode(kX,{stream:!0}),HX=1}catch{}const VX=n=>n&&n.isCubeTexture;class WX extends ti{constructor(e,t){var i,r;const s=VX(e),a=((r=s?(i=e.image[0])==null?void 0:i.width:e.image.width)!=null?r:1024)/4,l=Math.floor(Math.log2(a)),u=Math.pow(2,l),h=3*Math.max(u,16*7),d=4*u,p=[s?"#define ENVMAP_TYPE_CUBE":"",`#define CUBEUV_TEXEL_WIDTH ${1/h}`,`#define CUBEUV_TEXEL_HEIGHT ${1/d}`,`#define CUBEUV_MAX_MIP ${l}.0`],m=` varying vec3 vWorldPosition; void main() { @@ -4041,12 +4041,12 @@ No matching component was found for: #include #include <${parseInt(ch.replace(/\D+/g,""))>=154?"colorspace_fragment":"encodings_fragment"}> } - `,x={map:{value:e},height:{value:(t==null?void 0:t.height)||15},radius:{value:(t==null?void 0:t.radius)||100}},y=new jp(1,16),g=new Ws({uniforms:x,fragmentShader:v,vertexShader:m,side:Lr});super(y,g)}set radius(e){this.material.uniforms.radius.value=e}get radius(){return this.material.uniforms.radius.value}set height(e){this.material.uniforms.height.value=e}get height(){return this.material.uniforms.height.value}}var zX=Object.defineProperty,GX=(n,e,t)=>e in n?zX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ft=(n,e,t)=>(GX(n,typeof e!="symbol"?e+"":e,t),t);const x0=new oc,HP=new sa,HX=Math.cos(70*(Math.PI/180)),VP=(n,e)=>(n%e+e)%e;let VX=class extends Go{constructor(e,t){super(),Ft(this,"object"),Ft(this,"domElement"),Ft(this,"enabled",!0),Ft(this,"target",new G),Ft(this,"minDistance",0),Ft(this,"maxDistance",1/0),Ft(this,"minZoom",0),Ft(this,"maxZoom",1/0),Ft(this,"minPolarAngle",0),Ft(this,"maxPolarAngle",Math.PI),Ft(this,"minAzimuthAngle",-1/0),Ft(this,"maxAzimuthAngle",1/0),Ft(this,"enableDamping",!1),Ft(this,"dampingFactor",.05),Ft(this,"enableZoom",!0),Ft(this,"zoomSpeed",1),Ft(this,"enableRotate",!0),Ft(this,"rotateSpeed",1),Ft(this,"enablePan",!0),Ft(this,"panSpeed",1),Ft(this,"screenSpacePanning",!0),Ft(this,"keyPanSpeed",7),Ft(this,"zoomToCursor",!1),Ft(this,"autoRotate",!1),Ft(this,"autoRotateSpeed",2),Ft(this,"reverseOrbit",!1),Ft(this,"reverseHorizontalOrbit",!1),Ft(this,"reverseVerticalOrbit",!1),Ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ft(this,"mouseButtons",{LEFT:du.ROTATE,MIDDLE:du.DOLLY,RIGHT:du.PAN}),Ft(this,"touches",{ONE:pu.ROTATE,TWO:pu.DOLLY_PAN}),Ft(this,"target0"),Ft(this,"position0"),Ft(this,"zoom0"),Ft(this,"_domElementKeyEvents",null),Ft(this,"getPolarAngle"),Ft(this,"getAzimuthalAngle"),Ft(this,"setPolarAngle"),Ft(this,"setAzimuthalAngle"),Ft(this,"getDistance"),Ft(this,"listenToKeyEvents"),Ft(this,"stopListenToKeyEvents"),Ft(this,"saveState"),Ft(this,"reset"),Ft(this,"update"),Ft(this,"connect"),Ft(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=Z=>{let de=VP(Z,2*Math.PI),Ue=h.phi;Ue<0&&(Ue+=2*Math.PI),de<0&&(de+=2*Math.PI);let Le=Math.abs(de-Ue);2*Math.PI-Le{let de=VP(Z,2*Math.PI),Ue=h.theta;Ue<0&&(Ue+=2*Math.PI),de<0&&(de+=2*Math.PI);let Le=Math.abs(de-Ue);2*Math.PI-Lei.object.position.distanceTo(i.target),this.listenToKeyEvents=Z=>{Z.addEventListener("keydown",ct),this._domElementKeyEvents=Z},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ct),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const Z=new G,de=new G(0,1,0),Ue=new Ii().setFromUnitVectors(e.up,de),Le=Ue.clone().invert(),Pe=new G,ie=new Ii,He=2*Math.PI;return function(){const Ve=i.object.position;Ue.setFromUnitVectors(e.up,de),Le.copy(Ue).invert(),Z.copy(Ve).sub(i.target),Z.applyQuaternion(Ue),h.setFromVector3(Z),i.autoRotate&&l===a.NONE&&W(K()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Je=i.minAzimuthAngle,Mt=i.maxAzimuthAngle;isFinite(Je)&&isFinite(Mt)&&(Je<-Math.PI?Je+=He:Je>Math.PI&&(Je-=He),Mt<-Math.PI?Mt+=He:Mt>Math.PI&&(Mt-=He),Je<=Mt?h.theta=Math.max(Je,Math.min(Mt,h.theta)):h.theta=h.theta>(Je+Mt)/2?Math.max(Je,h.theta):Math.min(Mt,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&O||i.object.isOrthographicCamera?h.radius=ce(h.radius):h.radius=ce(h.radius*p),Z.setFromSpherical(h),Z.applyQuaternion(Le),Ve.copy(i.target).add(Z),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),m.set(0,0,0));let Ot=!1;if(i.zoomToCursor&&O){let ut=null;if(i.object instanceof Pn&&i.object.isPerspectiveCamera){const ot=Z.length();ut=ce(ot*p);const dt=ot-ut;i.object.position.addScaledVector(R,dt),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const ot=new G(I.x,I.y,0);ot.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Ot=!0;const dt=new G(I.x,I.y,0);dt.unproject(i.object),i.object.position.sub(dt).add(ot),i.object.updateMatrixWorld(),ut=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;ut!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(ut).add(i.object.position):(x0.origin.copy(i.object.position),x0.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(x0.direction))u||8*(1-ie.dot(i.object.quaternion))>u?(i.dispatchEvent(r),Pe.copy(i.object.position),ie.copy(i.object.quaternion),Ot=!1,!0):!1}})(),this.connect=Z=>{Z===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=Z,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Rt),i.domElement.addEventListener("pointerdown",H),i.domElement.addEventListener("pointercancel",Me),i.domElement.addEventListener("wheel",tt)},this.dispose=()=>{var Z,de,Ue,Le,Pe,ie;(Z=i.domElement)==null||Z.removeEventListener("contextmenu",Rt),(de=i.domElement)==null||de.removeEventListener("pointerdown",H),(Ue=i.domElement)==null||Ue.removeEventListener("pointercancel",Me),(Le=i.domElement)==null||Le.removeEventListener("wheel",tt),(Pe=i.domElement)==null||Pe.ownerDocument.removeEventListener("pointermove",U),(ie=i.domElement)==null||ie.ownerDocument.removeEventListener("pointerup",ve),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ct)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,h=new WS,d=new WS;let p=1;const m=new G,v=new Re,x=new Re,y=new Re,g=new Re,S=new Re,A=new Re,E=new Re,b=new Re,C=new Re,R=new G,I=new Re;let O=!1;const T=[],L={};function K(){return 2*Math.PI/60/60*i.autoRotateSpeed}function se(){return Math.pow(.95,i.zoomSpeed)}function W(Z){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=Z:d.theta-=Z}function te(Z){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=Z:d.phi-=Z}const $=(()=>{const Z=new G;return function(Ue,Le){Z.setFromMatrixColumn(Le,0),Z.multiplyScalar(-Ue),m.add(Z)}})(),oe=(()=>{const Z=new G;return function(Ue,Le){i.screenSpacePanning===!0?Z.setFromMatrixColumn(Le,1):(Z.setFromMatrixColumn(Le,0),Z.crossVectors(i.object.up,Z)),Z.multiplyScalar(Ue),m.add(Z)}})(),F=(()=>{const Z=new G;return function(Ue,Le){const Pe=i.domElement;if(Pe&&i.object instanceof Pn&&i.object.isPerspectiveCamera){const ie=i.object.position;Z.copy(ie).sub(i.target);let He=Z.length();He*=Math.tan(i.object.fov/2*Math.PI/180),$(2*Ue*He/Pe.clientHeight,i.object.matrix),oe(2*Le*He/Pe.clientHeight,i.object.matrix)}else Pe&&i.object instanceof Os&&i.object.isOrthographicCamera?($(Ue*(i.object.right-i.object.left)/i.object.zoom/Pe.clientWidth,i.object.matrix),oe(Le*(i.object.top-i.object.bottom)/i.object.zoom/Pe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function V(Z){i.object instanceof Pn&&i.object.isPerspectiveCamera||i.object instanceof Os&&i.object.isOrthographicCamera?p/=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function N(Z){i.object instanceof Pn&&i.object.isPerspectiveCamera||i.object instanceof Os&&i.object.isOrthographicCamera?p*=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ee(Z){if(!i.zoomToCursor||!i.domElement)return;O=!0;const de=i.domElement.getBoundingClientRect(),Ue=Z.clientX-de.left,Le=Z.clientY-de.top,Pe=de.width,ie=de.height;I.x=Ue/Pe*2-1,I.y=-(Le/ie)*2+1,R.set(I.x,I.y,1).unproject(i.object).sub(i.object.position).normalize()}function ce(Z){return Math.max(i.minDistance,Math.min(i.maxDistance,Z))}function Be(Z){v.set(Z.clientX,Z.clientY)}function ae(Z){ee(Z),E.set(Z.clientX,Z.clientY)}function xe(Z){g.set(Z.clientX,Z.clientY)}function Se(Z){x.set(Z.clientX,Z.clientY),y.subVectors(x,v).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(W(2*Math.PI*y.x/de.clientHeight),te(2*Math.PI*y.y/de.clientHeight)),v.copy(x),i.update()}function ke(Z){b.set(Z.clientX,Z.clientY),C.subVectors(b,E),C.y>0?V(se()):C.y<0&&N(se()),E.copy(b),i.update()}function We(Z){S.set(Z.clientX,Z.clientY),A.subVectors(S,g).multiplyScalar(i.panSpeed),F(A.x,A.y),g.copy(S),i.update()}function Qe(Z){ee(Z),Z.deltaY<0?N(se()):Z.deltaY>0&&V(se()),i.update()}function lt(Z){let de=!1;switch(Z.code){case i.keys.UP:F(0,i.keyPanSpeed),de=!0;break;case i.keys.BOTTOM:F(0,-i.keyPanSpeed),de=!0;break;case i.keys.LEFT:F(i.keyPanSpeed,0),de=!0;break;case i.keys.RIGHT:F(-i.keyPanSpeed,0),de=!0;break}de&&(Z.preventDefault(),i.update())}function Ne(){if(T.length==1)v.set(T[0].pageX,T[0].pageY);else{const Z=.5*(T[0].pageX+T[1].pageX),de=.5*(T[0].pageY+T[1].pageY);v.set(Z,de)}}function Y(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{const Z=.5*(T[0].pageX+T[1].pageX),de=.5*(T[0].pageY+T[1].pageY);g.set(Z,de)}}function Ae(){const Z=T[0].pageX-T[1].pageX,de=T[0].pageY-T[1].pageY,Ue=Math.sqrt(Z*Z+de*de);E.set(0,Ue)}function ge(){i.enableZoom&&Ae(),i.enablePan&&Y()}function Fe(){i.enableZoom&&Ae(),i.enableRotate&&Ne()}function Ce(Z){if(T.length==1)x.set(Z.pageX,Z.pageY);else{const Ue=ht(Z),Le=.5*(Z.pageX+Ue.x),Pe=.5*(Z.pageY+Ue.y);x.set(Le,Pe)}y.subVectors(x,v).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(W(2*Math.PI*y.x/de.clientHeight),te(2*Math.PI*y.y/de.clientHeight)),v.copy(x)}function re(Z){if(T.length==1)S.set(Z.pageX,Z.pageY);else{const de=ht(Z),Ue=.5*(Z.pageX+de.x),Le=.5*(Z.pageY+de.y);S.set(Ue,Le)}A.subVectors(S,g).multiplyScalar(i.panSpeed),F(A.x,A.y),g.copy(S)}function Xe(Z){const de=ht(Z),Ue=Z.pageX-de.x,Le=Z.pageY-de.y,Pe=Math.sqrt(Ue*Ue+Le*Le);b.set(0,Pe),C.set(0,Math.pow(b.y/E.y,i.zoomSpeed)),V(C.y),E.copy(b)}function et(Z){i.enableZoom&&Xe(Z),i.enablePan&&re(Z)}function Et(Z){i.enableZoom&&Xe(Z),i.enableRotate&&Ce(Z)}function H(Z){var de,Ue;i.enabled!==!1&&(T.length===0&&((de=i.domElement)==null||de.ownerDocument.addEventListener("pointermove",U),(Ue=i.domElement)==null||Ue.ownerDocument.addEventListener("pointerup",ve)),Oe(Z),Z.pointerType==="touch"?Ge(Z):be(Z))}function U(Z){i.enabled!==!1&&(Z.pointerType==="touch"?Ke(Z):Ie(Z))}function ve(Z){var de,Ue,Le;qt(Z),T.length===0&&((de=i.domElement)==null||de.releasePointerCapture(Z.pointerId),(Ue=i.domElement)==null||Ue.ownerDocument.removeEventListener("pointermove",U),(Le=i.domElement)==null||Le.ownerDocument.removeEventListener("pointerup",ve)),i.dispatchEvent(o),l=a.NONE}function Me(Z){qt(Z)}function be(Z){let de;switch(Z.button){case 0:de=i.mouseButtons.LEFT;break;case 1:de=i.mouseButtons.MIDDLE;break;case 2:de=i.mouseButtons.RIGHT;break;default:de=-1}switch(de){case du.DOLLY:if(i.enableZoom===!1)return;ae(Z),l=a.DOLLY;break;case du.ROTATE:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(i.enablePan===!1)return;xe(Z),l=a.PAN}else{if(i.enableRotate===!1)return;Be(Z),l=a.ROTATE}break;case du.PAN:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(i.enableRotate===!1)return;Be(Z),l=a.ROTATE}else{if(i.enablePan===!1)return;xe(Z),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ie(Z){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Se(Z);break;case a.DOLLY:if(i.enableZoom===!1)return;ke(Z);break;case a.PAN:if(i.enablePan===!1)return;We(Z);break}}function tt(Z){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(Z.preventDefault(),i.dispatchEvent(s),Qe(Z),i.dispatchEvent(o))}function ct(Z){i.enabled===!1||i.enablePan===!1||lt(Z)}function Ge(Z){switch(pt(Z),T.length){case 1:switch(i.touches.ONE){case pu.ROTATE:if(i.enableRotate===!1)return;Ne(),l=a.TOUCH_ROTATE;break;case pu.PAN:if(i.enablePan===!1)return;Y(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case pu.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ge(),l=a.TOUCH_DOLLY_PAN;break;case pu.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Fe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ke(Z){switch(pt(Z),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;Ce(Z),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;re(Z),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;et(Z),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Et(Z),i.update();break;default:l=a.NONE}}function Rt(Z){i.enabled!==!1&&Z.preventDefault()}function Oe(Z){T.push(Z)}function qt(Z){delete L[Z.pointerId];for(let de=0;de=2.0 are supported."));return}const l=new xJ(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function WX(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const nn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class XX{constructor(e){this.parser=e,this.name=nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class iJ{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class rJ{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class sJ{constructor(e){this.name=nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,u=r.byteLength||0,h=r.count,d=r.byteStride,p=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,d,p,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(h*d);return o.decodeGltfBuffer(new Uint8Array(m),h,d,p,r.mode,r.filter),m})})}else return null}}class oJ{constructor(e){this.name=nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const u of r.primitives)if(u.mode!==Ts.TRIANGLES&&u.mode!==Ts.TRIANGLE_STRIP&&u.mode!==Ts.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(h=>(l[u]=h,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const h=u.pop(),d=h.isGroup?h.children:[h],p=u[0].count,m=[];for(const v of d){const x=new bt,y=new G,g=new Ii,S=new G(1,1,1),A=new zE(v.geometry,v.material,p);for(let E=0;E=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Xa={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},dJ={CUBICSPLINE:void 0,LINEAR:ec,STEP:Zf},R1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function pJ(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Qp({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ko})),n.DefaultMaterial}function au(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Ka(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function mJ(n,e,t){let i=!1,r=!1,s=!1;for(let u=0,h=e.length;u0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const yJ=new bt;class xJ{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new WX,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new Zp(this.options.manager):this.textureLoader=new YN(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new fs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};au(s,a,r),Ka(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,h]of o.children.entries())s(h,a.children[u])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&y.setY(O,C[R*l+1]),l>=3&&y.setZ(O,C[R*l+2]),l>=4&&y.setW(O,C[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,i).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return h.magFilter=XP[p.magFilter]||pn,h.minFilter=XP[p.minFilter]||Fs,h.wrapS=JP[p.wrapS]||Rl,h.wrapT=JP[p.wrapT]||Rl,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){u=!0;const p=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(d){return new Promise(function(p,m){let v=p;t.isImageBitmapLoader===!0&&(v=function(x){const y=new Tn(x);y.needsUpdate=!0,p(y)}),t.load(Oo.resolveURL(d,s.path),v,void 0,m)})}).then(function(d){return u===!0&&a.revokeObjectURL(l),d.userData.mimeType=o.mimeType||_J(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=h,h}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[nn.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[nn.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[nn.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&("colorSpace"in o?o.colorSpace=r===3001?"srgb":"srgb-linear":o.encoding=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new x_,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new or,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Qp}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},u=[];if(l[nn.KHR_MATERIALS_UNLIT]){const d=r[nn.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),u.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new it(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}d.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",d.baseColorTexture,3001)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Lr);const h=s.alphaMode||R1.OPAQUE;if(h===R1.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===R1.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==rs&&(u.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Re(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}return s.occlusionTexture!==void 0&&o!==rs&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==rs&&(a.emissive=new it().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==rs&&u.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,3001)),Promise.all(u).then(function(){const d=new o(a);return s.name&&(d.name=s.name),Ka(d,s),t.associations.set(d,{materials:e}),s.extensions&&au(r,d,s),d})}createUniqueName(e){const t=on.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return jP(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&gJ(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Ka(g,s),y.extensions&&au(r,g,y),t.assignFinalMaterial(g),d.push(g)}for(let m=0,v=d.length;m1?h=new so:u.length===1?h=u[0]:h=new an,h!==u[0])for(let d=0,p=u.length;d{const d=new Map;for(const[p,m]of r.associations)(p instanceof mi||p instanceof Tn)&&d.set(p,m);return h.traverse(p=>{const m=r.associations.get(p);m!=null&&d.set(p,m)}),d};return r.associations=u(s),s})}}function AJ(n,e,t){const i=e.attributes,r=new rr;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,u=a.max;if(l!==void 0&&u!==void 0){if(r.set(new G(l[0],l[1],l[2]),new G(u[0],u[1],u[2])),a.normalized){const h=qS(Df[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new G,l=new G;for(let u=0,h=s.length;ue in n?XX(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ft=(n,e,t)=>(JX(n,typeof e!="symbol"?e+"":e,t),t);const x0=new oc,WP=new sa,jX=Math.cos(70*(Math.PI/180)),XP=(n,e)=>(n%e+e)%e;let YX=class extends Go{constructor(e,t){super(),Ft(this,"object"),Ft(this,"domElement"),Ft(this,"enabled",!0),Ft(this,"target",new G),Ft(this,"minDistance",0),Ft(this,"maxDistance",1/0),Ft(this,"minZoom",0),Ft(this,"maxZoom",1/0),Ft(this,"minPolarAngle",0),Ft(this,"maxPolarAngle",Math.PI),Ft(this,"minAzimuthAngle",-1/0),Ft(this,"maxAzimuthAngle",1/0),Ft(this,"enableDamping",!1),Ft(this,"dampingFactor",.05),Ft(this,"enableZoom",!0),Ft(this,"zoomSpeed",1),Ft(this,"enableRotate",!0),Ft(this,"rotateSpeed",1),Ft(this,"enablePan",!0),Ft(this,"panSpeed",1),Ft(this,"screenSpacePanning",!0),Ft(this,"keyPanSpeed",7),Ft(this,"zoomToCursor",!1),Ft(this,"autoRotate",!1),Ft(this,"autoRotateSpeed",2),Ft(this,"reverseOrbit",!1),Ft(this,"reverseHorizontalOrbit",!1),Ft(this,"reverseVerticalOrbit",!1),Ft(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),Ft(this,"mouseButtons",{LEFT:pu.ROTATE,MIDDLE:pu.DOLLY,RIGHT:pu.PAN}),Ft(this,"touches",{ONE:mu.ROTATE,TWO:mu.DOLLY_PAN}),Ft(this,"target0"),Ft(this,"position0"),Ft(this,"zoom0"),Ft(this,"_domElementKeyEvents",null),Ft(this,"getPolarAngle"),Ft(this,"getAzimuthalAngle"),Ft(this,"setPolarAngle"),Ft(this,"setAzimuthalAngle"),Ft(this,"getDistance"),Ft(this,"listenToKeyEvents"),Ft(this,"stopListenToKeyEvents"),Ft(this,"saveState"),Ft(this,"reset"),Ft(this,"update"),Ft(this,"connect"),Ft(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>h.phi,this.getAzimuthalAngle=()=>h.theta,this.setPolarAngle=Z=>{let de=XP(Z,2*Math.PI),Ue=h.phi;Ue<0&&(Ue+=2*Math.PI),de<0&&(de+=2*Math.PI);let Le=Math.abs(de-Ue);2*Math.PI-Le{let de=XP(Z,2*Math.PI),Ue=h.theta;Ue<0&&(Ue+=2*Math.PI),de<0&&(de+=2*Math.PI);let Le=Math.abs(de-Ue);2*Math.PI-Lei.object.position.distanceTo(i.target),this.listenToKeyEvents=Z=>{Z.addEventListener("keydown",ct),this._domElementKeyEvents=Z},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ct),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const Z=new G,de=new G(0,1,0),Ue=new Ii().setFromUnitVectors(e.up,de),Le=Ue.clone().invert(),Pe=new G,ie=new Ii,He=2*Math.PI;return function(){const Ve=i.object.position;Ue.setFromUnitVectors(e.up,de),Le.copy(Ue).invert(),Z.copy(Ve).sub(i.target),Z.applyQuaternion(Ue),h.setFromVector3(Z),i.autoRotate&&l===a.NONE&&W(K()),i.enableDamping?(h.theta+=d.theta*i.dampingFactor,h.phi+=d.phi*i.dampingFactor):(h.theta+=d.theta,h.phi+=d.phi);let Je=i.minAzimuthAngle,Mt=i.maxAzimuthAngle;isFinite(Je)&&isFinite(Mt)&&(Je<-Math.PI?Je+=He:Je>Math.PI&&(Je-=He),Mt<-Math.PI?Mt+=He:Mt>Math.PI&&(Mt-=He),Je<=Mt?h.theta=Math.max(Je,Math.min(Mt,h.theta)):h.theta=h.theta>(Je+Mt)/2?Math.max(Je,h.theta):Math.min(Mt,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(m,i.dampingFactor):i.target.add(m),i.zoomToCursor&&O||i.object.isOrthographicCamera?h.radius=fe(h.radius):h.radius=fe(h.radius*p),Z.setFromSpherical(h),Z.applyQuaternion(Le),Ve.copy(i.target).add(Z),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,m.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),m.set(0,0,0));let Ot=!1;if(i.zoomToCursor&&O){let ut=null;if(i.object instanceof Pn&&i.object.isPerspectiveCamera){const ot=Z.length();ut=fe(ot*p);const dt=ot-ut;i.object.position.addScaledVector(R,dt),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const ot=new G(I.x,I.y,0);ot.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Ot=!0;const dt=new G(I.x,I.y,0);dt.unproject(i.object),i.object.position.sub(dt).add(ot),i.object.updateMatrixWorld(),ut=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;ut!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(ut).add(i.object.position):(x0.origin.copy(i.object.position),x0.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(x0.direction))u||8*(1-ie.dot(i.object.quaternion))>u?(i.dispatchEvent(r),Pe.copy(i.object.position),ie.copy(i.object.quaternion),Ot=!1,!0):!1}})(),this.connect=Z=>{Z===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=Z,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Rt),i.domElement.addEventListener("pointerdown",H),i.domElement.addEventListener("pointercancel",Me),i.domElement.addEventListener("wheel",tt)},this.dispose=()=>{var Z,de,Ue,Le,Pe,ie;(Z=i.domElement)==null||Z.removeEventListener("contextmenu",Rt),(de=i.domElement)==null||de.removeEventListener("pointerdown",H),(Ue=i.domElement)==null||Ue.removeEventListener("pointercancel",Me),(Le=i.domElement)==null||Le.removeEventListener("wheel",tt),(Pe=i.domElement)==null||Pe.ownerDocument.removeEventListener("pointermove",U),(ie=i.domElement)==null||ie.ownerDocument.removeEventListener("pointerup",ve),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ct)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,h=new WS,d=new WS;let p=1;const m=new G,v=new Re,x=new Re,y=new Re,g=new Re,S=new Re,A=new Re,E=new Re,b=new Re,C=new Re,R=new G,I=new Re;let O=!1;const T=[],L={};function K(){return 2*Math.PI/60/60*i.autoRotateSpeed}function se(){return Math.pow(.95,i.zoomSpeed)}function W(Z){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=Z:d.theta-=Z}function te(Z){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=Z:d.phi-=Z}const $=(()=>{const Z=new G;return function(Ue,Le){Z.setFromMatrixColumn(Le,0),Z.multiplyScalar(-Ue),m.add(Z)}})(),oe=(()=>{const Z=new G;return function(Ue,Le){i.screenSpacePanning===!0?Z.setFromMatrixColumn(Le,1):(Z.setFromMatrixColumn(Le,0),Z.crossVectors(i.object.up,Z)),Z.multiplyScalar(Ue),m.add(Z)}})(),F=(()=>{const Z=new G;return function(Ue,Le){const Pe=i.domElement;if(Pe&&i.object instanceof Pn&&i.object.isPerspectiveCamera){const ie=i.object.position;Z.copy(ie).sub(i.target);let He=Z.length();He*=Math.tan(i.object.fov/2*Math.PI/180),$(2*Ue*He/Pe.clientHeight,i.object.matrix),oe(2*Le*He/Pe.clientHeight,i.object.matrix)}else Pe&&i.object instanceof Os&&i.object.isOrthographicCamera?($(Ue*(i.object.right-i.object.left)/i.object.zoom/Pe.clientWidth,i.object.matrix),oe(Le*(i.object.top-i.object.bottom)/i.object.zoom/Pe.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function V(Z){i.object instanceof Pn&&i.object.isPerspectiveCamera||i.object instanceof Os&&i.object.isOrthographicCamera?p/=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function N(Z){i.object instanceof Pn&&i.object.isPerspectiveCamera||i.object instanceof Os&&i.object.isOrthographicCamera?p*=Z:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ee(Z){if(!i.zoomToCursor||!i.domElement)return;O=!0;const de=i.domElement.getBoundingClientRect(),Ue=Z.clientX-de.left,Le=Z.clientY-de.top,Pe=de.width,ie=de.height;I.x=Ue/Pe*2-1,I.y=-(Le/ie)*2+1,R.set(I.x,I.y,1).unproject(i.object).sub(i.object.position).normalize()}function fe(Z){return Math.max(i.minDistance,Math.min(i.maxDistance,Z))}function Be(Z){v.set(Z.clientX,Z.clientY)}function ae(Z){ee(Z),E.set(Z.clientX,Z.clientY)}function xe(Z){g.set(Z.clientX,Z.clientY)}function Se(Z){x.set(Z.clientX,Z.clientY),y.subVectors(x,v).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(W(2*Math.PI*y.x/de.clientHeight),te(2*Math.PI*y.y/de.clientHeight)),v.copy(x),i.update()}function ke(Z){b.set(Z.clientX,Z.clientY),C.subVectors(b,E),C.y>0?V(se()):C.y<0&&N(se()),E.copy(b),i.update()}function We(Z){S.set(Z.clientX,Z.clientY),A.subVectors(S,g).multiplyScalar(i.panSpeed),F(A.x,A.y),g.copy(S),i.update()}function Qe(Z){ee(Z),Z.deltaY<0?N(se()):Z.deltaY>0&&V(se()),i.update()}function lt(Z){let de=!1;switch(Z.code){case i.keys.UP:F(0,i.keyPanSpeed),de=!0;break;case i.keys.BOTTOM:F(0,-i.keyPanSpeed),de=!0;break;case i.keys.LEFT:F(i.keyPanSpeed,0),de=!0;break;case i.keys.RIGHT:F(-i.keyPanSpeed,0),de=!0;break}de&&(Z.preventDefault(),i.update())}function Ne(){if(T.length==1)v.set(T[0].pageX,T[0].pageY);else{const Z=.5*(T[0].pageX+T[1].pageX),de=.5*(T[0].pageY+T[1].pageY);v.set(Z,de)}}function Y(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{const Z=.5*(T[0].pageX+T[1].pageX),de=.5*(T[0].pageY+T[1].pageY);g.set(Z,de)}}function Ae(){const Z=T[0].pageX-T[1].pageX,de=T[0].pageY-T[1].pageY,Ue=Math.sqrt(Z*Z+de*de);E.set(0,Ue)}function ge(){i.enableZoom&&Ae(),i.enablePan&&Y()}function Fe(){i.enableZoom&&Ae(),i.enableRotate&&Ne()}function Ce(Z){if(T.length==1)x.set(Z.pageX,Z.pageY);else{const Ue=ht(Z),Le=.5*(Z.pageX+Ue.x),Pe=.5*(Z.pageY+Ue.y);x.set(Le,Pe)}y.subVectors(x,v).multiplyScalar(i.rotateSpeed);const de=i.domElement;de&&(W(2*Math.PI*y.x/de.clientHeight),te(2*Math.PI*y.y/de.clientHeight)),v.copy(x)}function re(Z){if(T.length==1)S.set(Z.pageX,Z.pageY);else{const de=ht(Z),Ue=.5*(Z.pageX+de.x),Le=.5*(Z.pageY+de.y);S.set(Ue,Le)}A.subVectors(S,g).multiplyScalar(i.panSpeed),F(A.x,A.y),g.copy(S)}function Xe(Z){const de=ht(Z),Ue=Z.pageX-de.x,Le=Z.pageY-de.y,Pe=Math.sqrt(Ue*Ue+Le*Le);b.set(0,Pe),C.set(0,Math.pow(b.y/E.y,i.zoomSpeed)),V(C.y),E.copy(b)}function et(Z){i.enableZoom&&Xe(Z),i.enablePan&&re(Z)}function Et(Z){i.enableZoom&&Xe(Z),i.enableRotate&&Ce(Z)}function H(Z){var de,Ue;i.enabled!==!1&&(T.length===0&&((de=i.domElement)==null||de.ownerDocument.addEventListener("pointermove",U),(Ue=i.domElement)==null||Ue.ownerDocument.addEventListener("pointerup",ve)),Oe(Z),Z.pointerType==="touch"?Ge(Z):be(Z))}function U(Z){i.enabled!==!1&&(Z.pointerType==="touch"?Ke(Z):Ie(Z))}function ve(Z){var de,Ue,Le;qt(Z),T.length===0&&((de=i.domElement)==null||de.releasePointerCapture(Z.pointerId),(Ue=i.domElement)==null||Ue.ownerDocument.removeEventListener("pointermove",U),(Le=i.domElement)==null||Le.ownerDocument.removeEventListener("pointerup",ve)),i.dispatchEvent(o),l=a.NONE}function Me(Z){qt(Z)}function be(Z){let de;switch(Z.button){case 0:de=i.mouseButtons.LEFT;break;case 1:de=i.mouseButtons.MIDDLE;break;case 2:de=i.mouseButtons.RIGHT;break;default:de=-1}switch(de){case pu.DOLLY:if(i.enableZoom===!1)return;ae(Z),l=a.DOLLY;break;case pu.ROTATE:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(i.enablePan===!1)return;xe(Z),l=a.PAN}else{if(i.enableRotate===!1)return;Be(Z),l=a.ROTATE}break;case pu.PAN:if(Z.ctrlKey||Z.metaKey||Z.shiftKey){if(i.enableRotate===!1)return;Be(Z),l=a.ROTATE}else{if(i.enablePan===!1)return;xe(Z),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ie(Z){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Se(Z);break;case a.DOLLY:if(i.enableZoom===!1)return;ke(Z);break;case a.PAN:if(i.enablePan===!1)return;We(Z);break}}function tt(Z){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(Z.preventDefault(),i.dispatchEvent(s),Qe(Z),i.dispatchEvent(o))}function ct(Z){i.enabled===!1||i.enablePan===!1||lt(Z)}function Ge(Z){switch(pt(Z),T.length){case 1:switch(i.touches.ONE){case mu.ROTATE:if(i.enableRotate===!1)return;Ne(),l=a.TOUCH_ROTATE;break;case mu.PAN:if(i.enablePan===!1)return;Y(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case mu.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ge(),l=a.TOUCH_DOLLY_PAN;break;case mu.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Fe(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Ke(Z){switch(pt(Z),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;Ce(Z),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;re(Z),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;et(Z),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Et(Z),i.update();break;default:l=a.NONE}}function Rt(Z){i.enabled!==!1&&Z.preventDefault()}function Oe(Z){T.push(Z)}function qt(Z){delete L[Z.pointerId];for(let de=0;de=2.0 are supported."));return}const l=new wJ(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let u=0;u=0&&a[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}l.setExtensions(o),l.setPlugins(a),l.parse(i,r)}parseAsync(e,t){const i=this;return new Promise(function(r,s){i.parse(e,t,r,s)})}}function KX(){let n={};return{get:function(e){return n[e]},add:function(e,t){n[e]=t},remove:function(e){delete n[e]},removeAll:function(){n={}}}}const nn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class QX{constructor(e){this.parser=e,this.name=nn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class lJ{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class uJ{constructor(e){this.parser=e,this.name=nn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,i=this.parser,r=i.json,s=r.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],a=r.images[o.source];let l=i.textureLoader;if(a.uri){const u=i.options.manager.getHandler(a.uri);u!==null&&(l=u)}return this.detectSupport().then(function(u){if(u)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class cJ{constructor(e){this.name=nn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){const r=i.extensions[this.name],s=this.parser.getDependency("buffer",r.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){const l=r.byteOffset||0,u=r.byteLength||0,h=r.count,d=r.byteStride,p=new Uint8Array(a,l,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(h,d,p,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){const m=new ArrayBuffer(h*d);return o.decodeGltfBuffer(new Uint8Array(m),h,d,p,r.mode,r.filter),m})})}else return null}}class fJ{constructor(e){this.name=nn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;const r=t.meshes[i.mesh];for(const u of r.primitives)if(u.mode!==Ts.TRIANGLES&&u.mode!==Ts.TRIANGLE_STRIP&&u.mode!==Ts.TRIANGLE_FAN&&u.mode!==void 0)return null;const o=i.extensions[this.name].attributes,a=[],l={};for(const u in o)a.push(this.parser.getDependency("accessor",o[u]).then(h=>(l[u]=h,l[u])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(u=>{const h=u.pop(),d=h.isGroup?h.children:[h],p=u[0].count,m=[];for(const v of d){const x=new bt,y=new G,g=new Ii,S=new G(1,1,1),A=new zE(v.geometry,v.material,p);for(let E=0;E=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Xa={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},_J={CUBICSPLINE:void 0,LINEAR:tc,STEP:Zf},R1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function yJ(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Qp({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ko})),n.DefaultMaterial}function lu(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function Ka(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function xJ(n,e,t){let i=!1,r=!1,s=!1;for(let u=0,h=e.length;u0||n.search(/^data\:image\/jpeg/)===0?"image/jpeg":n.search(/\.webp($|\?)/i)>0||n.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const EJ=new bt;class wJ{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new KX,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,s=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,s=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&s<98?this.textureLoader=new Zp(this.options.manager):this.textureLoader=new QN(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new fs(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const a={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};lu(s,a,r),Ka(a,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(a)})).then(function(){e(a)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r{const l=this.associations.get(o);l!=null&&this.associations.set(a,l);for(const[u,h]of o.children.entries())s(h,a.children[u])};return s(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i=2&&y.setY(O,C[R*l+1]),l>=3&&y.setZ(O,C[R*l+2]),l>=4&&y.setW(O,C[R*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return y})}loadTexture(e){const t=this.json,i=this.options,s=t.textures[e].source,o=t.images[s];let a=this.textureLoader;if(o.uri){const l=i.manager.getHandler(o.uri);l!==null&&(a=l)}return this.loadTextureImage(e,s,a)}loadTextureImage(e,t,i){const r=this,s=this.json,o=s.textures[e],a=s.images[t],l=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(t,i).then(function(h){h.flipY=!1,h.name=o.name||a.name||"",h.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(h.name=a.uri);const p=(s.samplers||{})[o.sampler]||{};return h.magFilter=jP[p.magFilter]||pn,h.minFilter=jP[p.minFilter]||Fs,h.wrapS=YP[p.wrapS]||Rl,h.wrapT=YP[p.wrapT]||Rl,r.associations.set(h,{textures:e}),h}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,t){const i=this,r=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(d=>d.clone());const o=r.images[e],a=self.URL||self.webkitURL;let l=o.uri||"",u=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(d){u=!0;const p=new Blob([d],{type:o.mimeType});return l=a.createObjectURL(p),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const h=Promise.resolve(l).then(function(d){return new Promise(function(p,m){let v=p;t.isImageBitmapLoader===!0&&(v=function(x){const y=new Tn(x);y.needsUpdate=!0,p(y)}),t.load(Oo.resolveURL(d,s.path),v,void 0,m)})}).then(function(d){return u===!0&&a.revokeObjectURL(l),d.userData.mimeType=o.mimeType||MJ(o.uri),d}).catch(function(d){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),d});return this.sourceCache[e]=h,h}assignTexture(e,t,i,r){const s=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),s.extensions[nn.KHR_TEXTURE_TRANSFORM]){const a=i.extensions!==void 0?i.extensions[nn.KHR_TEXTURE_TRANSFORM]:void 0;if(a){const l=s.associations.get(o);o=s.extensions[nn.KHR_TEXTURE_TRANSFORM].extendTexture(o,a),s.associations.set(o,l)}}return r!==void 0&&("colorSpace"in o?o.colorSpace=r===3001?"srgb":"srgb-linear":o.encoding=r),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const a="PointsMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new x_,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(a,l)),i=l}else if(e.isLine){const a="LineBasicMaterial:"+i.uuid;let l=this.cache.get(a);l||(l=new or,mi.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(a,l)),i=l}if(r||s||o){let a="ClonedMaterial:"+i.uuid+":";r&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),o&&(a+="flat-shading:");let l=this.cache.get(a);l||(l=i.clone(),s&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(a,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Qp}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const a={},l=s.extensions||{},u=[];if(l[nn.KHR_MATERIALS_UNLIT]){const d=r[nn.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),u.push(d.extendParams(a,s,t))}else{const d=s.pbrMetallicRoughness||{};if(a.color=new it(1,1,1),a.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;a.color.fromArray(p),a.opacity=p[3]}d.baseColorTexture!==void 0&&u.push(t.assignTexture(a,"map",d.baseColorTexture,3001)),a.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,a.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(a,"metalnessMap",d.metallicRoughnessTexture)),u.push(t.assignTexture(a,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,a)})))}s.doubleSided===!0&&(a.side=Lr);const h=s.alphaMode||R1.OPAQUE;if(h===R1.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,h===R1.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==rs&&(u.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Re(1,1),s.normalTexture.scale!==void 0)){const d=s.normalTexture.scale;a.normalScale.set(d,d)}return s.occlusionTexture!==void 0&&o!==rs&&(u.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==rs&&(a.emissive=new it().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==rs&&u.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,3001)),Promise.all(u).then(function(){const d=new o(a);return s.name&&(d.name=s.name),Ka(d,s),t.associations.set(d,{materials:e}),s.extensions&&lu(r,d,s),d})}createUniqueName(e){const t=on.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(a){return i[nn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,t).then(function(l){return KP(l,a,t)})}const o=[];for(let a=0,l=e.length;a0&&AJ(g,s),g.name=t.createUniqueName(s.name||"mesh_"+e),Ka(g,s),y.extensions&&lu(r,g,y),t.assignFinalMaterial(g),d.push(g)}for(let m=0,v=d.length;m1?h=new so:u.length===1?h=u[0]:h=new an,h!==u[0])for(let d=0,p=u.length;d{const d=new Map;for(const[p,m]of r.associations)(p instanceof mi||p instanceof Tn)&&d.set(p,m);return h.traverse(p=>{const m=r.associations.get(p);m!=null&&d.set(p,m)}),d};return r.associations=u(s),s})}}function TJ(n,e,t){const i=e.attributes,r=new rr;if(i.POSITION!==void 0){const a=t.json.accessors[i.POSITION],l=a.min,u=a.max;if(l!==void 0&&u!==void 0){if(r.set(new G(l[0],l[1],l[2]),new G(u[0],u[1],u[2])),a.normalized){const h=qS(Df[a.componentType]);r.min.multiplyScalar(h),r.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const a=new G,l=new G;for(let u=0,h=s.length;u(I=L.indexOf(d))&&O=A.byteLength||!(T=p(A)))return a(1,"no header found");if(!(L=T.match(E)))return a(3,"bad initial token");for(O.valid|=1,O.programtype=L[1],O.string+=T+` `;T=p(A),T!==!1;){if(O.string+=T+` `,T.charAt(0)==="#"){O.comments+=T+` -`;continue}if((L=T.match(b))&&(O.gamma=parseFloat(L[1])),(L=T.match(C))&&(O.exposure=parseFloat(L[1])),(L=T.match(R))&&(O.valid|=2,O.format=L[1]),(L=T.match(I))&&(O.valid|=4,O.height=parseInt(L[1],10),O.width=parseInt(L[2],10)),O.valid&2&&O.valid&4)break}return O.valid&2?O.valid&4?O:a(3,"missing image size specifier"):a(3,"missing format specifier")},v=function(A,E,b){const C=E;if(C<8||C>32767||A[0]!==2||A[1]!==2||A[2]&128)return new Uint8Array(A);if(C!==(A[2]<<8|A[3]))return a(3,"wrong scanline width");const R=new Uint8Array(4*E*b);if(!R.length)return a(4,"unable to allocate buffer space");let I=0,O=0;const T=4*C,L=new Uint8Array(4),K=new Uint8Array(T);let se=b;for(;se>0&&OA.byteLength)return a(1);if(L[0]=A[O++],L[1]=A[O++],L[2]=A[O++],L[3]=A[O++],L[0]!=2||L[1]!=2||(L[2]<<8|L[3])!=C)return a(3,"bad rgbe scanline format");let W=0,te;for(;W128;if(oe&&(te-=128),te===0||W+te>T)return a(3,"bad scanline data");if(oe){const F=A[O++];for(let V=0;V>3]&1<<(B&7))&&(k[q++]=B);for(var z=q-1;q<65536;)k[q++]=0;return z}function L(D){for(var k=0;k<16384;k++)D[k]={},D[k].len=0,D[k].lit=0,D[k].p=null}const K={l:0,c:0,lc:0};function se(D,k,q,B,z){for(;q>q&(1<0;--k){var B=q+W[k]>>1;W[k]=q,q=B}for(var k=0;k<65537;++k){var z=D[k];z>0&&(D[k]=z|W[z]++<<6)}}function $(D,k,q,B,z,X,Q){for(var j=q,he=0,ye=0;z<=X;z++){if(j.value-q.value>B)return!1;se(6,he,ye,D,j);var we=K.l;if(he=K.c,ye=K.lc,Q[z]=we,we==63){if(j.value-q.value>B)throw"Something wrong with hufUnpackEncTable";se(8,he,ye,D,j);var _e=K.l+6;if(he=K.c,ye=K.lc,z+_e>X+1)throw"Something wrong with hufUnpackEncTable";for(;_e--;)Q[z++]=0;z--}else if(we>=59){var _e=we-59+2;if(z+_e>X+1)throw"Something wrong with hufUnpackEncTable";for(;_e--;)Q[z++]=0;z--}}te(Q)}function oe(D){return D&63}function F(D){return D>>6}function V(D,k,q,B){for(;k<=q;k++){var z=F(D[k]),X=oe(D[k]);if(z>>X)throw"Invalid table entry";if(X>14){var Q=B[z>>X-14];if(Q.len)throw"Invalid table entry";if(Q.lit++,Q.p){var j=Q.p;Q.p=new Array(Q.lit);for(var he=0;he0;he--){var Q=B[(z<<14-X)+ye];if(Q.len||Q.p)throw"Invalid table entry";Q.len=X,Q.lit=k,ye++}}return!0}const N={c:0,lc:0};function ee(D,k,q,B){D=D<<8|ht(q,B),k+=8,N.c=D,N.lc=k}const ce={c:0,lc:0};function Be(D,k,q,B,z,X,Q,j,he,ye){if(D==k){B<8&&(ee(q,B,z,Q),q=N.c,B=N.lc),B-=8;var we=q>>B,we=new Uint8Array([we])[0];if(he.value+we>ye)return!1;for(var _e=j[he.value-1];we-- >0;)j[he.value++]=_e}else if(he.value32767?k-65536:k}const Se={a:0,b:0};function ke(D,k){var q=xe(D),B=xe(k),z=B,X=q+(z&1)+(z>>1),Q=X,j=X-z;Se.a=Q,Se.b=j}function We(D,k){var q=ae(D),B=ae(k),z=q-(B>>1)&65535,X=B+z-32768&65535;Se.a=X,Se.b=z}function Qe(D,k,q,B,z,X,Q){for(var j=Q<16384,he=q>z?z:q,ye=1,we;ye<=he;)ye<<=1;for(ye>>=1,we=ye,ye>>=1;ye>=1;){for(var _e=0,Ze=_e+X*(z-we),De=X*ye,ze=X*we,ft=B*ye,At=B*we,yt,Lt,rt,qe;_e<=Ze;_e+=ze){for(var Jt=_e,Pt=_e+B*(q-we);Jt<=Pt;Jt+=At){var Nt=Jt+ft,gn=Jt+De,jn=gn+ft;j?(ke(D[Jt+k],D[gn+k]),yt=Se.a,rt=Se.b,ke(D[Nt+k],D[jn+k]),Lt=Se.a,qe=Se.b,ke(yt,Lt),D[Jt+k]=Se.a,D[Nt+k]=Se.b,ke(rt,qe),D[gn+k]=Se.a,D[jn+k]=Se.b):(We(D[Jt+k],D[gn+k]),yt=Se.a,rt=Se.b,We(D[Nt+k],D[jn+k]),Lt=Se.a,qe=Se.b,We(yt,Lt),D[Jt+k]=Se.a,D[Nt+k]=Se.b,We(rt,qe),D[gn+k]=Se.a,D[jn+k]=Se.b)}if(q&ye){var gn=Jt+De;j?ke(D[Jt+k],D[gn+k]):We(D[Jt+k],D[gn+k]),yt=Se.a,D[gn+k]=Se.b,D[Jt+k]=yt}}if(z&ye)for(var Jt=_e,Pt=_e+B*(q-we);Jt<=Pt;Jt+=At){var Nt=Jt+ft;j?ke(D[Jt+k],D[Nt+k]):We(D[Jt+k],D[Nt+k]),yt=Se.a,D[Nt+k]=Se.b,D[Jt+k]=yt}we=ye,ye>>=1}return _e}function lt(D,k,q,B,z,X,Q,j,he,ye){for(var we=0,_e=0,Ze=j,De=Math.trunc(z.value+(X+7)/8);z.value=14;){var ze=we>>_e-14&16383,ft=k[ze];if(ft.len)_e-=ft.len,Be(ft.lit,Q,we,_e,q,B,z,he,ye,Ze),we=ce.c,_e=ce.lc;else{if(!ft.p)throw"hufDecode issues";var At;for(At=0;At=yt&&F(D[ft.p[At]])==(we>>_e-yt&(1<>=Lt,_e-=Lt;_e>0;){var ft=k[we<<14-_e&16383];if(ft.len)_e-=ft.len,Be(ft.lit,Q,we,_e,q,B,z,he,ye,Ze),we=ce.c,_e=ce.lc;else throw"hufDecode issues"}return!0}function Ne(D,k,q,B,z,X){var Q={value:0},j=q.value,he=pt(k,q),ye=pt(k,q);q.value+=4;var we=pt(k,q);if(q.value+=4,he<0||he>=65537||ye<0||ye>=65537)throw"Something wrong with HUF_ENCSIZE";var _e=new Array(65537),Ze=new Array(16384);L(Ze);var De=B-(q.value-j);if($(D,k,q,De,he,ye,_e),we>8*(B-(q.value-j)))throw"Something wrong with hufUncompress";V(_e,he,ye,Ze),lt(_e,Ze,D,k,q,we,ye,X,z,Q)}function Y(D,k,q){for(var B=0;BX||(k[z++]=D[q++],z>X));)k[z++]=D[B++]}function Fe(D){for(var k=D.byteLength,q=new Array,B=0,z=new DataView(D);k>0;){var X=z.getInt8(B++);if(X<0){var Q=-X;k-=Q+1;for(var j=0;j>8==255?z+=B&255:(q[z]=B,z++),D.value++}function Xe(D,k){k[0]=Pe(D[0]),k[1]=Pe(D[1]),k[2]=Pe(D[5]),k[3]=Pe(D[6]),k[4]=Pe(D[14]),k[5]=Pe(D[15]),k[6]=Pe(D[27]),k[7]=Pe(D[28]),k[8]=Pe(D[2]),k[9]=Pe(D[4]),k[10]=Pe(D[7]),k[11]=Pe(D[13]),k[12]=Pe(D[16]),k[13]=Pe(D[26]),k[14]=Pe(D[29]),k[15]=Pe(D[42]),k[16]=Pe(D[3]),k[17]=Pe(D[8]),k[18]=Pe(D[12]),k[19]=Pe(D[17]),k[20]=Pe(D[25]),k[21]=Pe(D[30]),k[22]=Pe(D[41]),k[23]=Pe(D[43]),k[24]=Pe(D[9]),k[25]=Pe(D[11]),k[26]=Pe(D[18]),k[27]=Pe(D[24]),k[28]=Pe(D[31]),k[29]=Pe(D[40]),k[30]=Pe(D[44]),k[31]=Pe(D[53]),k[32]=Pe(D[10]),k[33]=Pe(D[19]),k[34]=Pe(D[23]),k[35]=Pe(D[32]),k[36]=Pe(D[39]),k[37]=Pe(D[45]),k[38]=Pe(D[52]),k[39]=Pe(D[54]),k[40]=Pe(D[20]),k[41]=Pe(D[22]),k[42]=Pe(D[33]),k[43]=Pe(D[38]),k[44]=Pe(D[46]),k[45]=Pe(D[51]),k[46]=Pe(D[55]),k[47]=Pe(D[60]),k[48]=Pe(D[21]),k[49]=Pe(D[34]),k[50]=Pe(D[37]),k[51]=Pe(D[47]),k[52]=Pe(D[50]),k[53]=Pe(D[56]),k[54]=Pe(D[59]),k[55]=Pe(D[61]),k[56]=Pe(D[35]),k[57]=Pe(D[36]),k[58]=Pe(D[48]),k[59]=Pe(D[49]),k[60]=Pe(D[57]),k[61]=Pe(D[58]),k[62]=Pe(D[62]),k[63]=Pe(D[63])}function et(D){const k=.5*Math.cos(.7853975),q=.5*Math.cos(3.14159/16),B=.5*Math.cos(3.14159/8),z=.5*Math.cos(3*3.14159/16),X=.5*Math.cos(5*3.14159/16),Q=.5*Math.cos(3*3.14159/8),j=.5*Math.cos(7*3.14159/16);for(var he=new Array(4),ye=new Array(4),we=new Array(4),_e=new Array(4),Ze=0;Ze<8;++Ze){var De=Ze*8;he[0]=B*D[De+2],he[1]=Q*D[De+2],he[2]=B*D[De+6],he[3]=Q*D[De+6],ye[0]=q*D[De+1]+z*D[De+3]+X*D[De+5]+j*D[De+7],ye[1]=z*D[De+1]-j*D[De+3]-q*D[De+5]-X*D[De+7],ye[2]=X*D[De+1]-q*D[De+3]+j*D[De+5]+z*D[De+7],ye[3]=j*D[De+1]-X*D[De+3]+z*D[De+5]-q*D[De+7],we[0]=k*(D[De+0]+D[De+4]),we[3]=k*(D[De+0]-D[De+4]),we[1]=he[0]+he[3],we[2]=he[1]-he[2],_e[0]=we[0]+we[1],_e[1]=we[3]+we[2],_e[2]=we[3]-we[2],_e[3]=we[0]-we[1],D[De+0]=_e[0]+ye[0],D[De+1]=_e[1]+ye[1],D[De+2]=_e[2]+ye[2],D[De+3]=_e[3]+ye[3],D[De+4]=_e[3]-ye[3],D[De+5]=_e[2]-ye[2],D[De+6]=_e[1]-ye[1],D[De+7]=_e[0]-ye[0]}for(var ze=0;ze<8;++ze)he[0]=B*D[16+ze],he[1]=Q*D[16+ze],he[2]=B*D[48+ze],he[3]=Q*D[48+ze],ye[0]=q*D[8+ze]+z*D[24+ze]+X*D[40+ze]+j*D[56+ze],ye[1]=z*D[8+ze]-j*D[24+ze]-q*D[40+ze]-X*D[56+ze],ye[2]=X*D[8+ze]-q*D[24+ze]+j*D[40+ze]+z*D[56+ze],ye[3]=j*D[8+ze]-X*D[24+ze]+z*D[40+ze]-q*D[56+ze],we[0]=k*(D[ze]+D[32+ze]),we[3]=k*(D[ze]-D[32+ze]),we[1]=he[0]+he[3],we[2]=he[1]-he[2],_e[0]=we[0]+we[1],_e[1]=we[3]+we[2],_e[2]=we[3]-we[2],_e[3]=we[0]-we[1],D[0+ze]=_e[0]+ye[0],D[8+ze]=_e[1]+ye[1],D[16+ze]=_e[2]+ye[2],D[24+ze]=_e[3]+ye[3],D[32+ze]=_e[3]-ye[3],D[40+ze]=_e[2]-ye[2],D[48+ze]=_e[1]-ye[1],D[56+ze]=_e[0]-ye[0]}function Et(D){for(var k=0;k<64;++k){var q=D[0][k],B=D[1][k],z=D[2][k];D[0][k]=q+1.5747*z,D[1][k]=q-.1873*B-.4682*z,D[2][k]=q+1.8556*B}}function H(D,k,q){for(var B=0;B<64;++B)k[q+B]=Cu.toHalfFloat(U(D[B]))}function U(D){return D<=1?Math.sign(D)*Math.pow(Math.abs(D),2.2):Math.sign(D)*Math.pow(O,Math.abs(D)-1)}function ve(D){return new DataView(D.array.buffer,D.offset.value,D.size)}function Me(D){var k=D.viewer.buffer.slice(D.offset.value,D.offset.value+D.size),q=new Uint8Array(Fe(k)),B=new Uint8Array(q.length);return Ae(q),ge(q,B),new DataView(B.buffer)}function be(D){var k=D.array.slice(D.offset.value,D.offset.value+D.size),q=y0(k),B=new Uint8Array(q.length);return Ae(q),ge(q,B),new DataView(B.buffer)}function Ie(D){for(var k=D.viewer,q={value:D.offset.value},B=new Uint16Array(D.width*D.scanlineBlockSize*(D.channels*D.type)),z=new Uint8Array(8192),X=0,Q=new Array(D.channels),j=0;j=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(he<=ye)for(var j=0;j0;){var j=Ge(k.buffer,q),he=Z(k,q),ye=he>>2&3,we=(he>>4)-1,_e=new Int8Array([we])[0],Ze=Z(k,q);X.push({name:j,index:_e,type:Ze,compression:ye}),Q-=j.length+3}for(var De=Dt.channels,ze=new Array(D.channels),ft=0;ft=0&&(Lt.idx[qe.index]=rt),At.offset=rt)}if(z.acCompressedSize>0)switch(z.acCompression){case 0:var Nt=new Uint16Array(z.totalAcUncompressedCount);Ne(D.array,k,q,z.acCompressedSize,Nt,z.totalAcUncompressedCount);break;case 1:var Jt=D.array.slice(q.value,q.value+z.totalAcUncompressedCount),Pt=y0(Jt),Nt=new Uint16Array(Pt.buffer);q.value+=z.totalAcUncompressedCount;break}if(z.dcCompressedSize>0){var gn={array:D.array,offset:q,size:z.dcCompressedSize},jn=new Uint16Array(be(gn).buffer);q.value+=z.dcCompressedSize}if(z.rleRawSize>0){var Jt=D.array.slice(q.value,q.value+z.rleCompressedSize),Pt=y0(Jt),Dn=Fe(Pt.buffer);q.value+=z.rleCompressedSize}for(var sn=0,Yt=new Array(ze.length),ft=0;ft>10,q=D&1023;return(D>>15?-1:1)*(k?k===31?q?NaN:1/0:Math.pow(2,k-15)*(1+q/1024):6103515625e-14*(q/1024))}function ie(D,k){var q=D.getUint16(k.value,!0);return k.value+=2,q}function He(D,k){return Pe(ie(D,k))}function pe(D,k,q,B){for(var z=q.value,X=[];q.value_t.height?_t.height-k:_t.scanlineBlockSize;const B=_t.size<_t.lines*_t.bytesPerLine?_t.uncompress(_t):ve(_t);dn.value+=_t.size;for(let z=0;z<_t.scanlineBlockSize;z++){const X=z+D*_t.scanlineBlockSize;if(X>=_t.height)break;for(let Q=0;Q<_t.channels;Q++){const j=mn[Dt.channels[Q].name];for(let he=0;he<_t.width;he++){Ln.value=(z*(_t.channels*_t.width)+Q*_t.width+he)*_t.inputSize;const ye=(_t.height-1-X)*(_t.width*_t.outputChannels)+he*_t.outputChannels+j;_t.byteArray[ye]=_t.getter(B,Ln)}}}}return{header:Dt,width:_t.width,height:_t.height,data:_t.byteArray,format:_t.format,[od?"colorSpace":"encoding"]:_t[od?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(o,a){od?o.colorSpace=a.colorSpace:o.encoding=a.encoding,o.minFilter=pn,o.magFilter=pn,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,a)}return super.load(e,s,i,r)}}const P1=new WeakMap;class EJ extends ar{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new fs(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const u=t.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=u.name)}const i=JSON.stringify(t);if(P1.has(e)){const l=P1.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((u,h)=>{r._callbacks[s]={resolve:u,reject:h},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),P1.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new zt;e.index&&t.setIndex(new un(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=wJ.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` -`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const d=h.draco,p=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const v=t(d,p,m,u),x=v.attributes.map(y=>y.array.buffer);v.index&&x.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},x)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{d.destroy(m),d.destroy(p)}});break}};function t(o,a,l,u){const h=u.attributeIDs,d=u.attributeTypes;let p,m;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(v===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const x={index:null,attributes:[]};for(const y in h){const g=self[d[y]];let S,A;if(u.useUniqueIDs)A=h[y],S=a.GetAttributeByUniqueId(p,A);else{if(A=a.GetAttributeId(p,o[h[y]]),A===-1)continue;S=a.GetAttribute(p,A)}x.attributes.push(r(o,a,p,y,g,S))}return v===o.TRIANGULAR_MESH&&(x.index=i(o,a,p)),o.destroy(p),x}function i(o,a,l){const h=l.num_faces()*3,d=h*4,p=o._malloc(d);a.GetTrianglesUInt32Array(l,d,p);const m=new Uint32Array(o.HEAPF32.buffer,p,h).slice();return o._free(p),{array:m,itemSize:1}}function r(o,a,l,u,h,d){const p=d.num_components(),v=l.num_points()*p,x=v*h.BYTES_PER_ELEMENT,y=s(o,h),g=o._malloc(x);a.GetAttributeDataArrayForAllPoints(l,d,y,x,g);const S=new h(o.HEAPF32.buffer,g,v).slice();return o._free(g),{name:u,array:S,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let A0;const B1=()=>{if(A0)return A0;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(d=>{s=d.instance,s.exports.__wasm_call_ctors()});function a(d){const p=new Uint8Array(d.length);for(let v=0;v96?x-71:x>64?x-65:x>47?x+4:x>46?63:62}let m=0;for(let v=0;vn===Object(n)&&!Array.isArray(n)&&typeof n!="function";function mw(n,e){const t=ri(s=>s.gl),i=Ta(Zp,YP(n)?Object.values(n):n);return ne.useLayoutEffect(()=>{e==null||e(i)},[e]),ne.useEffect(()=>{"initTexture"in t&&(Array.isArray(i)?i:[i]).forEach(t.initTexture)},[t,i]),ne.useMemo(()=>{if(YP(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}mw.preload=n=>Ta.preload(Zp,n);mw.clear=n=>Ta.clear(Zp,n);let S0=null,L3="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function D3(n,e,t){return i=>{t&&t(i),n&&(S0||(S0=new EJ),S0.setDecoderPath(typeof n=="string"?n:L3),i.setDRACOLoader(S0)),e&&i.setMeshoptDecoder(typeof B1=="function"?B1():B1)}}function nm(n,e=!0,t=!0,i){return Ta(pw,n,D3(e,t,i))}nm.preload=(n,e=!0,t=!0,i)=>Ta.preload(pw,n,D3(e,t,i));nm.clear=n=>Ta.clear(pw,n);nm.setDecoderPath=n=>{L3=n};function TJ(n,e,t){const i=ri(p=>p.size),r=ri(p=>p.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=typeof e=="number"?e:i.height*r.dpr,a=(typeof n=="number"?t:n)||{},{samples:l=0,depth:u,...h}=a,d=ne.useMemo(()=>{const p=new Vs(s,o,{minFilter:pn,magFilter:pn,type:tr,...h});return u&&(p.depthTexture=new m_(s,o,pi)),p.samples=l,p},[]);return ne.useLayoutEffect(()=>{d.setSize(s,o),l&&(d.samples=l)},[l,d,s,o]),ne.useEffect(()=>()=>d.dispose(),[]),d}const CJ=n=>typeof n=="function",RJ=ne.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const a=ri(({set:y})=>y),l=ri(({camera:y})=>y),u=ri(({size:y})=>y),h=ne.useRef(null);ne.useImperativeHandle(o,()=>h.current,[]);const d=ne.useRef(null),p=TJ(e);ne.useLayoutEffect(()=>{s.manual||(h.current.aspect=u.width/u.height)},[u,s]),ne.useLayoutEffect(()=>{h.current.updateProjectionMatrix()});let m=0,v=null;const x=CJ(r);return $p(y=>{x&&(t===1/0||m{if(i){const y=l;return a(()=>({camera:h.current})),()=>a(()=>({camera:y}))}},[h,i,a]),ne.createElement(ne.Fragment,null,ne.createElement("perspectiveCamera",hs({ref:h},s),!x&&r),ne.createElement("group",{ref:d},x&&r(p.texture)))}),bJ=ne.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},h)=>{const d=ri(C=>C.invalidate),p=ri(C=>C.camera),m=ri(C=>C.gl),v=ri(C=>C.events),x=ri(C=>C.setEvents),y=ri(C=>C.set),g=ri(C=>C.get),S=ri(C=>C.performance),A=e||p,E=i||v.connected||m.domElement,b=ne.useMemo(()=>new VX(A),[A]);return $p(()=>{b.enabled&&b.update()},-1),ne.useEffect(()=>(s&&b.connect(s===!0?E:s),b.connect(E),()=>void b.dispose()),[s,E,t,b,d]),ne.useEffect(()=>{const C=O=>{d(),t&&S.regress(),o&&o(O)},R=O=>{a&&a(O)},I=O=>{l&&l(O)};return b.addEventListener("change",C),b.addEventListener("start",R),b.addEventListener("end",I),()=>{b.removeEventListener("start",R),b.removeEventListener("end",I),b.removeEventListener("change",C)}},[o,a,l,b,d,x]),ne.useEffect(()=>{if(n){const C=g().controls;return y({controls:b}),()=>y({controls:C})}},[n,b]),ne.createElement("primitive",hs({ref:h,object:b,enableDamping:r},u))}),PJ=3e3,BJ=3001,I1={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},IJ="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",KP=n=>Array.isArray(n);function N3({files:n=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:e="",preset:t=void 0,encoding:i=void 0,extensions:r}={}){var s;let o=null,a=!1,l;if(t){if(!(t in I1))throw new Error("Preset must be one of: "+Object.keys(I1).join(", "));n=I1[t],e=IJ}if(a=KP(n),l=KP(n)?"cube":n.startsWith("data:application/exr")?"exr":n.startsWith("data:application/hdr")?"hdr":(s=n.split(".").pop())==null||(s=s.split("?"))==null||(s=s.shift())==null?void 0:s.toLowerCase(),o=a?zN:l==="hdr"?SJ:l==="exr"?MJ:null,!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);const u=Ta(o,a?[n]:n,d=>{d.setPath==null||d.setPath(e),r&&r(d)}),h=a?u[0]:u;return h.mapping=a?zo:Kf,"colorSpace"in h?h.colorSpace=i??a?"srgb":"srgb-linear":h.encoding=i??a?BJ:PJ,h}const LJ=n=>n.current&&n.current.isScene,DJ=n=>LJ(n)?n.current:n;function gw(n,e,t,i,r=0){const s=DJ(e||t),o=s.background,a=s.environment,l=s.backgroundBlurriness||0;return n!=="only"&&(s.environment=i),n&&(s.background=i),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=r),()=>{n!=="only"&&(s.environment=a),n&&(s.background=o),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=l)}}function vw({scene:n,background:e=!1,blur:t,map:i}){const r=ri(s=>s.scene);return ne.useLayoutEffect(()=>{if(i)return gw(e,n,r,i,t)},[r,n,i,e,t]),null}function F3({background:n=!1,scene:e,blur:t,...i}){const r=N3(i),s=ri(o=>o.scene);return ne.useLayoutEffect(()=>gw(n,e,s,r,t),[r,n,e,s,t]),null}function NJ({children:n,near:e=1,far:t=1e3,resolution:i=256,frames:r=1,map:s,background:o=!1,blur:a,scene:l,files:u,path:h,preset:d=void 0,extensions:p}){const m=ri(A=>A.gl),v=ri(A=>A.scene),x=ne.useRef(null),[y]=ne.useState(()=>new eh),g=ne.useMemo(()=>{const A=new LE(i);return A.texture.type=tr,A},[i]);ne.useLayoutEffect(()=>(r===1&&x.current.update(m,y),gw(o,l,v,g.texture,a)),[n,y,g.texture,l,v,o,r,m]);let S=1;return $p(()=>{(r===1/0||So3({GroundProjectedEnvImpl:kX}),[]);const a=ne.useMemo(()=>[o],[o]),l=(e=n.ground)==null?void 0:e.height,u=(t=n.ground)==null?void 0:t.radius,h=(i=(r=n.ground)==null?void 0:r.scale)!==null&&i!==void 0?i:1e3;return ne.createElement(ne.Fragment,null,ne.createElement(vw,hs({},n,{map:o})),ne.createElement("groundProjectedEnvImpl",{args:a,scale:h,height:l,radius:u}))}function OJ(n){return n.ground?ne.createElement(FJ,n):n.map?ne.createElement(vw,n):n.children?ne.createElement(NJ,n):ne.createElement(F3,n)}const L1=ne.forwardRef(({args:n,map:e,toneMapped:t=!1,color:i="white",form:r="rect",intensity:s=1,scale:o=1,target:a,children:l,...u},h)=>{const d=ne.useRef(null);return ne.useImperativeHandle(h,()=>d.current,[]),ne.useLayoutEffect(()=>{!l&&!u.material&&(vu(d.current.material,{color:i}),d.current.material.color.multiplyScalar(s))},[i,s,l,u.material]),ne.useLayoutEffect(()=>{a&&d.current.lookAt(Array.isArray(a)?new G(...a):a)},[a]),o=Array.isArray(o)&&o.length===2?[o[0],o[1],1]:o,ne.createElement("mesh",hs({ref:d,scale:o},u),r==="circle"?ne.createElement("ringGeometry",{args:[0,1,64]}):r==="ring"?ne.createElement("ringGeometry",{args:[.5,1,64]}):r==="rect"?ne.createElement("planeGeometry",null):ne.createElement(r,{args:n}),l||(u.material?null:ne.createElement("meshBasicMaterial",{toneMapped:t,map:e,side:Lr})))});var UJ={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const QP=n=>{let e;const t=new Set,i=(h,d)=>{const p=typeof h=="function"?h(e):h;if(!Object.is(p,e)){const m=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(v=>v(e,m))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(UJ?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=e=n(i,r,l);return l},kJ=n=>n?QP(n):QP;var O3={exports:{}},U3={},k3={exports:{}},z3={};/** +`;continue}if((L=T.match(b))&&(O.gamma=parseFloat(L[1])),(L=T.match(C))&&(O.exposure=parseFloat(L[1])),(L=T.match(R))&&(O.valid|=2,O.format=L[1]),(L=T.match(I))&&(O.valid|=4,O.height=parseInt(L[1],10),O.width=parseInt(L[2],10)),O.valid&2&&O.valid&4)break}return O.valid&2?O.valid&4?O:a(3,"missing image size specifier"):a(3,"missing format specifier")},v=function(A,E,b){const C=E;if(C<8||C>32767||A[0]!==2||A[1]!==2||A[2]&128)return new Uint8Array(A);if(C!==(A[2]<<8|A[3]))return a(3,"wrong scanline width");const R=new Uint8Array(4*E*b);if(!R.length)return a(4,"unable to allocate buffer space");let I=0,O=0;const T=4*C,L=new Uint8Array(4),K=new Uint8Array(T);let se=b;for(;se>0&&OA.byteLength)return a(1);if(L[0]=A[O++],L[1]=A[O++],L[2]=A[O++],L[3]=A[O++],L[0]!=2||L[1]!=2||(L[2]<<8|L[3])!=C)return a(3,"bad rgbe scanline format");let W=0,te;for(;W128;if(oe&&(te-=128),te===0||W+te>T)return a(3,"bad scanline data");if(oe){const F=A[O++];for(let V=0;V>3]&1<<(B&7))&&(k[q++]=B);for(var z=q-1;q<65536;)k[q++]=0;return z}function L(D){for(var k=0;k<16384;k++)D[k]={},D[k].len=0,D[k].lit=0,D[k].p=null}const K={l:0,c:0,lc:0};function se(D,k,q,B,z){for(;q>q&(1<0;--k){var B=q+W[k]>>1;W[k]=q,q=B}for(var k=0;k<65537;++k){var z=D[k];z>0&&(D[k]=z|W[z]++<<6)}}function $(D,k,q,B,z,X,Q){for(var j=q,he=0,ye=0;z<=X;z++){if(j.value-q.value>B)return!1;se(6,he,ye,D,j);var we=K.l;if(he=K.c,ye=K.lc,Q[z]=we,we==63){if(j.value-q.value>B)throw"Something wrong with hufUnpackEncTable";se(8,he,ye,D,j);var _e=K.l+6;if(he=K.c,ye=K.lc,z+_e>X+1)throw"Something wrong with hufUnpackEncTable";for(;_e--;)Q[z++]=0;z--}else if(we>=59){var _e=we-59+2;if(z+_e>X+1)throw"Something wrong with hufUnpackEncTable";for(;_e--;)Q[z++]=0;z--}}te(Q)}function oe(D){return D&63}function F(D){return D>>6}function V(D,k,q,B){for(;k<=q;k++){var z=F(D[k]),X=oe(D[k]);if(z>>X)throw"Invalid table entry";if(X>14){var Q=B[z>>X-14];if(Q.len)throw"Invalid table entry";if(Q.lit++,Q.p){var j=Q.p;Q.p=new Array(Q.lit);for(var he=0;he0;he--){var Q=B[(z<<14-X)+ye];if(Q.len||Q.p)throw"Invalid table entry";Q.len=X,Q.lit=k,ye++}}return!0}const N={c:0,lc:0};function ee(D,k,q,B){D=D<<8|ht(q,B),k+=8,N.c=D,N.lc=k}const fe={c:0,lc:0};function Be(D,k,q,B,z,X,Q,j,he,ye){if(D==k){B<8&&(ee(q,B,z,Q),q=N.c,B=N.lc),B-=8;var we=q>>B,we=new Uint8Array([we])[0];if(he.value+we>ye)return!1;for(var _e=j[he.value-1];we-- >0;)j[he.value++]=_e}else if(he.value32767?k-65536:k}const Se={a:0,b:0};function ke(D,k){var q=xe(D),B=xe(k),z=B,X=q+(z&1)+(z>>1),Q=X,j=X-z;Se.a=Q,Se.b=j}function We(D,k){var q=ae(D),B=ae(k),z=q-(B>>1)&65535,X=B+z-32768&65535;Se.a=X,Se.b=z}function Qe(D,k,q,B,z,X,Q){for(var j=Q<16384,he=q>z?z:q,ye=1,we;ye<=he;)ye<<=1;for(ye>>=1,we=ye,ye>>=1;ye>=1;){for(var _e=0,Ze=_e+X*(z-we),De=X*ye,ze=X*we,ft=B*ye,At=B*we,yt,Lt,rt,qe;_e<=Ze;_e+=ze){for(var Jt=_e,Pt=_e+B*(q-we);Jt<=Pt;Jt+=At){var Nt=Jt+ft,gn=Jt+De,jn=gn+ft;j?(ke(D[Jt+k],D[gn+k]),yt=Se.a,rt=Se.b,ke(D[Nt+k],D[jn+k]),Lt=Se.a,qe=Se.b,ke(yt,Lt),D[Jt+k]=Se.a,D[Nt+k]=Se.b,ke(rt,qe),D[gn+k]=Se.a,D[jn+k]=Se.b):(We(D[Jt+k],D[gn+k]),yt=Se.a,rt=Se.b,We(D[Nt+k],D[jn+k]),Lt=Se.a,qe=Se.b,We(yt,Lt),D[Jt+k]=Se.a,D[Nt+k]=Se.b,We(rt,qe),D[gn+k]=Se.a,D[jn+k]=Se.b)}if(q&ye){var gn=Jt+De;j?ke(D[Jt+k],D[gn+k]):We(D[Jt+k],D[gn+k]),yt=Se.a,D[gn+k]=Se.b,D[Jt+k]=yt}}if(z&ye)for(var Jt=_e,Pt=_e+B*(q-we);Jt<=Pt;Jt+=At){var Nt=Jt+ft;j?ke(D[Jt+k],D[Nt+k]):We(D[Jt+k],D[Nt+k]),yt=Se.a,D[Nt+k]=Se.b,D[Jt+k]=yt}we=ye,ye>>=1}return _e}function lt(D,k,q,B,z,X,Q,j,he,ye){for(var we=0,_e=0,Ze=j,De=Math.trunc(z.value+(X+7)/8);z.value=14;){var ze=we>>_e-14&16383,ft=k[ze];if(ft.len)_e-=ft.len,Be(ft.lit,Q,we,_e,q,B,z,he,ye,Ze),we=fe.c,_e=fe.lc;else{if(!ft.p)throw"hufDecode issues";var At;for(At=0;At=yt&&F(D[ft.p[At]])==(we>>_e-yt&(1<>=Lt,_e-=Lt;_e>0;){var ft=k[we<<14-_e&16383];if(ft.len)_e-=ft.len,Be(ft.lit,Q,we,_e,q,B,z,he,ye,Ze),we=fe.c,_e=fe.lc;else throw"hufDecode issues"}return!0}function Ne(D,k,q,B,z,X){var Q={value:0},j=q.value,he=pt(k,q),ye=pt(k,q);q.value+=4;var we=pt(k,q);if(q.value+=4,he<0||he>=65537||ye<0||ye>=65537)throw"Something wrong with HUF_ENCSIZE";var _e=new Array(65537),Ze=new Array(16384);L(Ze);var De=B-(q.value-j);if($(D,k,q,De,he,ye,_e),we>8*(B-(q.value-j)))throw"Something wrong with hufUncompress";V(_e,he,ye,Ze),lt(_e,Ze,D,k,q,we,ye,X,z,Q)}function Y(D,k,q){for(var B=0;BX||(k[z++]=D[q++],z>X));)k[z++]=D[B++]}function Fe(D){for(var k=D.byteLength,q=new Array,B=0,z=new DataView(D);k>0;){var X=z.getInt8(B++);if(X<0){var Q=-X;k-=Q+1;for(var j=0;j>8==255?z+=B&255:(q[z]=B,z++),D.value++}function Xe(D,k){k[0]=Pe(D[0]),k[1]=Pe(D[1]),k[2]=Pe(D[5]),k[3]=Pe(D[6]),k[4]=Pe(D[14]),k[5]=Pe(D[15]),k[6]=Pe(D[27]),k[7]=Pe(D[28]),k[8]=Pe(D[2]),k[9]=Pe(D[4]),k[10]=Pe(D[7]),k[11]=Pe(D[13]),k[12]=Pe(D[16]),k[13]=Pe(D[26]),k[14]=Pe(D[29]),k[15]=Pe(D[42]),k[16]=Pe(D[3]),k[17]=Pe(D[8]),k[18]=Pe(D[12]),k[19]=Pe(D[17]),k[20]=Pe(D[25]),k[21]=Pe(D[30]),k[22]=Pe(D[41]),k[23]=Pe(D[43]),k[24]=Pe(D[9]),k[25]=Pe(D[11]),k[26]=Pe(D[18]),k[27]=Pe(D[24]),k[28]=Pe(D[31]),k[29]=Pe(D[40]),k[30]=Pe(D[44]),k[31]=Pe(D[53]),k[32]=Pe(D[10]),k[33]=Pe(D[19]),k[34]=Pe(D[23]),k[35]=Pe(D[32]),k[36]=Pe(D[39]),k[37]=Pe(D[45]),k[38]=Pe(D[52]),k[39]=Pe(D[54]),k[40]=Pe(D[20]),k[41]=Pe(D[22]),k[42]=Pe(D[33]),k[43]=Pe(D[38]),k[44]=Pe(D[46]),k[45]=Pe(D[51]),k[46]=Pe(D[55]),k[47]=Pe(D[60]),k[48]=Pe(D[21]),k[49]=Pe(D[34]),k[50]=Pe(D[37]),k[51]=Pe(D[47]),k[52]=Pe(D[50]),k[53]=Pe(D[56]),k[54]=Pe(D[59]),k[55]=Pe(D[61]),k[56]=Pe(D[35]),k[57]=Pe(D[36]),k[58]=Pe(D[48]),k[59]=Pe(D[49]),k[60]=Pe(D[57]),k[61]=Pe(D[58]),k[62]=Pe(D[62]),k[63]=Pe(D[63])}function et(D){const k=.5*Math.cos(.7853975),q=.5*Math.cos(3.14159/16),B=.5*Math.cos(3.14159/8),z=.5*Math.cos(3*3.14159/16),X=.5*Math.cos(5*3.14159/16),Q=.5*Math.cos(3*3.14159/8),j=.5*Math.cos(7*3.14159/16);for(var he=new Array(4),ye=new Array(4),we=new Array(4),_e=new Array(4),Ze=0;Ze<8;++Ze){var De=Ze*8;he[0]=B*D[De+2],he[1]=Q*D[De+2],he[2]=B*D[De+6],he[3]=Q*D[De+6],ye[0]=q*D[De+1]+z*D[De+3]+X*D[De+5]+j*D[De+7],ye[1]=z*D[De+1]-j*D[De+3]-q*D[De+5]-X*D[De+7],ye[2]=X*D[De+1]-q*D[De+3]+j*D[De+5]+z*D[De+7],ye[3]=j*D[De+1]-X*D[De+3]+z*D[De+5]-q*D[De+7],we[0]=k*(D[De+0]+D[De+4]),we[3]=k*(D[De+0]-D[De+4]),we[1]=he[0]+he[3],we[2]=he[1]-he[2],_e[0]=we[0]+we[1],_e[1]=we[3]+we[2],_e[2]=we[3]-we[2],_e[3]=we[0]-we[1],D[De+0]=_e[0]+ye[0],D[De+1]=_e[1]+ye[1],D[De+2]=_e[2]+ye[2],D[De+3]=_e[3]+ye[3],D[De+4]=_e[3]-ye[3],D[De+5]=_e[2]-ye[2],D[De+6]=_e[1]-ye[1],D[De+7]=_e[0]-ye[0]}for(var ze=0;ze<8;++ze)he[0]=B*D[16+ze],he[1]=Q*D[16+ze],he[2]=B*D[48+ze],he[3]=Q*D[48+ze],ye[0]=q*D[8+ze]+z*D[24+ze]+X*D[40+ze]+j*D[56+ze],ye[1]=z*D[8+ze]-j*D[24+ze]-q*D[40+ze]-X*D[56+ze],ye[2]=X*D[8+ze]-q*D[24+ze]+j*D[40+ze]+z*D[56+ze],ye[3]=j*D[8+ze]-X*D[24+ze]+z*D[40+ze]-q*D[56+ze],we[0]=k*(D[ze]+D[32+ze]),we[3]=k*(D[ze]-D[32+ze]),we[1]=he[0]+he[3],we[2]=he[1]-he[2],_e[0]=we[0]+we[1],_e[1]=we[3]+we[2],_e[2]=we[3]-we[2],_e[3]=we[0]-we[1],D[0+ze]=_e[0]+ye[0],D[8+ze]=_e[1]+ye[1],D[16+ze]=_e[2]+ye[2],D[24+ze]=_e[3]+ye[3],D[32+ze]=_e[3]-ye[3],D[40+ze]=_e[2]-ye[2],D[48+ze]=_e[1]-ye[1],D[56+ze]=_e[0]-ye[0]}function Et(D){for(var k=0;k<64;++k){var q=D[0][k],B=D[1][k],z=D[2][k];D[0][k]=q+1.5747*z,D[1][k]=q-.1873*B-.4682*z,D[2][k]=q+1.8556*B}}function H(D,k,q){for(var B=0;B<64;++B)k[q+B]=Ru.toHalfFloat(U(D[B]))}function U(D){return D<=1?Math.sign(D)*Math.pow(Math.abs(D),2.2):Math.sign(D)*Math.pow(O,Math.abs(D)-1)}function ve(D){return new DataView(D.array.buffer,D.offset.value,D.size)}function Me(D){var k=D.viewer.buffer.slice(D.offset.value,D.offset.value+D.size),q=new Uint8Array(Fe(k)),B=new Uint8Array(q.length);return Ae(q),ge(q,B),new DataView(B.buffer)}function be(D){var k=D.array.slice(D.offset.value,D.offset.value+D.size),q=y0(k),B=new Uint8Array(q.length);return Ae(q),ge(q,B),new DataView(B.buffer)}function Ie(D){for(var k=D.viewer,q={value:D.offset.value},B=new Uint16Array(D.width*D.scanlineBlockSize*(D.channels*D.type)),z=new Uint8Array(8192),X=0,Q=new Array(D.channels),j=0;j=8192)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(he<=ye)for(var j=0;j0;){var j=Ge(k.buffer,q),he=Z(k,q),ye=he>>2&3,we=(he>>4)-1,_e=new Int8Array([we])[0],Ze=Z(k,q);X.push({name:j,index:_e,type:Ze,compression:ye}),Q-=j.length+3}for(var De=Dt.channels,ze=new Array(D.channels),ft=0;ft=0&&(Lt.idx[qe.index]=rt),At.offset=rt)}if(z.acCompressedSize>0)switch(z.acCompression){case 0:var Nt=new Uint16Array(z.totalAcUncompressedCount);Ne(D.array,k,q,z.acCompressedSize,Nt,z.totalAcUncompressedCount);break;case 1:var Jt=D.array.slice(q.value,q.value+z.totalAcUncompressedCount),Pt=y0(Jt),Nt=new Uint16Array(Pt.buffer);q.value+=z.totalAcUncompressedCount;break}if(z.dcCompressedSize>0){var gn={array:D.array,offset:q,size:z.dcCompressedSize},jn=new Uint16Array(be(gn).buffer);q.value+=z.dcCompressedSize}if(z.rleRawSize>0){var Jt=D.array.slice(q.value,q.value+z.rleCompressedSize),Pt=y0(Jt),Dn=Fe(Pt.buffer);q.value+=z.rleCompressedSize}for(var sn=0,Yt=new Array(ze.length),ft=0;ft>10,q=D&1023;return(D>>15?-1:1)*(k?k===31?q?NaN:1/0:Math.pow(2,k-15)*(1+q/1024):6103515625e-14*(q/1024))}function ie(D,k){var q=D.getUint16(k.value,!0);return k.value+=2,q}function He(D,k){return Pe(ie(D,k))}function pe(D,k,q,B){for(var z=q.value,X=[];q.value_t.height?_t.height-k:_t.scanlineBlockSize;const B=_t.size<_t.lines*_t.bytesPerLine?_t.uncompress(_t):ve(_t);dn.value+=_t.size;for(let z=0;z<_t.scanlineBlockSize;z++){const X=z+D*_t.scanlineBlockSize;if(X>=_t.height)break;for(let Q=0;Q<_t.channels;Q++){const j=mn[Dt.channels[Q].name];for(let he=0;he<_t.width;he++){Ln.value=(z*(_t.channels*_t.width)+Q*_t.width+he)*_t.inputSize;const ye=(_t.height-1-X)*(_t.width*_t.outputChannels)+he*_t.outputChannels+j;_t.byteArray[ye]=_t.getter(B,Ln)}}}}return{header:Dt,width:_t.width,height:_t.height,data:_t.byteArray,format:_t.format,[od?"colorSpace":"encoding"]:_t[od?"colorSpace":"encoding"],type:this.type}}setDataType(e){return this.type=e,this}load(e,t,i,r){function s(o,a){od?o.colorSpace=a.colorSpace:o.encoding=a.encoding,o.minFilter=pn,o.magFilter=pn,o.generateMipmaps=!1,o.flipY=!1,t&&t(o,a)}return super.load(e,s,i,r)}}const P1=new WeakMap;class bJ extends ar{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,i,r){const s=new fs(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,o=>{const a={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(o,a).then(t).catch(r)},i,r)}decodeDracoFile(e,t,i,r){const s={attributeIDs:i||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!i};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const l in t.attributeTypes){const u=t.attributeTypes[l];u.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[l]=u.name)}const i=JSON.stringify(t);if(P1.has(e)){const l=P1.get(e);if(l.key===i)return l.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const s=this.workerNextTaskID++,o=e.byteLength,a=this._getWorker(s,o).then(l=>(r=l,new Promise((u,h)=>{r._callbacks[s]={resolve:u,reject:h},r.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))).then(l=>this._createGeometry(l.geometry));return a.catch(()=>!0).then(()=>{r&&s&&this._releaseTask(r,s)}),P1.set(e,{key:i,promise:a}),a}_createGeometry(e){const t=new zt;e.index&&t.setIndex(new un(e.index.array,1));for(let i=0;i{i.load(e,r,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(i=>{const r=i[0];e||(this.decoderConfig.wasmBinary=i[1]);const s=PJ.toString(),o=["/* draco decoder */",r,"","/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join(` +`);this.workerSourceURL=URL.createObjectURL(new Blob([o]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengths._taskLoad?-1:1});const i=this.workerPool[this.workerPool.length-1];return i._taskCosts[e]=t,i._taskLoad+=t,i})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{const d=h.draco,p=new d.Decoder,m=new d.DecoderBuffer;m.Init(new Int8Array(l),l.byteLength);try{const v=t(d,p,m,u),x=v.attributes.map(y=>y.array.buffer);v.index&&x.push(v.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:v},x)}catch(v){console.error(v),self.postMessage({type:"error",id:a.id,error:v.message})}finally{d.destroy(m),d.destroy(p)}});break}};function t(o,a,l,u){const h=u.attributeIDs,d=u.attributeTypes;let p,m;const v=a.GetEncodedGeometryType(l);if(v===o.TRIANGULAR_MESH)p=new o.Mesh,m=a.DecodeBufferToMesh(l,p);else if(v===o.POINT_CLOUD)p=new o.PointCloud,m=a.DecodeBufferToPointCloud(l,p);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!m.ok()||p.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+m.error_msg());const x={index:null,attributes:[]};for(const y in h){const g=self[d[y]];let S,A;if(u.useUniqueIDs)A=h[y],S=a.GetAttributeByUniqueId(p,A);else{if(A=a.GetAttributeId(p,o[h[y]]),A===-1)continue;S=a.GetAttribute(p,A)}x.attributes.push(r(o,a,p,y,g,S))}return v===o.TRIANGULAR_MESH&&(x.index=i(o,a,p)),o.destroy(p),x}function i(o,a,l){const h=l.num_faces()*3,d=h*4,p=o._malloc(d);a.GetTrianglesUInt32Array(l,d,p);const m=new Uint32Array(o.HEAPF32.buffer,p,h).slice();return o._free(p),{array:m,itemSize:1}}function r(o,a,l,u,h,d){const p=d.num_components(),v=l.num_points()*p,x=v*h.BYTES_PER_ELEMENT,y=s(o,h),g=o._malloc(x);a.GetAttributeDataArrayForAllPoints(l,d,y,x,g);const S=new h(o.HEAPF32.buffer,g,v).slice();return o._free(g),{name:u,array:S,itemSize:p}}function s(o,a){switch(a){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}let A0;const B1=()=>{if(A0)return A0;const n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let r=n;WebAssembly.validate(t)&&(r=e);let s;const o=WebAssembly.instantiate(a(r),{}).then(d=>{s=d.instance,s.exports.__wasm_call_ctors()});function a(d){const p=new Uint8Array(d.length);for(let v=0;v96?x-71:x>64?x-65:x>47?x+4:x>46?63:62}let m=0;for(let v=0;vn===Object(n)&&!Array.isArray(n)&&typeof n!="function";function mw(n,e){const t=si(s=>s.gl),i=Ta(Zp,QP(n)?Object.values(n):n);return ne.useLayoutEffect(()=>{e==null||e(i)},[e]),ne.useEffect(()=>{"initTexture"in t&&(Array.isArray(i)?i:[i]).forEach(t.initTexture)},[t,i]),ne.useMemo(()=>{if(QP(n)){const s={};let o=0;for(const a in n)s[a]=i[o++];return s}else return i},[n,i])}mw.preload=n=>Ta.preload(Zp,n);mw.clear=n=>Ta.clear(Zp,n);let S0=null,N3="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function F3(n,e,t){return i=>{t&&t(i),n&&(S0||(S0=new bJ),S0.setDecoderPath(typeof n=="string"?n:N3),i.setDRACOLoader(S0)),e&&i.setMeshoptDecoder(typeof B1=="function"?B1():B1)}}function nm(n,e=!0,t=!0,i){return Ta(pw,n,F3(e,t,i))}nm.preload=(n,e=!0,t=!0,i)=>Ta.preload(pw,n,F3(e,t,i));nm.clear=n=>Ta.clear(pw,n);nm.setDecoderPath=n=>{N3=n};function BJ(n,e,t){const i=si(p=>p.size),r=si(p=>p.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=typeof e=="number"?e:i.height*r.dpr,a=(typeof n=="number"?t:n)||{},{samples:l=0,depth:u,...h}=a,d=ne.useMemo(()=>{const p=new Vs(s,o,{minFilter:pn,magFilter:pn,type:tr,...h});return u&&(p.depthTexture=new m_(s,o,pi)),p.samples=l,p},[]);return ne.useLayoutEffect(()=>{d.setSize(s,o),l&&(d.samples=l)},[l,d,s,o]),ne.useEffect(()=>()=>d.dispose(),[]),d}const IJ=n=>typeof n=="function",LJ=ne.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const a=si(({set:y})=>y),l=si(({camera:y})=>y),u=si(({size:y})=>y),h=ne.useRef(null);ne.useImperativeHandle(o,()=>h.current,[]);const d=ne.useRef(null),p=BJ(e);ne.useLayoutEffect(()=>{s.manual||(h.current.aspect=u.width/u.height)},[u,s]),ne.useLayoutEffect(()=>{h.current.updateProjectionMatrix()});let m=0,v=null;const x=IJ(r);return $p(y=>{x&&(t===1/0||m{if(i){const y=l;return a(()=>({camera:h.current})),()=>a(()=>({camera:y}))}},[h,i,a]),ne.createElement(ne.Fragment,null,ne.createElement("perspectiveCamera",hs({ref:h},s),!x&&r),ne.createElement("group",{ref:d},x&&r(p.texture)))}),DJ=ne.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},h)=>{const d=si(C=>C.invalidate),p=si(C=>C.camera),m=si(C=>C.gl),v=si(C=>C.events),x=si(C=>C.setEvents),y=si(C=>C.set),g=si(C=>C.get),S=si(C=>C.performance),A=e||p,E=i||v.connected||m.domElement,b=ne.useMemo(()=>new YX(A),[A]);return $p(()=>{b.enabled&&b.update()},-1),ne.useEffect(()=>(s&&b.connect(s===!0?E:s),b.connect(E),()=>void b.dispose()),[s,E,t,b,d]),ne.useEffect(()=>{const C=O=>{d(),t&&S.regress(),o&&o(O)},R=O=>{a&&a(O)},I=O=>{l&&l(O)};return b.addEventListener("change",C),b.addEventListener("start",R),b.addEventListener("end",I),()=>{b.removeEventListener("start",R),b.removeEventListener("end",I),b.removeEventListener("change",C)}},[o,a,l,b,d,x]),ne.useEffect(()=>{if(n){const C=g().controls;return y({controls:b}),()=>y({controls:C})}},[n,b]),ne.createElement("primitive",hs({ref:h,object:b,enableDamping:r},u))}),NJ=3e3,FJ=3001,I1={apartment:"lebombo_1k.hdr",city:"potsdamer_platz_1k.hdr",dawn:"kiara_1_dawn_1k.hdr",forest:"forest_slope_1k.hdr",lobby:"st_fagans_interior_1k.hdr",night:"dikhololo_night_1k.hdr",park:"rooitou_park_1k.hdr",studio:"studio_small_03_1k.hdr",sunset:"venice_sunset_1k.hdr",warehouse:"empty_warehouse_01_1k.hdr"},OJ="https://raw.githack.com/pmndrs/drei-assets/456060a26bbeb8fdf79326f224b6d99b8bcce736/hdri/",ZP=n=>Array.isArray(n);function O3({files:n=["/px.png","/nx.png","/py.png","/ny.png","/pz.png","/nz.png"],path:e="",preset:t=void 0,encoding:i=void 0,extensions:r}={}){var s;let o=null,a=!1,l;if(t){if(!(t in I1))throw new Error("Preset must be one of: "+Object.keys(I1).join(", "));n=I1[t],e=OJ}if(a=ZP(n),l=ZP(n)?"cube":n.startsWith("data:application/exr")?"exr":n.startsWith("data:application/hdr")?"hdr":(s=n.split(".").pop())==null||(s=s.split("?"))==null||(s=s.shift())==null?void 0:s.toLowerCase(),o=a?HN:l==="hdr"?CJ:l==="exr"?RJ:null,!o)throw new Error("useEnvironment: Unrecognized file extension: "+n);const u=Ta(o,a?[n]:n,d=>{d.setPath==null||d.setPath(e),r&&r(d)}),h=a?u[0]:u;return h.mapping=a?zo:Kf,"colorSpace"in h?h.colorSpace=i??a?"srgb":"srgb-linear":h.encoding=i??a?FJ:NJ,h}const UJ=n=>n.current&&n.current.isScene,kJ=n=>UJ(n)?n.current:n;function gw(n,e,t,i,r=0){const s=kJ(e||t),o=s.background,a=s.environment,l=s.backgroundBlurriness||0;return n!=="only"&&(s.environment=i),n&&(s.background=i),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=r),()=>{n!=="only"&&(s.environment=a),n&&(s.background=o),n&&s.backgroundBlurriness!==void 0&&(s.backgroundBlurriness=l)}}function vw({scene:n,background:e=!1,blur:t,map:i}){const r=si(s=>s.scene);return ne.useLayoutEffect(()=>{if(i)return gw(e,n,r,i,t)},[r,n,i,e,t]),null}function U3({background:n=!1,scene:e,blur:t,...i}){const r=O3(i),s=si(o=>o.scene);return ne.useLayoutEffect(()=>gw(n,e,s,r,t),[r,n,e,s,t]),null}function zJ({children:n,near:e=1,far:t=1e3,resolution:i=256,frames:r=1,map:s,background:o=!1,blur:a,scene:l,files:u,path:h,preset:d=void 0,extensions:p}){const m=si(A=>A.gl),v=si(A=>A.scene),x=ne.useRef(null),[y]=ne.useState(()=>new eh),g=ne.useMemo(()=>{const A=new LE(i);return A.texture.type=tr,A},[i]);ne.useLayoutEffect(()=>(r===1&&x.current.update(m,y),gw(o,l,v,g.texture,a)),[n,y,g.texture,l,v,o,r,m]);let S=1;return $p(()=>{(r===1/0||Sl3({GroundProjectedEnvImpl:WX}),[]);const a=ne.useMemo(()=>[o],[o]),l=(e=n.ground)==null?void 0:e.height,u=(t=n.ground)==null?void 0:t.radius,h=(i=(r=n.ground)==null?void 0:r.scale)!==null&&i!==void 0?i:1e3;return ne.createElement(ne.Fragment,null,ne.createElement(vw,hs({},n,{map:o})),ne.createElement("groundProjectedEnvImpl",{args:a,scale:h,height:l,radius:u}))}function HJ(n){return n.ground?ne.createElement(GJ,n):n.map?ne.createElement(vw,n):n.children?ne.createElement(zJ,n):ne.createElement(U3,n)}const L1=ne.forwardRef(({args:n,map:e,toneMapped:t=!1,color:i="white",form:r="rect",intensity:s=1,scale:o=1,target:a,children:l,...u},h)=>{const d=ne.useRef(null);return ne.useImperativeHandle(h,()=>d.current,[]),ne.useLayoutEffect(()=>{!l&&!u.material&&(_u(d.current.material,{color:i}),d.current.material.color.multiplyScalar(s))},[i,s,l,u.material]),ne.useLayoutEffect(()=>{a&&d.current.lookAt(Array.isArray(a)?new G(...a):a)},[a]),o=Array.isArray(o)&&o.length===2?[o[0],o[1],1]:o,ne.createElement("mesh",hs({ref:d,scale:o},u),r==="circle"?ne.createElement("ringGeometry",{args:[0,1,64]}):r==="ring"?ne.createElement("ringGeometry",{args:[.5,1,64]}):r==="rect"?ne.createElement("planeGeometry",null):ne.createElement(r,{args:n}),l||(u.material?null:ne.createElement("meshBasicMaterial",{toneMapped:t,map:e,side:Lr})))});var VJ={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const qP=n=>{let e;const t=new Set,i=(h,d)=>{const p=typeof h=="function"?h(e):h;if(!Object.is(p,e)){const m=e;e=d??(typeof p!="object"||p===null)?p:Object.assign({},e,p),t.forEach(v=>v(e,m))}},r=()=>e,l={setState:i,getState:r,getInitialState:()=>u,subscribe:h=>(t.add(h),()=>t.delete(h)),destroy:()=>{(VJ?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},u=e=n(i,r,l);return l},WJ=n=>n?qP(n):qP;var k3={exports:{}},z3={},G3={exports:{}},H3={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -4054,7 +4054,7 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oh=ne;function zJ(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var GJ=typeof Object.is=="function"?Object.is:zJ,HJ=oh.useState,VJ=oh.useEffect,WJ=oh.useLayoutEffect,XJ=oh.useDebugValue;function JJ(n,e){var t=e(),i=HJ({inst:{value:t,getSnapshot:e}}),r=i[0].inst,s=i[1];return WJ(function(){r.value=t,r.getSnapshot=e,D1(r)&&s({inst:r})},[n,t,e]),VJ(function(){return D1(r)&&s({inst:r}),n(function(){D1(r)&&s({inst:r})})},[n]),XJ(t),t}function D1(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!GJ(n,t)}catch{return!0}}function jJ(n,e){return e()}var YJ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?jJ:JJ;z3.useSyncExternalStore=oh.useSyncExternalStore!==void 0?oh.useSyncExternalStore:YJ;k3.exports=z3;var KJ=k3.exports;/** + */var oh=ne;function XJ(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var JJ=typeof Object.is=="function"?Object.is:XJ,jJ=oh.useState,YJ=oh.useEffect,KJ=oh.useLayoutEffect,QJ=oh.useDebugValue;function ZJ(n,e){var t=e(),i=jJ({inst:{value:t,getSnapshot:e}}),r=i[0].inst,s=i[1];return KJ(function(){r.value=t,r.getSnapshot=e,D1(r)&&s({inst:r})},[n,t,e]),YJ(function(){return D1(r)&&s({inst:r}),n(function(){D1(r)&&s({inst:r})})},[n]),QJ(t),t}function D1(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!JJ(n,t)}catch{return!0}}function qJ(n,e){return e()}var $J=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qJ:ZJ;H3.useSyncExternalStore=oh.useSyncExternalStore!==void 0?oh.useSyncExternalStore:$J;G3.exports=H3;var e7=G3.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -4062,8 +4062,8 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var O_=ne,QJ=KJ;function ZJ(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var qJ=typeof Object.is=="function"?Object.is:ZJ,$J=QJ.useSyncExternalStore,e7=O_.useRef,t7=O_.useEffect,n7=O_.useMemo,i7=O_.useDebugValue;U3.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var s=e7(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=n7(function(){function l(m){if(!u){if(u=!0,h=m,m=i(m),r!==void 0&&o.hasValue){var v=o.value;if(r(v,m))return d=v}return d=m}if(v=d,qJ(h,m))return v;var x=i(m);return r!==void 0&&r(v,x)?v:(h=m,d=x)}var u=!1,h,d,p=t===void 0?null:t;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,t,i,r]);var a=$J(n,s[0],s[1]);return t7(function(){o.hasValue=!0,o.value=a},[a]),i7(a),a};O3.exports=U3;var r7=O3.exports;const s7=Gv(r7);var G3={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:o7}=Nf,{useSyncExternalStoreWithSelector:a7}=s7;let ZP=!1;const l7=n=>n;function u7(n,e=l7,t){(G3?"production":void 0)!=="production"&&t&&!ZP&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),ZP=!0);const i=a7(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return o7(i),i}const qP=n=>{(G3?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?kJ(n):n,t=(i,r)=>u7(e,i,r);return Object.assign(t,e),t},c7=n=>n?qP(n):qP;var $P,eB;const tB=typeof window<"u"&&(($P=window.document)!=null&&$P.createElement||((eB=window.navigator)==null?void 0:eB.product)==="ReactNative")?Nf.useLayoutEffect:Nf.useEffect;function f7(){const n=c7(e=>({current:new Array,version:0,set:e}));return{In:({children:e})=>{const t=n(r=>r.set),i=n(r=>r.version);return tB(()=>{t(r=>({version:r.version+1}))},[]),tB(()=>(t(({current:r})=>({current:[...r,e]})),()=>t(({current:r})=>({current:r.filter(s=>s!==e)}))),[e,i]),null},Out:()=>{const e=n(t=>t.current);return Nf.createElement(Nf.Fragment,null,e)}}}const h7=n=>n&&n.isOrthographicCamera,nB=new it,H3=f7();function V3(n){return"top"in n}function N1(n,e){const{right:t,top:i,left:r,bottom:s,width:o,height:a}=e,l=e.bottom<0||i>n.height||t<0||e.left>n.width;if(V3(n)){const d=n.top+n.height-s,p=r-n.left;return{position:{width:o,height:a,left:p,top:i,bottom:d,right:t},isOffscreen:l}}const u=n.height-s;return{position:{width:o,height:a,top:i,left:r,bottom:u,right:t},isOffscreen:l}}function F1(n,{left:e,bottom:t,width:i,height:r}){let s;const o=i/r;return h7(n.camera)?(n.camera.left!==i/-2||n.camera.right!==i/2||n.camera.top!==r/2||n.camera.bottom!==r/-2)&&(Object.assign(n.camera,{left:i/-2,right:i/2,top:r/2,bottom:r/-2}),n.camera.updateProjectionMatrix()):n.camera.aspect!==o&&(n.camera.aspect=o,n.camera.updateProjectionMatrix()),s=n.gl.autoClear,n.gl.autoClear=!1,n.gl.setViewport(e,t,i,r),n.gl.setScissor(e,t,i,r),n.gl.setScissorTest(!0),s}function O1(n,e){n.gl.setScissorTest(!1),n.gl.autoClear=e}function iB(n){n.gl.getClearColor(nB),n.gl.setClearColor(nB,n.gl.getClearAlpha()),n.gl.clear(!0,!0)}function d7({visible:n=!0,canvasSize:e,scene:t,index:i,children:r,frames:s,rect:o,track:a}){const l=ri(),[u,h]=ne.useState(!1);let d=0;return $p(p=>{if(s===1/0||d<=s){var m;a&&(o.current=(m=a.current)==null?void 0:m.getBoundingClientRect()),d++}if(o.current){const{position:v,isOffscreen:x}=N1(e,o.current);if(u!==x&&h(x),n&&!u&&o.current){const y=F1(p,v);p.gl.render(r?p.scene:t,p.camera),O1(p,y)}}},i),ne.useLayoutEffect(()=>{const p=o.current;if(p&&(!n||!u)){const{position:m}=N1(e,p),v=F1(l,m);iB(l),O1(l,v)}},[n,u]),ne.useEffect(()=>{if(!a)return;const p=o.current,m=l.get().events.connected;return l.setEvents({connected:a.current}),()=>{if(p){const{position:v}=N1(e,p),x=F1(l,v);iB(l),O1(l,x)}l.setEvents({connected:m})}},[a]),ne.useEffect(()=>{V3(e)||console.warn(`Detected @react-three/fiber canvas size does not include position information. may not work as expected. Upgrade to @react-three/fiber ^8.1.0 for support. - See https://github.com/pmndrs/drei/issues/944`)},[]),ne.createElement(ne.Fragment,null,r,ne.createElement("group",{onPointerOver:()=>null}))}const W3=ne.forwardRef(({track:n,visible:e=!0,index:t=1,id:i,style:r,className:s,frames:o=1/0,children:a,...l},u)=>{var h,d,p,m;const v=ne.useRef(null),{size:x,scene:y}=ri(),[g]=ne.useState(()=>new eh),[S,A]=ne.useReducer(()=>!0,!1),E=ne.useCallback((b,C)=>{if(v.current&&n&&n.current&&b.target===n.current){const{width:R,height:I,left:O,top:T}=v.current,L=b.clientX-O,K=b.clientY-T;C.pointer.set(L/R*2-1,-(K/I)*2+1),C.raycaster.setFromCamera(C.pointer,C.camera)}},[v,n]);return ne.useEffect(()=>{var b;n&&(v.current=(b=n.current)==null?void 0:b.getBoundingClientRect()),A()},[n]),ne.createElement("group",hs({ref:u},l),S&&y3(ne.createElement(d7,{visible:e,canvasSize:x,frames:o,scene:y,track:n,rect:v,index:t},a),g,{events:{compute:E,priority:t},size:{width:(h=v.current)==null?void 0:h.width,height:(d=v.current)==null?void 0:d.height,top:(p=v.current)==null?void 0:p.top,left:(m=v.current)==null?void 0:m.left}}))}),p7=ne.forwardRef(({as:n="div",id:e,visible:t,className:i,style:r,index:s=1,track:o,frames:a=1/0,children:l,...u},h)=>{const d=ne.useId(),p=ne.useRef(null);return ne.useImperativeHandle(h,()=>p.current),ne.createElement(ne.Fragment,null,ne.createElement(n,hs({ref:p,id:e,className:i,style:r},u)),ne.createElement(H3.In,null,ne.createElement(W3,{visible:t,key:d,track:p,frames:a,index:s},l)))}),_w=ne.forwardRef((n,e)=>ne.useContext(F_)?ne.createElement(W3,hs({ref:e},n)):ne.createElement(p7,hs({ref:e},n)));_w.Port=()=>ne.createElement(H3.Out,null);const m7=()=>fe.jsxs("group",{name:"lights",children:[fe.jsx(OJ,{resolution:256,children:fe.jsxs("group",{children:[fe.jsx(L1,{form:"rect",intensity:10,position:[-1,0,-10],scale:10,color:"#495057"}),fe.jsx(L1,{form:"rect",intensity:10,position:[-10,2,1],scale:10,"rotation-y":Math.PI/2}),fe.jsx(L1,{form:"rect",intensity:10,position:[10,0,1],scale:10,"rotation-y":Math.PI/2})]})}),fe.jsx("spotLight",{position:[-2,10,5],angle:.15,penumbra:1,decay:0,intensity:Math.PI*.2,color:"#f8f9fa"}),fe.jsx("spotLight",{position:[0,-25,10],angle:.15,penumbra:1,decay:0,intensity:Math.PI*.2,color:"#f8f9fa"}),fe.jsx("spotLight",{position:[0,15,5],angle:.15,penumbra:1,decay:.1,intensity:Math.PI*3})]});function g7(n){const{nodes:e,materials:t}=nm("/models/scene.glb"),i=mw(n.item.img);return ne.useEffect(()=>{Object.entries(t).map(r=>{r[0]!=="zFdeDaGNRwzccye"&&r[0]!=="ujsvqBWRMnqdwPx"&&r[0]!=="hUlRcbieVuIiOXG"&&r[0]!=="jlzuBkUzuJqgiAK"&&r[0]!=="xNrofRCqOXXHVZt"&&(r[1].color=new it(n.item.color[0])),r[1].needsUpdate=!0})},[t,n.item]),fe.jsxs("group",{...n,dispose:null,children:[fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.ttmRoLdJipiIOmf.geometry,material:t.hUlRcbieVuIiOXG,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DjsDkGiopeiEJZK.geometry,material:t.PaletteMaterial001,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.buRWvyqhBBgcJFo.geometry,material:t.PaletteMaterial002,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.MrMmlCAsAxJpYqQ_0.geometry,material:t.dxCVrUCvYhjVxqy,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.wqbHSzWaUxBCwxY_0.geometry,material:t.MHFGNLrDQbTNima,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.QvGDcbDApaGssma.geometry,material:t.kUhjpatHUvkBwfM,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.vFwJFNASGvEHWhs.geometry,material:t.RJoymvEsaIItifI,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.evAxFwhaQUwXuua.geometry,material:t.KSIxMqttXxxmOYl,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.USxQiqZgxHbRvqB.geometry,material:t.mcPrzcBUcdqUybC,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.TvgBVmqNmSrFVfW.geometry,material:t.pIhYLPqiSQOZTjn,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.GuYJryuYunhpphO.geometry,material:t.eShKpuMNVJTRrgg,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.pvdHknDTGDzVpwc.geometry,material:t.xdyiJLYTYRfJffH,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.CfghdUoyzvwzIum.geometry,material:t.jpGaQNgTtEGkTfo,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DjdhycfQYjKMDyn.geometry,material:t.ujsvqBWRMnqdwPx,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.usFLmqcyrnltBUr.geometry,material:t.sxNzrmuTqVeaXdg,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.xXDHkMplTIDAXLN.geometry,material:t.pIJKfZsazmcpEiU,scale:.01,children:fe.jsx("meshStandardMaterial",{roughness:1,map:i})}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.vELORlCJixqPHsZ.geometry,material:t.zFdeDaGNRwzccye,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.EbQGKrWAqhBHiMv.geometry,material:t.TBLSREBUyLMVtJa,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.EddVrWkqZTlvmci.geometry,material:t.xNrofRCqOXXHVZt,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.KSWlaxBcnPDpFCs.geometry,material:t.yQQySPTfbEJufve,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.TakBsdEjEytCAMK.geometry,material:t.PaletteMaterial003,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.IykfmVvLplTsTEW.geometry,material:t.PaletteMaterial004,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.wLfSXtbwRlBrwof.geometry,material:t.oZRkkORNzkufnGD,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.WJwwVjsahIXbJpU.geometry,material:t.yhcAXNGcJWCqtIS,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.YfrJNXgMvGOAfzz.geometry,material:t.bCgzXjHOanGdTFV,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DCLCbjzqejuvsqH.geometry,material:t.vhaEJjZoqGtyLdo,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.CdalkzDVnwgdEhS.geometry,material:t.jlzuBkUzuJqgiAK,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.NtjcIgolNGgYlCg.geometry,material:t.PpwUTnTFZJXxCoE,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.pXBNoLiaMwsDHRF.geometry,material:t.yiDkEwDSyEhavuP,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.IkoiNqATMVoZFKD.geometry,material:t.hiVunnLeAHkwGEo,scale:.01}),fe.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.rqgRAGHOwnuBypi.geometry,material:t.HGhEhpqSBZRnjHC,scale:.01})]})}nm.preload("/models/scene.glb");const v7=()=>fe.jsx(MX,{children:fe.jsx("div",{className:"absolute top-0 left-0 w-full h-full flex justify-center items-center",children:fe.jsx("div",{className:"w-[10vw] h-[10vw] rounded-full",children:"Loading..."})})}),rB=({index:n,groupRef:e,gsapType:t,controlRef:i,setRotationState:r,size:s,item:o})=>fe.jsxs(_w,{index:n,id:t,className:`w-full h-full absolute ${n===2?"right-[-100%]":""}`,children:[fe.jsx("ambientLight",{intensity:.3}),fe.jsx(RJ,{makeDefault:!0,position:[0,0,4]}),fe.jsx(m7,{}),fe.jsx(bJ,{makeDefault:!0,ref:i,enableZoom:!1,enablePan:!1,rotateSpeed:.4,target:new G(0,0,0),onEnd:()=>r(i.current.getAzimuthalAngle())}),fe.jsx("group",{ref:e,name:`${n===1} + */var O_=ne,t7=e7;function n7(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var i7=typeof Object.is=="function"?Object.is:n7,r7=t7.useSyncExternalStore,s7=O_.useRef,o7=O_.useEffect,a7=O_.useMemo,l7=O_.useDebugValue;z3.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var s=s7(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=a7(function(){function l(m){if(!u){if(u=!0,h=m,m=i(m),r!==void 0&&o.hasValue){var v=o.value;if(r(v,m))return d=v}return d=m}if(v=d,i7(h,m))return v;var x=i(m);return r!==void 0&&r(v,x)?v:(h=m,d=x)}var u=!1,h,d,p=t===void 0?null:t;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,t,i,r]);var a=r7(n,s[0],s[1]);return o7(function(){o.hasValue=!0,o.value=a},[a]),l7(a),a};k3.exports=z3;var u7=k3.exports;const c7=Gv(u7);var V3={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:f7}=Nf,{useSyncExternalStoreWithSelector:h7}=c7;let $P=!1;const d7=n=>n;function p7(n,e=d7,t){(V3?"production":void 0)!=="production"&&t&&!$P&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),$P=!0);const i=h7(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return f7(i),i}const eB=n=>{(V3?"production":void 0)!=="production"&&typeof n!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof n=="function"?WJ(n):n,t=(i,r)=>p7(e,i,r);return Object.assign(t,e),t},m7=n=>n?eB(n):eB;var tB,nB;const iB=typeof window<"u"&&((tB=window.document)!=null&&tB.createElement||((nB=window.navigator)==null?void 0:nB.product)==="ReactNative")?Nf.useLayoutEffect:Nf.useEffect;function g7(){const n=m7(e=>({current:new Array,version:0,set:e}));return{In:({children:e})=>{const t=n(r=>r.set),i=n(r=>r.version);return iB(()=>{t(r=>({version:r.version+1}))},[]),iB(()=>(t(({current:r})=>({current:[...r,e]})),()=>t(({current:r})=>({current:r.filter(s=>s!==e)}))),[e,i]),null},Out:()=>{const e=n(t=>t.current);return Nf.createElement(Nf.Fragment,null,e)}}}const v7=n=>n&&n.isOrthographicCamera,rB=new it,W3=g7();function X3(n){return"top"in n}function N1(n,e){const{right:t,top:i,left:r,bottom:s,width:o,height:a}=e,l=e.bottom<0||i>n.height||t<0||e.left>n.width;if(X3(n)){const d=n.top+n.height-s,p=r-n.left;return{position:{width:o,height:a,left:p,top:i,bottom:d,right:t},isOffscreen:l}}const u=n.height-s;return{position:{width:o,height:a,top:i,left:r,bottom:u,right:t},isOffscreen:l}}function F1(n,{left:e,bottom:t,width:i,height:r}){let s;const o=i/r;return v7(n.camera)?(n.camera.left!==i/-2||n.camera.right!==i/2||n.camera.top!==r/2||n.camera.bottom!==r/-2)&&(Object.assign(n.camera,{left:i/-2,right:i/2,top:r/2,bottom:r/-2}),n.camera.updateProjectionMatrix()):n.camera.aspect!==o&&(n.camera.aspect=o,n.camera.updateProjectionMatrix()),s=n.gl.autoClear,n.gl.autoClear=!1,n.gl.setViewport(e,t,i,r),n.gl.setScissor(e,t,i,r),n.gl.setScissorTest(!0),s}function O1(n,e){n.gl.setScissorTest(!1),n.gl.autoClear=e}function sB(n){n.gl.getClearColor(rB),n.gl.setClearColor(rB,n.gl.getClearAlpha()),n.gl.clear(!0,!0)}function _7({visible:n=!0,canvasSize:e,scene:t,index:i,children:r,frames:s,rect:o,track:a}){const l=si(),[u,h]=ne.useState(!1);let d=0;return $p(p=>{if(s===1/0||d<=s){var m;a&&(o.current=(m=a.current)==null?void 0:m.getBoundingClientRect()),d++}if(o.current){const{position:v,isOffscreen:x}=N1(e,o.current);if(u!==x&&h(x),n&&!u&&o.current){const y=F1(p,v);p.gl.render(r?p.scene:t,p.camera),O1(p,y)}}},i),ne.useLayoutEffect(()=>{const p=o.current;if(p&&(!n||!u)){const{position:m}=N1(e,p),v=F1(l,m);sB(l),O1(l,v)}},[n,u]),ne.useEffect(()=>{if(!a)return;const p=o.current,m=l.get().events.connected;return l.setEvents({connected:a.current}),()=>{if(p){const{position:v}=N1(e,p),x=F1(l,v);sB(l),O1(l,x)}l.setEvents({connected:m})}},[a]),ne.useEffect(()=>{X3(e)||console.warn(`Detected @react-three/fiber canvas size does not include position information. may not work as expected. Upgrade to @react-three/fiber ^8.1.0 for support. + See https://github.com/pmndrs/drei/issues/944`)},[]),ne.createElement(ne.Fragment,null,r,ne.createElement("group",{onPointerOver:()=>null}))}const J3=ne.forwardRef(({track:n,visible:e=!0,index:t=1,id:i,style:r,className:s,frames:o=1/0,children:a,...l},u)=>{var h,d,p,m;const v=ne.useRef(null),{size:x,scene:y}=si(),[g]=ne.useState(()=>new eh),[S,A]=ne.useReducer(()=>!0,!1),E=ne.useCallback((b,C)=>{if(v.current&&n&&n.current&&b.target===n.current){const{width:R,height:I,left:O,top:T}=v.current,L=b.clientX-O,K=b.clientY-T;C.pointer.set(L/R*2-1,-(K/I)*2+1),C.raycaster.setFromCamera(C.pointer,C.camera)}},[v,n]);return ne.useEffect(()=>{var b;n&&(v.current=(b=n.current)==null?void 0:b.getBoundingClientRect()),A()},[n]),ne.createElement("group",hs({ref:u},l),S&&A3(ne.createElement(_7,{visible:e,canvasSize:x,frames:o,scene:y,track:n,rect:v,index:t},a),g,{events:{compute:E,priority:t},size:{width:(h=v.current)==null?void 0:h.width,height:(d=v.current)==null?void 0:d.height,top:(p=v.current)==null?void 0:p.top,left:(m=v.current)==null?void 0:m.left}}))}),y7=ne.forwardRef(({as:n="div",id:e,visible:t,className:i,style:r,index:s=1,track:o,frames:a=1/0,children:l,...u},h)=>{const d=ne.useId(),p=ne.useRef(null);return ne.useImperativeHandle(h,()=>p.current),ne.createElement(ne.Fragment,null,ne.createElement(n,hs({ref:p,id:e,className:i,style:r},u)),ne.createElement(W3.In,null,ne.createElement(J3,{visible:t,key:d,track:p,frames:a,index:s},l)))}),_w=ne.forwardRef((n,e)=>ne.useContext(F_)?ne.createElement(J3,hs({ref:e},n)):ne.createElement(y7,hs({ref:e},n)));_w.Port=()=>ne.createElement(W3.Out,null);const x7=()=>ue.jsxs("group",{name:"lights",children:[ue.jsx(HJ,{resolution:256,children:ue.jsxs("group",{children:[ue.jsx(L1,{form:"rect",intensity:10,position:[-1,0,-10],scale:10,color:"#495057"}),ue.jsx(L1,{form:"rect",intensity:10,position:[-10,2,1],scale:10,"rotation-y":Math.PI/2}),ue.jsx(L1,{form:"rect",intensity:10,position:[10,0,1],scale:10,"rotation-y":Math.PI/2})]})}),ue.jsx("spotLight",{position:[-2,10,5],angle:.15,penumbra:1,decay:0,intensity:Math.PI*.2,color:"#f8f9fa"}),ue.jsx("spotLight",{position:[0,-25,10],angle:.15,penumbra:1,decay:0,intensity:Math.PI*.2,color:"#f8f9fa"}),ue.jsx("spotLight",{position:[0,15,5],angle:.15,penumbra:1,decay:.1,intensity:Math.PI*3})]});function A7(n){const{nodes:e,materials:t}=nm("/models/scene.glb"),i=mw(n.item.img);return ne.useEffect(()=>{Object.entries(t).map(r=>{r[0]!=="zFdeDaGNRwzccye"&&r[0]!=="ujsvqBWRMnqdwPx"&&r[0]!=="hUlRcbieVuIiOXG"&&r[0]!=="jlzuBkUzuJqgiAK"&&r[0]!=="xNrofRCqOXXHVZt"&&(r[1].color=new it(n.item.color[0])),r[1].needsUpdate=!0})},[t,n.item]),ue.jsxs("group",{...n,dispose:null,children:[ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.ttmRoLdJipiIOmf.geometry,material:t.hUlRcbieVuIiOXG,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DjsDkGiopeiEJZK.geometry,material:t.PaletteMaterial001,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.buRWvyqhBBgcJFo.geometry,material:t.PaletteMaterial002,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.MrMmlCAsAxJpYqQ_0.geometry,material:t.dxCVrUCvYhjVxqy,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.wqbHSzWaUxBCwxY_0.geometry,material:t.MHFGNLrDQbTNima,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.QvGDcbDApaGssma.geometry,material:t.kUhjpatHUvkBwfM,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.vFwJFNASGvEHWhs.geometry,material:t.RJoymvEsaIItifI,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.evAxFwhaQUwXuua.geometry,material:t.KSIxMqttXxxmOYl,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.USxQiqZgxHbRvqB.geometry,material:t.mcPrzcBUcdqUybC,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.TvgBVmqNmSrFVfW.geometry,material:t.pIhYLPqiSQOZTjn,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.GuYJryuYunhpphO.geometry,material:t.eShKpuMNVJTRrgg,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.pvdHknDTGDzVpwc.geometry,material:t.xdyiJLYTYRfJffH,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.CfghdUoyzvwzIum.geometry,material:t.jpGaQNgTtEGkTfo,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DjdhycfQYjKMDyn.geometry,material:t.ujsvqBWRMnqdwPx,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.usFLmqcyrnltBUr.geometry,material:t.sxNzrmuTqVeaXdg,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.xXDHkMplTIDAXLN.geometry,material:t.pIJKfZsazmcpEiU,scale:.01,children:ue.jsx("meshStandardMaterial",{roughness:1,map:i})}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.vELORlCJixqPHsZ.geometry,material:t.zFdeDaGNRwzccye,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.EbQGKrWAqhBHiMv.geometry,material:t.TBLSREBUyLMVtJa,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.EddVrWkqZTlvmci.geometry,material:t.xNrofRCqOXXHVZt,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.KSWlaxBcnPDpFCs.geometry,material:t.yQQySPTfbEJufve,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.TakBsdEjEytCAMK.geometry,material:t.PaletteMaterial003,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.IykfmVvLplTsTEW.geometry,material:t.PaletteMaterial004,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.wLfSXtbwRlBrwof.geometry,material:t.oZRkkORNzkufnGD,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.WJwwVjsahIXbJpU.geometry,material:t.yhcAXNGcJWCqtIS,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.YfrJNXgMvGOAfzz.geometry,material:t.bCgzXjHOanGdTFV,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.DCLCbjzqejuvsqH.geometry,material:t.vhaEJjZoqGtyLdo,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.CdalkzDVnwgdEhS.geometry,material:t.jlzuBkUzuJqgiAK,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.NtjcIgolNGgYlCg.geometry,material:t.PpwUTnTFZJXxCoE,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.pXBNoLiaMwsDHRF.geometry,material:t.yiDkEwDSyEhavuP,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.IkoiNqATMVoZFKD.geometry,material:t.hiVunnLeAHkwGEo,scale:.01}),ue.jsx("mesh",{castShadow:!0,receiveShadow:!0,geometry:e.rqgRAGHOwnuBypi.geometry,material:t.HGhEhpqSBZRnjHC,scale:.01})]})}nm.preload("/models/scene.glb");const S7=()=>ue.jsx(RX,{children:ue.jsx("div",{className:"absolute top-0 left-0 w-full h-full flex justify-center items-center",children:ue.jsx("div",{className:"w-[10vw] h-[10vw] rounded-full",children:"Loading..."})})}),oB=({index:n,groupRef:e,gsapType:t,controlRef:i,setRotationState:r,size:s,item:o})=>ue.jsxs(_w,{index:n,id:t,className:`w-full h-full absolute ${n===2?"right-[-100%]":""}`,children:[ue.jsx("ambientLight",{intensity:.3}),ue.jsx(LJ,{makeDefault:!0,position:[0,0,4]}),ue.jsx(x7,{}),ue.jsx(DJ,{makeDefault:!0,ref:i,enableZoom:!1,enablePan:!1,rotateSpeed:.4,target:new G(0,0,0),onEnd:()=>r(i.current.getAzimuthalAngle())}),ue.jsx("group",{ref:e,name:`${n===1} ? 'small : 'large' - `,position:[0,0,0],children:fe.jsx(ne.Suspense,{fallback:fe.jsx(v7,{}),children:fe.jsx(g7,{scale:n===1?[15,15,15]:[17,17,17],item:o,size:s})})})]});fi.registerPlugin(Zt);const q0=(n,e,t)=>{fi.to(n,{...e,scrollTrigger:{trigger:n,toggleActions:"restart reverse restart reverse",start:"top 85%",...t}})},sB=(n,e,t,i,r,s)=>{n.to(e.current.rotation,{y:t,duration:1,ease:"power2.inOut"}),n.to(i,{...s,ease:"power2.inOut"},"<"),n.to(r,{...s,ease:"power2.inOut"},"<")},_7=()=>{const[n,e]=ne.useState("small"),[t,i]=ne.useState({title:"iPhone 15 Pro in Natural Titanium",color:["#8F8A81","#FFE7B9","#6F6C64"],img:xL}),r=ne.useRef(),s=ne.useRef(),o=ne.useRef(new so),a=ne.useRef(new so),[l,u]=ne.useState(0),[h,d]=ne.useState(0),p=fi.timeline();return ne.useEffect(()=>{n==="large"&&sB(p,o,l,"#view1","#view2",{transform:"translateX(-100%)",duration:2}),n==="small"&&sB(p,a,h,"#view2","#view1",{transform:"translateX(0)",duration:2})},[n]),sc(()=>{fi.to("#heading",{y:0,opacity:1})},[]),fe.jsx("section",{className:"common-padding",children:fe.jsxs("div",{className:"screen-max-width",children:[fe.jsx("h1",{id:"heading",className:"section-heading",children:"Take a closer look."}),fe.jsxs("div",{className:"flex flex-col items-center mt-5",children:[fe.jsxs("div",{className:"w-full h-[75vh] md:h-[90vh] overflow-hidden relative",children:[fe.jsx(rB,{index:1,groupRef:o,gsapType:"view1",controlRef:r,setRotationState:u,item:t,size:n}),fe.jsx(rB,{index:2,groupRef:a,gsapType:"view2",controlRef:s,setRotationState:d,item:t,size:n}),fe.jsx(dX,{className:"w-full h-full",style:{position:"fixed",top:0,bottom:0,left:0,right:0,overflow:"hidden"},eventSource:document.getElementById("root"),children:fe.jsx(_w.Port,{})})]}),fe.jsxs("div",{className:"mx-auto w-full",children:[fe.jsx("p",{className:"text-sm font-light text-center mb-5",children:t.title}),fe.jsxs("div",{className:"flex-center",children:[fe.jsx("ul",{className:"color-container",children:TG.map((m,v)=>fe.jsx("li",{className:"w-6 h-6 rounded-full mx-2 cursor-pointer",style:{backgroundColor:m.color[0]},onClick:()=>i(m)},v))}),fe.jsx("button",{className:"size-btn-container",children:CG.map(({label:m,value:v})=>fe.jsx("span",{className:"size-btn",style:{backgroundColor:n===v?"white":"transparent",color:n===v?"black":"white"},onClick:()=>e(v),children:m},m))})]})]})]})]})})},y7=()=>{const n=ne.useRef();return sc(()=>{fi.to("#exploreVideo",{scrollTrigger:{trigger:"#exploreVideo",toggleActions:"play pause reverse restart",start:"-10% bottom"},onComplete:()=>{n.current.play()}}),q0("#features_title",{y:0,opacity:1}),q0(".g_grow",{scale:1,opacity:1,ease:"power1"},{scrub:5.5}),q0(".g_text",{y:0,opacity:1,ease:"power2.inOut",duration:1})},[]),fe.jsx("section",{className:"h-full common-padding bg-zinc relative overflow-hidden",children:fe.jsxs("div",{className:"screen-max-width",children:[fe.jsx("div",{className:"mb-12 w-full",children:fe.jsx("h1",{id:"features_title",className:"section-heading",children:"Explore the full story."})}),fe.jsxs("div",{className:"flex flex-col justify-center items-center overflow-hidden",children:[fe.jsxs("div",{className:"mt-32 mb-24 pl-24",children:[fe.jsx("h2",{className:"text-5xl lg:text-7xl font-semibold",children:"iPhone."}),fe.jsx("h2",{className:"text-5xl lg:text-7xl font-semibold",children:"Forged in titanium."})]}),fe.jsxs("div",{className:"flex-center flex-col sm:px-10",children:[fe.jsx("div",{className:"relative h-[50vh] w-full flex items-center",children:fe.jsx("video",{playsInline:!0,id:"exploreVideo",className:"w-full h-full object-cover object-center",preload:"none",muted:!0,autoPlay:!0,ref:n,children:fe.jsx("source",{src:Xz,type:"video/mp4"})})}),fe.jsxs("div",{className:"flex flex-col w-full relative",children:[fe.jsxs("div",{className:"feature-video-container",children:[fe.jsx("div",{className:"overflow-hidden flex-1 h-[50vh]",children:fe.jsx("img",{src:rG,alt:"titanium",className:"feature-video g_grow"})}),fe.jsx("div",{className:"overflow-hidden flex-1 h-[50vh]",children:fe.jsx("img",{src:sG,alt:"titanium 2",className:"feature-video g_grow"})})]}),fe.jsxs("div",{className:"feature-text-container",children:[fe.jsx("div",{className:"flex-1 flex-center",children:fe.jsxs("p",{className:"feature-text g_text",children:["iPhone 15 Pro is "," ",fe.jsx("span",{className:"text-white",children:"the first iPhone to feature an aerospace-grade titanium design"}),", using the same alloy that spacecrafts use for missions to Mars."]})}),fe.jsx("div",{className:"flex-1 flex-center",children:fe.jsxs("p",{className:"feature-text g_text",children:["Titanium has one of the best strength-to-weight ratios of any metal, making these our "," ",fe.jsx("span",{className:"text-white",children:"lightest Pro models ever."}),"You'll notice the difference the moment you pick one up."]})})]})]})]})]})]})})},x7=()=>{const n=ne.useRef();return sc(()=>{fi.from("#chip",{scrollTrigger:{trigger:"#chip",start:"20% bottom"},opacity:0,scale:2,duration:2,ease:"power2.inOut"}),q0(".g_fadeIn",{opacity:1,y:0,duration:1,ease:"power2.inOut"})}),fe.jsx("section",{className:"common-padding",children:fe.jsxs("div",{className:"screen-max-width",children:[fe.jsx("div",{id:"chip",className:"flex-center w-full my-20",children:fe.jsx("img",{src:oG,alt:"chip",width:180,height:180})}),fe.jsxs("div",{className:"flex flex-col items-center",children:[fe.jsxs("h2",{className:"hiw-title",children:["A17 Pro chip.",fe.jsx("br",{})," A monster win for gaming."]}),fe.jsx("p",{className:"hiw-subtitle",children:"It's here. The biggest redesign in the history of Apple GPUs."})]}),fe.jsxs("div",{className:"mt-10 md:mt-20 mb-14",children:[fe.jsxs("div",{className:"relative h-full flex-center",children:[fe.jsx("div",{className:"overflow-hidden",children:fe.jsx("img",{src:aG,alt:"frame",className:"bg-transparent relative z-20"})}),fe.jsx("div",{className:"hiw-video",children:fe.jsx("video",{className:"pointer-events-none",playsInline:!0,preload:"none",muted:!0,autoPlay:!0,ref:n,children:fe.jsx("source",{src:Jz,type:"video/mp4"})})})]}),fe.jsx("p",{className:"text-gray font-semibold text-center mt-3",children:"Honkai: Star Rail"})]}),fe.jsxs("div",{className:"hiw-text-container",children:[fe.jsxs("div",{className:"flex flex-1 justify-center flex-col",children:[fe.jsxs("p",{className:"hiw-text g_fadeIn",children:["A17 Pro is an entirely new class of iPhone chip that delivers our "," ",fe.jsx("span",{className:"text-white",children:"best graphic performance by far"}),"."]}),fe.jsxs("p",{className:"hiw-text g_fadeIn",children:["Mobile "," ",fe.jsx("span",{className:"text-white",children:"games will look and feel so immersive"}),", with incredibly detailed environments and characters."]})]}),fe.jsxs("div",{className:"flex-1 flex justify-center flex-col g_fadeIn",children:[fe.jsx("p",{className:"hiw-text",children:"New"}),fe.jsx("p",{className:"hiw-bigtext",children:"Pro-class GPU"}),fe.jsx("p",{className:"hiw-text",children:"with 6 cores"})]})]})]})})},A7=()=>fe.jsxs("footer",{className:"py-5 sm:px-10 px-5",children:[fe.jsxs("div",{className:"screen-max-width",children:[fe.jsxs("p",{className:"font-semibold text-gray text-xs",children:["More ways to shop: "," ",fe.jsxs("span",{className:"underline text-blue",children:["Find an Apple Store "," "]}),"or "," ",fe.jsx("span",{className:"underline text-blue",children:"other retailer"})," "," ","near you."]}),fe.jsx("p",{className:"font-semibold text-gray text-xs",children:"Or call 000800-040-1966"})]}),fe.jsx("div",{className:"bg-neutral-700 my-5 h-[1px] w-full"}),fe.jsxs("div",{className:"flex md:flex-row flex-col md:items-center justify-between",children:[fe.jsx("p",{className:"font-semibold text-gray text-xs",children:"Copyright @ 2024 Olga K. All rights reserved."}),fe.jsx("div",{className:"flex",children:VR.map((n,e)=>fe.jsxs("p",{className:"font-semibold text-gray text-xs",children:[n," ",e!==VR.length-1&&fe.jsx("span",{className:"md:mx-2",children:"|"})]},n))})]})]}),S7=()=>fe.jsxs("main",{className:"bg-black",children:[fe.jsx(PG,{}),fe.jsx(bG,{}),fe.jsx(_7,{}),fe.jsx(y7,{}),fe.jsx(x7,{}),fe.jsx(A7,{})]});U1.createRoot(document.getElementById("root")).render(fe.jsx(Nf.StrictMode,{children:fe.jsx(S7,{})})); + `,position:[0,0,0],children:ue.jsx(ne.Suspense,{fallback:ue.jsx(S7,{}),children:ue.jsx(A7,{scale:n===1?[15,15,15]:[17,17,17],item:o,size:s})})})]});Zn.registerPlugin(Zt);const q0=(n,e,t)=>{Zn.to(n,{...e,scrollTrigger:{trigger:n,toggleActions:"restart reverse restart reverse",start:"top 85%",...t}})},aB=(n,e,t,i,r,s)=>{n.to(e.current.rotation,{y:t,duration:1,ease:"power2.inOut"}),n.to(i,{...s,ease:"power2.inOut"},"<"),n.to(r,{...s,ease:"power2.inOut"},"<")},M7=()=>{const[n,e]=ne.useState("small"),[t,i]=ne.useState({title:"iPhone 15 Pro in Natural Titanium",color:["#8F8A81","#FFE7B9","#6F6C64"],img:SL}),r=ne.useRef(),s=ne.useRef(),o=ne.useRef(new so),a=ne.useRef(new so),[l,u]=ne.useState(0),[h,d]=ne.useState(0),p=Zn.timeline();return ne.useEffect(()=>{n==="large"&&aB(p,o,l,"#view1","#view2",{transform:"translateX(-100%)",duration:2}),n==="small"&&aB(p,a,h,"#view2","#view1",{transform:"translateX(0)",duration:2})},[n]),Nl(()=>{Zn.to("#heading",{y:0,opacity:1})},[]),ue.jsx("section",{className:"common-padding",children:ue.jsxs("div",{className:"screen-max-width",children:[ue.jsx("h1",{id:"heading",className:"section-heading",children:"Take a closer look."}),ue.jsxs("div",{className:"flex flex-col items-center mt-5",children:[ue.jsxs("div",{className:"w-full h-[75vh] md:h-[90vh] overflow-hidden relative",children:[ue.jsx(oB,{index:1,groupRef:o,gsapType:"view1",controlRef:r,setRotationState:u,item:t,size:n}),ue.jsx(oB,{index:2,groupRef:a,gsapType:"view2",controlRef:s,setRotationState:d,item:t,size:n}),ue.jsx(_X,{className:"w-full h-full",style:{position:"fixed",top:0,bottom:0,left:0,right:0,overflow:"hidden"},eventSource:document.getElementById("root"),children:ue.jsx(_w.Port,{})})]}),ue.jsxs("div",{className:"mx-auto w-full",children:[ue.jsx("p",{className:"text-sm font-light text-center mb-5",children:t.title}),ue.jsxs("div",{className:"flex-center",children:[ue.jsx("ul",{className:"color-container",children:BG.map((m,v)=>ue.jsx("li",{className:"w-6 h-6 rounded-full mx-2 cursor-pointer",style:{backgroundColor:m.color[0]},onClick:()=>i(m)},v))}),ue.jsx("button",{className:"size-btn-container",children:IG.map(({label:m,value:v})=>ue.jsx("span",{className:"size-btn",style:{backgroundColor:n===v?"white":"transparent",color:n===v?"black":"white"},onClick:()=>e(v),children:m},m))})]})]})]})]})})},E7=()=>{const n=ne.useRef();return Nl(()=>{Zn.to("#exploreVideo",{scrollTrigger:{trigger:"#exploreVideo",toggleActions:"play pause reverse restart",start:"-10% bottom"},onComplete:()=>{n.current.play()}}),q0("#features_title",{y:0,opacity:1}),q0(".g_grow",{scale:1,opacity:1,ease:"power1"},{scrub:5.5}),q0(".g_text",{y:0,opacity:1,ease:"power2.inOut",duration:1})},[]),ue.jsx("section",{className:"h-full common-padding bg-zinc relative overflow-hidden",children:ue.jsxs("div",{className:"screen-max-width",children:[ue.jsx("div",{className:"mb-12 w-full",children:ue.jsx("h1",{id:"features_title",className:"section-heading",children:"Explore the full story."})}),ue.jsxs("div",{className:"flex flex-col justify-center items-center overflow-hidden",children:[ue.jsxs("div",{className:"mt-32 mb-24 pl-24",children:[ue.jsx("h2",{className:"text-5xl lg:text-7xl font-semibold",children:"iPhone."}),ue.jsx("h2",{className:"text-5xl lg:text-7xl font-semibold",children:"Forged in titanium."})]}),ue.jsxs("div",{className:"flex-center flex-col sm:px-10",children:[ue.jsx("div",{className:"relative h-[50vh] w-full flex items-center",children:ue.jsx("video",{playsInline:!0,id:"exploreVideo",className:"w-full h-full object-cover object-center",preload:"none",muted:!0,autoPlay:!0,ref:n,children:ue.jsx("source",{src:Kz,type:"video/mp4"})})}),ue.jsxs("div",{className:"flex flex-col w-full relative",children:[ue.jsxs("div",{className:"feature-video-container",children:[ue.jsx("div",{className:"overflow-hidden flex-1 h-[50vh]",children:ue.jsx("img",{src:lG,alt:"titanium",className:"feature-video g_grow"})}),ue.jsx("div",{className:"overflow-hidden flex-1 h-[50vh]",children:ue.jsx("img",{src:uG,alt:"titanium 2",className:"feature-video g_grow"})})]}),ue.jsxs("div",{className:"feature-text-container",children:[ue.jsx("div",{className:"flex-1 flex-center",children:ue.jsxs("p",{className:"feature-text g_text",children:["iPhone 15 Pro is "," ",ue.jsx("span",{className:"text-white",children:"the first iPhone to feature an aerospace-grade titanium design"}),", using the same alloy that spacecrafts use for missions to Mars."]})}),ue.jsx("div",{className:"flex-1 flex-center",children:ue.jsxs("p",{className:"feature-text g_text",children:["Titanium has one of the best strength-to-weight ratios of any metal, making these our "," ",ue.jsx("span",{className:"text-white",children:"lightest Pro models ever."}),"You'll notice the difference the moment you pick one up."]})})]})]})]})]})]})})},w7=()=>{const n=ne.useRef();return Nl(()=>{Zn.from("#chip",{scrollTrigger:{trigger:"#chip",start:"20% bottom"},opacity:0,scale:2,duration:2,ease:"power2.inOut"}),q0(".g_fadeIn",{opacity:1,y:0,duration:1,ease:"power2.inOut"})}),ue.jsx("section",{className:"common-padding",children:ue.jsxs("div",{className:"screen-max-width",children:[ue.jsx("div",{id:"chip",className:"flex-center w-full my-20",children:ue.jsx("img",{src:cG,alt:"chip",width:180,height:180})}),ue.jsxs("div",{className:"flex flex-col items-center",children:[ue.jsxs("h2",{className:"hiw-title",children:["A17 Pro chip.",ue.jsx("br",{})," A monster win for gaming."]}),ue.jsx("p",{className:"hiw-subtitle",children:"It's here. The biggest redesign in the history of Apple GPUs."})]}),ue.jsxs("div",{className:"mt-10 md:mt-20 mb-14",children:[ue.jsxs("div",{className:"relative h-full flex-center",children:[ue.jsx("div",{className:"overflow-hidden",children:ue.jsx("img",{src:fG,alt:"frame",className:"bg-transparent relative z-20"})}),ue.jsx("div",{className:"hiw-video",children:ue.jsx("video",{className:"pointer-events-none",playsInline:!0,preload:"none",muted:!0,autoPlay:!0,ref:n,children:ue.jsx("source",{src:Qz,type:"video/mp4"})})})]}),ue.jsx("p",{className:"text-gray font-semibold text-center mt-3",children:"Honkai: Star Rail"})]}),ue.jsxs("div",{className:"hiw-text-container",children:[ue.jsxs("div",{className:"flex flex-1 justify-center flex-col",children:[ue.jsxs("p",{className:"hiw-text g_fadeIn",children:["A17 Pro is an entirely new class of iPhone chip that delivers our "," ",ue.jsx("span",{className:"text-white",children:"best graphic performance by far"}),"."]}),ue.jsxs("p",{className:"hiw-text g_fadeIn",children:["Mobile "," ",ue.jsx("span",{className:"text-white",children:"games will look and feel so immersive"}),", with incredibly detailed environments and characters."]})]}),ue.jsxs("div",{className:"flex-1 flex justify-center flex-col g_fadeIn",children:[ue.jsx("p",{className:"hiw-text",children:"New"}),ue.jsx("p",{className:"hiw-bigtext",children:"Pro-class GPU"}),ue.jsx("p",{className:"hiw-text",children:"with 6 cores"})]})]})]})})},T7=()=>ue.jsxs("footer",{className:"py-5 sm:px-10 px-5",children:[ue.jsxs("div",{className:"screen-max-width",children:[ue.jsxs("p",{className:"font-semibold text-gray text-xs",children:["More ways to shop: "," ",ue.jsxs("span",{className:"underline text-blue",children:["Find an Apple Store "," "]}),"or "," ",ue.jsx("span",{className:"underline text-blue",children:"other retailer"})," "," ","near you."]}),ue.jsx("p",{className:"font-semibold text-gray text-xs",children:"Or call 000800-040-1966"})]}),ue.jsx("div",{className:"bg-neutral-700 my-5 h-[1px] w-full"}),ue.jsxs("div",{className:"flex md:flex-row flex-col md:items-center justify-between",children:[ue.jsx("p",{className:"font-semibold text-gray text-xs",children:"Copyright @ 2024 Olga K. All rights reserved."}),ue.jsx("div",{className:"flex",children:XR.map((n,e)=>ue.jsxs("p",{className:"font-semibold text-gray text-xs",children:[n," ",e!==XR.length-1&&ue.jsx("span",{className:"md:mx-2",children:"|"})]},n))})]})]}),C7=()=>ue.jsxs("main",{className:"bg-black",children:[ue.jsx(NG,{}),ue.jsx(hG,{}),ue.jsx(DG,{}),ue.jsx(M7,{}),ue.jsx(E7,{}),ue.jsx(w7,{}),ue.jsx(T7,{})]});U1.createRoot(document.getElementById("root")).render(ue.jsx(Nf.StrictMode,{children:ue.jsx(C7,{})})); diff --git a/index.html b/index.html index f19cfdb..2e5199d 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ /> Apple iPhone - +